diff --git a/docs/report/hwcodec/00-architecture.md b/docs/report/hwcodec/00-architecture.md index b9a9421e..4f2ce235 100644 --- a/docs/report/hwcodec/00-architecture.md +++ b/docs/report/hwcodec/00-architecture.md @@ -2,26 +2,24 @@ ## 1. 项目概述 -hwcodec 是一个基于 FFmpeg 的硬件视频编解码库,来源于 RustDesk 项目并针对 One-KVM 进行了定制优化。该库提供跨平台的 GPU 加速视频编解码能力,支持多个 GPU 厂商和多种编码标准。 +hwcodec 是一个基于 FFmpeg 的硬件视频编解码库,来源于 RustDesk 项目并针对 One-KVM 进行了深度定制优化。该库专注于 IP-KVM 场景,提供 Windows 和 Linux 平台的 GPU 加速视频编码能力。 ### 1.1 项目位置 ``` libs/hwcodec/ ├── src/ # Rust 源代码 -├── cpp/ # C++ 源代码 -├── externals/ # 外部依赖 (SDK) -├── dev/ # 开发工具 -└── examples/ # 示例程序 +└── cpp/ # C++ 源代码 ``` ### 1.2 核心特性 -- **多编解码格式支持**: H.264, H.265 (HEVC), VP8, VP9, AV1, MJPEG -- **硬件加速**: NVENC/NVDEC, AMF, Intel QSV/MFX, VAAPI, RKMPP, V4L2 M2M, VideoToolbox -- **跨平台**: Windows, Linux, macOS, Android, iOS +- **多编解码格式支持**: H.264, H.265 (HEVC), VP8, VP9, MJPEG +- **硬件加速**: NVENC, AMF, Intel QSV (Windows), VAAPI, RKMPP, V4L2 M2M (Linux) +- **跨平台**: Windows, Linux (x86_64, ARM64, ARMv7) - **低延迟优化**: 专为实时流媒体场景设计 - **Rust/C++ 混合架构**: Rust 提供安全的上层 API,C++ 实现底层编解码逻辑 +- **IP-KVM 专用**: 解码仅支持 MJPEG(采集卡输出格式),编码支持多种硬件加速 ## 2. 架构设计 @@ -30,35 +28,31 @@ libs/hwcodec/ ``` ┌─────────────────────────────────────────────────────────────┐ │ Rust API Layer │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ ffmpeg_ram │ │ vram │ │ mux │ │ -│ │ module │ │ module │ │ module │ │ -│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │ -├─────────┼────────────────┼───────────────────┼──────────────┤ -│ │ │ │ │ -│ │ FFI Bindings (bindgen) │ │ -│ ▼ ▼ ▼ │ +│ ┌─────────────────────────────────────────────────────────┐│ +│ │ ffmpeg_ram module ││ +│ │ (encode.rs + decode.rs) ││ +│ └──────────────────────────┬──────────────────────────────┘│ +├─────────────────────────────┼───────────────────────────────┤ +│ │ │ +│ FFI Bindings (bindgen) │ +│ ▼ │ ├─────────────────────────────────────────────────────────────┤ │ C++ Core Layer │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ ffmpeg_ram │ │ ffmpeg_vram │ │ mux.cpp │ │ -│ │ encode/ │ │ encode/ │ │ │ │ -│ │ decode │ │ decode │ │ │ │ -│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │ -├─────────┼────────────────┼───────────────────┼──────────────┤ -│ │ │ │ │ -│ └────────────────┴───────────────────┘ │ -│ │ │ -│ ▼ │ +│ ┌─────────────────────────────────────────────────────────┐│ +│ │ ffmpeg_ram (encode/decode) ││ +│ └──────────────────────────┬──────────────────────────────┘│ +├─────────────────────────────┼───────────────────────────────┤ +│ │ │ +│ ▼ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ FFmpeg Libraries │ │ │ │ libavcodec │ libavutil │ libavformat │ libswscale │ │ │ └──────────────────────────────────────────────────────┘ │ -│ │ │ -├──────────────────────────┼──────────────────────────────────┤ +│ │ │ +├─────────────────────────────┼───────────────────────────────┤ │ Hardware Acceleration Backends │ │ ┌────────┐ ┌─────┐ ┌─────┐ ┌───────┐ ┌───────┐ ┌───────┐ │ -│ │ NVENC │ │ AMF │ │ MFX │ │ VAAPI │ │ RKMPP │ │V4L2M2M│ │ +│ │ NVENC │ │ AMF │ │ QSV │ │ VAAPI │ │ RKMPP │ │V4L2M2M│ │ │ └────────┘ └─────┘ └─────┘ └───────┘ └───────┘ └───────┘ │ └─────────────────────────────────────────────────────────────┘ ``` @@ -68,8 +62,6 @@ libs/hwcodec/ | 模块 | 职责 | 关键文件 | |------|------|----------| | `ffmpeg_ram` | 基于 RAM 的软件/硬件编解码 | `src/ffmpeg_ram/` | -| `vram` | GPU 显存直接编解码 (Windows) | `src/vram/` | -| `mux` | 视频混流 (MP4/MKV) | `src/mux.rs` | | `common` | 公共定义和 GPU 检测 | `src/common.rs` | | `ffmpeg` | FFmpeg 日志和初始化 | `src/ffmpeg.rs` | @@ -82,17 +74,11 @@ libs/hwcodec/ pub mod common; pub mod ffmpeg; pub mod ffmpeg_ram; -pub mod mux; -#[cfg(all(windows, feature = "vram"))] -pub mod vram; -#[cfg(target_os = "android")] -pub mod android; ``` **功能**: - 导出所有子模块 -- 提供 C 日志回调函数 `hwcodec_log` -- 条件编译: `vram` 模块仅在 Windows + vram feature 启用时编译 +- 提供 C 日志回调函数 ### 3.2 公共模块 (common.rs) @@ -111,13 +97,11 @@ pub enum Driver { | 平台 | 检测函数 | 检测方式 | |------|----------|----------| -| Linux | `linux_support_nv()` | 加载 CUDA/NVENC 动态库 | +| Linux | `linux_support_nv()` | 加载 libcuda.so + libnvidia-encode.so | | Linux | `linux_support_amd()` | 检查 `libamfrt64.so.1` | | Linux | `linux_support_intel()` | 检查 `libvpl.so`/`libmfx.so` | | Linux | `linux_support_rkmpp()` | 检查 `/dev/mpp_service` | | Linux | `linux_support_v4l2m2m()` | 检查 `/dev/video*` 设备 | -| macOS | `get_video_toolbox_codec_support()` | 调用 VideoToolbox API | -| Windows | 通过 VRAM 模块检测 | 查询 D3D11 设备 | ### 3.3 FFmpeg RAM 编码模块 @@ -129,7 +113,7 @@ pub enum Driver { pub struct CodecInfo { pub name: String, // 编码器名称如 "h264_nvenc" pub mc_name: Option, // MediaCodec 名称 (Android) - pub format: DataFormat, // H264/H265/VP8/VP9/AV1/MJPEG + pub format: DataFormat, // H264/H265/VP8/VP9/MJPEG pub priority: i32, // 优先级 (Best=0, Good=1, Normal=2, Soft=3, Bad=4) pub hwdevice: AVHWDeviceType, // 硬件设备类型 } @@ -179,7 +163,7 @@ pub struct Encoder { #### 3.3.2 C++ 层 (cpp/ffmpeg_ram/) -**FFmpegRamEncoder 类** (ffmpeg_ram_encode.cpp:97-420): +**FFmpegRamEncoder 类** (ffmpeg_ram_encode.cpp): ```cpp class FFmpegRamEncoder { @@ -225,6 +209,8 @@ fill_frame() - 填充 AVFrame 数据指针 ### 3.4 FFmpeg RAM 解码模块 +**IP-KVM 专用设计**: 解码器仅支持 MJPEG 软件解码,因为 IP-KVM 场景中视频采集卡输出的是 MJPEG 格式。 + **Decoder 类**: ```rust @@ -244,16 +230,27 @@ pub struct DecodeFrame { } ``` +**available_decoders()**: 仅返回 MJPEG 软件解码器 + +```rust +pub fn available_decoders() -> Vec { + vec![CodecInfo { + name: "mjpeg".to_owned(), + format: MJPEG, + hwdevice: AV_HWDEVICE_TYPE_NONE, + priority: Priority::Best as _, + ..Default::default() + }] +} +``` + **C++ 实现** (ffmpeg_ram_decode.cpp): ```cpp class FFmpegRamDecoder { AVCodecContext *c_ = NULL; - AVBufferRef *hw_device_ctx_ = NULL; - AVFrame *sw_frame_ = NULL; // 软件帧 (用于硬件→软件转换) AVFrame *frame_ = NULL; // 解码输出帧 AVPacket *pkt_ = NULL; - bool hwaccel_ = true; int do_decode(const void *obj); }; @@ -262,23 +259,16 @@ class FFmpegRamDecoder { **解码流程**: ``` -输入编码数据 +输入 MJPEG 数据 │ ▼ avcodec_send_packet() - 发送数据到解码器 │ ▼ -avcodec_receive_frame() - 获取解码帧 +avcodec_receive_frame() - 获取解码帧 (YUV420P) │ - ├──▶ (软件解码) 直接使用 frame_ - │ - └──▶ (硬件解码) av_hwframe_transfer_data() - │ - ▼ - sw_frame_ (GPU → CPU) - │ - ▼ - callback() - 回调输出 + ▼ +callback() - 回调输出 ``` ## 4. 硬件加速支持 @@ -293,27 +283,32 @@ avcodec_receive_frame() - 获取解码帧 | VAAPI | 通用 | Linux | h264_vaapi, hevc_vaapi, vp8_vaapi, vp9_vaapi | | RKMPP | Rockchip | Linux | h264_rkmpp, hevc_rkmpp | | V4L2 M2M | ARM SoC | Linux | h264_v4l2m2m, hevc_v4l2m2m | -| VideoToolbox | Apple | macOS/iOS | hevc_videotoolbox | -| MediaCodec | Google | Android | h264_mediacodec, hevc_mediacodec | ### 4.2 硬件检测逻辑 (Linux) ```cpp // libs/hwcodec/cpp/common/platform/linux/linux.cpp -// NVIDIA 检测 - 加载 CUDA 和 NVENC 动态库 +// NVIDIA 检测 - 简化的动态库检测 int linux_support_nv() { - CudaFunctions *cuda_dl = NULL; - NvencFunctions *nvenc_dl = NULL; - CuvidFunctions *cvdl = NULL; - load_driver(&cuda_dl, &nvenc_dl, &cvdl); - // 成功加载则返回 0 + void *handle = dlopen("libcuda.so.1", RTLD_LAZY); + if (!handle) handle = dlopen("libcuda.so", RTLD_LAZY); + if (!handle) return -1; + dlclose(handle); + + handle = dlopen("libnvidia-encode.so.1", RTLD_LAZY); + if (!handle) handle = dlopen("libnvidia-encode.so", RTLD_LAZY); + if (!handle) return -1; + dlclose(handle); + return 0; } // AMD 检测 - 检查 AMF 运行时库 int linux_support_amd() { void *handle = dlopen("libamfrt64.so.1", RTLD_LAZY); - // 成功加载则返回 0 + if (!handle) return -1; + dlclose(handle); + return 0; } // Intel 检测 - 检查 VPL/MFX 库 @@ -379,11 +374,6 @@ bool set_lantency_free(void *priv_data, const std::string &name) { name.find("vaapi") != std::string::npos) { av_opt_set(priv_data, "async_depth", "1", 0); } - // VideoToolbox: 实时模式 - if (name.find("videotoolbox") != std::string::npos) { - av_opt_set_int(priv_data, "realtime", 1, 0); - av_opt_set_int(priv_data, "prio_speed", 1, 0); - } // libvpx: 实时模式 if (name.find("libvpx") != std::string::npos) { av_opt_set(priv_data, "deadline", "realtime", 0); @@ -394,86 +384,19 @@ bool set_lantency_free(void *priv_data, const std::string &name) { } ``` -## 5. 混流模块 (Mux) +## 5. 构建系统 -### 5.1 功能概述 - -混流模块提供将编码后的视频流写入容器格式 (MP4/MKV) 的功能。 - -### 5.2 Rust API - -```rust -// libs/hwcodec/src/mux.rs - -pub struct MuxContext { - pub filename: String, // 输出文件名 - pub width: usize, // 视频宽度 - pub height: usize, // 视频高度 - pub is265: bool, // 是否为 H.265 - pub framerate: usize, // 帧率 -} - -pub struct Muxer { - inner: *mut c_void, // C++ Muxer 指针 - pub ctx: MuxContext, - start: Instant, // 开始时间 -} - -impl Muxer { - pub fn new(ctx: MuxContext) -> Result; - pub fn write_video(&mut self, data: &[u8], key: bool) -> Result<(), i32>; - pub fn write_tail(&mut self) -> Result<(), i32>; -} -``` - -### 5.3 C++ 实现 - -```cpp -// libs/hwcodec/cpp/mux/mux.cpp - -class Muxer { - OutputStream video_st; // 视频流 - AVFormatContext *oc = NULL; // 格式上下文 - int framerate; - int64_t start_ms; // 起始时间戳 - int64_t last_pts; // 上一帧 PTS - int got_first; // 是否收到第一帧 - - bool init(const char *filename, int width, int height, - int is265, int framerate); - int write_video_frame(const uint8_t *data, int len, - int64_t pts_ms, int key); -}; -``` - -**写入流程**: - -``` -write_video_frame() - │ - ├── 检查是否为关键帧 (第一帧必须是关键帧) - │ - ├── 计算 PTS (相对于 start_ms) - │ - ├── 填充 AVPacket - │ - ├── av_packet_rescale_ts() (ms → stream timebase) - │ - └── av_write_frame() → 写入文件 -``` - -## 6. 构建系统 - -### 6.1 Cargo.toml 配置 +### 5.1 Cargo.toml 配置 ```toml [package] name = "hwcodec" -version = "0.7.1" +version = "0.8.0" +edition = "2021" +description = "Hardware video codec for IP-KVM (Windows/Linux)" [features] default = [] -vram = [] # GPU VRAM 直接编解码 (Windows only) [dependencies] log = "0.4" @@ -486,7 +409,7 @@ cc = "1.0" # C++ 编译 bindgen = "0.59" # FFI 绑定生成 ``` -### 6.2 构建流程 (build.rs) +### 5.2 构建流程 (build.rs) ``` build.rs @@ -494,57 +417,61 @@ build.rs ├── build_common() │ ├── 生成 common_ffi.rs (bindgen) │ ├── 编译平台相关 C++ 代码 - │ └── 链接系统库 (d3d11, dxgi, stdc++) + │ └── 链接系统库 (stdc++) │ - ├── ffmpeg::build_ffmpeg() - │ ├── 生成 ffmpeg_ffi.rs - │ ├── 链接 FFmpeg 库 (VCPKG 或 pkg-config) - │ ├── build_ffmpeg_ram() - │ │ └── 编译 ffmpeg_ram_encode.cpp, ffmpeg_ram_decode.cpp - │ ├── build_ffmpeg_vram() [vram feature] - │ │ └── 编译 ffmpeg_vram_encode.cpp, ffmpeg_vram_decode.cpp - │ └── build_mux() - │ └── 编译 mux.cpp - │ - └── sdk::build_sdk() [Windows + vram feature] - ├── build_nv() - NVIDIA SDK - ├── build_amf() - AMD AMF - └── build_mfx() - Intel MFX + └── ffmpeg::build_ffmpeg() + ├── 生成 ffmpeg_ffi.rs + ├── 链接 FFmpeg 库 (VCPKG 或 pkg-config) + └── build_ffmpeg_ram() + └── 编译 ffmpeg_ram_encode.cpp, ffmpeg_ram_decode.cpp ``` -### 6.3 FFmpeg 链接方式 +### 5.3 FFmpeg 链接方式 | 方式 | 平台 | 条件 | |------|------|------| | VCPKG 静态链接 | 跨平台 | 设置 `VCPKG_ROOT` 环境变量 | | pkg-config 动态链接 | Linux | 默认方式 | -## 7. 外部依赖 +## 6. 与原版 hwcodec 的区别 -### 7.1 SDK 版本 +针对 One-KVM IP-KVM 场景,对原版 RustDesk hwcodec 进行了以下简化: -| SDK | 版本 | 用途 | -|-----|------|------| -| nv-codec-headers | n12.1.14.0 | NVIDIA 编码头文件 | -| Video_Codec_SDK | 12.1.14 | NVIDIA 编解码 SDK | -| AMF | v1.4.35 | AMD Advanced Media Framework | -| MediaSDK | 22.5.4 | Intel Media SDK | +### 6.1 移除的功能 -### 7.2 FFmpeg 依赖库 +| 移除项 | 原因 | +|--------|------| +| VRAM 模块 | IP-KVM 不需要 GPU 显存直接编解码 | +| Mux 模块 | IP-KVM 不需要录制到文件 | +| macOS 支持 | IP-KVM 目标平台不包含 macOS | +| Android 支持 | IP-KVM 目标平台不包含 Android | +| 外部 SDK | 简化构建,减少依赖 | +| 多格式解码 | IP-KVM 仅需 MJPEG 解码 | -``` -libavcodec - 编解码核心 -libavutil - 工具函数 -libavformat - 容器格式 -libswscale - 图像缩放转换 -``` +### 6.2 保留的功能 -## 8. 总结 +| 保留项 | 用途 | +|--------|------| +| FFmpeg RAM 编码 | WebRTC 视频编码 | +| FFmpeg RAM 解码 | MJPEG 采集卡解码 | +| 硬件加速编码 | 低延迟高效编码 | +| 软件编码后备 | 无硬件加速时的兜底方案 | -hwcodec 库通过 Rust/C++ 混合架构,在保证内存安全的同时实现了高性能的视频编解码。其核心设计特点包括: +### 6.3 代码量对比 -1. **统一的编解码器 API**: 无论使用硬件还是软件编解码,上层 API 保持一致 +| 指标 | 原版 | 简化版 | 减少 | +|------|------|--------|------| +| 外部 SDK | ~9MB | 0 | 100% | +| C++ 文件 | ~30 | ~10 | ~67% | +| Rust 模块 | 6 | 3 | 50% | + +## 7. 总结 + +hwcodec 库通过 Rust/C++ 混合架构,在保证内存安全的同时实现了高性能的视频编解码。针对 One-KVM IP-KVM 场景的优化设计特点包括: + +1. **精简的编解码器 API**: 解码仅支持 MJPEG,编码支持多种硬件加速 2. **自动硬件检测**: 运行时自动检测并选择最优的硬件加速后端 3. **优先级系统**: 基于质量和性能为不同编码器分配优先级 4. **低延迟优化**: 针对实时流媒体场景进行了专门优化 -5. **跨平台支持**: 覆盖主流操作系统和 GPU 厂商 +5. **简化的构建系统**: 无需外部 SDK,仅依赖系统 FFmpeg +6. **Windows/Linux 跨平台**: 支持 x86_64、ARM64、ARMv7 架构 diff --git a/docs/report/hwcodec/01-api-reference.md b/docs/report/hwcodec/01-api-reference.md index bd1f50b4..742f4128 100644 --- a/docs/report/hwcodec/01-api-reference.md +++ b/docs/report/hwcodec/01-api-reference.md @@ -9,7 +9,7 @@ ```rust pub struct EncodeContext { pub name: String, // 编码器名称 - pub mc_name: Option, // MediaCodec 名称 (Android) + pub mc_name: Option, // MediaCodec 名称 (保留字段) pub width: i32, // 视频宽度 (必须为偶数) pub height: i32, // 视频高度 (必须为偶数) pub pixfmt: AVPixelFormat, // 像素格式 @@ -58,7 +58,6 @@ pub struct EncodeContext { | `hevc_rkmpp` | H.265 | Rockchip MPP | Linux | | `h264_v4l2m2m` | H.264 | V4L2 M2M | Linux | | `hevc_v4l2m2m` | H.265 | V4L2 M2M | Linux | -| `hevc_videotoolbox` | H.265 | VideoToolbox | macOS | | `h264` | H.264 | 软件 (x264) | 全平台 | | `hevc` | H.265 | 软件 (x265) | 全平台 | | `libvpx` | VP8 | 软件 | 全平台 | @@ -161,51 +160,44 @@ for encoder in available_encoders { ## 2. 解码器 API -### 2.1 解码器初始化 +### 2.1 IP-KVM 专用设计 + +在 One-KVM IP-KVM 场景中,解码器仅支持 MJPEG 软件解码。这是因为视频采集卡输出的格式是 MJPEG,不需要其他格式的硬件解码支持。 + +### 2.2 解码器初始化 #### DecodeContext 参数 ```rust pub struct DecodeContext { - pub name: String, // 解码器名称 - pub device_type: AVHWDeviceType, // 硬件设备类型 + pub name: String, // 解码器名称 ("mjpeg") + pub device_type: AVHWDeviceType, // 硬件设备类型 (NONE) pub thread_count: i32, // 解码线程数 } ``` -#### 硬件设备类型 - -| AVHWDeviceType | 说明 | -|----------------|------| -| `AV_HWDEVICE_TYPE_NONE` | 软件解码 | -| `AV_HWDEVICE_TYPE_CUDA` | NVIDIA CUDA | -| `AV_HWDEVICE_TYPE_VAAPI` | Linux VAAPI | -| `AV_HWDEVICE_TYPE_D3D11VA` | Windows D3D11 | -| `AV_HWDEVICE_TYPE_VIDEOTOOLBOX` | macOS VideoToolbox | -| `AV_HWDEVICE_TYPE_MEDIACODEC` | Android MediaCodec | - -### 2.2 创建解码器 +### 2.3 创建解码器 ```rust use hwcodec::ffmpeg_ram::decode::{Decoder, DecodeContext}; use hwcodec::ffmpeg::AVHWDeviceType; let ctx = DecodeContext { - name: "h264".to_string(), - device_type: AVHWDeviceType::AV_HWDEVICE_TYPE_VAAPI, + name: "mjpeg".to_string(), + device_type: AVHWDeviceType::AV_HWDEVICE_TYPE_NONE, thread_count: 4, }; let decoder = Decoder::new(ctx)?; ``` -### 2.3 解码帧 +### 2.4 解码帧 ```rust -// 输入编码数据 -let encoded_packet: Vec = receive_encoded_data(); +// 输入 MJPEG 编码数据 +let mjpeg_data: Vec = receive_mjpeg_frame(); -match decoder.decode(&encoded_packet) { +match decoder.decode(&mjpeg_data) { Ok(frames) => { for frame in frames.iter() { println!("Decoded: {}x{}, format={:?}, key={}", @@ -214,7 +206,7 @@ match decoder.decode(&encoded_packet) { // 访问 YUV 数据 let y_plane = &frame.data[0]; let u_plane = &frame.data[1]; - let v_plane = &frame.data[2]; // 仅 YUV420P + let v_plane = &frame.data[2]; } } Err(code) => { @@ -223,7 +215,7 @@ match decoder.decode(&encoded_packet) { } ``` -### 2.4 DecodeFrame 结构体 +### 2.5 DecodeFrame 结构体 ```rust pub struct DecodeFrame { @@ -246,7 +238,7 @@ pub struct DecodeFrame { | `NV12` | 2 | Y | UV (交错) | - | | `NV21` | 2 | Y | VU (交错) | - | -### 2.5 检测可用解码器 +### 2.6 获取可用解码器 ```rust use hwcodec::ffmpeg_ram::decode::Decoder; @@ -256,6 +248,9 @@ for decoder in available_decoders { println!("Available: {} (format: {:?}, hwdevice: {:?})", decoder.name, decoder.format, decoder.hwdevice); } + +// 输出: +// Available: mjpeg (format: MJPEG, hwdevice: AV_HWDEVICE_TYPE_NONE) ``` ## 3. 码率控制模式 @@ -287,7 +282,6 @@ pub enum RateControl { | amf | ✓ | ✓ (低延迟) | ✗ | | qsv | ✓ | ✓ | ✗ | | vaapi | ✓ | ✓ | ✗ | -| mediacodec | ✓ | ✓ | ✓ | ## 4. 质量等级 @@ -310,45 +304,9 @@ pub enum Quality { | Medium | p4 | balanced | medium | | Low | p1 | speed | veryfast | -## 5. 混流器 API +## 5. 错误处理 -### 5.1 创建混流器 - -```rust -use hwcodec::mux::{Muxer, MuxContext}; - -let ctx = MuxContext { - filename: "/tmp/output.mp4".to_string(), - width: 1920, - height: 1080, - is265: false, // H.264 - framerate: 30, -}; - -let muxer = Muxer::new(ctx)?; -``` - -### 5.2 写入视频帧 - -```rust -// 编码后的帧数据 -let encoded_data: Vec = encoder.encode(...)?; -let is_keyframe = true; - -muxer.write_video(&encoded_data, is_keyframe)?; -``` - -### 5.3 完成写入 - -```rust -// 写入文件尾 -muxer.write_tail()?; -// muxer 被 drop 时自动释放资源 -``` - -## 6. 错误处理 - -### 6.1 错误码 +### 5.1 错误码 | 错误码 | 常量 | 说明 | |--------|------|------| @@ -356,7 +314,7 @@ muxer.write_tail()?; | -1 | `HWCODEC_ERR_COMMON` | 通用错误 | | -2 | `HWCODEC_ERR_HEVC_COULD_NOT_FIND_POC` | HEVC 解码参考帧丢失 | -### 6.2 常见错误处理 +### 5.2 常见错误处理 ```rust match encoder.encode(&yuv_data, pts) { @@ -372,9 +330,9 @@ match encoder.encode(&yuv_data, pts) { } ``` -## 7. 最佳实践 +## 6. 最佳实践 -### 7.1 编码器选择策略 +### 6.1 编码器选择策略 ```rust fn select_best_encoder( @@ -399,7 +357,7 @@ fn select_best_encoder( } ``` -### 7.2 帧内存布局 +### 6.2 帧内存布局 ```rust // 获取 NV12 帧布局信息 @@ -417,7 +375,7 @@ let mut buffer = vec![0u8; length as usize]; // 填充 UV 平面: buffer[offset[0]..length] ``` -### 7.3 关键帧控制 +### 6.3 关键帧控制 ```rust let mut frame_count = 0; @@ -433,7 +391,7 @@ loop { } ``` -### 7.4 线程安全 +### 6.4 线程安全 ```rust // Decoder 实现了 Send + Sync @@ -443,3 +401,81 @@ unsafe impl Sync for Decoder {} // 可以安全地在多线程间传递 let decoder = Arc::new(Mutex::new(Decoder::new(ctx)?)); ``` + +## 7. IP-KVM 典型使用场景 + +### 7.1 视频采集和转码流程 + +``` +USB 采集卡 (MJPEG) + │ + ▼ +┌─────────────────┐ +│ MJPEG Decoder │ ◄── Decoder::new("mjpeg") +│ (软件解码) │ +└────────┬────────┘ + │ YUV420P + ▼ +┌─────────────────┐ +│ H264 Encoder │ ◄── Encoder::new("h264_vaapi") +│ (硬件加速) │ +└────────┬────────┘ + │ H264 NAL + ▼ + WebRTC 传输 +``` + +### 7.2 完整示例 + +```rust +use hwcodec::ffmpeg_ram::decode::{Decoder, DecodeContext}; +use hwcodec::ffmpeg_ram::encode::{Encoder, EncodeContext}; +use hwcodec::ffmpeg::AVHWDeviceType; + +// 创建 MJPEG 解码器 +let decode_ctx = DecodeContext { + name: "mjpeg".to_string(), + device_type: AVHWDeviceType::AV_HWDEVICE_TYPE_NONE, + thread_count: 4, +}; +let mut decoder = Decoder::new(decode_ctx)?; + +// 检测并选择最佳编码器 +let encode_ctx = EncodeContext { + name: String::new(), + width: 1920, + height: 1080, + // ... +}; +let available = Encoder::available_encoders(encode_ctx.clone(), None); +let best_h264 = available.iter() + .filter(|e| e.format == DataFormat::H264) + .min_by_key(|e| e.priority) + .expect("No H264 encoder available"); + +// 使用最佳编码器创建实例 +let encode_ctx = EncodeContext { + name: best_h264.name.clone(), + ..encode_ctx +}; +let mut encoder = Encoder::new(encode_ctx)?; + +// 处理循环 +loop { + let mjpeg_frame = capture_frame(); + + // 解码 MJPEG -> YUV + let decoded = decoder.decode(&mjpeg_frame)?; + + // 编码 YUV -> H264 + for frame in decoded { + let yuv_data = frame.data.concat(); + let encoded = encoder.encode(&yuv_data, pts)?; + + // 发送编码数据 + for packet in encoded { + send_to_webrtc(packet.data); + } + } +} +``` diff --git a/docs/report/hwcodec/02-hardware-acceleration.md b/docs/report/hwcodec/02-hardware-acceleration.md index e71efa80..6e5bd39f 100644 --- a/docs/report/hwcodec/02-hardware-acceleration.md +++ b/docs/report/hwcodec/02-hardware-acceleration.md @@ -35,7 +35,7 @@ 每个检测到的硬件编码器都会进行实际编码测试: ```rust -// libs/hwcodec/src/ffmpeg_ram/encode.rs:358-450 +// libs/hwcodec/src/ffmpeg_ram/encode.rs // 生成测试用 YUV 数据 let yuv = Encoder::dummy_yuv(ctx.clone())?; @@ -47,7 +47,7 @@ match Encoder::new(c) { match encoder.encode(&yuv, 0) { Ok(frames) => { let elapsed = start.elapsed().as_millis(); - // 验证: 必须产生 1 帧且为关键帧,且在 1 秒内完成 + // 验证: 必须产生 1 帧且为关键帧,且在超时时间内完成 if frames.len() == 1 && frames[0].key == 1 && elapsed < TEST_TIMEOUT_MS { res.push(codec); @@ -64,27 +64,35 @@ match Encoder::new(c) { ### 2.1 检测机制 (Linux) +使用简化的动态库检测方法,无需 CUDA SDK 依赖: + ```cpp -// libs/hwcodec/cpp/common/platform/linux/linux.cpp:57-73 +// libs/hwcodec/cpp/common/platform/linux/linux.cpp int linux_support_nv() { - CudaFunctions *cuda_dl = NULL; - NvencFunctions *nvenc_dl = NULL; - CuvidFunctions *cvdl = NULL; + // 检测 CUDA 运行时库 + void *handle = dlopen("libcuda.so.1", RTLD_LAZY); + if (!handle) { + handle = dlopen("libcuda.so", RTLD_LAZY); + } + if (!handle) { + LOG_TRACE("NVIDIA: libcuda.so not found"); + return -1; + } + dlclose(handle); - // 加载 CUDA 动态库 - if (cuda_load_functions(&cuda_dl, NULL) < 0) - throw "cuda_load_functions failed"; + // 检测 NVENC 编码库 + handle = dlopen("libnvidia-encode.so.1", RTLD_LAZY); + if (!handle) { + handle = dlopen("libnvidia-encode.so", RTLD_LAZY); + } + if (!handle) { + LOG_TRACE("NVIDIA: libnvidia-encode.so not found"); + return -1; + } + dlclose(handle); - // 加载 NVENC 动态库 - if (nvenc_load_functions(&nvenc_dl, NULL) < 0) - throw "nvenc_load_functions failed"; - - // 加载 CUVID (解码) 动态库 - if (cuvid_load_functions(&cvdl, NULL) < 0) - throw "cuvid_load_functions failed"; - - // 全部成功则支持 NVIDIA 硬件加速 + LOG_TRACE("NVIDIA: driver support detected"); return 0; } ``` @@ -127,16 +135,15 @@ av_opt_set(priv_data, "rc", "cbr", 0); // 或 "vbr" ### 2.4 依赖库 -- `libcuda.so` - CUDA 运行时 -- `libnvidia-encode.so` - NVENC 编码器 -- `libnvcuvid.so` - NVDEC 解码器 +- `libcuda.so` / `libcuda.so.1` - CUDA 运行时 +- `libnvidia-encode.so` / `libnvidia-encode.so.1` - NVENC 编码器 ## 3. AMD AMF ### 3.1 检测机制 (Linux) ```cpp -// libs/hwcodec/cpp/common/platform/linux/linux.cpp:75-91 +// libs/hwcodec/cpp/common/platform/linux/linux.cpp int linux_support_amd() { #if defined(__x86_64__) || defined(__aarch64__) @@ -186,26 +193,12 @@ av_opt_set(priv_data, "rc", "vbr_latency", 0); // 低延迟 VBR - `libamfrt64.so.1` (64位) 或 `libamfrt32.so.1` (32位) -### 3.4 外部 SDK - -``` -externals/AMF_v1.4.35/ -├── amf/ -│ ├── public/common/ # 公共代码 -│ │ ├── AMFFactory.cpp -│ │ ├── Thread.cpp -│ │ └── TraceAdapter.cpp -│ └── public/include/ # 头文件 -│ ├── components/ # 组件定义 -│ └── core/ # 核心定义 -``` - ## 4. Intel QSV/MFX ### 4.1 检测机制 (Linux) ```cpp -// libs/hwcodec/cpp/common/platform/linux/linux.cpp:93-107 +// libs/hwcodec/cpp/common/platform/linux/linux.cpp int linux_support_intel() { const char *libs[] = { @@ -262,18 +255,7 @@ c->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL; ### 4.3 限制 - QSV 不支持 `YUV420P` 像素格式,必须使用 `NV12` -- 仅在 Windows 平台完全支持 - -### 4.4 外部 SDK - -``` -externals/MediaSDK_22.5.4/ -├── api/ -│ ├── include/ # MFX 头文件 -│ ├── mfx_dispatch/ # MFX 调度器 -│ └── mediasdk_structures/ # 数据结构 -└── samples/sample_common/ # 示例代码 -``` +- 在 One-KVM 简化版中仅 Windows 平台完全支持 ## 5. VAAPI (Linux) @@ -362,17 +344,20 @@ avcodec_receive_packet(c_, pkt_) // 获取编码数据 ### 6.1 检测机制 ```cpp -// libs/hwcodec/cpp/common/platform/linux/linux.cpp:122-137 +// libs/hwcodec/cpp/common/platform/linux/linux.cpp int linux_support_rkmpp() { // 检测 MPP 服务设备 if (access("/dev/mpp_service", F_OK) == 0) { + LOG_TRACE("RKMPP: Found /dev/mpp_service"); return 0; // MPP 可用 } // 备用: 检测 RGA 设备 if (access("/dev/rga", F_OK) == 0) { + LOG_TRACE("RKMPP: Found /dev/rga"); return 0; // MPP 可能可用 } + LOG_TRACE("RKMPP: No Rockchip MPP device found"); return -1; // MPP 不可用 } ``` @@ -395,7 +380,7 @@ int linux_support_rkmpp() { ### 7.1 检测机制 ```cpp -// libs/hwcodec/cpp/common/platform/linux/linux.cpp:139-163 +// libs/hwcodec/cpp/common/platform/linux/linux.cpp int linux_support_v4l2m2m() { const char *m2m_devices[] = { @@ -409,10 +394,12 @@ int linux_support_v4l2m2m() { int fd = open(m2m_devices[i], O_RDWR | O_NONBLOCK); if (fd >= 0) { close(fd); + LOG_TRACE("V4L2 M2M: Found device " + m2m_devices[i]); return 0; // V4L2 M2M 可用 } } } + LOG_TRACE("V4L2 M2M: No M2M device found"); return -1; } ``` @@ -429,75 +416,9 @@ int linux_support_v4l2m2m() { - 通用 ARM SoC (Allwinner, Amlogic 等) - 支持 V4L2 M2M API 的设备 -## 8. Apple VideoToolbox +## 8. 硬件加速优先级 -### 8.1 检测机制 (macOS) - -```rust -// libs/hwcodec/src/common.rs:57-87 - -#[cfg(target_os = "macos")] -pub(crate) fn get_video_toolbox_codec_support() -> (bool, bool, bool, bool) { - extern "C" { - fn checkVideoToolboxSupport( - h264_encode: *mut i32, - h265_encode: *mut i32, - h264_decode: *mut i32, - h265_decode: *mut i32, - ) -> c_void; - } - - let mut h264_encode = 0; - let mut h265_encode = 0; - let mut h264_decode = 0; - let mut h265_decode = 0; - - unsafe { - checkVideoToolboxSupport(&mut h264_encode, &mut h265_encode, - &mut h264_decode, &mut h265_decode); - } - - (h264_encode == 1, h265_encode == 1, - h264_decode == 1, h265_decode == 1) -} -``` - -### 8.2 编码配置 - -```cpp -// libs/hwcodec/cpp/common/util.cpp - -// VideoToolbox 低延迟配置 -if (name.find("videotoolbox") != std::string::npos) { - av_opt_set_int(priv_data, "realtime", 1, 0); - av_opt_set_int(priv_data, "prio_speed", 1, 0); -} - -// 强制硬件编码 -if (name.find("videotoolbox") != std::string::npos) { - av_opt_set_int(priv_data, "allow_sw", 0, 0); -} -``` - -### 8.3 限制 - -- H.264 编码不稳定,已禁用 -- 仅支持 H.265 编码 -- 完全支持 H.264/H.265 解码 - -### 8.4 依赖框架 - -``` -CoreFoundation -CoreVideo -CoreMedia -VideoToolbox -AVFoundation -``` - -## 9. 硬件加速优先级 - -### 9.1 优先级定义 +### 8.1 优先级定义 ```rust pub enum Priority { @@ -509,7 +430,7 @@ pub enum Priority { } ``` -### 9.2 各编码器优先级 +### 8.2 各编码器优先级 | 优先级 | 编码器 | |--------|--------| @@ -517,10 +438,10 @@ pub enum Priority { | Good (1) | vaapi, v4l2m2m | | Soft (3) | x264, x265, libvpx | -### 9.3 选择策略 +### 8.3 选择策略 ```rust -// libs/hwcodec/src/ffmpeg_ram/mod.rs:49-117 +// libs/hwcodec/src/ffmpeg_ram/mod.rs pub fn prioritized(coders: Vec) -> CodecInfos { // 对于每种格式,选择优先级最高的编码器 @@ -537,9 +458,9 @@ pub fn prioritized(coders: Vec) -> CodecInfos { } ``` -## 10. 故障排除 +## 9. 故障排除 -### 10.1 NVIDIA +### 9.1 NVIDIA ```bash # 检查 NVIDIA 驱动 @@ -553,7 +474,7 @@ ldconfig -p | grep cuda ldconfig -p | grep nvidia-encode ``` -### 10.2 AMD +### 9.2 AMD ```bash # 检查 AMD 驱动 @@ -563,7 +484,7 @@ lspci | grep AMD ldconfig -p | grep amf ``` -### 10.3 Intel +### 9.3 Intel ```bash # 检查 Intel 驱动 @@ -574,7 +495,7 @@ ldconfig -p | grep mfx ldconfig -p | grep vpl ``` -### 10.4 VAAPI +### 9.4 VAAPI ```bash # 安装 vainfo @@ -593,7 +514,7 @@ vainfo # ... ``` -### 10.5 Rockchip MPP +### 9.5 Rockchip MPP ```bash # 检查 MPP 设备 @@ -604,7 +525,7 @@ ls -la /dev/rga ldconfig -p | grep rockchip_mpp ``` -### 10.6 V4L2 M2M +### 9.6 V4L2 M2M ```bash # 列出 V4L2 设备 @@ -613,3 +534,28 @@ v4l2-ctl --list-devices # 检查设备能力 v4l2-ctl -d /dev/video10 --all ``` + +## 10. 性能优化建议 + +### 10.1 编码器选择 + +1. **优先使用硬件编码**: NVENC > AMF > QSV > VAAPI > V4L2 M2M > 软件 +2. **ARM 设备**: 优先检测 RKMPP,其次 V4L2 M2M +3. **x86 设备**: 根据 GPU 厂商自动选择 + +### 10.2 低延迟配置 + +所有硬件编码器都启用了低延迟优化: + +| 编码器 | 配置 | +|--------|------| +| NVENC | `delay=0` | +| AMF | `query_timeout=1000` | +| QSV | `async_depth=1` | +| VAAPI | `async_depth=1` | +| libvpx | `deadline=realtime`, `cpu-used=6` | + +### 10.3 码率控制 + +- **实时流**: 推荐 CBR 模式,保证稳定码率 +- **GOP 大小**: 建议 30-60 帧 (1-2秒),平衡延迟和压缩效率 diff --git a/docs/report/hwcodec/03-build-integration.md b/docs/report/hwcodec/03-build-integration.md index 9b89803f..9fd13a33 100644 --- a/docs/report/hwcodec/03-build-integration.md +++ b/docs/report/hwcodec/03-build-integration.md @@ -7,43 +7,35 @@ libs/hwcodec/ ├── Cargo.toml # 包配置 ├── Cargo.lock # 依赖锁定 ├── build.rs # 构建脚本 -├── src/ # Rust 源码 -│ ├── lib.rs # 库入口 -│ ├── common.rs # 公共定义 -│ ├── ffmpeg.rs # FFmpeg 集成 -│ ├── mux.rs # 混流器 -│ ├── android.rs # Android 支持 -│ ├── ffmpeg_ram/ # RAM 编解码 -│ │ ├── mod.rs -│ │ ├── encode.rs -│ │ └── decode.rs -│ ├── vram/ # GPU 编解码 (Windows) -│ │ ├── mod.rs -│ │ ├── encode.rs -│ │ ├── decode.rs -│ │ └── ... -│ └── res/ # 测试资源 -│ ├── 720p.h264 -│ └── 720p.h265 -├── cpp/ # C++ 源码 -│ ├── common/ # 公共代码 -│ ├── ffmpeg_ram/ # FFmpeg RAM 实现 -│ ├── ffmpeg_vram/ # FFmpeg VRAM 实现 -│ ├── nv/ # NVIDIA 实现 -│ ├── amf/ # AMD 实现 -│ ├── mfx/ # Intel 实现 -│ ├── mux/ # 混流实现 -│ └── yuv/ # YUV 处理 -├── externals/ # 外部 SDK (Git 子模块) -│ ├── nv-codec-headers_n12.1.14.0/ -│ ├── Video_Codec_SDK_12.1.14/ -│ ├── AMF_v1.4.35/ -│ └── MediaSDK_22.5.4/ -├── dev/ # 开发工具 -│ ├── capture/ # 捕获工具 -│ ├── render/ # 渲染工具 -│ └── tool/ # 通用工具 -└── examples/ # 示例程序 +└── src/ # Rust 源码 + ├── lib.rs # 库入口 + ├── common.rs # 公共定义 + ├── ffmpeg.rs # FFmpeg 集成 + └── ffmpeg_ram/ # RAM 编解码 + ├── mod.rs + ├── encode.rs + └── decode.rs +└── cpp/ # C++ 源码 + ├── common/ # 公共代码 + │ ├── log.cpp + │ ├── log.h + │ ├── util.cpp + │ ├── util.h + │ ├── callback.h + │ ├── common.h + │ └── platform/ + │ ├── linux/ + │ │ ├── linux.cpp + │ │ └── linux.h + │ └── win/ + │ ├── win.cpp + │ └── win.h + ├── ffmpeg_ram/ # FFmpeg RAM 实现 + │ ├── ffmpeg_ram_encode.cpp + │ ├── ffmpeg_ram_decode.cpp + │ └── ffmpeg_ram_ffi.h + └── yuv/ # YUV 处理 + └── yuv.cpp ``` ## 2. Cargo 配置 @@ -53,12 +45,12 @@ libs/hwcodec/ ```toml [package] name = "hwcodec" -version = "0.7.1" +version = "0.8.0" edition = "2021" +description = "Hardware video codec for IP-KVM (Windows/Linux)" [features] default = [] -vram = [] # GPU VRAM 直接编解码 (仅 Windows) [dependencies] log = "0.4" # 日志 @@ -72,26 +64,23 @@ bindgen = "0.59" # FFI 绑定生成 [dev-dependencies] env_logger = "0.10" # 日志输出 -rand = "0.8" # 随机数 ``` -### 2.2 Feature 说明 +### 2.2 与原版的区别 -| Feature | 说明 | 平台 | -|---------|------|------| -| `default` | 基础功能 | 全平台 | -| `vram` | GPU VRAM 直接编解码 | 仅 Windows | +| 特性 | 原版 (RustDesk) | 简化版 (One-KVM) | +|------|-----------------|------------------| +| `vram` feature | ✓ | ✗ (已移除) | +| 外部 SDK | 需要 | 不需要 | +| 版本号 | 0.7.1 | 0.8.0 | +| 目标平台 | Windows/Linux/macOS/Android | Windows/Linux | ### 2.3 使用方式 ```toml -# 基础使用 +# 在 One-KVM 项目中使用 [dependencies] hwcodec = { path = "libs/hwcodec" } - -# 启用 VRAM 功能 (Windows) -[dependencies] -hwcodec = { path = "libs/hwcodec", features = ["vram"] } ``` ## 3. 构建脚本详解 (build.rs) @@ -109,11 +98,7 @@ fn main() { // 2. 构建 FFmpeg 相关模块 ffmpeg::build_ffmpeg(&mut builder); - // 3. 构建 SDK 模块 (Windows + vram feature) - #[cfg(all(windows, feature = "vram"))] - sdk::build_sdk(&mut builder); - - // 4. 编译生成静态库 + // 3. 编译生成静态库 builder.static_crt(true).compile("hwcodec"); } ``` @@ -139,9 +124,6 @@ fn build_common(builder: &mut Build) { #[cfg(target_os = "linux")] builder.file(common_dir.join("platform/linux/linux.cpp")); - #[cfg(target_os = "macos")] - builder.file(common_dir.join("platform/mac/mac.mm")); - // 工具代码 builder.files([ common_dir.join("log.cpp"), @@ -168,11 +150,8 @@ mod ffmpeg { // 链接系统库 link_os(); - // 构建子模块 + // 构建 FFmpeg RAM 模块 build_ffmpeg_ram(builder); - #[cfg(feature = "vram")] - build_ffmpeg_vram(builder); - build_mux(builder); } } ``` @@ -186,8 +165,6 @@ fn link_vcpkg(builder: &mut Build, path: PathBuf) -> PathBuf { // 目标平台识别 let target = match (target_os, target_arch) { ("windows", "x86_64") => "x64-windows-static", - ("macos", "x86_64") => "x64-osx", - ("macos", "aarch64") => "arm64-osx", ("linux", arch) => format!("{}-linux", arch), _ => panic!("unsupported platform"), }; @@ -239,57 +216,12 @@ fn link_os() { let libs: Vec<&str> = match target_os.as_str() { "windows" => vec!["User32", "bcrypt", "ole32", "advapi32"], "linux" => vec!["drm", "X11", "stdc++", "z"], - "macos" | "ios" => vec!["c++", "m"], - "android" => vec!["z", "m", "android", "atomic", "mediandk"], _ => panic!("unsupported os"), }; for lib in libs { println!("cargo:rustc-link-lib={}", lib); } - - // macOS 框架 - if target_os == "macos" || target_os == "ios" { - for framework in ["CoreFoundation", "CoreVideo", "CoreMedia", - "VideoToolbox", "AVFoundation"] { - println!("cargo:rustc-link-lib=framework={}", framework); - } - } -} -``` - -### 3.6 SDK 模块构建 (Windows) - -```rust -#[cfg(all(windows, feature = "vram"))] -mod sdk { - pub fn build_sdk(builder: &mut Build) { - build_amf(builder); // AMD AMF - build_nv(builder); // NVIDIA - build_mfx(builder); // Intel MFX - } - - fn build_nv(builder: &mut Build) { - let sdk_path = externals_dir.join("Video_Codec_SDK_12.1.14"); - - // 包含 SDK 头文件 - builder.includes([ - sdk_path.join("Interface"), - sdk_path.join("Samples/Utils"), - sdk_path.join("Samples/NvCodec"), - ]); - - // 编译 SDK 源文件 - builder.file(sdk_path.join("Samples/NvCodec/NvEncoder/NvEncoder.cpp")); - builder.file(sdk_path.join("Samples/NvCodec/NvEncoder/NvEncoderD3D11.cpp")); - builder.file(sdk_path.join("Samples/NvCodec/NvDecoder/NvDecoder.cpp")); - - // 编译封装代码 - builder.files([ - nv_dir.join("nv_encode.cpp"), - nv_dir.join("nv_decode.cpp"), - ]); - } } ``` @@ -332,40 +264,10 @@ impl bindgen::callbacks::ParseCallbacks for CommonCallbacks { | `common_ffi.rs` | `common.h`, `callback.h` | 枚举、常量、回调类型 | | `ffmpeg_ffi.rs` | `ffmpeg_ffi.h` | FFmpeg 日志级别、函数 | | `ffmpeg_ram_ffi.rs` | `ffmpeg_ram_ffi.h` | 编解码器函数 | -| `mux_ffi.rs` | `mux_ffi.h` | 混流器函数 | -## 5. 外部依赖管理 +## 5. 平台构建指南 -### 5.1 Git 子模块 - -```bash -# 初始化子模块 -git submodule update --init --recursive - -# 更新子模块 -git submodule update --remote externals -``` - -### 5.2 子模块配置 (.gitmodules) - -``` -[submodule "externals"] - path = libs/hwcodec/externals - url = https://github.com/rustdesk-org/externals.git -``` - -### 5.3 依赖版本 - -| 依赖 | 版本 | 用途 | -|------|------|------| -| nv-codec-headers | n12.1.14.0 | NVIDIA FFmpeg 编码头 | -| Video_Codec_SDK | 12.1.14 | NVIDIA 编解码 SDK | -| AMF | v1.4.35 | AMD Advanced Media Framework | -| MediaSDK | 22.5.4 | Intel Media SDK | - -## 6. 平台构建指南 - -### 6.1 Linux 构建 +### 5.1 Linux 构建 ```bash # 安装 FFmpeg 开发库 @@ -374,11 +276,14 @@ sudo apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev # 安装其他依赖 sudo apt install libdrm-dev libx11-dev pkg-config +# 安装 clang (bindgen 需要) +sudo apt install clang libclang-dev + # 构建 cargo build --release -p hwcodec ``` -### 6.2 Windows 构建 (VCPKG) +### 5.2 Windows 构建 (VCPKG) ```powershell # 安装 VCPKG @@ -392,26 +297,11 @@ cd vcpkg # 设置环境变量 $env:VCPKG_ROOT = "C:\path\to\vcpkg" -# 构建 -cargo build --release -p hwcodec --features vram -``` - -### 6.3 macOS 构建 - -```bash -# 安装 FFmpeg (Homebrew) -brew install ffmpeg pkg-config - -# 或使用 VCPKG -export VCPKG_ROOT=/path/to/vcpkg -vcpkg install ffmpeg:arm64-osx # Apple Silicon -vcpkg install ffmpeg:x64-osx # Intel - # 构建 cargo build --release -p hwcodec ``` -### 6.4 交叉编译 +### 5.3 交叉编译 ```bash # 安装 cross @@ -424,9 +314,9 @@ cross build --release -p hwcodec --target aarch64-unknown-linux-gnu cross build --release -p hwcodec --target armv7-unknown-linux-gnueabihf ``` -## 7. 集成到 One-KVM +## 6. 集成到 One-KVM -### 7.1 依赖配置 +### 6.1 依赖配置 ```toml # Cargo.toml @@ -434,12 +324,12 @@ cross build --release -p hwcodec --target armv7-unknown-linux-gnueabihf hwcodec = { path = "libs/hwcodec" } ``` -### 7.2 使用示例 +### 6.2 使用示例 ```rust use hwcodec::ffmpeg_ram::encode::{Encoder, EncodeContext}; use hwcodec::ffmpeg_ram::decode::{Decoder, DecodeContext}; -use hwcodec::ffmpeg::AVPixelFormat; +use hwcodec::ffmpeg::{AVPixelFormat, AVHWDeviceType}; // 检测可用编码器 let encoders = Encoder::available_encoders(ctx, None); @@ -458,31 +348,41 @@ let encoder = Encoder::new(EncodeContext { // 编码 let frames = encoder.encode(&yuv_data, pts_ms)?; + +// 创建 MJPEG 解码器 (IP-KVM 专用) +let decoder = Decoder::new(DecodeContext { + name: "mjpeg".to_string(), + device_type: AVHWDeviceType::AV_HWDEVICE_TYPE_NONE, + thread_count: 4, +})?; + +// 解码 +let frames = decoder.decode(&mjpeg_data)?; ``` -### 7.3 日志集成 +### 6.3 日志集成 ```rust // hwcodec 使用 log crate,与 One-KVM 日志系统兼容 use log::{debug, info, warn, error}; -// C++ 层日志通过回调传递 +// C++ 层日志通过回调传递到 Rust #[no_mangle] -pub extern "C" fn hwcodec_log(level: i32, message: *const c_char) { +pub extern "C" fn hwcodec_av_log_callback(level: i32, message: *const c_char) { + // 转发到 Rust log 系统 match level { - 0 => error!("{}", message), - 1 => warn!("{}", message), - 2 => info!("{}", message), - 3 => debug!("{}", message), - 4 => trace!("{}", message), + AV_LOG_ERROR => error!("{}", message), + AV_LOG_WARNING => warn!("{}", message), + AV_LOG_INFO => info!("{}", message), + AV_LOG_DEBUG => debug!("{}", message), _ => {} } } ``` -## 8. 故障排除 +## 7. 故障排除 -### 8.1 编译错误 +### 7.1 编译错误 **FFmpeg 未找到**: ``` @@ -502,7 +402,7 @@ error: failed to run custom build command for `hwcodec` sudo apt install clang libclang-dev ``` -### 8.2 链接错误 +### 7.2 链接错误 **符号未定义**: ``` @@ -521,7 +421,7 @@ sudo ldconfig export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ``` -### 8.3 运行时错误 +### 7.3 运行时错误 **硬件编码器不可用**: ``` @@ -537,3 +437,41 @@ Encoder h264_vaapi test failed avcodec_receive_frame failed, ret = -11 ``` 解决: 这通常表示需要更多输入数据 (EAGAIN),是正常行为 + +## 8. 与原版 RustDesk hwcodec 的构建差异 + +### 8.1 移除的构建步骤 + +| 步骤 | 原因 | +|------|------| +| `build_mux()` | 移除了 Mux 模块 | +| `build_ffmpeg_vram()` | 移除了 VRAM 模块 | +| `sdk::build_sdk()` | 移除了外部 SDK 依赖 | +| macOS 框架链接 | 移除了 macOS 支持 | +| Android NDK 链接 | 移除了 Android 支持 | + +### 8.2 简化的构建流程 + +``` +原版构建流程: +build.rs +├── build_common() +├── ffmpeg::build_ffmpeg() +│ ├── build_ffmpeg_ram() +│ ├── build_ffmpeg_vram() [已移除] +│ └── build_mux() [已移除] +└── sdk::build_sdk() [已移除] + +简化版构建流程: +build.rs +├── build_common() +└── ffmpeg::build_ffmpeg() + └── build_ffmpeg_ram() +``` + +### 8.3 优势 + +1. **更快的编译**: 无需编译外部 SDK 代码 +2. **更少的依赖**: 无需下载 ~9MB 的外部 SDK +3. **更简单的维护**: 代码量减少约 67% +4. **更小的二进制**: 不包含未使用的功能 diff --git a/libs/hwcodec/.gitmodules b/libs/hwcodec/.gitmodules deleted file mode 100644 index 5e105746..00000000 --- a/libs/hwcodec/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "externals"] - path = externals - url = https://github.com/rustdesk-org/externals.git diff --git a/libs/hwcodec/Cargo.toml b/libs/hwcodec/Cargo.toml index 7468bb5c..1909c6b4 100644 --- a/libs/hwcodec/Cargo.toml +++ b/libs/hwcodec/Cargo.toml @@ -1,13 +1,11 @@ [package] name = "hwcodec" -version = "0.7.1" +version = "0.8.0" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "Hardware video codec for IP-KVM (Windows/Linux)" [features] default = [] -vram = [] [dependencies] log = "0.4" @@ -21,9 +19,3 @@ bindgen = "0.59" [dev-dependencies] env_logger = "0.10" -rand = "0.8" - -[target.'cfg(target_os="windows")'.dev-dependencies] -capture = { path = "dev/capture" } -render = { path = "dev/render" } -tool = { path = "dev/tool" } diff --git a/libs/hwcodec/build.rs b/libs/hwcodec/build.rs index e7cb30c3..16d95a48 100644 --- a/libs/hwcodec/build.rs +++ b/libs/hwcodec/build.rs @@ -6,18 +6,13 @@ use std::{ fn main() { let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir.join("externals"); let cpp_dir = manifest_dir.join("cpp"); println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed=deps"); - println!("cargo:rerun-if-changed={}", externals_dir.display()); println!("cargo:rerun-if-changed={}", cpp_dir.display()); let mut builder = Build::new(); build_common(&mut builder); ffmpeg::build_ffmpeg(&mut builder); - #[cfg(all(windows, feature = "vram"))] - sdk::build_sdk(&mut builder); builder.static_crt(true).compile("hwcodec"); } @@ -25,6 +20,7 @@ fn build_common(builder: &mut Build) { let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let common_dir = manifest_dir.join("cpp").join("common"); + bindgen::builder() .header(common_dir.join("common.h").to_string_lossy().to_string()) .header(common_dir.join("callback.h").to_string_lossy().to_string()) @@ -44,32 +40,23 @@ fn build_common(builder: &mut Build) { builder.include(&common_dir); // platform - let _platform_path = common_dir.join("platform"); + let platform_path = common_dir.join("platform"); #[cfg(windows)] { - let win_path = _platform_path.join("win"); + let win_path = platform_path.join("win"); builder.include(&win_path); builder.file(win_path.join("win.cpp")); } #[cfg(target_os = "linux")] { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir.join("externals"); - // ffnvcodec - let ffnvcodec_path = externals_dir - .join("nv-codec-headers_n12.1.14.0") - .join("include") - .join("ffnvcodec"); - builder.include(ffnvcodec_path); - - let linux_path = _platform_path.join("linux"); + let linux_path = platform_path.join("linux"); builder.include(&linux_path); builder.file(linux_path.join("linux.cpp")); } - if target_os == "macos" { - let macos_path = _platform_path.join("mac"); - builder.include(&macos_path); - builder.file(macos_path.join("mac.mm")); + + // Unsupported platforms + if target_os != "windows" && target_os != "linux" { + panic!("Unsupported OS: {}. Only Windows and Linux are supported.", target_os); } // tool @@ -93,9 +80,6 @@ impl bindgen::callbacks::ParseCallbacks for CommonCallbacks { } mod ffmpeg { - #[allow(unused_imports)] - use core::panic; - use super::*; pub fn build_ffmpeg(builder: &mut Build) { @@ -111,13 +95,6 @@ mod ffmpeg { link_os(); build_ffmpeg_ram(builder); - #[cfg(feature = "vram")] - build_ffmpeg_vram(builder); - build_mux(builder); - let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); - if target_os == "macos" || target_os == "ios" { - builder.flag("-std=c++11"); - } } /// Link system FFmpeg using pkg-config (for Linux development) @@ -181,15 +158,7 @@ mod ffmpeg { } else { target_arch = "arm".to_owned(); } - let mut target = if target_os == "macos" { - if target_arch == "x64" { - "x64-osx".to_owned() - } else if target_arch == "arm64" { - "arm64-osx".to_owned() - } else { - format!("{}-{}", target_arch, target_os) - } - } else if target_os == "windows" { + let mut target = if target_os == "windows" { "x64-windows-static".to_owned() } else { format!("{}-{}", target_arch, target_os) @@ -241,27 +210,13 @@ mod ffmpeg { v.push("z"); } v - } else if target_os == "macos" || target_os == "ios" { - ["c++", "m"].to_vec() - } else if target_os == "android" { - // https://github.com/FFmpeg/FFmpeg/commit/98b5e80fd6980e641199e9ce3bc27100e2df17a4 - // link to mediandk directly since n7.1 - ["z", "m", "android", "atomic", "mediandk"].to_vec() } else { - panic!("unsupported os"); + panic!("Unsupported OS: {}. Only Windows and Linux are supported.", target_os); }; for lib in dyn_libs.iter() { println!("cargo:rustc-link-lib={}", lib); } - - if target_os == "macos" || target_os == "ios" { - println!("cargo:rustc-link-lib=framework=CoreFoundation"); - println!("cargo:rustc-link-lib=framework=CoreVideo"); - println!("cargo:rustc-link-lib=framework=CoreMedia"); - println!("cargo:rustc-link-lib=framework=VideoToolbox"); - println!("cargo:rustc-link-lib=framework=AVFoundation"); - } } fn ffmpeg_ffi() { @@ -299,223 +254,4 @@ mod ffmpeg { ["ffmpeg_ram_encode.cpp", "ffmpeg_ram_decode.cpp"].map(|f| ffmpeg_ram_dir.join(f)), ); } - - #[cfg(feature = "vram")] - fn build_ffmpeg_vram(builder: &mut Build) { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let ffmpeg_ram_dir = manifest_dir.join("cpp").join("ffmpeg_vram"); - let ffi_header = ffmpeg_ram_dir - .join("ffmpeg_vram_ffi.h") - .to_string_lossy() - .to_string(); - bindgen::builder() - .header(ffi_header) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("ffmpeg_vram_ffi.rs")) - .unwrap(); - - builder.files( - ["ffmpeg_vram_decode.cpp", "ffmpeg_vram_encode.cpp"].map(|f| ffmpeg_ram_dir.join(f)), - ); - } - - fn build_mux(builder: &mut Build) { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let mux_dir = manifest_dir.join("cpp").join("mux"); - let mux_header = mux_dir.join("mux_ffi.h").to_string_lossy().to_string(); - bindgen::builder() - .header(mux_header) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("mux_ffi.rs")) - .unwrap(); - - builder.files(["mux.cpp"].map(|f| mux_dir.join(f))); - } -} - -#[cfg(all(windows, feature = "vram"))] -mod sdk { - use super::*; - - pub(crate) fn build_sdk(builder: &mut Build) { - build_amf(builder); - build_nv(builder); - build_mfx(builder); - } - - fn build_nv(builder: &mut Build) { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir.join("externals"); - let common_dir = manifest_dir.join("common"); - let nv_dir = manifest_dir.join("cpp").join("nv"); - println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed={}", common_dir.display()); - println!("cargo:rerun-if-changed={}", externals_dir.display()); - bindgen::builder() - .header(&nv_dir.join("nv_ffi.h").to_string_lossy().to_string()) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("nv_ffi.rs")) - .unwrap(); - - // system - #[cfg(target_os = "windows")] - [ - "kernel32", "user32", "gdi32", "winspool", "shell32", "ole32", "oleaut32", "uuid", - "comdlg32", "advapi32", "d3d11", "dxgi", - ] - .map(|lib| println!("cargo:rustc-link-lib={}", lib)); - #[cfg(target_os = "linux")] - println!("cargo:rustc-link-lib=stdc++"); - - // ffnvcodec - let ffnvcodec_path = externals_dir - .join("nv-codec-headers_n12.1.14.0") - .join("include") - .join("ffnvcodec"); - builder.include(ffnvcodec_path); - - // video codc sdk - let sdk_path = externals_dir.join("Video_Codec_SDK_12.1.14"); - builder.includes([ - sdk_path.clone(), - sdk_path.join("Interface"), - sdk_path.join("Samples").join("Utils"), - sdk_path.join("Samples").join("NvCodec"), - sdk_path.join("Samples").join("NvCodec").join("NVEncoder"), - sdk_path.join("Samples").join("NvCodec").join("NVDecoder"), - ]); - - for file in vec!["NvEncoder.cpp", "NvEncoderD3D11.cpp"] { - builder.file( - sdk_path - .join("Samples") - .join("NvCodec") - .join("NvEncoder") - .join(file), - ); - } - for file in vec!["NvDecoder.cpp"] { - builder.file( - sdk_path - .join("Samples") - .join("NvCodec") - .join("NvDecoder") - .join(file), - ); - } - - // crate - builder.files(["nv_encode.cpp", "nv_decode.cpp"].map(|f| nv_dir.join(f))); - } - - fn build_amf(builder: &mut Build) { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir.join("externals"); - let amf_dir = manifest_dir.join("cpp").join("amf"); - println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed={}", externals_dir.display()); - bindgen::builder() - .header(amf_dir.join("amf_ffi.h").to_string_lossy().to_string()) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("amf_ffi.rs")) - .unwrap(); - - // system - #[cfg(windows)] - println!("cargo:rustc-link-lib=ole32"); - #[cfg(target_os = "linux")] - println!("cargo:rustc-link-lib=stdc++"); - - // amf - let amf_path = externals_dir.join("AMF_v1.4.35"); - builder.include(format!("{}/amf/public/common", amf_path.display())); - builder.include(amf_path.join("amf")); - - for f in vec![ - "AMFFactory.cpp", - "AMFSTL.cpp", - "Thread.cpp", - #[cfg(windows)] - "Windows/ThreadWindows.cpp", - #[cfg(target_os = "linux")] - "Linux/ThreadLinux.cpp", - "TraceAdapter.cpp", - ] { - builder.file(format!("{}/amf/public/common/{}", amf_path.display(), f)); - } - - // crate - builder.files(["amf_encode.cpp", "amf_decode.cpp"].map(|f| amf_dir.join(f))); - } - - fn build_mfx(builder: &mut Build) { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir.join("externals"); - let mfx_dir = manifest_dir.join("cpp").join("mfx"); - println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed={}", externals_dir.display()); - bindgen::builder() - .header(&mfx_dir.join("mfx_ffi.h").to_string_lossy().to_string()) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("mfx_ffi.rs")) - .unwrap(); - - // MediaSDK - let sdk_path = externals_dir.join("MediaSDK_22.5.4"); - - // mfx_dispatch - let mfx_path = sdk_path.join("api").join("mfx_dispatch"); - // include headers and reuse static lib - builder.include(mfx_path.join("windows").join("include")); - - let sample_path = sdk_path.join("samples").join("sample_common"); - builder - .includes([ - sdk_path.join("api").join("include"), - sample_path.join("include"), - ]) - .files( - [ - "sample_utils.cpp", - "base_allocator.cpp", - "d3d11_allocator.cpp", - "avc_bitstream.cpp", - "avc_spl.cpp", - "avc_nal_spl.cpp", - ] - .map(|f| sample_path.join("src").join(f)), - ) - .files( - [ - "time.cpp", - "atomic.cpp", - "shared_object.cpp", - "thread_windows.cpp", - ] - .map(|f| sample_path.join("src").join("vm").join(f)), - ); - - // link - [ - "kernel32", "user32", "gdi32", "winspool", "shell32", "ole32", "oleaut32", "uuid", - "comdlg32", "advapi32", "d3d11", "dxgi", - ] - .map(|lib| println!("cargo:rustc-link-lib={}", lib)); - - builder - .files(["mfx_encode.cpp", "mfx_decode.cpp"].map(|f| mfx_dir.join(f))) - .define("NOMINMAX", None) - .define("MFX_DEPRECATED_OFF", None) - .define("MFX_D3D11_SUPPORT", None); - } } diff --git a/libs/hwcodec/cpp/amf/amf_common.cpp b/libs/hwcodec/cpp/amf/amf_common.cpp deleted file mode 100644 index eb94300c..00000000 --- a/libs/hwcodec/cpp/amf/amf_common.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "common.h" -#include -#include -#include - -#ifndef AMF_FACILITY -#define AMF_FACILITY L"AMFCommon" -#endif - -static bool convert_api(amf::AMF_MEMORY_TYPE &rhs) { - // Always use DX11 since it's the only supported API - rhs = amf::AMF_MEMORY_DX11; - return true; -} - -static bool convert_surface_format(SurfaceFormat lhs, - amf::AMF_SURFACE_FORMAT &rhs) { - switch (lhs) { - case SURFACE_FORMAT_NV12: - rhs = amf::AMF_SURFACE_NV12; - break; - case SURFACE_FORMAT_RGBA: - rhs = amf::AMF_SURFACE_RGBA; - break; - case SURFACE_FORMAT_BGRA: - rhs = amf::AMF_SURFACE_BGRA; - break; - default: - std::cerr << "unsupported surface format: " << static_cast(lhs) - << "\n"; - return false; - } - return true; -} diff --git a/libs/hwcodec/cpp/amf/amf_decode.cpp b/libs/hwcodec/cpp/amf/amf_decode.cpp deleted file mode 100644 index b938cbaa..00000000 --- a/libs/hwcodec/cpp/amf/amf_decode.cpp +++ /dev/null @@ -1,451 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "AMFDEC" -#include "log.h" - -#define AMF_FACILITY L"AMFDecoder" - -#define AMF_CHECK_RETURN(res, msg) \ - if (res != AMF_OK) { \ - LOG_ERROR(std::string(msg) + ", result code: " + std::to_string(int(res))); \ - return res; \ - } - -namespace { -class AMFDecoder { - -private: - // system - void *device_; - int64_t luid_; - std::unique_ptr nativeDevice_ = nullptr; - // amf - AMFFactoryHelper AMFFactory_; - amf::AMFContextPtr AMFContext_ = NULL; - amf::AMFComponentPtr AMFDecoder_ = NULL; - amf::AMF_MEMORY_TYPE AMFMemoryType_; - amf::AMF_SURFACE_FORMAT decodeFormatOut_ = amf::AMF_SURFACE_NV12; - amf::AMF_SURFACE_FORMAT textureFormatOut_; - amf::AMFComponentPtr AMFConverter_ = NULL; - int last_width_ = 0; - int last_height_ = 0; - amf_wstring codec_; - bool full_range_ = false; - bool bt709_ = false; - - // buffer - std::vector> buffer_; - -public: - AMFDecoder(void *device, int64_t luid, amf::AMF_MEMORY_TYPE memoryTypeOut, - amf_wstring codec, amf::AMF_SURFACE_FORMAT textureFormatOut) { - device_ = device; - luid_ = luid; - AMFMemoryType_ = memoryTypeOut; - textureFormatOut_ = textureFormatOut; - codec_ = codec; - } - - ~AMFDecoder() {} - - AMF_RESULT decode(uint8_t *iData, uint32_t iDataSize, DecodeCallback callback, - void *obj) { - AMF_RESULT res = AMF_FAIL; - bool decoded = false; - amf::AMFBufferPtr iDataWrapBuffer = NULL; - - res = AMFContext_->CreateBufferFromHostNative(iData, iDataSize, - &iDataWrapBuffer, NULL); - AMF_CHECK_RETURN(res, "CreateBufferFromHostNative failed"); - res = AMFDecoder_->SubmitInput(iDataWrapBuffer); - if (res == AMF_RESOLUTION_CHANGED) { - iDataWrapBuffer = NULL; - LOG_INFO(std::string("resolution changed")); - res = AMFDecoder_->Drain(); - AMF_CHECK_RETURN(res, "Drain failed"); - res = AMFDecoder_->Terminate(); - AMF_CHECK_RETURN(res, "Terminate failed"); - res = AMFDecoder_->Init(decodeFormatOut_, 0, 0); - AMF_CHECK_RETURN(res, "Init failed"); - res = AMFContext_->CreateBufferFromHostNative(iData, iDataSize, - &iDataWrapBuffer, NULL); - AMF_CHECK_RETURN(res, "CreateBufferFromHostNative failed"); - res = AMFDecoder_->SubmitInput(iDataWrapBuffer); - } - AMF_CHECK_RETURN(res, "SubmitInput failed"); - amf::AMFDataPtr oData = NULL; - auto start = util::now(); - do { - res = AMFDecoder_->QueryOutput(&oData); - if (res == AMF_REPEAT) { - amf_sleep(1); - } - } while (res == AMF_REPEAT && util::elapsed_ms(start) < DECODE_TIMEOUT_MS); - if (res == AMF_OK && oData != NULL) { - amf::AMFSurfacePtr surface(oData); - AMF_RETURN_IF_INVALID_POINTER(surface, L"surface is NULL"); - - if (surface->GetPlanesCount() == 0) - return AMF_FAIL; - - // convert texture - amf::AMFDataPtr convertData; - res = Convert(surface, convertData); - AMF_CHECK_RETURN(res, "Convert failed"); - amf::AMFSurfacePtr convertSurface(convertData); - if (!convertSurface || convertSurface->GetPlanesCount() == 0) - return AMF_FAIL; - - // For DirectX objects, when a pointer to a COM interface is returned, - // GetNative does not call IUnknown::AddRef on the interface being - // returned. - void *native = convertSurface->GetPlaneAt(0)->GetNative(); - if (!native) - return AMF_FAIL; - switch (convertSurface->GetMemoryType()) { - case amf::AMF_MEMORY_DX11: { - { - ID3D11Texture2D *src = (ID3D11Texture2D *)native; - D3D11_TEXTURE2D_DESC desc; - src->GetDesc(&desc); - nativeDevice_->EnsureTexture(desc.Width, desc.Height); - nativeDevice_->next(); - ID3D11Texture2D *dst = nativeDevice_->GetCurrentTexture(); - nativeDevice_->context_->CopyResource(dst, src); - nativeDevice_->context_->Flush(); - if (callback) - callback(dst, obj); - decoded = true; - } - break; - } break; - case amf::AMF_MEMORY_OPENCL: { - uint8_t *buf = (uint8_t *)native; - } break; - } - - surface = NULL; - convertData = NULL; - convertSurface = NULL; - } - oData = NULL; - iDataWrapBuffer = NULL; - return decoded ? AMF_OK : AMF_FAIL; - return AMF_OK; - } - - AMF_RESULT destroy() { - // Terminate converter before terminate decoder get "[AMFDeviceDX11Impl] - // Warning: Possible memory leak detected: DX11 device is being destroyed, - // but has 6 surfaces associated with it. This is OK if there are references - // to the device outside AMF" - - if (AMFConverter_ != NULL) { - AMFConverter_->Drain(); - AMFConverter_->Terminate(); - AMFConverter_ = NULL; - } - if (AMFDecoder_ != NULL) { - AMFDecoder_->Drain(); - AMFDecoder_->Terminate(); - AMFDecoder_ = NULL; - } - if (AMFContext_ != NULL) { - AMFContext_->Terminate(); - AMFContext_ = NULL; // context is the last - } - AMFFactory_.Terminate(); - return AMF_OK; - } - - AMF_RESULT initialize() { - AMF_RESULT res; - - res = AMFFactory_.Init(); - AMF_CHECK_RETURN(res, "AMFFactory Init failed"); - amf::AMFSetCustomTracer(AMFFactory_.GetTrace()); - amf::AMFTraceEnableWriter(AMF_TRACE_WRITER_CONSOLE, true); - amf::AMFTraceSetWriterLevel(AMF_TRACE_WRITER_CONSOLE, AMF_TRACE_WARNING); - - res = AMFFactory_.GetFactory()->CreateContext(&AMFContext_); - AMF_CHECK_RETURN(res, "CreateContext failed"); - - switch (AMFMemoryType_) { - case amf::AMF_MEMORY_DX11: - nativeDevice_ = std::make_unique(); - if (!nativeDevice_->Init(luid_, (ID3D11Device *)device_, 4)) { - LOG_ERROR(std::string("Init NativeDevice failed")); - return AMF_FAIL; - } - res = AMFContext_->InitDX11( - nativeDevice_->device_.Get()); // can be DX11 device - AMF_CHECK_RETURN(res, "InitDX11 failed"); - break; - default: - LOG_ERROR(std::string("unsupported memory type: ") + - std::to_string((int)AMFMemoryType_)); - return AMF_FAIL; - } - - res = AMFFactory_.GetFactory()->CreateComponent(AMFContext_, codec_.c_str(), - &AMFDecoder_); - AMF_CHECK_RETURN(res, "CreateComponent failed"); - - res = setParameters(); - AMF_CHECK_RETURN(res, "setParameters failed"); - - res = AMFDecoder_->Init(decodeFormatOut_, 0, 0); - AMF_CHECK_RETURN(res, "Init decoder failed"); - - return AMF_OK; - } - -private: - AMF_RESULT setParameters() { - AMF_RESULT res; - res = - AMFDecoder_->SetProperty(AMF_TIMESTAMP_MODE, amf_int64(AMF_TS_DECODE)); - AMF_RETURN_IF_FAILED( - res, L"SetProperty AMF_TIMESTAMP_MODE to AMF_TS_DECODE failed"); - res = - AMFDecoder_->SetProperty(AMF_VIDEO_DECODER_REORDER_MODE, - amf_int64(AMF_VIDEO_DECODER_MODE_LOW_LATENCY)); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_DECODER_REORDER_MODE failed"); - // color - res = AMFDecoder_->SetProperty( - AMF_VIDEO_DECODER_COLOR_RANGE, - full_range_ ? AMF_COLOR_RANGE_FULL : AMF_COLOR_RANGE_STUDIO); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_DECODER_COLOR_RANGE failed"); - res = AMFDecoder_->SetProperty( - AMF_VIDEO_DECODER_COLOR_PROFILE, - bt709_ ? (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_709) - : (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_601)); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_DECODER_COLOR_PROFILE failed"); - // res = AMFDecoder_->SetProperty( - // AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC, - // bt709_ ? AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709 - // : AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M); - // AMF_CHECK_RETURN( - // res, - // "SetProperty AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC - // failed"); - // res = AMFDecoder_->SetProperty( - // AMF_VIDEO_DECODER_COLOR_PRIMARIES, - // bt709_ ? AMF_COLOR_PRIMARIES_BT709 : AMF_COLOR_PRIMARIES_SMPTE170M); - // AMF_CHECK_RETURN(res, - // "SetProperty AMF_VIDEO_DECODER_COLOR_PRIMARIES failed"); - return AMF_OK; - } - - AMF_RESULT Convert(IN amf::AMFSurfacePtr &surface, - OUT amf::AMFDataPtr &convertData) { - if (decodeFormatOut_ == textureFormatOut_) - return AMF_OK; - AMF_RESULT res; - - int width = surface->GetPlaneAt(0)->GetWidth(); - int height = surface->GetPlaneAt(0)->GetHeight(); - if (AMFConverter_ != NULL) { - if (width != last_width_ || height != last_height_) { - LOG_INFO(std::string("Convert size changed, (") + std::to_string(last_width_) + "x" + - std::to_string(last_height_) + ") -> (" + - std::to_string(width) + "x" + std::to_string(width) + ")"); - AMFConverter_->Terminate(); - AMFConverter_ = NULL; - } - } - if (!AMFConverter_) { - res = AMFFactory_.GetFactory()->CreateComponent( - AMFContext_, AMFVideoConverter, &AMFConverter_); - AMF_CHECK_RETURN(res, "Convert CreateComponent failed"); - res = AMFConverter_->SetProperty(AMF_VIDEO_CONVERTER_MEMORY_TYPE, - AMFMemoryType_); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_CONVERTER_MEMORY_TYPE failed"); - res = AMFConverter_->SetProperty(AMF_VIDEO_CONVERTER_OUTPUT_FORMAT, - textureFormatOut_); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_CONVERTER_OUTPUT_FORMAT failed"); - res = AMFConverter_->SetProperty(AMF_VIDEO_CONVERTER_OUTPUT_SIZE, - ::AMFConstructSize(width, height)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_CONVERTER_OUTPUT_SIZE failed"); - res = AMFConverter_->Init(decodeFormatOut_, width, height); - AMF_CHECK_RETURN(res, "Init converter failed"); - // color - res = AMFConverter_->SetProperty( - AMF_VIDEO_CONVERTER_INPUT_COLOR_RANGE, - full_range_ ? AMF_COLOR_RANGE_FULL : AMF_COLOR_RANGE_STUDIO); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_CONVERTER_INPUT_COLOR_RANGE failed"); - res = AMFConverter_->SetProperty( - AMF_VIDEO_CONVERTER_OUTPUT_COLOR_RANGE, AMF_COLOR_RANGE_FULL); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_CONVERTER_OUTPUT_COLOR_RANGE failed"); - res = AMFConverter_->SetProperty( - AMF_VIDEO_CONVERTER_COLOR_PROFILE, - bt709_ ? (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_709) - : (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_601)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_CONVERTER_COLOR_PROFILE failed"); - res = AMFConverter_->SetProperty( - AMF_VIDEO_CONVERTER_INPUT_TRANSFER_CHARACTERISTIC, - bt709_ ? AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709 - : AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_CONVERTER_INPUT_TRANSFER_CHARACTERISTIC " - "failed"); - res = AMFConverter_->SetProperty( - AMF_VIDEO_CONVERTER_INPUT_COLOR_PRIMARIES, - bt709_ ? AMF_COLOR_PRIMARIES_BT709 : AMF_COLOR_PRIMARIES_SMPTE170M); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_CONVERTER_INPUT_COLOR_PRIMARIES failed"); - } - last_width_ = width; - last_height_ = height; - res = AMFConverter_->SubmitInput(surface); - AMF_CHECK_RETURN(res, "Convert SubmitInput failed"); - res = AMFConverter_->QueryOutput(&convertData); - AMF_CHECK_RETURN(res, "Convert QueryOutput failed"); - return AMF_OK; - } -}; - -bool convert_codec(DataFormat lhs, amf_wstring &rhs) { - switch (lhs) { - case H264: - rhs = AMFVideoDecoderUVD_H264_AVC; - break; - case H265: - rhs = AMFVideoDecoderHW_H265_HEVC; - break; - default: - LOG_ERROR(std::string("unsupported codec: ") + std::to_string(lhs)); - return false; - } - return true; -} - -} // namespace - -#include "amf_common.cpp" - -extern "C" { - -int amf_destroy_decoder(void *decoder) { - try { - AMFDecoder *dec = (AMFDecoder *)decoder; - if (dec) { - dec->destroy(); - delete dec; - dec = NULL; - return 0; - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("destroy failed: ") + e.what()); - } - return -1; -} - -void *amf_new_decoder(void *device, int64_t luid, - DataFormat dataFormat) { - AMFDecoder *dec = NULL; - try { - amf_wstring codecStr; - amf::AMF_MEMORY_TYPE memory; - amf::AMF_SURFACE_FORMAT surfaceFormat; - if (!convert_api(memory)) { - return NULL; - } - if (!convert_codec(dataFormat, codecStr)) { - return NULL; - } - dec = new AMFDecoder(device, luid, memory, codecStr, amf::AMF_SURFACE_BGRA); - if (dec) { - if (dec->initialize() == AMF_OK) { - return dec; - } - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("new failed: ") + e.what()); - } - if (dec) { - dec->destroy(); - delete dec; - dec = NULL; - } - return NULL; -} - -int amf_decode(void *decoder, uint8_t *data, int32_t length, - DecodeCallback callback, void *obj) { - try { - AMFDecoder *dec = (AMFDecoder *)decoder; - if (dec->decode(data, length, callback, obj) == AMF_OK) { - return HWCODEC_SUCCESS; - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("decode failed: ") + e.what()); - } - return HWCODEC_ERR_COMMON; -} - -int amf_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, DataFormat dataFormat, - uint8_t *data, int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_AMD)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - AMFDecoder *p = (AMFDecoder *)amf_new_decoder( - nullptr, currentLuid, dataFormat); - if (!p) - continue; - auto start = util::now(); - bool succ = p->decode(data, length, nullptr, nullptr) == AMF_OK; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_AMD; - count += 1; - } - p->destroy(); - delete p; - p = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("test failed: ") + e.what()); - } - return -1; -} - -} // extern "C" diff --git a/libs/hwcodec/cpp/amf/amf_encode.cpp b/libs/hwcodec/cpp/amf/amf_encode.cpp deleted file mode 100644 index 6d39fd54..00000000 --- a/libs/hwcodec/cpp/amf/amf_encode.cpp +++ /dev/null @@ -1,611 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "AMFENC" -#include "log.h" - -#define AMF_FACILITY L"AMFEncoder" -#define MILLISEC_TIME 10000 - -namespace { - -#define AMF_CHECK_RETURN(res, msg) \ - if (res != AMF_OK) { \ - LOG_ERROR(std::string(msg) + ", result code: " + std::to_string(int(res))); \ - return res; \ - } - -/** Encoder output packet */ -struct encoder_packet { - uint8_t *data; /**< Packet data */ - size_t size; /**< Packet size */ - - int64_t pts; /**< Presentation timestamp */ - int64_t dts; /**< Decode timestamp */ - - int32_t timebase_num; /**< Timebase numerator */ - int32_t timebase_den; /**< Timebase denominator */ - - bool keyframe; /**< Is a keyframe */ - - /* ---------------------------------------------------------------- */ - /* Internal video variables (will be parsed automatically) */ - - /* DTS in microseconds */ - int64_t dts_usec; - - /* System DTS in microseconds */ - int64_t sys_dts_usec; -}; - -class AMFEncoder { - -public: - DataFormat dataFormat_; - amf::AMFComponentPtr AMFEncoder_ = NULL; - amf::AMFContextPtr AMFContext_ = NULL; - -private: - // system - void *handle_; - // AMF Internals - AMFFactoryHelper AMFFactory_; - amf::AMF_MEMORY_TYPE AMFMemoryType_; - amf::AMF_SURFACE_FORMAT AMFSurfaceFormat_ = amf::AMF_SURFACE_BGRA; - std::pair resolution_; - amf_wstring codec_; - // const - AMF_COLOR_BIT_DEPTH_ENUM eDepth_ = AMF_COLOR_BIT_DEPTH_8; - int query_timeout_ = ENCODE_TIMEOUT_MS; - int32_t bitRateIn_; - int32_t frameRate_; - int32_t gop_; - bool enable4K_ = false; - bool full_range_ = false; - bool bt709_ = false; - - // Buffers - std::vector packetDataBuffer_; - -public: - AMFEncoder(void *handle, amf::AMF_MEMORY_TYPE memoryType, amf_wstring codec, - DataFormat dataFormat, int32_t width, int32_t height, - int32_t bitrate, int32_t framerate, int32_t gop) { - handle_ = handle; - dataFormat_ = dataFormat; - AMFMemoryType_ = memoryType; - resolution_ = std::make_pair(width, height); - codec_ = codec; - bitRateIn_ = bitrate; - frameRate_ = framerate; - gop_ = (gop > 0 && gop < MAX_GOP) ? gop : MAX_GOP; - enable4K_ = width > 1920 && height > 1080; - } - - ~AMFEncoder() {} - - AMF_RESULT encode(void *tex, EncodeCallback callback, void *obj, int64_t ms) { - amf::AMFSurfacePtr surface = NULL; - amf::AMFComputeSyncPointPtr pSyncPoint = NULL; - AMF_RESULT res; - bool encoded = false; - - switch (AMFMemoryType_) { - case amf::AMF_MEMORY_DX11: - // https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/280 - // AMF will not copy the surface during the CreateSurfaceFromDX11Native - // call - res = AMFContext_->CreateSurfaceFromDX11Native(tex, &surface, NULL); - AMF_CHECK_RETURN(res, "CreateSurfaceFromDX11Native failed"); - { - amf::AMFDataPtr data1; - surface->Duplicate(surface->GetMemoryType(), &data1); - surface = amf::AMFSurfacePtr(data1); - } - break; - default: - LOG_ERROR(std::string("Unsupported memory type")); - return AMF_NOT_IMPLEMENTED; - break; - } - surface->SetPts(ms * AMF_MILLISECOND); - res = AMFEncoder_->SubmitInput(surface); - AMF_CHECK_RETURN(res, "SubmitInput failed"); - - amf::AMFDataPtr data = NULL; - res = AMFEncoder_->QueryOutput(&data); - if (res == AMF_OK && data != NULL) { - struct encoder_packet packet; - PacketKeyframe(data, &packet); - amf::AMFBufferPtr pBuffer = amf::AMFBufferPtr(data); - packet.size = pBuffer->GetSize(); - if (packet.size > 0) { - if (packetDataBuffer_.size() < packet.size) { - size_t newBufferSize = (size_t)exp2(ceil(log2((double)packet.size))); - packetDataBuffer_.resize(newBufferSize); - } - packet.data = packetDataBuffer_.data(); - std::memcpy(packet.data, pBuffer->GetNative(), packet.size); - if (callback) - callback(packet.data, packet.size, packet.keyframe, obj, ms); - encoded = true; - } - pBuffer = NULL; - } - data = NULL; - pSyncPoint = NULL; - surface = NULL; - return encoded ? AMF_OK : AMF_FAIL; - } - - AMF_RESULT destroy() { - if (AMFEncoder_) { - AMFEncoder_->Terminate(); - AMFEncoder_ = NULL; - } - if (AMFContext_) { - AMFContext_->Terminate(); - AMFContext_ = NULL; // AMFContext_ is the last - } - AMFFactory_.Terminate(); - return AMF_OK; - } - - AMF_RESULT test() { - AMF_RESULT res = AMF_OK; - amf::AMFSurfacePtr surface = nullptr; - res = AMFContext_->AllocSurface(AMFMemoryType_, AMFSurfaceFormat_, - resolution_.first, resolution_.second, - &surface); - AMF_CHECK_RETURN(res, "AllocSurface failed"); - if (surface->GetPlanesCount() < 1) - return AMF_FAIL; - void *native = surface->GetPlaneAt(0)->GetNative(); - if (!native) - return AMF_FAIL; - int32_t key_obj = 0; - auto start = util::now(); - res = encode(native, util_encode::vram_encode_test_callback, &key_obj, 0); - int64_t elapsed = util::elapsed_ms(start); - if (res == AMF_OK && key_obj == 1 && elapsed < TEST_TIMEOUT_MS) { - return AMF_OK; - } - return AMF_FAIL; - } - - AMF_RESULT initialize() { - AMF_RESULT res; - - res = AMFFactory_.Init(); - if (res != AMF_OK) { - std::cerr << "AMF init failed, error code = " << res << "\n"; - return res; - } - amf::AMFSetCustomTracer(AMFFactory_.GetTrace()); - amf::AMFTraceEnableWriter(AMF_TRACE_WRITER_CONSOLE, true); - amf::AMFTraceSetWriterLevel(AMF_TRACE_WRITER_CONSOLE, AMF_TRACE_WARNING); - - // AMFContext_ - res = AMFFactory_.GetFactory()->CreateContext(&AMFContext_); - AMF_CHECK_RETURN(res, "CreateContext failed"); - - switch (AMFMemoryType_) { - case amf::AMF_MEMORY_DX11: - res = AMFContext_->InitDX11(handle_); // can be DX11 device - AMF_CHECK_RETURN(res, "InitDX11 failed"); - break; - default: - LOG_ERROR(std::string("unsupported amf memory type")); - return AMF_FAIL; - } - - // component: encoder - res = AMFFactory_.GetFactory()->CreateComponent(AMFContext_, codec_.c_str(), - &AMFEncoder_); - AMF_CHECK_RETURN(res, "CreateComponent failed"); - - res = SetParams(codec_); - AMF_CHECK_RETURN(res, "Could not set params in encoder."); - - res = AMFEncoder_->Init(AMFSurfaceFormat_, resolution_.first, - resolution_.second); - AMF_CHECK_RETURN(res, "encoder->Init() failed"); - - return AMF_OK; - } - -private: - AMF_RESULT SetParams(const amf_wstring &codecStr) { - AMF_RESULT res; - if (codecStr == amf_wstring(AMFVideoEncoderVCE_AVC)) { - // ------------- Encoder params usage--------------- - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_USAGE, - AMF_VIDEO_ENCODER_USAGE_LOW_LATENCY_HIGH_QUALITY); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_ENCODER_USAGE failed"); - - // ------------- Encoder params static--------------- - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_FRAMESIZE, - ::AMFConstructSize(resolution_.first, resolution_.second)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_FRAMESIZE failed, (" + - std::to_string(resolution_.first) + "," + - std::to_string(resolution_.second) + ")"); - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_LOWLATENCY_MODE, true); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_LOWLATENCY_MODE failed"); - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_QUALITY_PRESET, - AMF_VIDEO_ENCODER_QUALITY_PRESET_QUALITY); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_QUALITY_PRESET failed"); - res = - AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_COLOR_BIT_DEPTH, eDepth_); - AMF_CHECK_RETURN(res, - "SetProperty(AMF_VIDEO_ENCODER_COLOR_BIT_DEPTH failed"); - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CBR); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD"); - if (enable4K_) { - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_PROFILE, - AMF_VIDEO_ENCODER_PROFILE_HIGH); - AMF_CHECK_RETURN(res, "SetProperty(AMF_VIDEO_ENCODER_PROFILE failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_PROFILE_LEVEL, - AMF_H264_LEVEL__5_1); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_PROFILE_LEVEL failed"); - } - // color - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_FULL_RANGE_COLOR, - full_range_); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_ENCODER_FULL_RANGE_COLOR"); - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_OUTPUT_COLOR_PROFILE, - bt709_ ? (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_709) - : (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_601)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_OUTPUT_COLOR_PROFILE"); - // https://github.com/obsproject/obs-studio/blob/e27b013d4754e0e81119ab237ffedce8fcebcbbf/plugins/obs-ffmpeg/texture-amf.cpp#L924 - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_OUTPUT_TRANSFER_CHARACTERISTIC, - bt709_ ? AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709 - : AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_OUTPUT_TRANSFER_CHARACTERISTIC"); - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_OUTPUT_COLOR_PRIMARIES, - bt709_ ? AMF_COLOR_PRIMARIES_BT709 : AMF_COLOR_PRIMARIES_SMPTE170M); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_OUTPUT_COLOR_PRIMARIES"); - - // ------------- Encoder params dynamic --------------- - AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_B_PIC_PATTERN, 0); - // do not check error for AMF_VIDEO_ENCODER_B_PIC_PATTERN - // - can be not supported - check Capability Manager - // sample - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_QUERY_TIMEOUT, - query_timeout_); // ms - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_QUERY_TIMEOUT failed"); - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_TARGET_BITRATE, - bitRateIn_); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_TARGET_BITRATE failed"); - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_FRAMERATE, - ::AMFConstructRate(frameRate_, 1)); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_ENCODER_FRAMERATE failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_IDR_PERIOD, gop_); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_ENCODER_IDR_PERIOD failed"); - - } else if (codecStr == amf_wstring(AMFVideoEncoder_HEVC)) { - // ------------- Encoder params usage--------------- - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_USAGE, - AMF_VIDEO_ENCODER_HEVC_USAGE_LOW_LATENCY_HIGH_QUALITY); - AMF_CHECK_RETURN(res, "SetProperty AMF_VIDEO_ENCODER_HEVC_USAGE failed"); - - // ------------- Encoder params static--------------- - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_FRAMESIZE, - ::AMFConstructSize(resolution_.first, resolution_.second)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_HEVC_FRAMESIZE failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_LOWLATENCY_MODE, - true); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_LOWLATENCY_MODE failed"); - - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET, - AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_QUALITY); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH, - eDepth_); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH failed"); - - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CBR); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD failed"); - - if (enable4K_) { - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_TIER, - AMF_VIDEO_ENCODER_HEVC_TIER_HIGH); - AMF_CHECK_RETURN(res, "SetProperty(AMF_VIDEO_ENCODER_HEVC_TIER failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_PROFILE_LEVEL, - AMF_LEVEL_5_1); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_PROFILE_LEVEL failed"); - } - // color - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE, - full_range_ ? AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_FULL - : AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_STUDIO); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE failed"); - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE, - bt709_ ? (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_709) - : (full_range_ ? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601 - : AMF_VIDEO_CONVERTER_COLOR_PROFILE_601)); - AMF_CHECK_RETURN( - res, - "SetProperty AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE failed"); - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, - bt709_ ? AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709 - : AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M); - AMF_CHECK_RETURN( - res, "SetProperty " - "AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC failed"); - res = AMFEncoder_->SetProperty( - AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, - bt709_ ? AMF_COLOR_PRIMARIES_BT709 : AMF_COLOR_PRIMARIES_SMPTE170M); - AMF_CHECK_RETURN( - res, - "SetProperty AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES failed"); - - // ------------- Encoder params dynamic --------------- - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT, - query_timeout_); // ms - AMF_CHECK_RETURN( - res, "SetProperty(AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE, - bitRateIn_); - AMF_CHECK_RETURN( - res, "SetProperty AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_FRAMERATE, - ::AMFConstructRate(frameRate_, 1)); - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_HEVC_FRAMERATE failed"); - - res = AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_GOP_SIZE, - gop_); // todo - AMF_CHECK_RETURN(res, - "SetProperty AMF_VIDEO_ENCODER_HEVC_GOP_SIZE failed"); - } else { - return AMF_FAIL; - } - return AMF_OK; - } - - void PacketKeyframe(amf::AMFDataPtr &pData, struct encoder_packet *packet) { - if (AMFVideoEncoderVCE_AVC == codec_) { - uint64_t pktType; - pData->GetProperty(AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE, &pktType); - packet->keyframe = AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_IDR == pktType || - AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_I == pktType; - } else if (AMFVideoEncoder_HEVC == codec_) { - uint64_t pktType; - pData->GetProperty(AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE, &pktType); - packet->keyframe = - AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_IDR == pktType || - AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_I == pktType; - } - } -}; - -bool convert_codec(DataFormat lhs, amf_wstring &rhs) { - switch (lhs) { - case H264: - rhs = AMFVideoEncoderVCE_AVC; - break; - case H265: - rhs = AMFVideoEncoder_HEVC; - break; - default: - LOG_ERROR(std::string("unsupported codec: ") + std::to_string((int)lhs)); - return false; - } - return true; -} - -} // namespace -#include "amf_common.cpp" - -extern "C" { - -int amf_destroy_encoder(void *encoder) { - try { - AMFEncoder *enc = (AMFEncoder *)encoder; - enc->destroy(); - delete enc; - enc = NULL; - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("destroy failed: ") + e.what()); - } - return -1; -} - -void *amf_new_encoder(void *handle, int64_t luid, - DataFormat dataFormat, int32_t width, int32_t height, - int32_t kbs, int32_t framerate, int32_t gop) { - AMFEncoder *enc = NULL; - try { - amf_wstring codecStr; - if (!convert_codec(dataFormat, codecStr)) { - return NULL; - } - amf::AMF_MEMORY_TYPE memoryType; - if (!convert_api(memoryType)) { - return NULL; - } - enc = new AMFEncoder(handle, memoryType, codecStr, dataFormat, width, - height, kbs * 1000, framerate, gop); - if (enc) { - if (AMF_OK == enc->initialize()) { - return enc; - } - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("new failed: ") + e.what()); - } - if (enc) { - enc->destroy(); - delete enc; - enc = NULL; - } - return NULL; -} - -int amf_encode(void *encoder, void *tex, EncodeCallback callback, void *obj, - int64_t ms) { - try { - AMFEncoder *enc = (AMFEncoder *)encoder; - return -enc->encode(tex, callback, obj, ms); - } catch (const std::exception &e) { - LOG_ERROR(std::string("encode failed: ") + e.what()); - } - return -1; -} - -int amf_driver_support() { - try { - AMFFactoryHelper factory; - AMF_RESULT res = factory.Init(); - if (res == AMF_OK) { - factory.Terminate(); - return 0; - } - } catch (const std::exception &e) { - } - return -1; -} - -int amf_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - DataFormat dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, - int32_t gop, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_AMD)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - AMFEncoder *e = (AMFEncoder *)amf_new_encoder( - (void *)adapter.get()->device_.Get(), currentLuid, - dataFormat, width, height, kbs, framerate, gop); - if (!e) - continue; - if (e->test() == AMF_OK) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_AMD; - count += 1; - } - e->destroy(); - delete e; - e = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - - } catch (const std::exception &e) { - LOG_ERROR(std::string("test ") + std::to_string(kbs) + " failed: " + e.what()); - } - return -1; -} - -int amf_set_bitrate(void *encoder, int32_t kbs) { - try { - AMFEncoder *enc = (AMFEncoder *)encoder; - AMF_RESULT res = AMF_FAIL; - switch (enc->dataFormat_) { - case H264: - res = enc->AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_TARGET_BITRATE, - kbs * 1000); - break; - case H265: - res = enc->AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE, - kbs * 1000); - break; - } - return res == AMF_OK ? 0 : -1; - } catch (const std::exception &e) { - LOG_ERROR(std::string("set bitrate to ") + std::to_string(kbs) + - "k failed: " + e.what()); - } - return -1; -} - -int amf_set_framerate(void *encoder, int32_t framerate) { - try { - AMFEncoder *enc = (AMFEncoder *)encoder; - AMF_RESULT res = AMF_FAIL; - AMFRate rate = ::AMFConstructRate(framerate, 1); - switch (enc->dataFormat_) { - case H264: - res = enc->AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_FRAMERATE, rate); - break; - case H265: - res = - enc->AMFEncoder_->SetProperty(AMF_VIDEO_ENCODER_HEVC_FRAMERATE, rate); - break; - } - return res == AMF_OK ? 0 : -1; - } catch (const std::exception &e) { - LOG_ERROR(std::string("set framerate to ") + std::to_string(framerate) + - " failed: " + e.what()); - } - return -1; -} - -} // extern "C" \ No newline at end of file diff --git a/libs/hwcodec/cpp/amf/amf_ffi.h b/libs/hwcodec/cpp/amf/amf_ffi.h deleted file mode 100644 index 55390ee8..00000000 --- a/libs/hwcodec/cpp/amf/amf_ffi.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef AMF_FFI_H -#define AMF_FFI_H - -#include "../common/callback.h" -#include - -int amf_driver_support(); - -void *amf_new_encoder(void *handle, int64_t luid, - int32_t data_format, int32_t width, int32_t height, - int32_t bitrate, int32_t framerate, int32_t gop); - -int amf_encode(void *encoder, void *texture, EncodeCallback callback, void *obj, - int64_t ms); - -int amf_destroy_encoder(void *encoder); - -void *amf_new_decoder(void *device, int64_t luid, - int32_t dataFormat); - -int amf_decode(void *decoder, uint8_t *data, int32_t length, - DecodeCallback callback, void *obj); - -int amf_destroy_decoder(void *decoder); - -int amf_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, - int32_t gop, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int amf_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, uint8_t *data, - int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int amf_set_bitrate(void *encoder, int32_t kbs); - -int amf_set_framerate(void *encoder, int32_t framerate); - -#endif // AMF_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/cpp/common/platform/linux/linux.cpp b/libs/hwcodec/cpp/common/platform/linux/linux.cpp index b0d58a19..2d60c9ce 100644 --- a/libs/hwcodec/cpp/common/platform/linux/linux.cpp +++ b/libs/hwcodec/cpp/common/platform/linux/linux.cpp @@ -2,83 +2,50 @@ #include "../../log.h" #include #include -#include -#include #include -#include // Include the necessary header file #include #include #include #include -namespace -{ - void load_driver(CudaFunctions **pp_cuda_dl, NvencFunctions **pp_nvenc_dl, - CuvidFunctions **pp_cvdl) - { - if (cuda_load_functions(pp_cuda_dl, NULL) < 0) - { - LOG_TRACE(std::string("cuda_load_functions failed")); - throw "cuda_load_functions failed"; - } - if (nvenc_load_functions(pp_nvenc_dl, NULL) < 0) - { - LOG_TRACE(std::string("nvenc_load_functions failed")); - throw "nvenc_load_functions failed"; - } - if (cuvid_load_functions(pp_cvdl, NULL) < 0) - { - LOG_TRACE(std::string("cuvid_load_functions failed")); - throw "cuvid_load_functions failed"; - } - } - - void free_driver(CudaFunctions **pp_cuda_dl, NvencFunctions **pp_nvenc_dl, - CuvidFunctions **pp_cvdl) - { - if (*pp_cvdl) - { - cuvid_free_functions(pp_cvdl); - *pp_cvdl = NULL; - } - if (*pp_nvenc_dl) - { - nvenc_free_functions(pp_nvenc_dl); - *pp_nvenc_dl = NULL; - } - if (*pp_cuda_dl) - { - cuda_free_functions(pp_cuda_dl); - *pp_cuda_dl = NULL; - } - } -} // namespace - +// Check for NVIDIA driver support by loading CUDA libraries int linux_support_nv() { - try + // Try to load NVIDIA CUDA runtime library + void *handle = dlopen("libcuda.so.1", RTLD_LAZY); + if (!handle) { - CudaFunctions *cuda_dl = NULL; - NvencFunctions *nvenc_dl = NULL; - CuvidFunctions *cvdl = NULL; - load_driver(&cuda_dl, &nvenc_dl, &cvdl); - free_driver(&cuda_dl, &nvenc_dl, &cvdl); - return 0; + handle = dlopen("libcuda.so", RTLD_LAZY); } - catch (...) + if (!handle) { - LOG_TRACE(std::string("nvidia driver not support")); + LOG_TRACE(std::string("NVIDIA: libcuda.so not found")); + return -1; } - return -1; + dlclose(handle); + + // Also check for nvenc library + handle = dlopen("libnvidia-encode.so.1", RTLD_LAZY); + if (!handle) + { + handle = dlopen("libnvidia-encode.so", RTLD_LAZY); + } + if (!handle) + { + LOG_TRACE(std::string("NVIDIA: libnvidia-encode.so not found")); + return -1; + } + dlclose(handle); + + LOG_TRACE(std::string("NVIDIA: driver support detected")); + return 0; } int linux_support_amd() { #if defined(__x86_64__) || defined(__aarch64__) -#define AMF_DLL_NAME L"libamfrt64.so.1" #define AMF_DLL_NAMEA "libamfrt64.so.1" #else -#define AMF_DLL_NAME L"libamfrt32.so.1" #define AMF_DLL_NAMEA "libamfrt32.so.1" #endif void *handle = dlopen(AMF_DLL_NAMEA, RTLD_LAZY); @@ -160,4 +127,4 @@ int linux_support_v4l2m2m() { LOG_TRACE(std::string("V4L2 M2M: No M2M device found")); return -1; -} \ No newline at end of file +} diff --git a/libs/hwcodec/cpp/common/platform/mac/mac.mm b/libs/hwcodec/cpp/common/platform/mac/mac.mm deleted file mode 100644 index d77d7302..00000000 --- a/libs/hwcodec/cpp/common/platform/mac/mac.mm +++ /dev/null @@ -1,167 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../../log.h" - -#if defined(__APPLE__) -#include -#endif - -// ---------------------- Core: More Robust Hardware Encoder Detection ---------------------- -static int32_t hasHardwareEncoder(bool h265) { - CMVideoCodecType codecType = h265 ? kCMVideoCodecType_HEVC : kCMVideoCodecType_H264; - - // ---------- Path A: Quick Query with Enable + Require ---------- - // Note: Require implies Enable, but setting both here makes it easier to bypass the strategy on some models that default to a software encoder. - CFMutableDictionaryRef spec = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - CFDictionarySetValue(spec, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kCFBooleanTrue); - CFDictionarySetValue(spec, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kCFBooleanTrue); - - CFDictionaryRef properties = NULL; - CFStringRef outID = NULL; - - // Use 1280x720 for capability detection to reduce the probability of "no hardware encoding" due to resolution/level issues. - OSStatus result = VTCopySupportedPropertyDictionaryForEncoder(1280, 720, codecType, spec, &outID, &properties); - - if (properties) CFRelease(properties); - if (outID) CFRelease(outID); - if (spec) CFRelease(spec); - - if (result == noErr) { - // Explicitly found an encoder that meets the "hardware-only" specification. - return 1; - } - // Reaching here means either no encoder satisfying Require was found (common), or another error occurred. - // For all failure cases, continue with the safer "session-level confirmation" path to avoid misjudgment. - - // ---------- Path B: Create Session and Read UsingHardwareAcceleratedVideoEncoder ---------- - CFMutableDictionaryRef enableOnly = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - CFDictionarySetValue(enableOnly, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kCFBooleanTrue); - - VTCompressionSessionRef session = NULL; - // Also use 1280x720 to reduce profile/level interference - OSStatus st = VTCompressionSessionCreate(kCFAllocatorDefault, - 1280, 720, codecType, - enableOnly, /* encoderSpecification */ - NULL, /* sourceImageBufferAttributes */ - NULL, /* compressedDataAllocator */ - NULL, /* outputCallback */ - NULL, /* outputRefCon */ - &session); - if (enableOnly) CFRelease(enableOnly); - - if (st != noErr || !session) { - // Creation failed, considered no hardware available. - return 0; - } - - // First, explicitly prepare the encoding process to give VideoToolbox a chance to choose between software/hardware. - OSStatus prepareStatus = VTCompressionSessionPrepareToEncodeFrames(session); - if (prepareStatus != noErr) { - VTCompressionSessionInvalidate(session); - CFRelease(session); - return 0; - } - - // Query the session's read-only property: whether it is using a hardware encoder. - CFBooleanRef usingHW = NULL; - st = VTSessionCopyProperty(session, - kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder, - kCFAllocatorDefault, - (void **)&usingHW); - - Boolean isHW = (st == noErr && usingHW && CFBooleanGetValue(usingHW)); - - if (usingHW) CFRelease(usingHW); - VTCompressionSessionInvalidate(session); - CFRelease(session); - - return isHW ? 1 : 0; -} - -// -------------- Your Public Interface: Unchanged ------------------ -extern "C" void checkVideoToolboxSupport(int32_t *h264Encoder, int32_t *h265Encoder, int32_t *h264Decoder, int32_t *h265Decoder) { - // https://stackoverflow.com/questions/50956097/determine-if-ios-device-can-support-hevc-encoding - *h264Encoder = 0; // H.264 encoder support is disabled due to frequent reliability issues (see encode.rs) - *h265Encoder = hasHardwareEncoder(true); - - *h264Decoder = VTIsHardwareDecodeSupported(kCMVideoCodecType_H264); - *h265Decoder = VTIsHardwareDecodeSupported(kCMVideoCodecType_HEVC); - - return; -} - -extern "C" uint64_t GetHwcodecGpuSignature() { - int32_t h264Encoder = 0; - int32_t h265Encoder = 0; - int32_t h264Decoder = 0; - int32_t h265Decoder = 0; - checkVideoToolboxSupport(&h264Encoder, &h265Encoder, &h264Decoder, &h265Decoder); - return (uint64_t)h264Encoder << 24 | (uint64_t)h265Encoder << 16 | (uint64_t)h264Decoder << 8 | (uint64_t)h265Decoder; -} - -static void *parent_death_monitor_thread(void *arg) { - int kq = (intptr_t)arg; - struct kevent events[1]; - - int ret = kevent(kq, NULL, 0, events, 1, NULL); - - if (ret > 0) { - // Parent process died, terminate this process - LOG_INFO("Parent process died, terminating hwcodec check process"); - exit(1); - } - - return NULL; -} - -extern "C" int setup_parent_death_signal() { - // On macOS, use kqueue to monitor parent process death - pid_t parent_pid = getppid(); - int kq = kqueue(); - - if (kq == -1) { - LOG_DEBUG("Failed to create kqueue for parent monitoring"); - return -1; - } - - struct kevent event; - EV_SET(&event, parent_pid, EVFILT_PROC, EV_ADD | EV_ONESHOT, NOTE_EXIT, 0, - NULL); - - int ret = kevent(kq, &event, 1, NULL, 0, NULL); - - if (ret == -1) { - LOG_ERROR("Failed to register parent death monitoring on macOS\n"); - close(kq); - return -1; - } else { - - // Spawn a thread to monitor parent death - pthread_t monitor_thread; - ret = pthread_create(&monitor_thread, NULL, parent_death_monitor_thread, - (void *)(intptr_t)kq); - - if (ret != 0) { - LOG_ERROR("Failed to create parent death monitor thread"); - close(kq); - return -1; - } - - // Detach the thread so it can run independently - pthread_detach(monitor_thread); - return 0; - } -} diff --git a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_decode.cpp b/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_decode.cpp deleted file mode 100644 index f8a0f926..00000000 --- a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_decode.cpp +++ /dev/null @@ -1,410 +0,0 @@ -// https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/hw_decode.c -// https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/decode_video.c - -extern "C" { -#include -#include -#include -#include -#include -} -#include -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" - -#define LOG_MODULE "FFMPEG_VRAM_DEC" -#include -#include - -namespace { - -#define USE_SHADER - -void lockContext(void *lock_ctx); -void unlockContext(void *lock_ctx); - -class FFmpegVRamDecoder { -public: - AVCodecContext *c_ = NULL; - AVBufferRef *hw_device_ctx_ = NULL; - AVCodecParserContext *sw_parser_ctx_ = NULL; - AVFrame *frame_ = NULL; - AVPacket *pkt_ = NULL; - std::unique_ptr native_ = nullptr; - ID3D11Device *d3d11Device_ = NULL; - ID3D11DeviceContext *d3d11DeviceContext_ = NULL; - - void *device_ = nullptr; - int64_t luid_ = 0; - DataFormat dataFormat_; - std::string name_; - AVHWDeviceType device_type_ = AV_HWDEVICE_TYPE_D3D11VA; - - bool bt709_ = false; - bool full_range_ = false; - - FFmpegVRamDecoder(void *device, int64_t luid, DataFormat dataFormat) { - device_ = device; - luid_ = luid; - dataFormat_ = dataFormat; - switch (dataFormat) { - case H264: - name_ = "h264"; - break; - case H265: - name_ = "hevc"; - break; - default: - LOG_ERROR(std::string("unsupported data format")); - break; - } - // Always use DX11 since it's the only API - device_type_ = AV_HWDEVICE_TYPE_D3D11VA; - } - - ~FFmpegVRamDecoder() {} - - void destroy() { - if (frame_) - av_frame_free(&frame_); - if (pkt_) - av_packet_free(&pkt_); - if (c_) - avcodec_free_context(&c_); - if (hw_device_ctx_) { - av_buffer_unref(&hw_device_ctx_); - // AVHWDeviceContext takes ownership of d3d11 object - d3d11Device_ = nullptr; - d3d11DeviceContext_ = nullptr; - } else { - SAFE_RELEASE(d3d11Device_); - SAFE_RELEASE(d3d11DeviceContext_); - } - - frame_ = NULL; - pkt_ = NULL; - c_ = NULL; - hw_device_ctx_ = NULL; - } - int reset() { - destroy(); - if (!native_) { - native_ = std::make_unique(); - if (!native_->Init(luid_, (ID3D11Device *)device_, 4)) { - LOG_ERROR(std::string("Failed to init native device")); - return -1; - } - } - if (!native_->support_decode(dataFormat_)) { - LOG_ERROR(std::string("unsupported data format")); - return -1; - } - d3d11Device_ = native_->device_.Get(); - d3d11Device_->AddRef(); - d3d11DeviceContext_ = native_->context_.Get(); - d3d11DeviceContext_->AddRef(); - const AVCodec *codec = NULL; - int ret; - if (!(codec = avcodec_find_decoder_by_name(name_.c_str()))) { - LOG_ERROR(std::string("avcodec_find_decoder_by_name ") + name_ + " failed"); - return -1; - } - if (!(c_ = avcodec_alloc_context3(codec))) { - LOG_ERROR(std::string("Could not allocate video codec context")); - return -1; - } - - c_->flags |= AV_CODEC_FLAG_LOW_DELAY; - hw_device_ctx_ = av_hwdevice_ctx_alloc(device_type_); - if (!hw_device_ctx_) { - LOG_ERROR(std::string("av_hwdevice_ctx_create failed")); - return -1; - } - AVHWDeviceContext *deviceContext = - (AVHWDeviceContext *)hw_device_ctx_->data; - AVD3D11VADeviceContext *d3d11vaDeviceContext = - (AVD3D11VADeviceContext *)deviceContext->hwctx; - d3d11vaDeviceContext->device = d3d11Device_; - d3d11vaDeviceContext->device_context = d3d11DeviceContext_; - d3d11vaDeviceContext->lock = lockContext; - d3d11vaDeviceContext->unlock = unlockContext; - d3d11vaDeviceContext->lock_ctx = this; - ret = av_hwdevice_ctx_init(hw_device_ctx_); - if (ret < 0) { - LOG_ERROR(std::string("av_hwdevice_ctx_init failed, ret = ") + av_err2str(ret)); - return -1; - } - c_->hw_device_ctx = av_buffer_ref(hw_device_ctx_); - - if (!(pkt_ = av_packet_alloc())) { - LOG_ERROR(std::string("av_packet_alloc failed")); - return -1; - } - - if (!(frame_ = av_frame_alloc())) { - LOG_ERROR(std::string("av_frame_alloc failed")); - return -1; - } - - if ((ret = avcodec_open2(c_, codec, NULL)) != 0) { - LOG_ERROR(std::string("avcodec_open2 failed, ret = ") + av_err2str(ret) + - ", name=" + name_); - return -1; - } - - return 0; - } - - int decode(const uint8_t *data, int length, DecodeCallback callback, - const void *obj) { - int ret = -1; - - if (!data || !length) { - LOG_ERROR(std::string("illegal decode parameter")); - return -1; - } - pkt_->data = (uint8_t *)data; - pkt_->size = length; - ret = do_decode(callback, obj); - return ret; - } - -private: - int do_decode(DecodeCallback callback, const void *obj) { - int ret; - bool decoded = false; - bool locked = false; - - ret = avcodec_send_packet(c_, pkt_); - if (ret < 0) { - LOG_ERROR(std::string("avcodec_send_packet failed, ret = ") + av_err2str(ret)); - return ret; - } - - auto start = util::now(); - while (ret >= 0 && util::elapsed_ms(start) < DECODE_TIMEOUT_MS) { - if ((ret = avcodec_receive_frame(c_, frame_)) != 0) { - if (ret != AVERROR(EAGAIN)) { - LOG_ERROR(std::string("avcodec_receive_frame failed, ret = ") + av_err2str(ret)); - } - goto _exit; - } - if (frame_->format != AV_PIX_FMT_D3D11) { - LOG_ERROR(std::string("only AV_PIX_FMT_D3D11 is supported")); - goto _exit; - } - lockContext(this); - locked = true; - if (!convert(frame_, callback, obj)) { - LOG_ERROR(std::string("Failed to convert")); - goto _exit; - } - if (callback) - callback(native_->GetCurrentTexture(), obj); - decoded = true; - } - _exit: - if (locked) { - unlockContext(this); - } - av_packet_unref(pkt_); - return decoded ? 0 : -1; - } - - bool convert(AVFrame *frame, DecodeCallback callback, const void *obj) { - - ID3D11Texture2D *texture = (ID3D11Texture2D *)frame->data[0]; - if (!texture) { - LOG_ERROR(std::string("texture is NULL")); - return false; - } - D3D11_TEXTURE2D_DESC desc2D; - texture->GetDesc(&desc2D); - if (desc2D.Format != DXGI_FORMAT_NV12) { - LOG_ERROR(std::string("only DXGI_FORMAT_NV12 is supported")); - return false; - } - if (!native_->EnsureTexture(frame->width, frame->height)) { - LOG_ERROR(std::string("Failed to EnsureTexture")); - return false; - } - native_->next(); // comment out to remove picture shaking -#ifdef USE_SHADER - native_->BeginQuery(); - if (!native_->Nv12ToBgra(frame->width, frame->height, texture, - native_->GetCurrentTexture(), - (int)frame->data[1])) { - LOG_ERROR(std::string("Failed to Nv12ToBgra")); - native_->EndQuery(); - return false; - } - native_->EndQuery(); - native_->Query(); - -#else - native_->BeginQuery(); - - // nv12 -> bgra - D3D11_VIDEO_PROCESSOR_CONTENT_DESC contentDesc; - ZeroMemory(&contentDesc, sizeof(contentDesc)); - contentDesc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; - contentDesc.InputFrameRate.Numerator = 60; - contentDesc.InputFrameRate.Denominator = 1; - // TODO: aligned width, height or crop width, height - contentDesc.InputWidth = frame->width; - contentDesc.InputHeight = frame->height; - contentDesc.OutputWidth = frame->width; - contentDesc.OutputHeight = frame->height; - contentDesc.OutputFrameRate.Numerator = 60; - contentDesc.OutputFrameRate.Denominator = 1; - DXGI_COLOR_SPACE_TYPE colorSpace_out = - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; - DXGI_COLOR_SPACE_TYPE colorSpace_in; - if (bt709_) { - if (full_range_) { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709; - } else { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; - } - } else { - if (full_range_) { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601; - } else { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; - } - } - if (!native_->Process(texture, native_->GetCurrentTexture(), contentDesc, - colorSpace_in, colorSpace_out, (int)frame->data[1])) { - LOG_ERROR(std::string("Failed to process")); - native_->EndQuery(); - return false; - } - native_->context_->Flush(); - native_->EndQuery(); - if (!native_->Query()) { - LOG_ERROR(std::string("Failed to query")); - return false; - } -#endif - return true; - } -}; - -void lockContext(void *lock_ctx) { (void)lock_ctx; } - -void unlockContext(void *lock_ctx) { (void)lock_ctx; } - -} // namespace - -extern "C" int ffmpeg_vram_destroy_decoder(FFmpegVRamDecoder *decoder) { - try { - if (!decoder) - return 0; - decoder->destroy(); - delete decoder; - decoder = NULL; - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("ffmpeg_ram_free_decoder exception:") + e.what()); - } - return -1; -} - -extern "C" FFmpegVRamDecoder *ffmpeg_vram_new_decoder(void *device, - int64_t luid, - DataFormat dataFormat) { - FFmpegVRamDecoder *decoder = NULL; - try { - decoder = new FFmpegVRamDecoder(device, luid, dataFormat); - if (decoder) { - if (decoder->reset() == 0) { - return decoder; - } - } - } catch (std::exception &e) { - LOG_ERROR(std::string("new decoder exception:") + e.what()); - } - if (decoder) { - decoder->destroy(); - delete decoder; - decoder = NULL; - } - return NULL; -} - -extern "C" int ffmpeg_vram_decode(FFmpegVRamDecoder *decoder, - const uint8_t *data, int length, - DecodeCallback callback, const void *obj) { - try { - int ret = decoder->decode(data, length, callback, obj); - if (DataFormat::H265 == decoder->dataFormat_ && util_decode::has_flag_could_not_find_ref_with_poc()) { - return HWCODEC_ERR_HEVC_COULD_NOT_FIND_POC; - } else { - return ret == 0 ? HWCODEC_SUCCESS : HWCODEC_ERR_COMMON; - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("ffmpeg_ram_decode exception:") + e.what()); - } - return HWCODEC_ERR_COMMON; -} - -extern "C" int ffmpeg_vram_test_decode(int64_t *outLuids, int32_t *outVendors, - int32_t maxDescNum, int32_t *outDescNum, - DataFormat dataFormat, - uint8_t *data, int32_t length, - const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - int count = 0; - struct VendorMapping { - AdapterVendor adapter_vendor; - int driver_vendor; - }; - VendorMapping vendors[] = { - {ADAPTER_VENDOR_INTEL, VENDOR_INTEL}, - {ADAPTER_VENDOR_NVIDIA, VENDOR_NV}, - {ADAPTER_VENDOR_AMD, VENDOR_AMD} - }; - - for (auto vendorMap : vendors) { - Adapters adapters; - if (!adapters.Init(vendorMap.adapter_vendor)) - continue; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - FFmpegVRamDecoder *p = (FFmpegVRamDecoder *)ffmpeg_vram_new_decoder( - nullptr, LUID(adapter.get()->desc1_), dataFormat); - if (!p) - continue; - auto start = util::now(); - bool succ = ffmpeg_vram_decode(p, data, length, nullptr, nullptr) == 0; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = LUID(adapter.get()->desc1_); - outVendors[count] = (int32_t)vendorMap.driver_vendor; // Map adapter vendor to driver vendor - count += 1; - } - p->destroy(); - delete p; - p = nullptr; - if (count >= maxDescNum) - break; - } - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - } catch (const std::exception &e) { - std::cerr << e.what() << '\n'; - } - return -1; -} \ No newline at end of file diff --git a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_encode.cpp b/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_encode.cpp deleted file mode 100644 index 2b21b734..00000000 --- a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_encode.cpp +++ /dev/null @@ -1,558 +0,0 @@ -extern "C" { -#include -#include -#include -#include -#include -} - -#ifdef _WIN32 -#include -#endif - -#include -#include -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" - -#define LOG_MODULE "FFMPEG_VRAM_ENC" -#include -#include - -namespace { - -void lockContext(void *lock_ctx); -void unlockContext(void *lock_ctx); - -enum class EncoderDriver { - NVENC, - AMF, - QSV, -}; - -class Encoder { -public: - Encoder(EncoderDriver driver, const char *name, AVHWDeviceType device_type, - AVHWDeviceType derived_device_type, AVPixelFormat hw_pixfmt, - AVPixelFormat sw_pixfmt) { - driver_ = driver; - name_ = name; - device_type_ = device_type; - derived_device_type_ = derived_device_type; - hw_pixfmt_ = hw_pixfmt; - sw_pixfmt_ = sw_pixfmt; - }; - EncoderDriver driver_; - std::string name_; - AVHWDeviceType device_type_; - AVHWDeviceType derived_device_type_; - AVPixelFormat hw_pixfmt_; - AVPixelFormat sw_pixfmt_; -}; - -class FFmpegVRamEncoder { -public: - AVCodecContext *c_ = NULL; - AVBufferRef *hw_device_ctx_ = NULL; - AVFrame *frame_ = NULL; - AVFrame *mapped_frame_ = NULL; - ID3D11Texture2D *encode_texture_ = NULL; // no free - AVPacket *pkt_ = NULL; - std::unique_ptr native_ = nullptr; - ID3D11Device *d3d11Device_ = NULL; - ID3D11DeviceContext *d3d11DeviceContext_ = NULL; - std::unique_ptr encoder_ = nullptr; - - void *handle_ = nullptr; - int64_t luid_; - DataFormat dataFormat_; - int32_t width_ = 0; - int32_t height_ = 0; - int32_t kbs_; - int32_t framerate_; - int32_t gop_; - - const int align_ = 0; - const bool full_range_ = false; - const bool bt709_ = false; - FFmpegVRamEncoder(void *handle, int64_t luid, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, - int32_t framerate, int32_t gop) { - handle_ = handle; - luid_ = luid; - dataFormat_ = dataFormat; - width_ = width; - height_ = height; - kbs_ = kbs; - framerate_ = framerate; - gop_ = gop; - } - - ~FFmpegVRamEncoder() {} - - bool init() { - const AVCodec *codec = NULL; - int ret; - - native_ = std::make_unique(); - if (!native_->Init(luid_, (ID3D11Device *)handle_)) { - LOG_ERROR(std::string("NativeDevice init failed")); - return false; - } - d3d11Device_ = native_->device_.Get(); - d3d11Device_->AddRef(); - d3d11DeviceContext_ = native_->context_.Get(); - d3d11DeviceContext_->AddRef(); - - AdapterVendor vendor = native_->GetVendor(); - if (!choose_encoder(vendor)) { - return false; - } - LOG_INFO(std::string("encoder name: ") + encoder_->name_); - if (!(codec = avcodec_find_encoder_by_name(encoder_->name_.c_str()))) { - LOG_ERROR(std::string("Codec ") + encoder_->name_ + " not found"); - return false; - } - - if (!(c_ = avcodec_alloc_context3(codec))) { - LOG_ERROR(std::string("Could not allocate video codec context")); - return false; - } - - /* resolution must be a multiple of two */ - c_->width = width_; - c_->height = height_; - c_->pix_fmt = encoder_->hw_pixfmt_; - c_->sw_pix_fmt = encoder_->sw_pixfmt_; - util_encode::set_av_codec_ctx(c_, encoder_->name_, kbs_, gop_, framerate_); - if (!util_encode::set_lantency_free(c_->priv_data, encoder_->name_)) { - return false; - } - // util_encode::set_quality(c_->priv_data, encoder_->name_, Quality_Default); - util_encode::set_rate_control(c_, encoder_->name_, RC_CBR, -1); - util_encode::set_others(c_->priv_data, encoder_->name_); - - hw_device_ctx_ = av_hwdevice_ctx_alloc(encoder_->device_type_); - if (!hw_device_ctx_) { - LOG_ERROR(std::string("av_hwdevice_ctx_create failed")); - return false; - } - - AVHWDeviceContext *deviceContext = - (AVHWDeviceContext *)hw_device_ctx_->data; - AVD3D11VADeviceContext *d3d11vaDeviceContext = - (AVD3D11VADeviceContext *)deviceContext->hwctx; - d3d11vaDeviceContext->device = d3d11Device_; - d3d11vaDeviceContext->device_context = d3d11DeviceContext_; - d3d11vaDeviceContext->lock = lockContext; - d3d11vaDeviceContext->unlock = unlockContext; - d3d11vaDeviceContext->lock_ctx = this; - ret = av_hwdevice_ctx_init(hw_device_ctx_); - if (ret < 0) { - LOG_ERROR(std::string("av_hwdevice_ctx_init failed, ret = ") + av_err2str(ret)); - return false; - } - if (encoder_->derived_device_type_ != AV_HWDEVICE_TYPE_NONE) { - AVBufferRef *derived_context = nullptr; - ret = av_hwdevice_ctx_create_derived( - &derived_context, encoder_->derived_device_type_, hw_device_ctx_, 0); - if (ret) { - LOG_ERROR(std::string("av_hwdevice_ctx_create_derived failed, err = ") + - av_err2str(ret)); - return false; - } - av_buffer_unref(&hw_device_ctx_); - hw_device_ctx_ = derived_context; - } - c_->hw_device_ctx = av_buffer_ref(hw_device_ctx_); - if (!set_hwframe_ctx()) { - return false; - } - - if (!(pkt_ = av_packet_alloc())) { - LOG_ERROR(std::string("Could not allocate video packet")); - return false; - } - - if ((ret = avcodec_open2(c_, codec, NULL)) < 0) { - LOG_ERROR(std::string("avcodec_open2 failed, ret = ") + av_err2str(ret) + - ", name: " + encoder_->name_); - return false; - } - - if (!(frame_ = av_frame_alloc())) { - LOG_ERROR(std::string("Could not allocate video frame")); - return false; - } - frame_->format = c_->pix_fmt; - frame_->width = c_->width; - frame_->height = c_->height; - frame_->color_range = c_->color_range; - frame_->color_primaries = c_->color_primaries; - frame_->color_trc = c_->color_trc; - frame_->colorspace = c_->colorspace; - frame_->chroma_location = c_->chroma_sample_location; - - if ((ret = av_hwframe_get_buffer(c_->hw_frames_ctx, frame_, 0)) < 0) { - LOG_ERROR(std::string("av_frame_get_buffer failed, ret = ") + av_err2str(ret)); - return false; - } - if (frame_->format == AV_PIX_FMT_QSV) { - mapped_frame_ = av_frame_alloc(); - if (!mapped_frame_) { - LOG_ERROR(std::string("Could not allocate mapped video frame")); - return false; - } - mapped_frame_->format = AV_PIX_FMT_D3D11; - ret = av_hwframe_map(mapped_frame_, frame_, - AV_HWFRAME_MAP_WRITE | AV_HWFRAME_MAP_OVERWRITE); - if (ret) { - LOG_ERROR(std::string("av_hwframe_map failed, err = ") + av_err2str(ret)); - return false; - } - encode_texture_ = (ID3D11Texture2D *)mapped_frame_->data[0]; - } else { - encode_texture_ = (ID3D11Texture2D *)frame_->data[0]; - } - - return true; - } - - int encode(void *texture, EncodeCallback callback, void *obj, int64_t ms) { - - if (!convert(texture)) - return -1; - - return do_encode(callback, obj, ms); - } - - void destroy() { - if (pkt_) - av_packet_free(&pkt_); - if (frame_) - av_frame_free(&frame_); - if (mapped_frame_) - av_frame_free(&mapped_frame_); - if (c_) - avcodec_free_context(&c_); - if (hw_device_ctx_) { - av_buffer_unref(&hw_device_ctx_); - // AVHWDeviceContext takes ownership of d3d11 object - d3d11Device_ = nullptr; - d3d11DeviceContext_ = nullptr; - } else { - SAFE_RELEASE(d3d11Device_); - SAFE_RELEASE(d3d11DeviceContext_); - } - } - - int set_bitrate(int kbs) { - return util_encode::change_bit_rate(c_, encoder_->name_, kbs) ? 0 : -1; - } - - int set_framerate(int framerate) { - c_->time_base = av_make_q(1, framerate); - c_->framerate = av_inv_q(c_->time_base); - return 0; - } - -private: - bool choose_encoder(AdapterVendor vendor) { - if (ADAPTER_VENDOR_NVIDIA == vendor) { - const char *name = nullptr; - if (dataFormat_ == H264) { - name = "h264_nvenc"; - } else if (dataFormat_ == H265) { - name = "hevc_nvenc"; - } else { - LOG_ERROR(std::string("Unsupported data format: ") + std::to_string(dataFormat_)); - return false; - } - encoder_ = std::make_unique( - EncoderDriver::NVENC, name, AV_HWDEVICE_TYPE_D3D11VA, - AV_HWDEVICE_TYPE_NONE, AV_PIX_FMT_D3D11, AV_PIX_FMT_NV12); - return true; - } else if (ADAPTER_VENDOR_AMD == vendor) { - const char *name = nullptr; - if (dataFormat_ == H264) { - name = "h264_amf"; - } else if (dataFormat_ == H265) { - name = "hevc_amf"; - } else { - LOG_ERROR(std::string("Unsupported data format: ") + std::to_string(dataFormat_)); - return false; - } - encoder_ = std::make_unique( - EncoderDriver::AMF, name, AV_HWDEVICE_TYPE_D3D11VA, - AV_HWDEVICE_TYPE_NONE, AV_PIX_FMT_D3D11, AV_PIX_FMT_NV12); - return true; - } else if (ADAPTER_VENDOR_INTEL == vendor) { - const char *name = nullptr; - if (dataFormat_ == H264) { - name = "h264_qsv"; - } else if (dataFormat_ == H265) { - name = "hevc_qsv"; - } else { - LOG_ERROR(std::string("Unsupported data format: ") + std::to_string(dataFormat_)); - return false; - } - encoder_ = std::make_unique( - EncoderDriver::QSV, name, AV_HWDEVICE_TYPE_D3D11VA, - AV_HWDEVICE_TYPE_QSV, AV_PIX_FMT_QSV, AV_PIX_FMT_NV12); - return true; - } else { - LOG_ERROR(std::string("Unsupported vendor: ") + std::to_string(vendor)); - return false; - } - return false; - } - int do_encode(EncodeCallback callback, const void *obj, int64_t ms) { - int ret; - bool encoded = false; - frame_->pts = ms; - if ((ret = avcodec_send_frame(c_, frame_)) < 0) { - LOG_ERROR(std::string("avcodec_send_frame failed, ret = ") + av_err2str(ret)); - return ret; - } - - auto start = util::now(); - while (ret >= 0 && util::elapsed_ms(start) < ENCODE_TIMEOUT_MS) { - if ((ret = avcodec_receive_packet(c_, pkt_)) < 0) { - if (ret != AVERROR(EAGAIN)) { - LOG_ERROR(std::string("avcodec_receive_packet failed, ret = ") + av_err2str(ret)); - } - goto _exit; - } - if (!pkt_->data || !pkt_->size) { - LOG_ERROR(std::string("avcodec_receive_packet failed, pkt size is 0")); - goto _exit; - } - encoded = true; - if (callback) - callback(pkt_->data, pkt_->size, pkt_->flags & AV_PKT_FLAG_KEY, obj, - pkt_->pts); - } - _exit: - av_packet_unref(pkt_); - return encoded ? 0 : -1; - } - - bool convert(void *texture) { - if (frame_->format == AV_PIX_FMT_D3D11 || - frame_->format == AV_PIX_FMT_QSV) { - ID3D11Texture2D *texture2D = (ID3D11Texture2D *)encode_texture_; - D3D11_TEXTURE2D_DESC desc; - texture2D->GetDesc(&desc); - if (desc.Format != DXGI_FORMAT_NV12) { - LOG_ERROR(std::string("convert: texture format mismatch, ") + - std::to_string(desc.Format) + - " != " + std::to_string(DXGI_FORMAT_NV12)); - return false; - } - DXGI_COLOR_SPACE_TYPE colorSpace_in = - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; - DXGI_COLOR_SPACE_TYPE colorSpace_out; - if (bt709_) { - if (full_range_) { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709; - } else { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; - } - } else { - if (full_range_) { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601; - } else { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; - } - } - if (!native_->BgraToNv12((ID3D11Texture2D *)texture, texture2D, width_, - height_, colorSpace_in, colorSpace_out)) { - LOG_ERROR(std::string("convert: BgraToNv12 failed")); - return false; - } - return true; - } else { - LOG_ERROR(std::string("convert: unsupported format, ") + - std::to_string(frame_->format)); - return false; - } - } - - bool set_hwframe_ctx() { - AVBufferRef *hw_frames_ref; - AVHWFramesContext *frames_ctx = NULL; - int err = 0; - bool ret = true; - - if (!(hw_frames_ref = av_hwframe_ctx_alloc(hw_device_ctx_))) { - LOG_ERROR(std::string("av_hwframe_ctx_alloc failed.")); - return false; - } - frames_ctx = (AVHWFramesContext *)(hw_frames_ref->data); - frames_ctx->format = encoder_->hw_pixfmt_; - frames_ctx->sw_format = encoder_->sw_pixfmt_; - frames_ctx->width = width_; - frames_ctx->height = height_; - frames_ctx->initial_pool_size = 0; - if (encoder_->device_type_ == AV_HWDEVICE_TYPE_D3D11VA) { - frames_ctx->initial_pool_size = 1; - AVD3D11VAFramesContext *frames_hwctx = - (AVD3D11VAFramesContext *)frames_ctx->hwctx; - frames_hwctx->BindFlags = D3D11_BIND_RENDER_TARGET; - frames_hwctx->MiscFlags = 0; - } - if ((err = av_hwframe_ctx_init(hw_frames_ref)) < 0) { - LOG_ERROR(std::string("av_hwframe_ctx_init failed.")); - av_buffer_unref(&hw_frames_ref); - return false; - } - c_->hw_frames_ctx = av_buffer_ref(hw_frames_ref); - if (!c_->hw_frames_ctx) { - LOG_ERROR(std::string("av_buffer_ref failed")); - ret = false; - } - av_buffer_unref(&hw_frames_ref); - - return ret; - } -}; - -void lockContext(void *lock_ctx) { (void)lock_ctx; } - -void unlockContext(void *lock_ctx) { (void)lock_ctx; } - -} // namespace - -extern "C" { -FFmpegVRamEncoder *ffmpeg_vram_new_encoder(void *handle, int64_t luid, - DataFormat dataFormat, int32_t width, - int32_t height, int32_t kbs, - int32_t framerate, int32_t gop) { - FFmpegVRamEncoder *encoder = NULL; - try { - encoder = new FFmpegVRamEncoder(handle, luid, dataFormat, width, - height, kbs, framerate, gop); - if (encoder) { - if (encoder->init()) { - return encoder; - } - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("new FFmpegVRamEncoder failed, ") + std::string(e.what())); - } - if (encoder) { - encoder->destroy(); - delete encoder; - encoder = NULL; - } - return NULL; -} - -int ffmpeg_vram_encode(FFmpegVRamEncoder *encoder, void *texture, - EncodeCallback callback, void *obj, int64_t ms) { - try { - return encoder->encode(texture, callback, obj, ms); - } catch (const std::exception &e) { - LOG_ERROR(std::string("ffmpeg_vram_encode failed, ") + std::string(e.what())); - } - return -1; -} - -void ffmpeg_vram_destroy_encoder(FFmpegVRamEncoder *encoder) { - try { - if (!encoder) - return; - encoder->destroy(); - delete encoder; - encoder = NULL; - } catch (const std::exception &e) { - LOG_ERROR(std::string("free encoder failed, ") + std::string(e.what())); - } -} - -int ffmpeg_vram_set_bitrate(FFmpegVRamEncoder *encoder, int kbs) { - try { - return encoder->set_bitrate(kbs); - } catch (const std::exception &e) { - LOG_ERROR(std::string("ffmpeg_ram_set_bitrate failed, ") + std::string(e.what())); - } - return -1; -} - -int ffmpeg_vram_set_framerate(FFmpegVRamEncoder *encoder, int32_t framerate) { - try { - return encoder->set_bitrate(framerate); - } catch (const std::exception &e) { - LOG_ERROR(std::string("ffmpeg_vram_set_framerate failed, ") + std::string(e.what())); - } - return -1; -} - -int ffmpeg_vram_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, - int32_t framerate, int32_t gop, - const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - int count = 0; - struct VendorMapping { - AdapterVendor adapter_vendor; - int driver_vendor; - }; - VendorMapping vendors[] = { - {ADAPTER_VENDOR_INTEL, VENDOR_INTEL}, - {ADAPTER_VENDOR_NVIDIA, VENDOR_NV}, - {ADAPTER_VENDOR_AMD, VENDOR_AMD} - }; - - for (auto vendorMap : vendors) { - Adapters adapters; - if (!adapters.Init(vendorMap.adapter_vendor)) - continue; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - FFmpegVRamEncoder *e = (FFmpegVRamEncoder *)ffmpeg_vram_new_encoder( - (void *)adapter.get()->device_.Get(), currentLuid, - dataFormat, width, height, kbs, framerate, gop); - if (!e) - continue; - if (e->native_->EnsureTexture(e->width_, e->height_)) { - e->native_->next(); - int32_t key_obj = 0; - auto start = util::now(); - bool succ = ffmpeg_vram_encode(e, e->native_->GetCurrentTexture(), util_encode::vram_encode_test_callback, - &key_obj, 0) == 0 && key_obj == 1; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = (int32_t)vendorMap.driver_vendor; // Map adapter vendor to driver vendor - count += 1; - } - } - e->destroy(); - delete e; - e = nullptr; - if (count >= maxDescNum) - break; - } - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("test failed: ") + e.what()); - } - return -1; -} - -} // extern "C" diff --git a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_ffi.h b/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_ffi.h deleted file mode 100644 index 7a7f5f8b..00000000 --- a/libs/hwcodec/cpp/ffmpeg_vram/ffmpeg_vram_ffi.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef FFMPEG_VRAM_FFI_H -#define FFMPEG_VRAM_FFI_H - -#include "../common/callback.h" -#include - -void *ffmpeg_vram_new_decoder(void *device, int64_t luid, - int32_t codecID); -int ffmpeg_vram_decode(void *decoder, uint8_t *data, int len, - DecodeCallback callback, void *obj); -int ffmpeg_vram_destroy_decoder(void *decoder); -int ffmpeg_vram_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, - int32_t dataFormat, uint8_t *data, int32_t length, - const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); -void *ffmpeg_vram_new_encoder(void *handle, int64_t luid, - int32_t dataFormat, int32_t width, int32_t height, - int32_t kbs, int32_t framerate, int32_t gop); - -int ffmpeg_vram_encode(void *encoder, void *tex, EncodeCallback callback, - void *obj, int64_t ms); -int ffmpeg_vram_destroy_encoder(void *encoder); - -int ffmpeg_vram_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, - int32_t dataFormat, int32_t width, int32_t height, - int32_t kbs, int32_t framerate, int32_t gop, - const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); -int ffmpeg_vram_set_bitrate(void *encoder, int32_t kbs); -int ffmpeg_vram_set_framerate(void *encoder, int32_t framerate); - -#endif // FFMPEG_VRAM_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/cpp/mfx/mfx_decode.cpp b/libs/hwcodec/cpp/mfx/mfx_decode.cpp deleted file mode 100644 index 4d77cc46..00000000 --- a/libs/hwcodec/cpp/mfx/mfx_decode.cpp +++ /dev/null @@ -1,481 +0,0 @@ -#include - -#include -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "MFXDEC" -#include "log.h" - -#define CHECK_STATUS(X, MSG) \ - { \ - mfxStatus __sts = (X); \ - if (__sts != MFX_ERR_NONE) { \ - MSDK_PRINT_RET_MSG(__sts, MSG); \ - LOG_ERROR(std::string(MSG) + "failed, sts=" + std::to_string((int)__sts)); \ - return __sts; \ - } \ - } - -#define USE_SHADER - -namespace { - -class VplDecoder { -public: - std::unique_ptr native_ = nullptr; - MFXVideoSession session_; - MFXVideoDECODE *mfxDEC_ = NULL; - std::vector pmfxSurfaces_; - mfxVideoParam mfxVideoParams_; - bool initialized_ = false; - D3D11FrameAllocator d3d11FrameAllocator_; - mfxFrameAllocResponse mfxResponse_; - - void *device_; - int64_t luid_; - DataFormat codecID_; - - bool bt709_ = false; - bool full_range_ = false; - - VplDecoder(void *device, int64_t luid, DataFormat codecID) { - device_ = device; - luid_ = luid; - codecID_ = codecID; - ZeroMemory(&mfxVideoParams_, sizeof(mfxVideoParams_)); - ZeroMemory(&mfxResponse_, sizeof(mfxResponse_)); - } - - ~VplDecoder() {} - - int destroy() { - if (mfxDEC_) { - mfxDEC_->Close(); - delete mfxDEC_; - mfxDEC_ = NULL; - } - return 0; - } - - mfxStatus init() { - mfxStatus sts = MFX_ERR_NONE; - native_ = std::make_unique(); - if (!native_->Init(luid_, (ID3D11Device *)device_, 4)) { - LOG_ERROR(std::string("Failed to initialize native device")); - return MFX_ERR_DEVICE_FAILED; - } - sts = InitializeMFX(); - CHECK_STATUS(sts, "InitializeMFX"); - - // Create Media SDK decoder - mfxDEC_ = new MFXVideoDECODE(session_); - if (!mfxDEC_) { - LOG_ERROR(std::string("Failed to create MFXVideoDECODE")); - return MFX_ERR_NOT_INITIALIZED; - } - - memset(&mfxVideoParams_, 0, sizeof(mfxVideoParams_)); - if (!convert_codec(codecID_, mfxVideoParams_.mfx.CodecId)) { - LOG_ERROR(std::string("Unsupported codec")); - return MFX_ERR_UNSUPPORTED; - } - - mfxVideoParams_.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; - // AsyncDepth: sSpecifies how many asynchronous operations an - // application performs before the application explicitly synchronizes the - // result. If zero, the value is not specified - mfxVideoParams_.AsyncDepth = 1; // Not important. - // DecodedOrder: For AVC and HEVC, used to instruct the decoder - // to return output frames in the decoded order. Must be zero for all other - // decoders. - mfxVideoParams_.mfx.DecodedOrder = true; // Not important. - - mfxVideoParams_.mfx.FrameInfo.FrameRateExtN = 30; - mfxVideoParams_.mfx.FrameInfo.FrameRateExtD = 1; - mfxVideoParams_.mfx.FrameInfo.AspectRatioW = 1; - mfxVideoParams_.mfx.FrameInfo.AspectRatioH = 1; - mfxVideoParams_.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; - mfxVideoParams_.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; - - // Validate video decode parameters (optional) - sts = mfxDEC_->Query(&mfxVideoParams_, &mfxVideoParams_); - CHECK_STATUS(sts, "Query"); - - return MFX_ERR_NONE; - } - - int decode(uint8_t *data, int len, DecodeCallback callback, void *obj) { - mfxStatus sts = MFX_ERR_NONE; - mfxSyncPoint syncp; - mfxFrameSurface1 *pmfxOutSurface = NULL; - bool decoded = false; - mfxBitstream mfxBS; - - setBitStream(&mfxBS, data, len); - if (!initialized_) { - sts = initializeDecode(&mfxBS, false); - if (sts != MFX_ERR_NONE) { - LOG_ERROR(std::string("initializeDecode failed, sts=") + std::to_string((int)sts)); - return -1; - } - initialized_ = true; - } - setBitStream(&mfxBS, data, len); - - auto start = util::now(); - do { - if (util::elapsed_ms(start) > DECODE_TIMEOUT_MS) { - LOG_ERROR(std::string("decode timeout")); - break; - } - int nIndex = - GetFreeSurfaceIndex(pmfxSurfaces_.data(), - pmfxSurfaces_.size()); // Find free frame surface - if (nIndex >= pmfxSurfaces_.size()) { - LOG_ERROR(std::string("GetFreeSurfaceIndex failed, nIndex=") + - std::to_string(nIndex)); - break; - } - sts = mfxDEC_->DecodeFrameAsync(&mfxBS, &pmfxSurfaces_[nIndex], - &pmfxOutSurface, &syncp); - if (MFX_ERR_NONE == sts) { - if (!syncp) { - LOG_ERROR(std::string("should not happen, syncp is NULL while error is none")); - break; - } - sts = session_.SyncOperation(syncp, 1000); - if (MFX_ERR_NONE != sts) { - LOG_ERROR(std::string("SyncOperation failed, sts=") + std::to_string((int)sts)); - break; - } - if (!pmfxOutSurface) { - LOG_ERROR(std::string("pmfxOutSurface is null")); - break; - } - if (!convert(pmfxOutSurface)) { - LOG_ERROR(std::string("Failed to convert")); - break; - } - if (callback) - callback(native_->GetCurrentTexture(), obj); - decoded = true; - break; - } else if (MFX_WRN_DEVICE_BUSY == sts) { - LOG_INFO(std::string("Device busy")); - Sleep(1); - continue; - } else if (MFX_ERR_INCOMPATIBLE_VIDEO_PARAM == sts) { - // https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#multiple-sequence-headers - LOG_INFO(std::string("Incompatible video param, reset decoder")); - // https://github.com/FFmpeg/FFmpeg/blob/f84412d6f4e9c1f1d1a2491f9337d7e789c688ba/libavcodec/qsvdec.c#L736 - setBitStream(&mfxBS, data, len); - sts = initializeDecode(&mfxBS, true); - if (sts != MFX_ERR_NONE) { - LOG_ERROR(std::string("initializeDecode failed, sts=") + std::to_string((int)sts)); - break; - } - Sleep(1); - continue; - } else if (MFX_WRN_VIDEO_PARAM_CHANGED == sts) { - LOG_TRACE(std::string("new sequence header")); - sts = mfxDEC_->GetVideoParam(&mfxVideoParams_); - if (sts != MFX_ERR_NONE) { - LOG_ERROR(std::string("GetVideoParam failed, sts=") + std::to_string((int)sts)); - } - continue; - } else if (MFX_ERR_MORE_SURFACE == sts) { - LOG_INFO(std::string("More surface")); - Sleep(1); - continue; - } else { - LOG_ERROR(std::string("DecodeFrameAsync failed, sts=") + std::to_string(sts)); - break; - } - // double confirm, check continue - } while (MFX_ERR_NONE == sts || MFX_WRN_DEVICE_BUSY == sts || - MFX_ERR_INCOMPATIBLE_VIDEO_PARAM == sts || - MFX_WRN_VIDEO_PARAM_CHANGED == sts || MFX_ERR_MORE_SURFACE == sts); - - if (!decoded) { - LOG_ERROR(std::string("decode failed, sts=") + std::to_string(sts)); - } - - return decoded ? 0 : -1; - } - -private: - mfxStatus InitializeMFX() { - mfxStatus sts = MFX_ERR_NONE; - mfxIMPL impl = MFX_IMPL_HARDWARE_ANY | MFX_IMPL_VIA_D3D11; - mfxVersion ver = {{0, 1}}; - D3D11AllocatorParams allocParams; - - sts = session_.Init(impl, &ver); - CHECK_STATUS(sts, "session Init"); - - sts = session_.SetHandle(MFX_HANDLE_D3D11_DEVICE, native_->device_.Get()); - CHECK_STATUS(sts, "SetHandle"); - - allocParams.bUseSingleTexture = false; // important - allocParams.pDevice = native_->device_.Get(); - allocParams.uncompressedResourceMiscFlags = 0; - sts = d3d11FrameAllocator_.Init(&allocParams); - CHECK_STATUS(sts, "init D3D11FrameAllocator"); - - sts = session_.SetFrameAllocator(&d3d11FrameAllocator_); - CHECK_STATUS(sts, "SetFrameAllocator"); - - return MFX_ERR_NONE; - } - - bool convert_codec(DataFormat dataFormat, mfxU32 &CodecId) { - switch (dataFormat) { - case H264: - CodecId = MFX_CODEC_AVC; - return true; - case H265: - CodecId = MFX_CODEC_HEVC; - return true; - } - return false; - } - - mfxStatus initializeDecode(mfxBitstream *mfxBS, bool reinit) { - mfxStatus sts = MFX_ERR_NONE; - mfxFrameAllocRequest Request; - memset(&Request, 0, sizeof(Request)); - mfxU16 numSurfaces; - mfxU16 width, height; - mfxU8 bitsPerPixel = 12; // NV12 - mfxU32 surfaceSize; - mfxU8 *surfaceBuffers; - - // mfxExtVideoSignalInfo got MFX_ERR_INVALID_VIDEO_PARAM - // mfxExtVideoSignalInfo video_signal_info = {0}; - - // https://spec.oneapi.io/versions/1.1-rev-1/elements/oneVPL/source/API_ref/VPL_func_vid_decode.html#mfxvideodecode-decodeheader - sts = mfxDEC_->DecodeHeader(mfxBS, &mfxVideoParams_); - MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - - sts = mfxDEC_->QueryIOSurf(&mfxVideoParams_, &Request); - MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - - numSurfaces = Request.NumFrameSuggested; - - // Request.Type |= WILL_READ; // This line is only required for Windows - // DirectX11 to ensure that surfaces can be retrieved by the application - - // Allocate surfaces for decoder - if (reinit) { - sts = d3d11FrameAllocator_.FreeFrames(&mfxResponse_); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - } - sts = d3d11FrameAllocator_.AllocFrames(&Request, &mfxResponse_); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - - // Allocate surface headers (mfxFrameSurface1) for decoder - pmfxSurfaces_.resize(numSurfaces); - for (int i = 0; i < numSurfaces; i++) { - memset(&pmfxSurfaces_[i], 0, sizeof(mfxFrameSurface1)); - pmfxSurfaces_[i].Info = mfxVideoParams_.mfx.FrameInfo; - pmfxSurfaces_[i].Data.MemId = - mfxResponse_ - .mids[i]; // MID (memory id) represents one video NV12 surface - } - - // Initialize the Media SDK decoder - if (reinit) { - // https://github.com/FFmpeg/FFmpeg/blob/f84412d6f4e9c1f1d1a2491f9337d7e789c688ba/libavcodec/qsvdec.c#L181 - sts = mfxDEC_->Close(); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - } - sts = mfxDEC_->Init(&mfxVideoParams_); - MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION); - MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); - return MFX_ERR_NONE; - } - - void setBitStream(mfxBitstream *mfxBS, uint8_t *data, int len) { - memset(mfxBS, 0, sizeof(mfxBitstream)); - mfxBS->Data = data; - mfxBS->DataLength = len; - mfxBS->MaxLength = len; - mfxBS->DataFlag = MFX_BITSTREAM_COMPLETE_FRAME; - } - - bool convert(mfxFrameSurface1 *pmfxOutSurface) { - mfxStatus sts = MFX_ERR_NONE; - mfxHDLPair pair = {NULL}; - sts = d3d11FrameAllocator_.GetFrameHDL(pmfxOutSurface->Data.MemId, - (mfxHDL *)&pair); - if (MFX_ERR_NONE != sts) { - LOG_ERROR(std::string("Failed to GetFrameHDL")); - return false; - } - ID3D11Texture2D *texture = (ID3D11Texture2D *)pair.first; - D3D11_TEXTURE2D_DESC desc2D; - texture->GetDesc(&desc2D); - if (!native_->EnsureTexture(pmfxOutSurface->Info.CropW, - pmfxOutSurface->Info.CropH)) { - LOG_ERROR(std::string("Failed to EnsureTexture")); - return false; - } - native_->next(); // comment out to remove picture shaking -#ifdef USE_SHADER - native_->BeginQuery(); - if (!native_->Nv12ToBgra(pmfxOutSurface->Info.CropW, - pmfxOutSurface->Info.CropH, texture, - native_->GetCurrentTexture(), 0)) { - LOG_ERROR(std::string("Failed to Nv12ToBgra")); - native_->EndQuery(); - return false; - } - native_->EndQuery(); - native_->Query(); -#else - native_->BeginQuery(); - - // nv12 -> bgra - D3D11_VIDEO_PROCESSOR_CONTENT_DESC contentDesc; - ZeroMemory(&contentDesc, sizeof(contentDesc)); - contentDesc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; - contentDesc.InputFrameRate.Numerator = 60; - contentDesc.InputFrameRate.Denominator = 1; - // TODO: aligned width, height or crop width, height - contentDesc.InputWidth = pmfxOutSurface->Info.CropW; - contentDesc.InputHeight = pmfxOutSurface->Info.CropH; - contentDesc.OutputWidth = pmfxOutSurface->Info.CropW; - contentDesc.OutputHeight = pmfxOutSurface->Info.CropH; - contentDesc.OutputFrameRate.Numerator = 60; - contentDesc.OutputFrameRate.Denominator = 1; - DXGI_COLOR_SPACE_TYPE colorSpace_out = - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; - DXGI_COLOR_SPACE_TYPE colorSpace_in; - if (bt709_) { - if (full_range_) { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709; - } else { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; - } - } else { - if (full_range_) { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601; - } else { - colorSpace_in = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; - } - } - if (!native_->Process(texture, native_->GetCurrentTexture(), contentDesc, - colorSpace_in, colorSpace_out, 0)) { - LOG_ERROR(std::string("Failed to process")); - native_->EndQuery(); - return false; - } - - native_->context_->Flush(); - native_->EndQuery(); - if (!native_->Query()) { - LOG_ERROR(std::string("Failed to query")); - return false; - } -#endif - return true; - } -}; - -} // namespace - -extern "C" { - -int mfx_destroy_decoder(void *decoder) { - VplDecoder *p = (VplDecoder *)decoder; - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return 0; -} - -void *mfx_new_decoder(void *device, int64_t luid, DataFormat codecID) { - VplDecoder *p = NULL; - try { - p = new VplDecoder(device, luid, codecID); - if (p) { - if (p->init() == MFX_ERR_NONE) { - return p; - } - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("new failed: ") + e.what()); - } - - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return NULL; -} - -int mfx_decode(void *decoder, uint8_t *data, int len, DecodeCallback callback, - void *obj) { - try { - VplDecoder *p = (VplDecoder *)decoder; - if (p->decode(data, len, callback, obj) == 0) { - return HWCODEC_SUCCESS; - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("decode failed: ") + e.what()); - } - return HWCODEC_ERR_COMMON; -} - -int mfx_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, DataFormat dataFormat, - uint8_t *data, int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_INTEL)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - VplDecoder *p = (VplDecoder *)mfx_new_decoder( - nullptr, currentLuid, dataFormat); - if (!p) - continue; - auto start = util::now(); - bool succ = mfx_decode(p, data, length, nullptr, nullptr) == 0; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_INTEL; - count += 1; - } - p->destroy(); - delete p; - p = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - } catch (const std::exception &e) { - std::cerr << e.what() << '\n'; - } - return -1; -} -} // extern "C" diff --git a/libs/hwcodec/cpp/mfx/mfx_encode.cpp b/libs/hwcodec/cpp/mfx/mfx_encode.cpp deleted file mode 100644 index 4b78fc95..00000000 --- a/libs/hwcodec/cpp/mfx/mfx_encode.cpp +++ /dev/null @@ -1,709 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "MFXENC" -#include "log.h" - -// #define CONFIG_USE_VPP -#define CONFIG_USE_D3D_CONVERT - -#define CHECK_STATUS(X, MSG) \ - { \ - mfxStatus __sts = (X); \ - if (__sts != MFX_ERR_NONE) { \ - LOG_ERROR(std::string(MSG) + " failed, sts=" + std::to_string((int)__sts)); \ - return __sts; \ - } \ - } - -namespace { - -mfxStatus MFX_CDECL simple_getHDL(mfxHDL pthis, mfxMemId mid, mfxHDL *handle) { - mfxHDLPair *pair = (mfxHDLPair *)handle; - pair->first = mid; - pair->second = (mfxHDL)(UINT)0; - return MFX_ERR_NONE; -} - -mfxFrameAllocator frameAllocator{{}, NULL, NULL, NULL, - NULL, simple_getHDL, NULL}; - -mfxStatus InitSession(MFXVideoSession &session) { - mfxInitParam mfxparams{}; - mfxIMPL impl = MFX_IMPL_HARDWARE_ANY | MFX_IMPL_VIA_D3D11; - mfxparams.Implementation = impl; - mfxparams.Version.Major = 1; - mfxparams.Version.Minor = 0; - mfxparams.GPUCopy = MFX_GPUCOPY_OFF; - - return session.InitEx(mfxparams); -} - - -class VplEncoder { -public: - std::unique_ptr native_ = nullptr; - MFXVideoSession session_; - MFXVideoENCODE *mfxENC_ = nullptr; - std::vector encSurfaces_; - std::vector bstData_; - mfxBitstream mfxBS_; - mfxVideoParam mfxEncParams_; - mfxExtBuffer *extbuffers_[4] = {NULL, NULL, NULL, NULL}; - mfxExtCodingOption coding_option_; - mfxExtCodingOption2 coding_option2_; - mfxExtCodingOption3 coding_option3_; - mfxExtVideoSignalInfo signal_info_; - ComPtr nv12Texture_ = nullptr; - -// vpp -#ifdef CONFIG_USE_VPP - MFXVideoVPP *mfxVPP_ = nullptr; - mfxVideoParam vppParams_; - mfxExtBuffer *vppExtBuffers_[1] = {NULL}; - mfxExtVPPDoNotUse vppDontUse_; - mfxU32 vppDontUseArgList_[4]; - std::vector vppSurfaces_; -#endif - - void *handle_ = nullptr; - int64_t luid_; - DataFormat dataFormat_; - int32_t width_ = 0; - int32_t height_ = 0; - int32_t kbs_; - int32_t framerate_; - int32_t gop_; - - bool full_range_ = false; - bool bt709_ = false; - - VplEncoder(void *handle, int64_t luid, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, int32_t framerate, - int32_t gop) { - handle_ = handle; - luid_ = luid; - dataFormat_ = dataFormat; - width_ = width; - height_ = height; - kbs_ = kbs; - framerate_ = framerate; - gop_ = gop; - } - - ~VplEncoder() {} - - mfxStatus Reset() { - mfxStatus sts = MFX_ERR_NONE; - - if (!native_) { - native_ = std::make_unique(); - if (!native_->Init(luid_, (ID3D11Device *)handle_)) { - LOG_ERROR(std::string("failed to init native device")); - return MFX_ERR_DEVICE_FAILED; - } - } - sts = resetMFX(); - CHECK_STATUS(sts, "resetMFX"); -#ifdef CONFIG_USE_VPP - sts = resetVpp(); - CHECK_STATUS(sts, "resetVpp"); -#endif - sts = resetEnc(); - CHECK_STATUS(sts, "resetEnc"); - return MFX_ERR_NONE; - } - - int encode(ID3D11Texture2D *tex, EncodeCallback callback, void *obj, - int64_t ms) { - mfxStatus sts = MFX_ERR_NONE; - - int nEncSurfIdx = - GetFreeSurfaceIndex(encSurfaces_.data(), encSurfaces_.size()); - if (nEncSurfIdx >= encSurfaces_.size()) { - LOG_ERROR(std::string("no free enc surface")); - return -1; - } - mfxFrameSurface1 *encSurf = &encSurfaces_[nEncSurfIdx]; -#ifdef CONFIG_USE_VPP - mfxSyncPoint syncp; - sts = vppOneFrame(tex, encSurf, syncp); - syncp = NULL; - if (sts != MFX_ERR_NONE) { - LOG_ERROR(std::string("vppOneFrame failed, sts=") + std::to_string((int)sts)); - return -1; - } -#elif defined(CONFIG_USE_D3D_CONVERT) - DXGI_COLOR_SPACE_TYPE colorSpace_in = - DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; - DXGI_COLOR_SPACE_TYPE colorSpace_out; - if (bt709_) { - if (full_range_) { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709; - } else { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709; - } - } else { - if (full_range_) { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601; - } else { - colorSpace_out = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601; - } - } - if (!nv12Texture_) { - D3D11_TEXTURE2D_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - tex->GetDesc(&desc); - desc.Format = DXGI_FORMAT_NV12; - desc.MiscFlags = 0; - HRI(native_->device_->CreateTexture2D( - &desc, NULL, nv12Texture_.ReleaseAndGetAddressOf())); - } - if (!native_->BgraToNv12(tex, nv12Texture_.Get(), width_, height_, - colorSpace_in, colorSpace_out)) { - LOG_ERROR(std::string("failed to convert to NV12")); - return -1; - } - encSurf->Data.MemId = nv12Texture_.Get(); -#else - encSurf->Data.MemId = tex; -#endif - return encodeOneFrame(encSurf, callback, obj, ms); - } - - void destroy() { - if (mfxENC_) { - // - It is recommended to close Media SDK components first, before - // releasing allocated surfaces, since - // some surfaces may still be locked by internal Media SDK resources. - mfxENC_->Close(); - delete mfxENC_; - mfxENC_ = NULL; - } -#ifdef CONFIG_USE_VPP - if (mfxVPP_) { - mfxVPP_->Close(); - delete mfxVPP_; - mfxVPP_ = NULL; - } -#endif - // session closed automatically on destruction - } - -private: - mfxStatus resetMFX() { - mfxStatus sts = MFX_ERR_NONE; - - sts = InitSession(session_); - CHECK_STATUS(sts, "InitSession"); - sts = session_.SetHandle(MFX_HANDLE_D3D11_DEVICE, native_->device_.Get()); - CHECK_STATUS(sts, "SetHandle"); - sts = session_.SetFrameAllocator(&frameAllocator); - CHECK_STATUS(sts, "SetFrameAllocator"); - - return MFX_ERR_NONE; - } - -#ifdef CONFIG_USE_VPP - mfxStatus resetVpp() { - mfxStatus sts = MFX_ERR_NONE; - memset(&vppParams_, 0, sizeof(vppParams_)); - vppParams_.IOPattern = - MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY; - vppParams_.vpp.In.PicStruct = MFX_PICSTRUCT_PROGRESSIVE; - vppParams_.vpp.In.FrameRateExtN = framerate_; - vppParams_.vpp.In.FrameRateExtD = 1; - vppParams_.vpp.In.Width = MSDK_ALIGN16(width_); - vppParams_.vpp.In.Height = - (MFX_PICSTRUCT_PROGRESSIVE == vppParams_.vpp.In.PicStruct) - ? MSDK_ALIGN16(height_) - : MSDK_ALIGN32(height_); - vppParams_.vpp.In.CropX = 0; - vppParams_.vpp.In.CropY = 0; - vppParams_.vpp.In.CropW = width_; - vppParams_.vpp.In.CropH = height_; - vppParams_.vpp.In.Shift = 0; - memcpy(&vppParams_.vpp.Out, &vppParams_.vpp.In, sizeof(vppParams_.vpp.Out)); - vppParams_.vpp.In.FourCC = MFX_FOURCC_RGB4; - vppParams_.vpp.Out.FourCC = MFX_FOURCC_NV12; - vppParams_.vpp.In.ChromaFormat = MFX_CHROMAFORMAT_YUV444; - vppParams_.vpp.Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420; - vppParams_.AsyncDepth = 1; - - vppParams_.ExtParam = vppExtBuffers_; - vppParams_.NumExtParam = 1; - vppExtBuffers_[0] = (mfxExtBuffer *)&vppDontUse_; - vppDontUse_.Header.BufferId = MFX_EXTBUFF_VPP_DONOTUSE; - vppDontUse_.Header.BufferSz = sizeof(vppDontUse_); - vppDontUse_.AlgList = vppDontUseArgList_; - vppDontUse_.NumAlg = 4; - vppDontUseArgList_[0] = MFX_EXTBUFF_VPP_DENOISE; - vppDontUseArgList_[1] = MFX_EXTBUFF_VPP_SCENE_ANALYSIS; - vppDontUseArgList_[2] = MFX_EXTBUFF_VPP_DETAIL; - vppDontUseArgList_[3] = MFX_EXTBUFF_VPP_PROCAMP; - - if (mfxVPP_) { - mfxVPP_->Close(); - delete mfxVPP_; - mfxVPP_ = NULL; - } - mfxVPP_ = new MFXVideoVPP(session_); - if (!mfxVPP_) { - LOG_ERROR(std::string("Failed to create MFXVideoVPP")); - return MFX_ERR_MEMORY_ALLOC; - } - - sts = mfxVPP_->Query(&vppParams_, &vppParams_); - CHECK_STATUS(sts, "vpp query"); - mfxFrameAllocRequest vppAllocRequest; - ZeroMemory(&vppAllocRequest, sizeof(vppAllocRequest)); - memcpy(&vppAllocRequest.Info, &vppParams_.vpp.In, sizeof(mfxFrameInfo)); - sts = mfxVPP_->QueryIOSurf(&vppParams_, &vppAllocRequest); - CHECK_STATUS(sts, "vpp QueryIOSurf"); - - vppSurfaces_.resize(vppAllocRequest.NumFrameSuggested); - for (int i = 0; i < vppAllocRequest.NumFrameSuggested; i++) { - memset(&vppSurfaces_[i], 0, sizeof(mfxFrameSurface1)); - memcpy(&vppSurfaces_[i].Info, &vppParams_.vpp.In, sizeof(mfxFrameInfo)); - } - - sts = mfxVPP_->Init(&vppParams_); - MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION); - CHECK_STATUS(sts, "vpp init"); - - return MFX_ERR_NONE; - } -#endif - - mfxStatus resetEnc() { - mfxStatus sts = MFX_ERR_NONE; - memset(&mfxEncParams_, 0, sizeof(mfxEncParams_)); - - // Basic - if (!convert_codec(dataFormat_, mfxEncParams_.mfx.CodecId)) { - LOG_ERROR(std::string("unsupported dataFormat: ") + std::to_string(dataFormat_)); - return MFX_ERR_UNSUPPORTED; - } - // mfxEncParams_.mfx.LowPower = MFX_CODINGOPTION_ON; - mfxEncParams_.mfx.BRCParamMultiplier = 0; - - // Frame Info - mfxEncParams_.mfx.FrameInfo.FrameRateExtN = framerate_; - mfxEncParams_.mfx.FrameInfo.FrameRateExtD = 1; -#ifdef CONFIG_USE_VPP - mfxEncParams_.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; - mfxEncParams_.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; -#elif defined(CONFIG_USE_D3D_CONVERT) - mfxEncParams_.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; - mfxEncParams_.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; -#else - mfxEncParams_.mfx.FrameInfo.FourCC = MFX_FOURCC_BGR4; - mfxEncParams_.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444; -#endif - mfxEncParams_.mfx.FrameInfo.BitDepthLuma = 8; - mfxEncParams_.mfx.FrameInfo.BitDepthChroma = 8; - mfxEncParams_.mfx.FrameInfo.Shift = 0; - mfxEncParams_.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE; - mfxEncParams_.mfx.FrameInfo.CropX = 0; - mfxEncParams_.mfx.FrameInfo.CropY = 0; - mfxEncParams_.mfx.FrameInfo.CropW = width_; - mfxEncParams_.mfx.FrameInfo.CropH = height_; - // Width must be a multiple of 16 - // Height must be a multiple of 16 in case of frame picture and a multiple - // of 32 in case of field picture - mfxEncParams_.mfx.FrameInfo.Width = MSDK_ALIGN16(width_); - mfxEncParams_.mfx.FrameInfo.Height = - (MFX_PICSTRUCT_PROGRESSIVE == mfxEncParams_.mfx.FrameInfo.PicStruct) - ? MSDK_ALIGN16(height_) - : MSDK_ALIGN32(height_); - - // Encoding Options - mfxEncParams_.mfx.EncodedOrder = 0; - - mfxEncParams_.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY; - - // Configuration for low latency - mfxEncParams_.AsyncDepth = 1; // 1 is best for low latency - mfxEncParams_.mfx.GopRefDist = - 1; // 1 is best for low latency, I and P frames only - mfxEncParams_.mfx.GopPicSize = (gop_ > 0 && gop_ < 0xFFFF) ? gop_ : 0xFFFF; - // quality - // https://www.intel.com/content/www/us/en/developer/articles/technical/common-bitrate-control-methods-in-intel-media-sdk.html - mfxEncParams_.mfx.TargetUsage = MFX_TARGETUSAGE_BEST_SPEED; - mfxEncParams_.mfx.RateControlMethod = MFX_RATECONTROL_VBR; - mfxEncParams_.mfx.InitialDelayInKB = 0; - mfxEncParams_.mfx.BufferSizeInKB = 512; - mfxEncParams_.mfx.TargetKbps = kbs_; - mfxEncParams_.mfx.MaxKbps = kbs_; - mfxEncParams_.mfx.NumSlice = 1; - mfxEncParams_.mfx.NumRefFrame = 0; - - if (H264 == dataFormat_) { - mfxEncParams_.mfx.CodecLevel = MFX_LEVEL_AVC_51; - mfxEncParams_.mfx.CodecProfile = MFX_PROFILE_AVC_MAIN; - } else if (H265 == dataFormat_) { - mfxEncParams_.mfx.CodecLevel = MFX_LEVEL_HEVC_51; - mfxEncParams_.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN; - } - - resetEncExtParams(); - - // Create Media SDK encoder - if (mfxENC_) { - mfxENC_->Close(); - delete mfxENC_; - mfxENC_ = NULL; - } - mfxENC_ = new MFXVideoENCODE(session_); - if (!mfxENC_) { - LOG_ERROR(std::string("failed to create MFXVideoENCODE")); - return MFX_ERR_NOT_INITIALIZED; - } - - // Validate video encode parameters (optional) - // - In this example the validation result is written to same structure - // - MFX_WRN_INCOMPATIBLE_VIDEO_PARAM is returned if some of the video - // parameters are not supported, - // instead the encoder will select suitable parameters closest matching - // the requested configuration - sts = mfxENC_->Query(&mfxEncParams_, &mfxEncParams_); - MSDK_IGNORE_MFX_STS(sts, MFX_WRN_INCOMPATIBLE_VIDEO_PARAM); - CHECK_STATUS(sts, "Query"); - - mfxFrameAllocRequest EncRequest; - memset(&EncRequest, 0, sizeof(EncRequest)); - sts = mfxENC_->QueryIOSurf(&mfxEncParams_, &EncRequest); - CHECK_STATUS(sts, "QueryIOSurf"); - - // Allocate surface headers (mfxFrameSurface1) for encoder - encSurfaces_.resize(EncRequest.NumFrameSuggested); - for (int i = 0; i < EncRequest.NumFrameSuggested; i++) { - memset(&encSurfaces_[i], 0, sizeof(mfxFrameSurface1)); - memcpy(&encSurfaces_[i].Info, &mfxEncParams_.mfx.FrameInfo, - sizeof(mfxFrameInfo)); - } - - // Initialize the Media SDK encoder - sts = mfxENC_->Init(&mfxEncParams_); - CHECK_STATUS(sts, "Init"); - - // Retrieve video parameters selected by encoder. - // - BufferSizeInKB parameter is required to set bit stream buffer size - sts = mfxENC_->GetVideoParam(&mfxEncParams_); - CHECK_STATUS(sts, "GetVideoParam"); - - // Prepare Media SDK bit stream buffer - memset(&mfxBS_, 0, sizeof(mfxBS_)); - mfxBS_.MaxLength = mfxEncParams_.mfx.BufferSizeInKB * 1024; - bstData_.resize(mfxBS_.MaxLength); - mfxBS_.Data = bstData_.data(); - - return MFX_ERR_NONE; - } - -#ifdef CONFIG_USE_VPP - mfxStatus vppOneFrame(void *texture, mfxFrameSurface1 *out, - mfxSyncPoint syncp) { - mfxStatus sts = MFX_ERR_NONE; - - int surfIdx = - GetFreeSurfaceIndex(vppSurfaces_.data(), - vppSurfaces_.size()); // Find free frame surface - if (surfIdx >= vppSurfaces_.size()) { - LOG_ERROR(std::string("No free vpp surface")); - return MFX_ERR_MORE_SURFACE; - } - mfxFrameSurface1 *in = &vppSurfaces_[surfIdx]; - in->Data.MemId = texture; - - for (;;) { - sts = mfxVPP_->RunFrameVPPAsync(in, out, NULL, &syncp); - - if (MFX_ERR_NONE < sts && - !syncp) // repeat the call if warning and no output - { - if (MFX_WRN_DEVICE_BUSY == sts) - MSDK_SLEEP(1); // wait if device is busy - } else if (MFX_ERR_NONE < sts && syncp) { - sts = MFX_ERR_NONE; // ignore warnings if output is available - break; - } else { - break; // not a warning - } - } - - if (MFX_ERR_NONE == sts) { - sts = session_.SyncOperation( - syncp, 1000); // Synchronize. Wait until encoded frame is ready - CHECK_STATUS(sts, "SyncOperation"); - } - - return sts; - } -#endif - - int encodeOneFrame(mfxFrameSurface1 *in, EncodeCallback callback, void *obj, - int64_t ms) { - mfxStatus sts = MFX_ERR_NONE; - mfxSyncPoint syncp; - bool encoded = false; - - auto start = util::now(); - do { - if (util::elapsed_ms(start) > ENCODE_TIMEOUT_MS) { - LOG_ERROR(std::string("encode timeout")); - break; - } - mfxBS_.DataLength = 0; - mfxBS_.DataOffset = 0; - mfxBS_.TimeStamp = ms * 90; // ms to 90KHZ - mfxBS_.DecodeTimeStamp = mfxBS_.TimeStamp; - sts = mfxENC_->EncodeFrameAsync(NULL, in, &mfxBS_, &syncp); - if (MFX_ERR_NONE == sts) { - if (!syncp) { - LOG_ERROR(std::string("should not happen, error is none while syncp is null")); - break; - } - sts = session_.SyncOperation( - syncp, 1000); // Synchronize. Wait until encoded frame is ready - if (MFX_ERR_NONE != sts) { - LOG_ERROR(std::string("SyncOperation failed, sts=") + std::to_string(sts)); - break; - } - if (mfxBS_.DataLength <= 0) { - LOG_ERROR(std::string("mfxBS_.DataLength <= 0")); - break; - } - int key = (mfxBS_.FrameType & MFX_FRAMETYPE_I) || - (mfxBS_.FrameType & MFX_FRAMETYPE_IDR); - if (callback) - callback(mfxBS_.Data + mfxBS_.DataOffset, mfxBS_.DataLength, key, obj, - ms); - encoded = true; - break; - } else if (MFX_WRN_DEVICE_BUSY == sts) { - LOG_INFO(std::string("device busy")); - Sleep(1); - continue; - } else if (MFX_ERR_NOT_ENOUGH_BUFFER == sts) { - LOG_ERROR(std::string("not enough buffer, size=") + - std::to_string(mfxBS_.MaxLength)); - if (mfxBS_.MaxLength < 10 * 1024 * 1024) { - mfxBS_.MaxLength *= 2; - bstData_.resize(mfxBS_.MaxLength); - mfxBS_.Data = bstData_.data(); - Sleep(1); - continue; - } else { - break; - } - } else { - LOG_ERROR(std::string("EncodeFrameAsync failed, sts=") + std::to_string(sts)); - break; - } - // double confirm, check continue - } while (MFX_WRN_DEVICE_BUSY == sts || MFX_ERR_NOT_ENOUGH_BUFFER == sts); - - if (!encoded) { - LOG_ERROR(std::string("encode failed, sts=") + std::to_string(sts)); - } - return encoded ? 0 : -1; - } - - void resetEncExtParams() { - // coding option - memset(&coding_option_, 0, sizeof(mfxExtCodingOption)); - coding_option_.Header.BufferId = MFX_EXTBUFF_CODING_OPTION; - coding_option_.Header.BufferSz = sizeof(mfxExtCodingOption); - coding_option_.NalHrdConformance = MFX_CODINGOPTION_OFF; - extbuffers_[0] = (mfxExtBuffer *)&coding_option_; - - // coding option2 - memset(&coding_option2_, 0, sizeof(mfxExtCodingOption2)); - coding_option2_.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; - coding_option2_.Header.BufferSz = sizeof(mfxExtCodingOption2); - coding_option2_.RepeatPPS = MFX_CODINGOPTION_OFF; - extbuffers_[1] = (mfxExtBuffer *)&coding_option2_; - - // coding option3 - memset(&coding_option3_, 0, sizeof(mfxExtCodingOption3)); - coding_option3_.Header.BufferId = MFX_EXTBUFF_CODING_OPTION3; - coding_option3_.Header.BufferSz = sizeof(mfxExtCodingOption3); - extbuffers_[2] = (mfxExtBuffer *)&coding_option3_; - - // signal info - memset(&signal_info_, 0, sizeof(mfxExtVideoSignalInfo)); - signal_info_.Header.BufferId = MFX_EXTBUFF_VIDEO_SIGNAL_INFO; - signal_info_.Header.BufferSz = sizeof(mfxExtVideoSignalInfo); - signal_info_.VideoFormat = 5; - signal_info_.ColourDescriptionPresent = 1; - signal_info_.VideoFullRange = !!full_range_; - signal_info_.MatrixCoefficients = - bt709_ ? AVCOL_SPC_BT709 : AVCOL_SPC_SMPTE170M; - signal_info_.ColourPrimaries = - bt709_ ? AVCOL_PRI_BT709 : AVCOL_PRI_SMPTE170M; - signal_info_.TransferCharacteristics = - bt709_ ? AVCOL_TRC_BT709 : AVCOL_TRC_SMPTE170M; - // https://github.com/GStreamer/gstreamer/blob/651dcb49123ec516e7c582e4a49a5f3f15c10f93/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp#L1647 - extbuffers_[3] = (mfxExtBuffer *)&signal_info_; - - mfxEncParams_.ExtParam = extbuffers_; - mfxEncParams_.NumExtParam = 4; - } - - bool convert_codec(DataFormat dataFormat, mfxU32 &CodecId) { - switch (dataFormat) { - case H264: - CodecId = MFX_CODEC_AVC; - return true; - case H265: - CodecId = MFX_CODEC_HEVC; - return true; - } - return false; - } -}; - -} // namespace - -extern "C" { - -int mfx_driver_support() { - MFXVideoSession session; - return InitSession(session) == MFX_ERR_NONE ? 0 : -1; -} - -int mfx_destroy_encoder(void *encoder) { - VplEncoder *p = (VplEncoder *)encoder; - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return 0; -} - -void *mfx_new_encoder(void *handle, int64_t luid, - DataFormat dataFormat, int32_t w, int32_t h, int32_t kbs, - int32_t framerate, int32_t gop) { - VplEncoder *p = NULL; - try { - p = new VplEncoder(handle, luid, dataFormat, w, h, kbs, framerate, - gop); - if (!p) { - return NULL; - } - mfxStatus sts = p->Reset(); - if (sts == MFX_ERR_NONE) { - return p; - } else { - LOG_ERROR(std::string("Init failed, sts=") + std::to_string(sts)); - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("Exception: ") + e.what()); - } - - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return NULL; -} - -int mfx_encode(void *encoder, ID3D11Texture2D *tex, EncodeCallback callback, - void *obj, int64_t ms) { - try { - return ((VplEncoder *)encoder)->encode(tex, callback, obj, ms); - } catch (const std::exception &e) { - LOG_ERROR(std::string("Exception: ") + e.what()); - } - return -1; -} - -int mfx_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - DataFormat dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, - int32_t gop, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_INTEL)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - VplEncoder *e = (VplEncoder *)mfx_new_encoder( - (void *)adapter.get()->device_.Get(), currentLuid, - dataFormat, width, height, kbs, framerate, gop); - if (!e) - continue; - if (e->native_->EnsureTexture(e->width_, e->height_)) { - e->native_->next(); - int32_t key_obj = 0; - auto start = util::now(); - bool succ = mfx_encode(e, e->native_->GetCurrentTexture(), util_encode::vram_encode_test_callback, &key_obj, - 0) == 0 && key_obj == 1; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_INTEL; - count += 1; - } - } - e->destroy(); - delete e; - e = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - - } catch (const std::exception &e) { - LOG_ERROR(std::string("test failed: ") + e.what()); - } - return -1; -} - -// https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#dynamic-bitrate-change -// https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxinfomfx -// https://spec.oneapi.io/onevpl/2.4.0/programming_guide/VPL_prg_encoding.html#configuration-change -int mfx_set_bitrate(void *encoder, int32_t kbs) { - try { - VplEncoder *p = (VplEncoder *)encoder; - mfxStatus sts = MFX_ERR_NONE; - // https://github.com/GStreamer/gstreamer/blob/e19428a802c2f4ee9773818aeb0833f93509a1c0/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp#L1312 - p->kbs_ = kbs; - p->mfxENC_->GetVideoParam(&p->mfxEncParams_); - p->mfxEncParams_.mfx.TargetKbps = kbs; - p->mfxEncParams_.mfx.MaxKbps = kbs; - sts = p->mfxENC_->Reset(&p->mfxEncParams_); - if (sts != MFX_ERR_NONE) { - LOG_ERROR(std::string("reset failed, sts=") + std::to_string(sts)); - return -1; - } - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("Exception: ") + e.what()); - } - return -1; -} - -int mfx_set_framerate(void *encoder, int32_t framerate) { - LOG_WARN("not support change framerate"); - return -1; -} -} diff --git a/libs/hwcodec/cpp/mfx/mfx_ffi.h b/libs/hwcodec/cpp/mfx/mfx_ffi.h deleted file mode 100644 index 64506a36..00000000 --- a/libs/hwcodec/cpp/mfx/mfx_ffi.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef MFX_FFI_H -#define MFX_FFI_H - -#include "../common/callback.h" -#include - -int mfx_driver_support(); - -void *mfx_new_encoder(void *handle, int64_t luid, - int32_t dataFormat, int32_t width, int32_t height, - int32_t kbs, int32_t framerate, int32_t gop); - -int mfx_encode(void *encoder, void *tex, EncodeCallback callback, void *obj, - int64_t ms); - -int mfx_destroy_encoder(void *encoder); - -void *mfx_new_decoder(void *device, int64_t luid, - int32_t dataFormat); - -int mfx_decode(void *decoder, uint8_t *data, int len, DecodeCallback callback, - void *obj); - -int mfx_destroy_decoder(void *decoder); - -int mfx_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, - int32_t gop, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int mfx_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, uint8_t *data, - int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int mfx_set_bitrate(void *encoder, int32_t kbs); - -int mfx_set_framerate(void *encoder, int32_t framerate); - -#endif // MFX_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/cpp/mux/mux.cpp b/libs/hwcodec/cpp/mux/mux.cpp deleted file mode 100644 index 72c7206d..00000000 --- a/libs/hwcodec/cpp/mux/mux.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/muxing.c - -extern "C" { -#include -#include -#include -#include -} -#include -#include -#include -#include - -#define LOG_MODULE "MUX" -#include - -namespace { -typedef struct OutputStream { - AVStream *st; - AVPacket *tmp_pkt; -} OutputStream; - -class Muxer { -public: - OutputStream video_st; - AVFormatContext *oc = NULL; - int framerate; - int64_t start_ms; - int64_t last_pts; - int got_first; - - Muxer() {} - - void destroy() { - OutputStream *ost = &video_st; - if (ost && ost->tmp_pkt) - av_packet_free(&ost->tmp_pkt); - if (oc && oc->pb && !(oc->oformat->flags & AVFMT_NOFILE)) - avio_closep(&oc->pb); - if (oc) - avformat_free_context(oc); - } - - bool init(const char *filename, int width, int height, int is265, - int framerate) { - OutputStream *ost = &video_st; - ost->st = NULL; - ost->tmp_pkt = NULL; - int ret; - - if ((ret = avformat_alloc_output_context2(&oc, NULL, NULL, filename)) < 0) { - LOG_ERROR(std::string("avformat_alloc_output_context2 failed, ret = ") + - std::to_string(ret)); - return false; - } - - ost->st = avformat_new_stream(oc, NULL); - if (!ost->st) { - LOG_ERROR(std::string("avformat_new_stream failed")); - return false; - } - ost->st->id = oc->nb_streams - 1; - ost->st->codecpar->codec_id = is265 ? AV_CODEC_ID_H265 : AV_CODEC_ID_H264; - ost->st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; - ost->st->codecpar->width = width; - ost->st->codecpar->height = height; - - if (!(oc->oformat->flags & AVFMT_NOFILE)) { - ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE); - if (ret < 0) { - LOG_ERROR(std::string("avio_open failed, ret = ") + std::to_string(ret)); - return false; - } - } - - ost->tmp_pkt = av_packet_alloc(); - if (!ost->tmp_pkt) { - LOG_ERROR(std::string("av_packet_alloc failed")); - return false; - } - - ret = avformat_write_header(oc, NULL); - if (ret < 0) { - LOG_ERROR(std::string("avformat_write_header failed")); - return false; - } - - this->framerate = framerate; - this->start_ms = 0; - this->last_pts = 0; - this->got_first = 0; - - return true; - } - - int write_video_frame(const uint8_t *data, int len, int64_t pts_ms, int key) { - OutputStream *ost = &video_st; - AVPacket *pkt = ost->tmp_pkt; - AVFormatContext *fmt_ctx = oc; - int ret; - - if (framerate <= 0) - return -3; - if (!got_first) { - if (key != 1) - return -2; - start_ms = pts_ms; - } - int64_t pts = (pts_ms - start_ms); // use write timestamp - if (pts <= last_pts && got_first) { - pts = last_pts + 1000 / framerate; - } - got_first = 1; - - pkt->data = (uint8_t *)data; - pkt->size = len; - pkt->pts = pts; - pkt->dts = pkt->pts; // no B-frame - int64_t duration = pkt->pts - last_pts; - last_pts = pkt->pts; - pkt->duration = duration > 0 ? duration : 1000 / framerate; // predict - AVRational rational; - rational.num = 1; - rational.den = 1000; - av_packet_rescale_ts(pkt, rational, - ost->st->time_base); // ms -> stream timebase - pkt->stream_index = ost->st->index; - if (key == 1) { - pkt->flags |= AV_PKT_FLAG_KEY; - } else { - pkt->flags &= ~AV_PKT_FLAG_KEY; - } - ret = av_write_frame(fmt_ctx, pkt); - if (ret < 0) { - LOG_ERROR(std::string("av_write_frame failed, ret = ") + std::to_string(ret)); - return -1; - } - return 0; - } -}; -} // namespace - -extern "C" Muxer *hwcodec_new_muxer(const char *filename, int width, int height, - int is265, int framerate) { - Muxer *muxer = NULL; - try { - muxer = new Muxer(); - if (muxer) { - if (muxer->init(filename, width, height, is265, framerate)) { - return muxer; - } - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("new muxer exception: ") + std::string(e.what())); - } - if (muxer) { - muxer->destroy(); - delete muxer; - muxer = NULL; - } - return NULL; -} - -extern "C" int hwcodec_write_video_frame(Muxer *muxer, const uint8_t *data, - int len, int64_t pts_ms, int key) { - try { - return muxer->write_video_frame(data, len, pts_ms, key); - } catch (const std::exception &e) { - LOG_ERROR(std::string("write_video_frame exception: ") + std::string(e.what())); - } - return -1; -} - -extern "C" int hwcodec_write_tail(Muxer *muxer) { - return av_write_trailer(muxer->oc); -} - -extern "C" void hwcodec_free_muxer(Muxer *muxer) { - try { - if (!muxer) - return; - muxer->destroy(); - delete muxer; - muxer = NULL; - } catch (const std::exception &e) { - LOG_ERROR(std::string("free_muxer exception: ") + std::string(e.what())); - } -} \ No newline at end of file diff --git a/libs/hwcodec/cpp/mux/mux_ffi.h b/libs/hwcodec/cpp/mux/mux_ffi.h deleted file mode 100644 index 3f1b50c6..00000000 --- a/libs/hwcodec/cpp/mux/mux_ffi.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef MUX_FFI_H -#define MUX_FFI_H - -#include - -void *hwcodec_new_muxer(const char *filename, int width, int height, int is265, - int framerate); - -int hwcodec_write_video_frame(void *muxer, const uint8_t *data, int len, - int64_t pts_ms, int key); -int hwcodec_write_tail(void *muxer); - -void hwcodec_free_muxer(void *muxer); - -#endif // FFI_H \ No newline at end of file diff --git a/libs/hwcodec/cpp/nv/nv_decode.cpp b/libs/hwcodec/cpp/nv/nv_decode.cpp deleted file mode 100644 index 077ef81e..00000000 --- a/libs/hwcodec/cpp/nv/nv_decode.cpp +++ /dev/null @@ -1,693 +0,0 @@ -#define FFNV_LOG_FUNC -#define FFNV_DEBUG_LOG_FUNC - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "CUVID" -#include "log.h" - -#define NUMVERTICES 6 - -using namespace DirectX; - -namespace { - -#define succ(call) ((call) == 0) - -class CUVIDAutoUnmapper { - CudaFunctions *cudl_ = NULL; - CUgraphicsResource *pCuResource_ = NULL; - -public: - CUVIDAutoUnmapper(CudaFunctions *cudl, CUgraphicsResource *pCuResource) - : cudl_(cudl), pCuResource_(pCuResource) { - if (!succ(cudl->cuGraphicsMapResources(1, pCuResource, 0))) { - LOG_TRACE(std::string("cuGraphicsMapResources failed")); - NVDEC_THROW_ERROR("cuGraphicsMapResources failed", CUDA_ERROR_UNKNOWN); - } - } - ~CUVIDAutoUnmapper() { - if (!succ(cudl_->cuGraphicsUnmapResources(1, pCuResource_, 0))) { - LOG_TRACE(std::string("cuGraphicsUnmapResources failed")); - // NVDEC_THROW_ERROR("cuGraphicsUnmapResources failed", - // CUDA_ERROR_UNKNOWN); - } - } -}; - -class CUVIDAutoCtxPopper { - CudaFunctions *cudl_ = NULL; - -public: - CUVIDAutoCtxPopper(CudaFunctions *cudl, CUcontext cuContext) : cudl_(cudl) { - if (!succ(cudl->cuCtxPushCurrent(cuContext))) { - LOG_TRACE(std::string("cuCtxPushCurrent failed")); - NVDEC_THROW_ERROR("cuCtxPopCurrent failed", CUDA_ERROR_UNKNOWN); - } - } - ~CUVIDAutoCtxPopper() { - if (!succ(cudl_->cuCtxPopCurrent(NULL))) { - LOG_TRACE(std::string("cuCtxPopCurrent failed")); - // NVDEC_THROW_ERROR("cuCtxPopCurrent failed", CUDA_ERROR_UNKNOWN); - } - } -}; - -void load_driver(CudaFunctions **pp_cudl, CuvidFunctions **pp_cvdl) { - if (cuda_load_functions(pp_cudl, NULL) < 0) { - LOG_TRACE(std::string("cuda_load_functions failed")); - NVDEC_THROW_ERROR("cuda_load_functions failed", CUDA_ERROR_UNKNOWN); - } - if (cuvid_load_functions(pp_cvdl, NULL) < 0) { - LOG_TRACE(std::string("cuvid_load_functions failed")); - NVDEC_THROW_ERROR("cuvid_load_functions failed", CUDA_ERROR_UNKNOWN); - } -} - -void free_driver(CudaFunctions **pp_cudl, CuvidFunctions **pp_cvdl) { - if (*pp_cvdl) { - cuvid_free_functions(pp_cvdl); - *pp_cvdl = NULL; - } - if (*pp_cudl) { - cuda_free_functions(pp_cudl); - *pp_cudl = NULL; - } -} - -typedef struct _VERTEX { - DirectX::XMFLOAT3 Pos; - DirectX::XMFLOAT2 TexCoord; -} VERTEX; - -class CuvidDecoder { -public: - CudaFunctions *cudl_ = NULL; - CuvidFunctions *cvdl_ = NULL; - NvDecoder *dec_ = NULL; - CUcontext cuContext_ = NULL; - CUgraphicsResource cuResource_[2] = {NULL, NULL}; // r8, r8g8 - ComPtr textures_[2] = {NULL, NULL}; - ComPtr RTV_ = NULL; - ComPtr SRV_[2] = {NULL, NULL}; - ComPtr vertexShader_ = NULL; - ComPtr pixelShader_ = NULL; - ComPtr samplerLinear_ = NULL; - std::unique_ptr native_ = nullptr; - - void *device_; - int64_t luid_; - DataFormat dataFormat_; - - bool prepare_tried_ = false; - bool prepare_ok_ = false; - - int width_ = 0; - int height_ = 0; - CUVIDEOFORMAT last_video_format_ = {}; - -public: - CuvidDecoder(void *device, int64_t luid, DataFormat dataFormat) { - device_ = device; - luid_ = luid; - dataFormat_ = dataFormat; - ZeroMemory(&last_video_format_, sizeof(last_video_format_)); - load_driver(&cudl_, &cvdl_); - } - - ~CuvidDecoder() {} - - bool init() { - if (!succ(cudl_->cuInit(0))) { - LOG_ERROR(std::string("cuInit failed")); - return false; - } - CUdevice cuDevice = 0; - native_ = std::make_unique(); - if (!native_->Init(luid_, (ID3D11Device *)device_, 4)) { - LOG_ERROR(std::string("Failed to init native device")); - return false; - } - if (!succ(cudl_->cuD3D11GetDevice(&cuDevice, native_->adapter_.Get()))) { - LOG_ERROR(std::string("Failed to get cuDevice")); - return false; - } - - if (!succ(cudl_->cuCtxCreate(&cuContext_, 0, cuDevice))) { - LOG_ERROR(std::string("Failed to create cuContext")); - return false; - } - if (!create_nvdecoder()) { - LOG_ERROR(std::string("Failed to create nvdecoder")); - return false; - } - return true; - } - - // ref: HandlePictureDisplay - int decode(uint8_t *data, int len, DecodeCallback callback, void *obj) { - int nFrameReturned = decode_and_recreate(data, len); - if (nFrameReturned == -2) { - nFrameReturned = dec_->Decode(data, len, CUVID_PKT_ENDOFPICTURE); - } - if (nFrameReturned <= 0) { - return -1; - } - last_video_format_ = dec_->GetLatestVideoFormat(); - cudaVideoSurfaceFormat format = dec_->GetOutputFormat(); - int width = dec_->GetWidth(); - int height = dec_->GetHeight(); - if (prepare_tried_ && (width != width_ || height != height_)) { - LOG_INFO(std::string("resolution changed, (") + std::to_string(width_) + "," + - std::to_string(height_) + ") -> (" + std::to_string(width) + - "," + std::to_string(height) + ")"); - reset_prepare(); - width_ = width; - height_ = height; - } - if (!prepare()) { - LOG_ERROR(std::string("prepare failed")); - return -1; - } - bool decoded = false; - for (int i = 0; i < nFrameReturned; i++) { - uint8_t *pFrame = dec_->GetFrame(); - native_->BeginQuery(); - if (!copy_cuda_frame(pFrame)) { - LOG_ERROR(std::string("copy_cuda_frame failed")); - native_->EndQuery(); - return -1; - } - if (!native_->EnsureTexture(width, height)) { - LOG_ERROR(std::string("EnsureTexture failed")); - native_->EndQuery(); - return -1; - } - native_->next(); - if (!set_rtv(native_->GetCurrentTexture())) { - LOG_ERROR(std::string("set_rtv failed")); - native_->EndQuery(); - return -1; - } - if (!draw()) { - LOG_ERROR(std::string("draw failed")); - native_->EndQuery(); - return -1; - } - native_->EndQuery(); - if (!native_->Query()) { - LOG_ERROR(std::string("Query failed")); - } - - if (callback) - callback(native_->GetCurrentTexture(), obj); - decoded = true; - } - return decoded ? 0 : -1; - } - - void destroy() { - if (dec_) { - delete dec_; - dec_ = nullptr; - } - if (cudl_ && cuContext_) { - cudl_->cuCtxPushCurrent(cuContext_); - for (int i = 0; i < 2; i++) { - if (cuResource_[i]) { - cudl_->cuGraphicsUnregisterResource(cuResource_[i]); - cuResource_[i] = NULL; - } - } - cudl_->cuCtxPopCurrent(NULL); - cudl_->cuCtxDestroy(cuContext_); - cuContext_ = NULL; - } - free_driver(&cudl_, &cvdl_); - } - -private: - void reset_prepare() { - prepare_tried_ = false; - prepare_ok_ = false; - if (cudl_ && cuContext_) { - cudl_->cuCtxPushCurrent(cuContext_); - for (int i = 0; i < 2; i++) { - if (cuResource_[i]) - cudl_->cuGraphicsUnregisterResource(cuResource_[i]); - } - cudl_->cuCtxPopCurrent(NULL); - } - for (int i = 0; i < 2; i++) { - textures_[i].Reset(); - SRV_[i].Reset(); - } - RTV_.Reset(); - vertexShader_.Reset(); - pixelShader_.Reset(); - samplerLinear_.Reset(); - } - - bool prepare() { - if (prepare_tried_) { - return prepare_ok_; - } - prepare_tried_ = true; - - if (!set_srv()) - return false; - if (!set_view_port()) - return false; - if (!set_sample()) - return false; - if (!set_shader()) - return false; - if (!set_vertex_buffer()) - return false; - if (!register_texture()) - return false; - - prepare_ok_ = true; - return true; - } - - bool copy_cuda_frame(unsigned char *dpNv12) { - int width = dec_->GetWidth(); - int height = dec_->GetHeight(); - int chromaHeight = dec_->GetChromaHeight(); - - CUVIDAutoCtxPopper ctxPoper(cudl_, cuContext_); - - for (int i = 0; i < 2; i++) { - CUarray dstArray; - CUVIDAutoUnmapper unmapper(cudl_, &cuResource_[i]); - if (!succ(cudl_->cuGraphicsSubResourceGetMappedArray( - &dstArray, cuResource_[i], 0, 0))) - return false; - CUDA_MEMCPY2D m = {0}; - m.srcMemoryType = CU_MEMORYTYPE_DEVICE; - m.srcDevice = (CUdeviceptr)(dpNv12 + (width * height) * i); - m.srcPitch = width; // pitch - m.dstMemoryType = CU_MEMORYTYPE_ARRAY; - m.dstArray = dstArray; - m.WidthInBytes = width; - m.Height = i == 0 ? height : chromaHeight; - if (!succ(cudl_->cuMemcpy2D(&m))) - return false; - } - return true; - } - - bool draw() { - native_->context_->Draw(NUMVERTICES, 0); - native_->context_->Flush(); - - return true; - } - - // return: - // >=0: nFrameReturned - // -1: failed - // -2: recreated, please decode again - int decode_and_recreate(uint8_t *data, int len) { - try { - int nFrameReturned = dec_->Decode(data, len, CUVID_PKT_ENDOFPICTURE); - if (nFrameReturned <= 0) - return -1; - CUVIDEOFORMAT video_format = dec_->GetLatestVideoFormat(); - auto d1 = last_video_format_.display_area; - auto d2 = video_format.display_area; - // reconfigure may cause wrong display area - if (last_video_format_.coded_width != 0 && - (d1.left != d2.left || d1.right != d2.right || d1.top != d2.top || - d1.bottom != d2.bottom)) { - LOG_INFO( - std::string("recreate, display area changed from (") + std::to_string(d1.left) + - ", " + std::to_string(d1.top) + ", " + std::to_string(d1.right) + - ", " + std::to_string(d1.bottom) + ") to (" + - std::to_string(d2.left) + ", " + std::to_string(d2.top) + ", " + - std::to_string(d2.right) + ", " + std::to_string(d2.bottom) + ")"); - if (create_nvdecoder()) { - return -2; - } else { - LOG_ERROR(std::string("create_nvdecoder failed")); - } - return -1; - } else { - return nFrameReturned; - } - } catch (const std::exception &e) { - unsigned int maxWidth = dec_->GetMaxWidth(); - unsigned int maxHeight = dec_->GetMaxHeight(); - CUVIDEOFORMAT video_format = dec_->GetLatestVideoFormat(); - // https://github.com/NVIDIA/DALI/blob/4f5ee72b287cfbbe0d400734416ff37bd8027099/dali/operators/reader/loader/video/frames_decoder_gpu.cc#L212 - if (maxWidth > 0 && (video_format.coded_width > maxWidth || - video_format.coded_height > maxHeight)) { - LOG_INFO(std::string("recreate, exceed maxWidth/maxHeight: (") + - std::to_string(video_format.coded_width) + ", " + - std::to_string(video_format.coded_height) + " > (" + - std::to_string(maxWidth) + ", " + std::to_string(maxHeight) + - ")"); - if (create_nvdecoder()) { - return -2; - } else { - LOG_ERROR(std::string("create_nvdecoder failed")); - } - } else { - LOG_ERROR(std::string("Exception decode_and_recreate: ") + e.what()); - } - } - - return -1; - } - - bool set_srv() { - int width = dec_->GetWidth(); - int height = dec_->GetHeight(); - int chromaHeight = dec_->GetChromaHeight(); - LOG_TRACE(std::string("width:") + std::to_string(width) + - ", height:" + std::to_string(height) + - ", chromaHeight:" + std::to_string(chromaHeight)); - - D3D11_TEXTURE2D_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - desc.Width = width; - desc.Height = height; - desc.MipLevels = 1; - desc.ArraySize = 1; - desc.Format = DXGI_FORMAT_R8_UNORM; - desc.SampleDesc.Count = 1; - desc.SampleDesc.Quality = 0; - desc.MiscFlags = 0; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = 0; - HRB(native_->device_->CreateTexture2D( - &desc, nullptr, textures_[0].ReleaseAndGetAddressOf())); - - desc.Format = DXGI_FORMAT_R8G8_UNORM; - desc.Width = width / 2; - desc.Height = chromaHeight; - HRB(native_->device_->CreateTexture2D( - &desc, nullptr, textures_[1].ReleaseAndGetAddressOf())); - - D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc; - srvDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(textures_[0].Get(), - D3D11_SRV_DIMENSION_TEXTURE2D, - DXGI_FORMAT_R8_UNORM); - HRB(native_->device_->CreateShaderResourceView( - textures_[0].Get(), &srvDesc, SRV_[0].ReleaseAndGetAddressOf())); - - srvDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(textures_[1].Get(), - D3D11_SRV_DIMENSION_TEXTURE2D, - DXGI_FORMAT_R8G8_UNORM); - HRB(native_->device_->CreateShaderResourceView( - textures_[1].Get(), &srvDesc, SRV_[1].ReleaseAndGetAddressOf())); - - // set SRV - std::array const textureViews = { - SRV_[0].Get(), SRV_[1].Get()}; - native_->context_->PSSetShaderResources(0, textureViews.size(), - textureViews.data()); - return true; - } - - bool set_rtv(ID3D11Texture2D *texture) { - D3D11_RENDER_TARGET_VIEW_DESC rtDesc; - rtDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; - rtDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; - rtDesc.Texture2D.MipSlice = 0; - HRB(native_->device_->CreateRenderTargetView( - texture, &rtDesc, RTV_.ReleaseAndGetAddressOf())); - - const float clearColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; // clear as black - native_->context_->ClearRenderTargetView(RTV_.Get(), clearColor); - native_->context_->OMSetRenderTargets(1, RTV_.GetAddressOf(), NULL); - - return true; - } - - bool set_view_port() { - int width = dec_->GetWidth(); - int height = dec_->GetHeight(); - - D3D11_VIEWPORT vp; - vp.Width = (FLOAT)(width); - vp.Height = (FLOAT)(height); - vp.MinDepth = 0.0f; - vp.MaxDepth = 1.0f; - vp.TopLeftX = 0; - vp.TopLeftY = 0; - native_->context_->RSSetViewports(1, &vp); - - return true; - } - - bool set_sample() { - D3D11_SAMPLER_DESC sampleDesc = CD3D11_SAMPLER_DESC(CD3D11_DEFAULT()); - HRB(native_->device_->CreateSamplerState( - &sampleDesc, samplerLinear_.ReleaseAndGetAddressOf())); - native_->context_->PSSetSamplers(0, 1, samplerLinear_.GetAddressOf()); - return true; - } - - bool set_shader() { -// https://gist.github.com/RomiTT/9c05d36fe339b899793a3252297a5624 -#include "pixel_shader_601.h" -#include "vertex_shader.h" - native_->device_->CreateVertexShader( - g_VS, ARRAYSIZE(g_VS), nullptr, vertexShader_.ReleaseAndGetAddressOf()); - native_->device_->CreatePixelShader(g_PS, ARRAYSIZE(g_PS), nullptr, - pixelShader_.ReleaseAndGetAddressOf()); - - // set InputLayout - constexpr std::array Layout = {{ - {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, - D3D11_INPUT_PER_VERTEX_DATA, 0}, - {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, - D3D11_INPUT_PER_VERTEX_DATA, 0}, - }}; - ComPtr inputLayout = NULL; - HRB(native_->device_->CreateInputLayout(Layout.data(), Layout.size(), g_VS, - ARRAYSIZE(g_VS), - inputLayout.GetAddressOf())); - native_->context_->IASetInputLayout(inputLayout.Get()); - - native_->context_->VSSetShader(vertexShader_.Get(), NULL, 0); - native_->context_->PSSetShader(pixelShader_.Get(), NULL, 0); - - return true; - } - - bool set_vertex_buffer() { - UINT Stride = sizeof(VERTEX); - UINT Offset = 0; - FLOAT blendFactor[4] = {0.f, 0.f, 0.f, 0.f}; - native_->context_->OMSetBlendState(nullptr, blendFactor, 0xffffffff); - - native_->context_->IASetPrimitiveTopology( - D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - - // set VertexBuffers - VERTEX Vertices[NUMVERTICES] = { - {XMFLOAT3(-1.0f, -1.0f, 0), XMFLOAT2(0.0f, 1.0f)}, - {XMFLOAT3(-1.0f, 1.0f, 0), XMFLOAT2(0.0f, 0.0f)}, - {XMFLOAT3(1.0f, -1.0f, 0), XMFLOAT2(1.0f, 1.0f)}, - {XMFLOAT3(1.0f, -1.0f, 0), XMFLOAT2(1.0f, 1.0f)}, - {XMFLOAT3(-1.0f, 1.0f, 0), XMFLOAT2(0.0f, 0.0f)}, - {XMFLOAT3(1.0f, 1.0f, 0), XMFLOAT2(1.0f, 0.0f)}, - }; - D3D11_BUFFER_DESC BufferDesc; - RtlZeroMemory(&BufferDesc, sizeof(BufferDesc)); - BufferDesc.Usage = D3D11_USAGE_DEFAULT; - BufferDesc.ByteWidth = sizeof(VERTEX) * NUMVERTICES; - BufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - BufferDesc.CPUAccessFlags = 0; - D3D11_SUBRESOURCE_DATA InitData; - RtlZeroMemory(&InitData, sizeof(InitData)); - InitData.pSysMem = Vertices; - ComPtr VertexBuffer = nullptr; - // Create vertex buffer - HRB(native_->device_->CreateBuffer(&BufferDesc, &InitData, &VertexBuffer)); - native_->context_->IASetVertexBuffers(0, 1, VertexBuffer.GetAddressOf(), - &Stride, &Offset); - - return true; - } - - bool register_texture() { - CUVIDAutoCtxPopper ctxPoper(cudl_, cuContext_); - - bool ret = true; - for (int i = 0; i < 2; i++) { - if (!succ(cudl_->cuGraphicsD3D11RegisterResource( - &cuResource_[i], textures_[i].Get(), - CU_GRAPHICS_REGISTER_FLAGS_NONE))) { - ret = false; - break; - } - if (!succ(cudl_->cuGraphicsResourceSetMapFlags( - cuResource_[i], CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD))) { - ret = false; - break; - } - } - - return ret; - } - - bool dataFormat_to_cuCodecID(DataFormat dataFormat, cudaVideoCodec &cuda) { - switch (dataFormat) { - case H264: - cuda = cudaVideoCodec_H264; - break; - case H265: - cuda = cudaVideoCodec_HEVC; - break; - default: - return false; - } - return true; - } - - bool create_nvdecoder() { - LOG_TRACE(std::string("create nvdecoder")); - bool bUseDeviceFrame = true; - bool bLowLatency = true; - bool bDeviceFramePitched = false; // width=pitch - cudaVideoCodec cudaCodecID; - if (!dataFormat_to_cuCodecID(dataFormat_, cudaCodecID)) { - return false; - } - if (dec_) { - delete dec_; - dec_ = nullptr; - } - dec_ = new NvDecoder(cudl_, cvdl_, cuContext_, bUseDeviceFrame, cudaCodecID, - bLowLatency, bDeviceFramePitched); - return true; - } -}; - -} // namespace - -extern "C" { - -int nv_decode_driver_support() { - try { - CudaFunctions *cudl = NULL; - CuvidFunctions *cvdl = NULL; - load_driver(&cudl, &cvdl); - free_driver(&cudl, &cvdl); - return 0; - } catch (const std::exception &e) { - } - return -1; -} - -int nv_destroy_decoder(void *decoder) { - try { - CuvidDecoder *p = (CuvidDecoder *)decoder; - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("destroy failed: ") + e.what()); - } - return -1; -} - -void *nv_new_decoder(void *device, int64_t luid, - DataFormat dataFormat) { - CuvidDecoder *p = NULL; - try { - p = new CuvidDecoder(device, luid, dataFormat); - if (!p) { - goto _exit; - } - if (p->init()) - return p; - } catch (const std::exception &ex) { - LOG_ERROR(std::string("destroy failed: ") + ex.what()); - goto _exit; - } - -_exit: - if (p) { - p->destroy(); - delete p; - p = NULL; - } - return NULL; -} - -int nv_decode(void *decoder, uint8_t *data, int len, DecodeCallback callback, - void *obj) { - try { - CuvidDecoder *p = (CuvidDecoder *)decoder; - if (p->decode(data, len, callback, obj) == 0 ) { - return HWCODEC_SUCCESS; - } - } catch (const std::exception &e) { - LOG_ERROR(std::string("decode failed: ") + e.what()); - } - return HWCODEC_ERR_COMMON; -} - -int nv_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, - int32_t *outDescNum, DataFormat dataFormat, - uint8_t *data, int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_NVIDIA)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - CuvidDecoder *p = (CuvidDecoder *)nv_new_decoder( - nullptr, currentLuid, dataFormat); - if (!p) - continue; - auto start = util::now(); - bool succ = nv_decode(p, data, length, nullptr, nullptr) == 0; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_NV; - count += 1; - } - p->destroy(); - delete p; - p = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("test failed: ") + e.what()); - } - return -1; -} -} // extern "C" diff --git a/libs/hwcodec/cpp/nv/nv_encode.cpp b/libs/hwcodec/cpp/nv/nv_encode.cpp deleted file mode 100644 index 0887d0ba..00000000 --- a/libs/hwcodec/cpp/nv/nv_encode.cpp +++ /dev/null @@ -1,464 +0,0 @@ -#define FFNV_LOG_FUNC -#define FFNV_DEBUG_LOG_FUNC - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -using Microsoft::WRL::ComPtr; - -#include "callback.h" -#include "common.h" -#include "system.h" -#include "util.h" - -#define LOG_MODULE "NVENC" -#include "log.h" - -simplelogger::Logger *logger = - simplelogger::LoggerFactory::CreateConsoleLogger(); - -namespace { - -// #define CONFIG_NV_OPTIMUS_FOR_DEV - -#define succ(call) ((call) == 0) - -void load_driver(CudaFunctions **pp_cuda_dl, NvencFunctions **pp_nvenc_dl) { - if (cuda_load_functions(pp_cuda_dl, NULL) < 0) { - LOG_TRACE(std::string("cuda_load_functions failed")); - NVENC_THROW_ERROR("cuda_load_functions failed", NV_ENC_ERR_GENERIC); - } - if (nvenc_load_functions(pp_nvenc_dl, NULL) < 0) { - LOG_TRACE(std::string("nvenc_load_functions failed")); - NVENC_THROW_ERROR("nvenc_load_functions failed", NV_ENC_ERR_GENERIC); - } -} - -void free_driver(CudaFunctions **pp_cuda_dl, NvencFunctions **pp_nvenc_dl) { - if (*pp_nvenc_dl) { - nvenc_free_functions(pp_nvenc_dl); - *pp_nvenc_dl = NULL; - } - if (*pp_cuda_dl) { - cuda_free_functions(pp_cuda_dl); - *pp_cuda_dl = NULL; - } -} - -class NvencEncoder { -public: - std::unique_ptr native_ = nullptr; - NvEncoderD3D11 *pEnc_ = nullptr; - CudaFunctions *cuda_dl_ = nullptr; - NvencFunctions *nvenc_dl_ = nullptr; - - void *handle_ = nullptr; - int64_t luid_; - DataFormat dataFormat_; - int32_t width_; - int32_t height_; - int32_t kbs_; - int32_t framerate_; - int32_t gop_; - bool full_range_ = false; - bool bt709_ = false; - NV_ENC_CONFIG encodeConfig_ = {0}; - - NvencEncoder(void *handle, int64_t luid, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, int32_t framerate, - int32_t gop) { - handle_ = handle; - luid_ = luid; - dataFormat_ = dataFormat; - width_ = width; - height_ = height; - kbs_ = kbs; - framerate_ = framerate; - gop_ = gop; - - load_driver(&cuda_dl_, &nvenc_dl_); - } - - ~NvencEncoder() {} - - bool init() { - GUID guidCodec; - switch (dataFormat_) { - case H264: - guidCodec = NV_ENC_CODEC_H264_GUID; - break; - case H265: - guidCodec = NV_ENC_CODEC_HEVC_GUID; - break; - default: - LOG_ERROR(std::string("dataFormat not support, dataFormat: ") + - std::to_string(dataFormat_)); - return false; - } - if (!succ(cuda_dl_->cuInit(0))) { - LOG_TRACE(std::string("cuInit failed")); - return false; - } - - native_ = std::make_unique(); -#ifdef CONFIG_NV_OPTIMUS_FOR_DEV - if (!native_->Init(luid_, nullptr)) - return false; -#else - if (!native_->Init(luid_, (ID3D11Device *)handle_)) { - LOG_ERROR(std::string("d3d device init failed")); - return false; - } -#endif - - CUdevice cuDevice = 0; - if (!succ(cuda_dl_->cuD3D11GetDevice(&cuDevice, native_->adapter_.Get()))) { - LOG_ERROR(std::string("Failed to get cuDevice")); - return false; - } - - int nExtraOutputDelay = 0; - pEnc_ = new NvEncoderD3D11(cuda_dl_, nvenc_dl_, native_->device_.Get(), - width_, height_, NV_ENC_BUFFER_FORMAT_ARGB, - nExtraOutputDelay, false, false); // no delay - NV_ENC_INITIALIZE_PARAMS initializeParams = {0}; - ZeroMemory(&initializeParams, sizeof(initializeParams)); - ZeroMemory(&encodeConfig_, sizeof(encodeConfig_)); - initializeParams.encodeConfig = &encodeConfig_; - pEnc_->CreateDefaultEncoderParams( - &initializeParams, guidCodec, - NV_ENC_PRESET_P3_GUID /*NV_ENC_PRESET_LOW_LATENCY_HP_GUID*/, - NV_ENC_TUNING_INFO_LOW_LATENCY); - - // no delay - initializeParams.encodeConfig->frameIntervalP = 1; - initializeParams.encodeConfig->rcParams.lookaheadDepth = 0; - - // bitrate - initializeParams.encodeConfig->rcParams.averageBitRate = kbs_ * 1000; - // framerate - initializeParams.frameRateNum = framerate_; - initializeParams.frameRateDen = 1; - // gop - initializeParams.encodeConfig->gopLength = - (gop_ > 0 && gop_ < MAX_GOP) ? gop_ : NVENC_INFINITE_GOPLENGTH; - // rc method - initializeParams.encodeConfig->rcParams.rateControlMode = - NV_ENC_PARAMS_RC_CBR; - // color - if (dataFormat_ == H264) { - setup_h264(initializeParams.encodeConfig); - } else { - setup_hevc(initializeParams.encodeConfig); - } - - pEnc_->CreateEncoder(&initializeParams); - return true; - } - - int encode(void *texture, EncodeCallback callback, void *obj, int64_t ms) { - bool encoded = false; - std::vector vPacket; - const NvEncInputFrame *pEncInput = pEnc_->GetNextInputFrame(); - - // TODO: sdk can ensure the inputPtr's width, height same as width_, - // height_, does capture's frame can ensure width height same with width_, - // height_ ? - ID3D11Texture2D *pBgraTextyure = - reinterpret_cast(pEncInput->inputPtr); -#ifdef CONFIG_NV_OPTIMUS_FOR_DEV - copy_texture(texture, pBgraTextyure); -#else - native_->context_->CopyResource( - pBgraTextyure, reinterpret_cast(texture)); -#endif - - NV_ENC_PIC_PARAMS picParams = {0}; - picParams.inputTimeStamp = ms; - pEnc_->EncodeFrame(vPacket); - for (NvPacket &packet : vPacket) { - int32_t key = (packet.pictureType == NV_ENC_PIC_TYPE_IDR || - packet.pictureType == NV_ENC_PIC_TYPE_I) - ? 1 - : 0; - if (packet.data.size() > 0) { - if (callback) - callback(packet.data.data(), packet.data.size(), key, obj, ms); - encoded = true; - } - } - return encoded ? 0 : -1; - } - - void destroy() { - if (pEnc_) { - pEnc_->DestroyEncoder(); - delete pEnc_; - pEnc_ = nullptr; - } - free_driver(&cuda_dl_, &nvenc_dl_); - } - - void setup_h264(NV_ENC_CONFIG *encodeConfig) { - NV_ENC_CODEC_CONFIG *encodeCodecConfig = &encodeConfig->encodeCodecConfig; - NV_ENC_CONFIG_H264 *h264 = &encodeCodecConfig->h264Config; - NV_ENC_CONFIG_H264_VUI_PARAMETERS *vui = &h264->h264VUIParameters; - vui->videoFullRangeFlag = !!full_range_; - vui->colourMatrix = bt709_ ? NV_ENC_VUI_MATRIX_COEFFS_BT709 : NV_ENC_VUI_MATRIX_COEFFS_SMPTE170M; - vui->colourPrimaries = bt709_ ? NV_ENC_VUI_COLOR_PRIMARIES_BT709 : NV_ENC_VUI_COLOR_PRIMARIES_SMPTE170M; - vui->transferCharacteristics = - bt709_ ? NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT709 : NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE170M; - vui->colourDescriptionPresentFlag = 1; - vui->videoSignalTypePresentFlag = 1; - - h264->sliceMode = 3; - h264->sliceModeData = 1; - h264->repeatSPSPPS = 1; - // Specifies the chroma format. Should be set to 1 for yuv420 input, 3 for - // yuv444 input - h264->chromaFormatIDC = 1; - h264->level = NV_ENC_LEVEL_AUTOSELECT; - - encodeConfig->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID; - } - - void setup_hevc(NV_ENC_CONFIG *encodeConfig) { - NV_ENC_CODEC_CONFIG *encodeCodecConfig = &encodeConfig->encodeCodecConfig; - NV_ENC_CONFIG_HEVC *hevc = &encodeCodecConfig->hevcConfig; - NV_ENC_CONFIG_HEVC_VUI_PARAMETERS *vui = &hevc->hevcVUIParameters; - vui->videoFullRangeFlag = !!full_range_; - vui->colourMatrix = bt709_ ? NV_ENC_VUI_MATRIX_COEFFS_BT709 : NV_ENC_VUI_MATRIX_COEFFS_SMPTE170M; - vui->colourPrimaries = bt709_ ? NV_ENC_VUI_COLOR_PRIMARIES_BT709 : NV_ENC_VUI_COLOR_PRIMARIES_SMPTE170M; - vui->transferCharacteristics = - bt709_ ? NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT709 : NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE170M; - vui->colourDescriptionPresentFlag = 1; - vui->videoSignalTypePresentFlag = 1; - - hevc->sliceMode = 3; - hevc->sliceModeData = 1; - hevc->repeatSPSPPS = 1; - // Specifies the chroma format. Should be set to 1 for yuv420 input, 3 for - // yuv444 input - hevc->chromaFormatIDC = 1; - hevc->level = NV_ENC_LEVEL_AUTOSELECT; - hevc->outputPictureTimingSEI = 1; - hevc->tier = NV_ENC_TIER_HEVC_MAIN; - - encodeConfig->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; - } - -private: -#ifdef CONFIG_NV_OPTIMUS_FOR_DEV - int copy_texture(void *src, void *dst) { - ComPtr src_device = (ID3D11Device *)handle_; - ComPtr src_deviceContext; - src_device->GetImmediateContext(src_deviceContext.ReleaseAndGetAddressOf()); - ComPtr src_tex = (ID3D11Texture2D *)src; - ComPtr dst_tex = (ID3D11Texture2D *)dst; - HRESULT hr; - - D3D11_TEXTURE2D_DESC desc; - ZeroMemory(&desc, sizeof(desc)); - src_tex->GetDesc(&desc); - desc.Usage = D3D11_USAGE_STAGING; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - desc.BindFlags = 0; - desc.MiscFlags = 0; - ComPtr staging_tex; - src_device->CreateTexture2D(&desc, NULL, - staging_tex.ReleaseAndGetAddressOf()); - src_deviceContext->CopyResource(staging_tex.Get(), src_tex.Get()); - - D3D11_MAPPED_SUBRESOURCE map; - src_deviceContext->Map(staging_tex.Get(), 0, D3D11_MAP_READ, 0, &map); - std::unique_ptr buffer( - new uint8_t[desc.Width * desc.Height * 4]); - memcpy(buffer.get(), map.pData, desc.Width * desc.Height * 4); - src_deviceContext->Unmap(staging_tex.Get(), 0); - - D3D11_BOX Box; - Box.left = 0; - Box.right = desc.Width; - Box.top = 0; - Box.bottom = desc.Height; - Box.front = 0; - Box.back = 1; - native_->context_->UpdateSubresource(dst_tex.Get(), 0, &Box, buffer.get(), - desc.Width * 4, - desc.Width * desc.Height * 4); - - return 0; - } -#endif -}; - -} // namespace - -extern "C" { - -int nv_encode_driver_support() { - try { - CudaFunctions *cuda_dl = NULL; - NvencFunctions *nvenc_dl = NULL; - load_driver(&cuda_dl, &nvenc_dl); - free_driver(&cuda_dl, &nvenc_dl); - return 0; - } catch (const std::exception &e) { - LOG_TRACE(std::string("driver not support, ") + e.what()); - } - return -1; -} - -int nv_destroy_encoder(void *encoder) { - try { - NvencEncoder *e = (NvencEncoder *)encoder; - if (e) { - e->destroy(); - delete e; - e = NULL; - } - return 0; - } catch (const std::exception &e) { - LOG_ERROR(std::string("destroy failed: ") + e.what()); - } - return -1; -} - -void *nv_new_encoder(void *handle, int64_t luid, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, - int32_t framerate, int32_t gop) { - NvencEncoder *e = NULL; - try { - e = new NvencEncoder(handle, luid, dataFormat, width, height, kbs, - framerate, gop); - if (!e->init()) { - goto _exit; - } - return e; - } catch (const std::exception &ex) { - LOG_ERROR(std::string("new failed: ") + ex.what()); - goto _exit; - } - -_exit: - if (e) { - e->destroy(); - delete e; - e = NULL; - } - return NULL; -} - -int nv_encode(void *encoder, void *texture, EncodeCallback callback, void *obj, - int64_t ms) { - try { - NvencEncoder *e = (NvencEncoder *)encoder; - return e->encode(texture, callback, obj, ms); - } catch (const std::exception &e) { - LOG_ERROR(std::string("encode failed: ") + e.what()); - } - return -1; -} - -// ref: Reconfigure API - -#define RECONFIGURE_HEAD \ - NvencEncoder *enc = (NvencEncoder *)e; \ - NV_ENC_CONFIG sEncodeConfig = {0}; \ - NV_ENC_INITIALIZE_PARAMS sInitializeParams = {0}; \ - sInitializeParams.encodeConfig = &sEncodeConfig; \ - enc->pEnc_->GetInitializeParams(&sInitializeParams); \ - NV_ENC_RECONFIGURE_PARAMS params = {0}; \ - params.version = NV_ENC_RECONFIGURE_PARAMS_VER; \ - params.reInitEncodeParams = sInitializeParams; - -#define RECONFIGURE_TAIL \ - if (enc->pEnc_->Reconfigure(¶ms)) { \ - return 0; \ - } - -int nv_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - DataFormat dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, - int32_t gop, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount) { - try { - Adapters adapters; - if (!adapters.Init(ADAPTER_VENDOR_NVIDIA)) - return -1; - int count = 0; - for (auto &adapter : adapters.adapters_) { - int64_t currentLuid = LUID(adapter.get()->desc1_); - if (util::skip_test(excludedLuids, excludeFormats, excludeCount, currentLuid, dataFormat)) { - continue; - } - - NvencEncoder *e = (NvencEncoder *)nv_new_encoder( - (void *)adapter.get()->device_.Get(), currentLuid, - dataFormat, width, height, kbs, framerate, gop); - if (!e) - continue; - if (e->native_->EnsureTexture(e->width_, e->height_)) { - e->native_->next(); - int32_t key_obj = 0; - auto start = util::now(); - bool succ = nv_encode(e, e->native_->GetCurrentTexture(), util_encode::vram_encode_test_callback, &key_obj, - 0) == 0 && key_obj == 1; - int64_t elapsed = util::elapsed_ms(start); - if (succ && elapsed < TEST_TIMEOUT_MS) { - outLuids[count] = currentLuid; - outVendors[count] = VENDOR_NV; - count += 1; - } - } - e->destroy(); - delete e; - e = nullptr; - if (count >= maxDescNum) - break; - } - *outDescNum = count; - return 0; - - } catch (const std::exception &e) { - LOG_ERROR(std::string("test failed: ") + e.what()); - } - return -1; -} - -int nv_set_bitrate(void *e, int32_t kbs) { - try { - RECONFIGURE_HEAD - params.reInitEncodeParams.encodeConfig->rcParams.averageBitRate = - kbs * 1000; - RECONFIGURE_TAIL - } catch (const std::exception &e) { - LOG_ERROR(std::string("set bitrate to ") + std::to_string(kbs) + - "k failed: " + e.what()); - } - return -1; -} - -int nv_set_framerate(void *e, int32_t framerate) { - try { - RECONFIGURE_HEAD - params.reInitEncodeParams.frameRateNum = framerate; - params.reInitEncodeParams.frameRateDen = 1; - RECONFIGURE_TAIL - } catch (const std::exception &e) { - LOG_ERROR(std::string("set framerate failed: ") + e.what()); - } - return -1; -} -} // extern "C" diff --git a/libs/hwcodec/cpp/nv/nv_ffi.h b/libs/hwcodec/cpp/nv/nv_ffi.h deleted file mode 100644 index 06a82fca..00000000 --- a/libs/hwcodec/cpp/nv/nv_ffi.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef NV_FFI_H -#define NV_FFI_H - -#include "../common/callback.h" -#include - -int nv_encode_driver_support(); - -int nv_decode_driver_support(); - -void *nv_new_encoder(void *handle, int64_t luid, - int32_t dataFormat, int32_t width, int32_t height, - int32_t bitrate, int32_t framerate, int32_t gop); - -int nv_encode(void *encoder, void *tex, EncodeCallback callback, void *obj, - int64_t ms); - -int nv_destroy_encoder(void *encoder); - -void *nv_new_decoder(void *device, int64_t luid, int32_t codecID); - -int nv_decode(void *decoder, uint8_t *data, int len, DecodeCallback callback, - void *obj); - -int nv_destroy_decoder(void *decoder); - -int nv_test_encode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, int32_t width, - int32_t height, int32_t kbs, int32_t framerate, int32_t gop, - const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int nv_test_decode(int64_t *outLuids, int32_t *outVendors, int32_t maxDescNum, int32_t *outDescNum, - int32_t dataFormat, uint8_t *data, - int32_t length, const int64_t *excludedLuids, const int32_t *excludeFormats, int32_t excludeCount); - -int nv_set_bitrate(void *encoder, int32_t kbs); - -int nv_set_framerate(void *encoder, int32_t framerate); - -#endif // NV_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/dev/capture/Cargo.toml b/libs/hwcodec/dev/capture/Cargo.toml deleted file mode 100644 index b92ca0c3..00000000 --- a/libs/hwcodec/dev/capture/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "capture" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -log = "0.4" - -[build-dependencies] -cc = "1.0" -bindgen = "0.59" \ No newline at end of file diff --git a/libs/hwcodec/dev/capture/build.rs b/libs/hwcodec/dev/capture/build.rs deleted file mode 100644 index 7d6b423d..00000000 --- a/libs/hwcodec/dev/capture/build.rs +++ /dev/null @@ -1,51 +0,0 @@ -use cc::Build; -use std::{ - env, - path::{Path, PathBuf}, -}; - -fn main() { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir - .parent() - .unwrap() - .parent() - .unwrap() - .join("externals"); - println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed={}", externals_dir.display()); - let ffi_header = "src/dxgi_ffi.h"; - bindgen::builder() - .header(ffi_header) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("capture_ffi.rs")) - .unwrap(); - - let mut builder = Build::new(); - - // system - #[cfg(windows)] - ["d3d11", "dxgi"].map(|lib| println!("cargo:rustc-link-lib={}", lib)); - #[cfg(target_os = "linux")] - println!("cargo:rustc-link-lib=stdc++"); - - #[cfg(windows)] - { - // dxgi - let dxgi_path = externals_dir.join("nvEncDXGIOutputDuplicationSample"); - builder.include(&dxgi_path); - for f in vec!["DDAImpl.cpp"] { - builder.file(format!("{}/{}", dxgi_path.display(), f)); - } - builder.file("src/dxgi.cpp"); - } - - // crate - builder - .cpp(false) - .static_crt(true) - .warnings(false) - .compile("capture"); -} diff --git a/libs/hwcodec/dev/capture/src/dxgi.cpp b/libs/hwcodec/dev/capture/src/dxgi.cpp deleted file mode 100644 index 01bf8ff0..00000000 --- a/libs/hwcodec/dev/capture/src/dxgi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include - -extern "C" void *dxgi_new_capturer(int64_t luid) { - DemoApplication *d = new DemoApplication(luid); - HRESULT hr = d->Init(); - if (FAILED(hr)) { - delete d; - d = NULL; - return NULL; - } - - return d; -} - -extern "C" void *dxgi_device(void *capturer) { - DemoApplication *d = (DemoApplication *)capturer; - return d->Device(); -} - -extern "C" int dxgi_width(const void *capturer) { - DemoApplication *d = (DemoApplication *)capturer; - return d->width(); -} - -extern "C" int dxgi_height(const void *capturer) { - DemoApplication *d = (DemoApplication *)capturer; - return d->height(); -} - -extern "C" void *dxgi_capture(void *capturer, int wait_ms) { - DemoApplication *d = (DemoApplication *)capturer; - void *texture = d->Capture(wait_ms); - return texture; -} - -extern "C" void destroy_dxgi_capturer(void *capturer) { - DemoApplication *d = (DemoApplication *)capturer; - if (d) - delete d; -} \ No newline at end of file diff --git a/libs/hwcodec/dev/capture/src/dxgi.rs b/libs/hwcodec/dev/capture/src/dxgi.rs deleted file mode 100644 index 7ef2344f..00000000 --- a/libs/hwcodec/dev/capture/src/dxgi.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use std::os::raw::c_void; - -include!(concat!(env!("OUT_DIR"), "/capture_ffi.rs")); - -pub struct Capturer { - inner: *mut c_void, -} - -impl Capturer { - pub fn new(luid: i64) -> Result { - let inner = unsafe { dxgi_new_capturer(luid) }; - if inner.is_null() { - Err(()) - } else { - Ok(Self { inner }) - } - } - - pub unsafe fn device(&mut self) -> *mut c_void { - dxgi_device(self.inner) - } - - pub unsafe fn width(&self) -> i32 { - dxgi_width(self.inner) - } - - pub unsafe fn height(&self) -> i32 { - dxgi_height(self.inner) - } - - pub unsafe fn capture(&mut self, wait_ms: i32) -> *mut c_void { - dxgi_capture(self.inner, wait_ms) - } - - pub unsafe fn drop(&mut self) { - destroy_dxgi_capturer(self.inner); - } -} diff --git a/libs/hwcodec/dev/capture/src/dxgi_ffi.h b/libs/hwcodec/dev/capture/src/dxgi_ffi.h deleted file mode 100644 index 396bffea..00000000 --- a/libs/hwcodec/dev/capture/src/dxgi_ffi.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef FFI_H -#define FFI_H - -#include - -void *dxgi_new_capturer(int64_t luid); -void *dxgi_device(void *capturer); -int dxgi_width(const void *capturer); -int dxgi_height(const void *capturer); -void *dxgi_capture(void *capturer, int wait_ms); -void destroy_dxgi_capturer(void *capturer); - -#endif // FFI_H \ No newline at end of file diff --git a/libs/hwcodec/dev/capture/src/lib.rs b/libs/hwcodec/dev/capture/src/lib.rs deleted file mode 100644 index 5a839a88..00000000 --- a/libs/hwcodec/dev/capture/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(windows)] -pub mod dxgi; diff --git a/libs/hwcodec/dev/render/Cargo.toml b/libs/hwcodec/dev/render/Cargo.toml deleted file mode 100644 index 328e0cd6..00000000 --- a/libs/hwcodec/dev/render/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "render" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -log = "0.4" - -[build-dependencies] -cc = "1.0" -bindgen = "0.59" diff --git a/libs/hwcodec/dev/render/build.rs b/libs/hwcodec/dev/render/build.rs deleted file mode 100644 index 699be518..00000000 --- a/libs/hwcodec/dev/render/build.rs +++ /dev/null @@ -1,50 +0,0 @@ -use cc::Build; -use std::{ - env, - path::{Path, PathBuf}, -}; - -fn main() { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let externals_dir = manifest_dir - .parent() - .unwrap() - .parent() - .unwrap() - .join("externals"); - println!("cargo:rerun-if-changed=src"); - println!("cargo:rerun-if-changed={}", externals_dir.display()); - let ffi_header = "src/render_ffi.h"; - bindgen::builder() - .header(ffi_header) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("render_ffi.rs")) - .unwrap(); - - let mut builder = Build::new(); - - // system - #[cfg(windows)] - ["d3d11", "dxgi", "User32"].map(|lib| println!("cargo:rustc-link-lib={}", lib)); - #[cfg(target_os = "linux")] - println!("cargo:rustc-link-lib=stdc++"); - - #[cfg(windows)] - { - let sdl_dir = externals_dir.join("SDL"); - builder.include(sdl_dir.join("include")); - let sdl_lib_path = sdl_dir.join("lib").join("x64"); - builder.file(manifest_dir.join("src").join("dxgi_sdl.cpp")); - println!("cargo:rustc-link-search=native={}", sdl_lib_path.display()); - println!("cargo:rustc-link-lib=SDL2"); - } - - // crate - builder - .cpp(false) - .static_crt(true) - .warnings(false) - .compile("render"); -} diff --git a/libs/hwcodec/dev/render/res/frag.cso b/libs/hwcodec/dev/render/res/frag.cso deleted file mode 100644 index 0a186a9a..00000000 Binary files a/libs/hwcodec/dev/render/res/frag.cso and /dev/null differ diff --git a/libs/hwcodec/dev/render/res/vert.cso b/libs/hwcodec/dev/render/res/vert.cso deleted file mode 100644 index c10c86d6..00000000 Binary files a/libs/hwcodec/dev/render/res/vert.cso and /dev/null differ diff --git a/libs/hwcodec/dev/render/src/dxgi_sdl.cpp b/libs/hwcodec/dev/render/src/dxgi_sdl.cpp deleted file mode 100644 index 561a1985..00000000 --- a/libs/hwcodec/dev/render/src/dxgi_sdl.cpp +++ /dev/null @@ -1,581 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using Microsoft::WRL::ComPtr; - -#define SAFE_RELEASE(p) \ - { \ - if ((p)) { \ - (p)->Release(); \ - (p) = nullptr; \ - } \ - } -#define LUID(desc) \ - (((int64_t)desc.AdapterLuid.HighPart << 32) | desc.AdapterLuid.LowPart) -#define HRB(f) MS_CHECK(f, return false;) -#define HRI(f) MS_CHECK(f, return -1;) -#define HRP(f) MS_CHECK(f, return nullptr;) -#define MS_CHECK(f, ...) \ - do { \ - HRESULT __ms_hr__ = (f); \ - if (FAILED(__ms_hr__)) { \ - std::clog \ - << #f " ERROR@" << __LINE__ << __FUNCTION__ << ": (" << std::hex \ - << __ms_hr__ << std::dec << ") " \ - << std::error_code(__ms_hr__, std::system_category()).message() \ - << std::endl \ - << std::flush; \ - __VA_ARGS__ \ - } \ - } while (false) -#define MS_THROW(f, ...) MS_CHECK(f, throw std::runtime_error(#f);) - -#define LUID(desc) \ - (((int64_t)desc.AdapterLuid.HighPart << 32) | desc.AdapterLuid.LowPart) - -#ifndef CSO_DIR -#define CSO_DIR "dev/render/res" -#endif - -struct AdatperOutputs { - IDXGIAdapter1 *adapter; - DXGI_ADAPTER_DESC1 desc; - AdatperOutputs() : adapter(nullptr){}; - AdatperOutputs(AdatperOutputs &&src) noexcept { - adapter = src.adapter; - src.adapter = nullptr; - desc = src.desc; - } - AdatperOutputs(const AdatperOutputs &src) { - adapter = src.adapter; - adapter->AddRef(); - desc = src.desc; - } - ~AdatperOutputs() { - if (adapter) - adapter->Release(); - } -}; - -bool get_first_adapter_output(IDXGIFactory2 *factory2, - IDXGIAdapter1 **adapter_out, - IDXGIOutput1 **output_out, int64_t luid) { - UINT num_adapters = 0; - AdatperOutputs curent_adapter; - IDXGIAdapter1 *selected_adapter = nullptr; - IDXGIOutput1 *selected_output = nullptr; - HRESULT hr = S_OK; - bool found = false; - while (factory2->EnumAdapters1(num_adapters, &curent_adapter.adapter) != - DXGI_ERROR_NOT_FOUND) { - ++num_adapters; - DXGI_ADAPTER_DESC1 desc = DXGI_ADAPTER_DESC1(); - curent_adapter.adapter->GetDesc1(&desc); - if (LUID(desc) != luid) { - continue; - } - selected_adapter = curent_adapter.adapter; - selected_adapter->AddRef(); - IDXGIOutput *output; - if (curent_adapter.adapter->EnumOutputs(0, &output) != - DXGI_ERROR_NOT_FOUND) { - IDXGIOutput1 *temp; - hr = output->QueryInterface(IID_PPV_ARGS(&temp)); - if (SUCCEEDED(hr)) { - selected_output = temp; - } - } - found = true; - break; - } - *adapter_out = selected_adapter; - *output_out = selected_output; - return found; -} - -class dx_device_context { -public: - dx_device_context(int64_t luid) { - // This is what matters (the 1) - // Only a guid of fatory2 will not work - HRESULT hr = CreateDXGIFactory1(IID_PPV_ARGS(&factory2)); - if (FAILED(hr)) - exit(hr); - if (!get_first_adapter_output(factory2, &adapter1, &output1, luid)) { - std::cout << "no render adapter found" << std::endl; - exit(-1); - } - D3D_FEATURE_LEVEL levels[]{D3D_FEATURE_LEVEL_11_0}; - hr = D3D11CreateDevice( - adapter1, D3D_DRIVER_TYPE_UNKNOWN, NULL, - D3D11_CREATE_DEVICE_VIDEO_SUPPORT | D3D11_CREATE_DEVICE_BGRA_SUPPORT, - levels, 1, D3D11_SDK_VERSION, &device, NULL, &context); - if (FAILED(hr)) - exit(hr); - hr = device->QueryInterface(IID_PPV_ARGS(&video_device)); - if (FAILED(hr)) - exit(hr); - hr = context->QueryInterface(IID_PPV_ARGS(&video_context)); - if (FAILED(hr)) - exit(hr); - hr = context->QueryInterface(IID_PPV_ARGS(&hmt)); - if (FAILED(hr)) - exit(hr); - // This is required for MFXVideoCORE_SetHandle - hr = hmt->SetMultithreadProtected(TRUE); - if (FAILED(hr)) - exit(hr); - } - ~dx_device_context() { - if (hmt) - hmt->Release(); - if (video_context) - video_context->Release(); - if (video_device) - video_device->Release(); - if (context) - context->Release(); - if (device) - device->Release(); - if (output1) - output1->Release(); - if (adapter1) - adapter1->Release(); - if (factory2) - factory2->Release(); - } - IDXGIFactory2 *factory2 = nullptr; - IDXGIAdapter1 *adapter1 = nullptr; - IDXGIOutput1 *output1 = nullptr; - ID3D11Device *device = nullptr; - ID3D11DeviceContext *context = nullptr; - ID3D11VideoDevice *video_device = nullptr; - ID3D11VideoContext *video_context = nullptr; - ID3D10Multithread *hmt = nullptr; - HMODULE debug_mod = nullptr; -}; - -class simplerenderer { -public: - simplerenderer(HWND in_window, dx_device_context &dev_ctx) - : ctx(dev_ctx), window(in_window) { - ctx.factory2->MakeWindowAssociation(in_window, 0); - sampler_view = nullptr; - D3D11_SAMPLER_DESC desc = CD3D11_SAMPLER_DESC(CD3D11_DEFAULT()); - HRESULT hr = ctx.device->CreateSamplerState(&desc, &sampler_interp); - if (FAILED(hr)) - exit(hr); - init_fbo0(window); - init_vbo(); - init_shaders(); - } - ~simplerenderer() { - // render_thread.join(); - if (sampler_interp) - sampler_interp->Release(); - if (sampler_view) - sampler_view->Release(); - if (vbo) - vbo->Release(); - if (vao) - vao->Release(); - if (frag) - frag->Release(); - if (vert) - vert->Release(); - if (fbo0) - fbo0->Release(); - if (fbo0rbo) - fbo0rbo->Release(); - if (swapchain) - swapchain->Release(); - } - -private: - void init_fbo0(HWND window) { - DXGI_SWAP_CHAIN_DESC1 swp_desc{ - 1280, 720, DXGI_FORMAT_B8G8R8A8_UNORM, FALSE, DXGI_SAMPLE_DESC{1, 0}, - DXGI_USAGE_RENDER_TARGET_OUTPUT, 3, DXGI_SCALING_STRETCH, - // DXGI_SWAP_EFFECT_DISCARD, - DXGI_SWAP_EFFECT_FLIP_DISCARD, DXGI_ALPHA_MODE_UNSPECIFIED, 0}; - HRESULT hr = ctx.factory2->CreateSwapChainForHwnd( - ctx.device, window, &swp_desc, NULL, NULL, &swapchain); - if (FAILED(hr)) - exit(hr); - fbo0 = nullptr; - fbo0rbo = nullptr; - RECT rect; - GetClientRect(window, &rect); - hr = swapchain->GetBuffer(0, IID_PPV_ARGS(&fbo0rbo)); - if (FAILED(hr)) - exit(hr); - hr = ctx.device->CreateRenderTargetView(fbo0rbo, nullptr, &fbo0); - if (FAILED(hr)) - exit(hr); - D3D11_VIEWPORT VP{}; - VP.Width = static_cast(rect.right - rect.left); - VP.Height = static_cast(rect.bottom - rect.top); - VP.MinDepth = 0.0f; - VP.MaxDepth = 1.0f; - VP.TopLeftX = 0; - VP.TopLeftY = 0; - ctx.context->RSSetViewports(1, &VP); - } - void init_vbo() { - struct vertex { - DirectX::XMFLOAT3 Pos; - DirectX::XMFLOAT2 TexCoord; - }; - vertex points[4]{{DirectX::XMFLOAT3(-1, 1, 0), DirectX::XMFLOAT2(0, 0)}, - {DirectX::XMFLOAT3(1, 1, 0), DirectX::XMFLOAT2(1, 0)}, - {DirectX::XMFLOAT3(-1, -1, 0), DirectX::XMFLOAT2(0, 1)}, - {DirectX::XMFLOAT3(1, -1, 0), DirectX::XMFLOAT2(1, 1)}}; - D3D11_BUFFER_DESC vbo_desc{}; - vbo_desc.ByteWidth = sizeof(vertex) * 4; - vbo_desc.Usage = D3D11_USAGE_IMMUTABLE; - vbo_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - D3D11_SUBRESOURCE_DATA initial_data{}; - initial_data.pSysMem = points; - HRESULT hr = ctx.device->CreateBuffer(&vbo_desc, &initial_data, &vbo); - if (FAILED(hr)) - exit(hr); - vbo_stride = sizeof(vertex); - vbo_offset = 0; - } - void init_shaders() { - uint8_t *shader_bytecode = nullptr; - size_t bytecode_len = 0; - // read file - FILE *shader_file = fopen(CSO_DIR "/frag.cso", "rb"); - fseek(shader_file, 0, SEEK_END); - bytecode_len = ftell(shader_file); - fseek(shader_file, 0, SEEK_SET); - shader_bytecode = (uint8_t *)malloc(bytecode_len); - fread(shader_bytecode, 1, bytecode_len, shader_file); - HRESULT hr = ctx.device->CreatePixelShader(shader_bytecode, bytecode_len, - nullptr, &frag); - if (FAILED(hr)) - exit(hr); - // free(shader_bytecode); - shader_file = freopen(CSO_DIR "/vert.cso", "rb", shader_file); - fseek(shader_file, 0, SEEK_END); - bytecode_len = ftell(shader_file); - fseek(shader_file, 0, SEEK_SET); - shader_bytecode = (uint8_t *)malloc(bytecode_len); - fread(shader_bytecode, 1, bytecode_len, shader_file); - // fclose(shader_file); - hr = ctx.device->CreateVertexShader(shader_bytecode, bytecode_len, nullptr, - &vert); - if (FAILED(hr)) - exit(hr); - D3D11_INPUT_ELEMENT_DESC input_desc[]{ - // name, vertex attrib index, format, unpack alignment, instance - // releated - {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, - D3D11_INPUT_PER_VERTEX_DATA, 0}, - {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, - D3D11_INPUT_PER_VERTEX_DATA, 0}, - }; - hr = ctx.device->CreateInputLayout(input_desc, 2, shader_bytecode, - bytecode_len, &vao); - if (FAILED(hr)) - exit(hr); - // free(shader_bytecode); - ctx.context->VSSetShader(vert, nullptr, 0); - ctx.context->IASetInputLayout(vao); - ctx.context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); - ctx.context->IASetVertexBuffers(0, 1, &vbo, &vbo_stride, &vbo_offset); - ctx.context->PSSetShader(frag, nullptr, 0); - ctx.context->PSSetSamplers(0, 1, &sampler_interp); - } - - void bind_texture(ID3D11Texture2D *texture) { - D3D11_TEXTURE2D_DESC desc; - texture->GetDesc(&desc); - D3D11_SHADER_RESOURCE_VIEW_DESC shader_resource_desc{}; - shader_resource_desc.Format = desc.Format; - ; - shader_resource_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; - shader_resource_desc.Texture2D = {0, 1}; - if (sampler_view) - sampler_view->Release(); - HRESULT hr = ctx.device->CreateShaderResourceView( - texture, &shader_resource_desc, &sampler_view); - if (FAILED(hr)) - exit(hr); - ctx.context->PSSetShaderResources(0, 1, &sampler_view); - } - void resize_swapchain(uint32_t width, uint32_t height) { - if (fbo0) - fbo0->Release(); - if (fbo0rbo) - fbo0rbo->Release(); - HRESULT hr = - swapchain->ResizeBuffers(0, width, height, DXGI_FORMAT_UNKNOWN, 0); - hr = swapchain->GetBuffer(0, IID_PPV_ARGS(&fbo0rbo)); - if (FAILED(hr)) - exit(hr); - hr = ctx.device->CreateRenderTargetView(fbo0rbo, nullptr, &fbo0); - if (FAILED(hr)) - exit(hr); - D3D11_VIEWPORT VP{}; - VP.Width = static_cast(width); - VP.Height = static_cast(height); - VP.MinDepth = 0.0f; - VP.MaxDepth = 1.0f; - VP.TopLeftX = 0; - VP.TopLeftY = 0; - ctx.context->RSSetViewports(1, &VP); - } - std::chrono::high_resolution_clock::time_point last_fps_time = - std::chrono::high_resolution_clock::now(); - -public: - void render_frame(ID3D11Texture2D *texture) { - if (!occluded) { - bind_texture(texture); - if (need_resize.load(std::memory_order_acquire)) { - atomic_packed_32x2 temp; - temp.packed.store(client_size.packed.load(std::memory_order_relaxed), - std::memory_order_relaxed); - resize_swapchain(temp.separate.width, temp.separate.height); - } - ctx.context->OMSetRenderTargets(1, &fbo0, nullptr); - ctx.context->Draw(4, 0); - HRESULT hr = swapchain->Present(0, 0); - if (FAILED(hr)) - exit(hr); - if (hr == DXGI_STATUS_OCCLUDED) { - occluded = true; - } - frame_count++; - std::chrono::high_resolution_clock::time_point current = - std::chrono::high_resolution_clock::now(); - if (current - last_fps_time >= std::chrono::seconds(1)) { - int fps = frame_count - last_frame_count; - last_frame_count = frame_count; - last_fps_time = current; - std::cout << fps << " Hz" << std::endl; - } - } else { - HRESULT hr = swapchain->Present(0, DXGI_PRESENT_TEST); - if (FAILED(hr)) - exit(hr); - if (!DXGI_STATUS_OCCLUDED) { - occluded = false; - } - } - } - void set_size(uint32_t width, uint32_t height) { - atomic_packed_32x2 temp; - temp.separate.width = width; - temp.separate.height = height; - client_size.packed.store(temp.packed.load(std::memory_order_relaxed), - std::memory_order_relaxed); - } - HWND window; - dx_device_context &ctx; - IDXGISwapChain1 *swapchain; - ID3D11Texture2D *fbo0rbo; - ID3D11RenderTargetView *fbo0; - ID3D11VertexShader *vert; - ID3D11PixelShader *frag; - ID3D11InputLayout *vao; - ID3D11Buffer *vbo; - ID3D11ShaderResourceView *sampler_view; - ID3D11SamplerState *sampler_interp; - UINT vbo_stride; - UINT vbo_offset; - std::thread render_thread; - std::atomic_bool running; - std::atomic_bool need_resize; - bool occluded = false; - int frame_count = 0; - int last_frame_count = 0; - struct atomic_packed_32x2 { - union { - struct detail { - uint32_t width; - uint32_t height; - } separate; - std::atomic_uint64_t packed; - }; - atomic_packed_32x2(); - } client_size; -}; - -simplerenderer::atomic_packed_32x2::atomic_packed_32x2(void) {} - -class Render { -public: - Render(int64_t luid, bool inputSharedHandle); - int Init(); - int RenderTexture(ID3D11Texture2D *); - std::unique_ptr message_thread; - std::unique_ptr renderer; - bool running = false; - std::unique_ptr ctx; - // dx_device_context ctx; - int64_t luid; - bool inputSharedHandle; -}; - -Render::Render(int64_t luid, bool inputSharedHandle) { - // ctx.reset(new dx_device_context()); - this->luid = luid; - this->inputSharedHandle = inputSharedHandle; - ctx = std::make_unique(luid); -}; - -static void run(Render *self) { - SetProcessDPIAware(); - SDL_Init(SDL_INIT_VIDEO); - SDL_Window *window = SDL_CreateWindow( - "test window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1280, - 720, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); - SDL_SysWMinfo info{}; - SDL_GetWindowWMInfo(window, &info); - { - self->renderer.reset(new simplerenderer(info.info.win.window, *self->ctx)); - MONITORINFOEX monitor_info{}; - monitor_info.cbSize = sizeof(monitor_info); - DXGI_OUTPUT_DESC screen_desc; - if (self->ctx->output1) { - HRESULT hr = self->ctx->output1->GetDesc(&screen_desc); - GetMonitorInfo(screen_desc.Monitor, &monitor_info); - } - self->running = true; - bool maximized = false; - while (self->running) { - SDL_Event event; - SDL_WaitEvent(&event); - switch (event.type) { - case SDL_WINDOWEVENT: - switch (event.window.event) { - case SDL_WINDOWEVENT_CLOSE: - // capturer.Stop(); - self->running = false; - break; - case SDL_WINDOWEVENT_MAXIMIZED: - if (self->ctx->output1) { - int border_l, border_r, border_t, border_b; - SDL_GetWindowBordersSize(window, &border_t, &border_l, &border_b, - &border_r); - int max_w = monitor_info.rcWork.right - monitor_info.rcWork.left; - int max_h = - monitor_info.rcWork.bottom - monitor_info.rcWork.top - border_t; - SDL_SetWindowSize(window, max_w, max_h); - SDL_SetWindowPosition(window, monitor_info.rcWork.left, border_t); - maximized = true; - } - break; - case SDL_WINDOWEVENT_RESTORED: - maximized = false; - break; - case SDL_WINDOWEVENT_RESIZED: - if (self->ctx->output1) { - int max_w, max_h; - SDL_GetWindowMaximumSize(window, &max_w, &max_h); - double aspect = double(screen_desc.DesktopCoordinates.right - - screen_desc.DesktopCoordinates.left) / - (screen_desc.DesktopCoordinates.bottom - - screen_desc.DesktopCoordinates.top); - int temp = event.window.data1 * event.window.data2; - int width = sqrt(temp * aspect) + 0.5; - int height = sqrt(temp / aspect) + 0.5; - int pos_x, pos_y; - SDL_GetWindowPosition(window, &pos_x, &pos_y); - int ori_w, ori_h; - SDL_GetWindowSize(window, &ori_w, &ori_h); - SDL_SetWindowPosition(window, pos_x + ((ori_w - width) / 2), - pos_y + ((ori_h - height) / 2)); - SDL_SetWindowSize(window, width, height); - } - break; - case SDL_WINDOWEVENT_SIZE_CHANGED: - self->renderer->set_size(event.window.data1, event.window.data2); - break; - default: - break; - } - break; - default: - break; - } - if (event.type == SDL_WINDOWEVENT) { - } - } - } - - SDL_DestroyWindow(window); - SDL_Quit(); - exit(0); -} - -int Render::Init() { - message_thread.reset(new std::thread(run, this)); - return 0; -} - -int Render::RenderTexture(ID3D11Texture2D *texture) { - renderer->render_frame(texture); - return 0; -} - -extern "C" void *CreateDXGIRender(int64_t luid, bool inputSharedHandle) { - Render *p = new Render(luid, inputSharedHandle); - p->Init(); - return p; -} - -extern "C" int DXGIRenderTexture(void *render, HANDLE handle) { - Render *self = (Render *)render; - if (!self->running) - return 0; - ComPtr texture = nullptr; - if (self->inputSharedHandle) { - ComPtr resource = nullptr; - ComPtr tex_ = nullptr; - MS_THROW(self->ctx->device->OpenSharedResource( - handle, __uuidof(ID3D11Texture2D), - (void **)resource.ReleaseAndGetAddressOf())); - MS_THROW(resource.As(&tex_)); - texture = tex_.Get(); - } else { - texture = (ID3D11Texture2D *)handle; - } - self->RenderTexture(texture.Get()); - - return 0; -} - -extern "C" void DestroyDXGIRender(void *render) { - Render *self = (Render *)render; - self->running = false; - if (self->message_thread) - self->message_thread->join(); -} - -extern "C" void *DXGIDevice(void *render) { - Render *self = (Render *)render; - return self->ctx->device; -} diff --git a/libs/hwcodec/dev/render/src/lib.rs b/libs/hwcodec/dev/render/src/lib.rs deleted file mode 100644 index 81b8e84f..00000000 --- a/libs/hwcodec/dev/render/src/lib.rs +++ /dev/null @@ -1,39 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use std::os::raw::c_void; - -include!(concat!(env!("OUT_DIR"), "/render_ffi.rs")); - -pub struct Render { - inner: *mut c_void, -} - -impl Render { - pub fn new(luid: i64, input_shared_handle: bool) -> Result { - let inner = unsafe { CreateDXGIRender(luid, input_shared_handle) }; - if inner.is_null() { - Err(()) - } else { - Ok(Self { inner }) - } - } - - pub unsafe fn render(&mut self, tex: *mut c_void) -> Result<(), i32> { - let result = DXGIRenderTexture(self.inner, tex); - if result == 0 { - Ok(()) - } else { - Err(result) - } - } - - pub unsafe fn device(&mut self) -> *mut c_void { - DXGIDevice(self.inner) - } - - pub unsafe fn drop(&mut self) { - DestroyDXGIRender(self.inner); - } -} diff --git a/libs/hwcodec/dev/render/src/render_ffi.h b/libs/hwcodec/dev/render/src/render_ffi.h deleted file mode 100644 index c9285d8b..00000000 --- a/libs/hwcodec/dev/render/src/render_ffi.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef RENDER_FFI_H -#define RENDER_FFI_H - -#include - -void *CreateDXGIRender(long long luid, bool inputSharedHandle); -int DXGIRenderTexture(void *render, void *tex); -void DestroyDXGIRender(void *render); -void *DXGIDevice(void *render); - -#endif // RENDER_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/dev/tool/Cargo.toml b/libs/hwcodec/dev/tool/Cargo.toml deleted file mode 100644 index 64a24b7b..00000000 --- a/libs/hwcodec/dev/tool/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "tool" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -log = "0.4" - -[build-dependencies] -cc = "1.0" -bindgen = "0.59" \ No newline at end of file diff --git a/libs/hwcodec/dev/tool/build.rs b/libs/hwcodec/dev/tool/build.rs deleted file mode 100644 index 32126891..00000000 --- a/libs/hwcodec/dev/tool/build.rs +++ /dev/null @@ -1,39 +0,0 @@ -use cc::Build; -use std::{ - env, - path::{Path, PathBuf}, -}; - -fn main() { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - println!("cargo:rerun-if-changed=src"); - let ffi_header = "src/tool_ffi.h"; - bindgen::builder() - .header(ffi_header) - .rustified_enum("*") - .generate() - .unwrap() - .write_to_file(Path::new(&env::var_os("OUT_DIR").unwrap()).join("tool_ffi.rs")) - .unwrap(); - - let mut builder = Build::new(); - - builder.include( - manifest_dir - .parent() - .unwrap() - .parent() - .unwrap() - .join("cpp") - .join("common"), - ); - - builder.file("src/tool.cpp"); - - // crate - builder - .cpp(false) - .static_crt(true) - .warnings(false) - .compile("tool"); -} diff --git a/libs/hwcodec/dev/tool/src/lib.rs b/libs/hwcodec/dev/tool/src/lib.rs deleted file mode 100644 index d6cd2094..00000000 --- a/libs/hwcodec/dev/tool/src/lib.rs +++ /dev/null @@ -1,44 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use std::os::raw::c_void; - -include!(concat!(env!("OUT_DIR"), "/tool_ffi.rs")); - -pub struct Tool { - inner: *mut c_void, -} - -impl Tool { - pub fn new(luid: i64) -> Result { - let inner = unsafe { tool_new(luid) }; - if inner.is_null() { - Err(()) - } else { - Ok(Self { inner }) - } - } - - pub fn device(&mut self) -> *mut c_void { - unsafe { tool_device(self.inner) } - } - - pub fn get_texture(&mut self, width: i32, height: i32) -> *mut c_void { - unsafe { tool_get_texture(self.inner, width, height) } - } - - pub fn get_texture_size(&mut self, texture: *mut c_void) -> (i32, i32) { - let mut width = 0; - let mut height = 0; - unsafe { tool_get_texture_size(self.inner, texture, &mut width, &mut height) } - (width, height) - } -} - -impl Drop for Tool { - fn drop(&mut self) { - unsafe { tool_destroy(self.inner) } - self.inner = std::ptr::null_mut(); - } -} diff --git a/libs/hwcodec/dev/tool/src/tool.cpp b/libs/hwcodec/dev/tool/src/tool.cpp deleted file mode 100644 index 963955d9..00000000 --- a/libs/hwcodec/dev/tool/src/tool.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include - -#include "common.h" -#include "system.h" - -namespace { - -class Tool { -public: - std::unique_ptr native_; - bool initialized_ = false; - -public: - Tool(int64_t luid) { - native_ = std::make_unique(); - initialized_ = native_->Init(luid, nullptr, 1); - } - - ID3D11Texture2D *GetTexture(int width, int height) { - native_->EnsureTexture(width, height); - return native_->GetCurrentTexture(); - } - - void getSize(ID3D11Texture2D *texture, int *width, int *height) { - D3D11_TEXTURE2D_DESC desc; - texture->GetDesc(&desc); - *width = desc.Width; - *height = desc.Height; - } -}; -} // namespace - -extern "C" { - -void *tool_new(int64_t luid) { - Tool *t = new Tool(luid); - if (t && !t->initialized_) { - delete t; - return nullptr; - } - return t; -} - -void *tool_device(void *tool) { - Tool *t = (Tool *)tool; - return t->native_->device_.Get(); -} - -void *tool_get_texture(void *tool, int width, int height) { - Tool *t = (Tool *)tool; - return t->GetTexture(width, height); -} - -void tool_get_texture_size(void *tool, void *texture, int *width, int *height) { - Tool *t = (Tool *)tool; - t->getSize((ID3D11Texture2D *)texture, width, height); -} - -void tool_destroy(void *tool) { - Tool *t = (Tool *)tool; - if (t) { - delete t; - t = nullptr; - } -} - -} // extern "C" \ No newline at end of file diff --git a/libs/hwcodec/dev/tool/src/tool_ffi.h b/libs/hwcodec/dev/tool/src/tool_ffi.h deleted file mode 100644 index 4fe10d7a..00000000 --- a/libs/hwcodec/dev/tool/src/tool_ffi.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef TOOL_FFI_H -#define TOOL_FFI_H - -#include - -void *tool_new(int64_t luid); -void *tool_device(void *tool); -void *tool_get_texture(void *tool, int width, int height); -void tool_get_texture_size(void *tool, void *texture, int *width, int *height); -void tool_destroy(void *tool); - -#endif // TOOL_FFI_H \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/AMFTest/AMFTest.sln b/libs/hwcodec/dev/vs/AMFTest/AMFTest.sln deleted file mode 100644 index b3c0dd04..00000000 --- a/libs/hwcodec/dev/vs/AMFTest/AMFTest.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33627.172 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AMFTest", "AMFTest.vcxproj", "{59599E6A-52F7-44DD-9EC5-487342FF33F8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x64.ActiveCfg = Debug|x64 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x64.Build.0 = Debug|x64 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x86.ActiveCfg = Debug|Win32 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x86.Build.0 = Debug|Win32 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x64.ActiveCfg = Release|x64 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x64.Build.0 = Release|x64 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x86.ActiveCfg = Release|Win32 - {59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E1168B32-184A-4268-AC43-21E66A82F076} - EndGlobalSection -EndGlobal diff --git a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj b/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj deleted file mode 100644 index 51502ae2..00000000 --- a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {59599e6a-52f7-44dd-9ec5-487342ff33f8} - AMFTest - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CSO_DIR="../../render/res";%(PreprocessorDefinitions) - true - ..\..\externals\AMF_v1.4.29\amf;..\..\externals\AMF_v1.4.29\amf\public\common;..\..\common\src;..\..\common\src\platform\win;..\..\externals\nvEncDXGIOutputDuplicationSample;..\..\codec\src;..\..\externals\SDL\include;%(AdditionalIncludeDirectories) - - - Console - true - ..\..\externals\SDL\lib\x64;%(AdditionalLibraryDirectories) - SDL2.lib;dxgi.lib;d3d11.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.filters b/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.filters deleted file mode 100644 index deb85d3b..00000000 --- a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.filters +++ /dev/null @@ -1,83 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {a09eabb2-ceac-4062-b19e-244b29176c2b} - - - {8adb5a7a-3fba-4330-9a43-dc4251f2ff2f} - - - {2bc8fd1a-5082-40fb-a6b5-ac8c3b84d450} - - - {6edc9023-4c96-4474-b544-20059b2e32ac} - - - {ccee2176-d5f2-46b3-b138-538ac9bd7d13} - - - {8a1b8e43-9bdb-4e28-98d9-854c8e8bf107} - - - {a65898d7-8992-40d0-9141-7b4f10415e1f} - - - - - source - - - source\externals\AMF_v1.4.29 - - - source\externals\AMF_v1.4.29 - - - source\externals\AMF_v1.4.29 - - - source\externals\AMF_v1.4.29 - - - source\externals\AMF_v1.4.29 - - - source\externals\nvEncDXGIOutputDuplicationSample - - - source\externals\nvEncDXGIOutputDuplicationSample - - - source\common - - - source\capture - - - source\render - - - source\codec - - - source\codec - - - source\codec - - - source\codec - - - source\codec - - - source\common - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.user b/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/AMFTest/main.cpp b/libs/hwcodec/dev/vs/AMFTest/main.cpp deleted file mode 100644 index f36435f0..00000000 --- a/libs/hwcodec/dev/vs/AMFTest/main.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include -#include -#include -#include -#include - -extern "C" { -void *dxgi_new_capturer(int64_t luid); -void *dxgi_device(void *self); -int dxgi_width(const void *self); -int dxgi_height(const void *self); -void *dxgi_capture(void *self, int wait_ms); -void destroy_dxgi_capturer(void *self); -void *amf_new_encoder(void *hdl, int64_t luid, API api, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, - int32_t framerate, int32_t gop); -int amf_encode(void *e, void *tex, EncodeCallback callback, void *obj); -int amf_destroy_encoder(void *e); -void *amf_new_decoder(void *device, int64_t luid, int32_t api, - int32_t dataFormat, bool outputSharedHandle); -int amf_decode(void *decoder, uint8_t *data, int32_t length, - DecodeCallback callback, void *obj); -int amf_destroy_decoder(void *decoder); -void *CreateDXGIRender(long long luid, bool inputSharedHandle); -int DXGIRenderTexture(void *render, HANDLE shared_handle); -void DestroyDXGIRender(void *render); -void *DXGIDevice(void *render); -} - -static const uint8_t *encode_data; -static int32_t encode_len; -static void *decode_shared_handle; - -extern "C" static void encode_callback(const uint8_t *data, int32_t len, - int32_t key, const void *obj) { - encode_data = data; - encode_len = len; - std::cerr << "encode len" << len << std::endl; -} - -extern "C" static void decode_callback(void *shared_handle, const void *obj) { - decode_shared_handle = shared_handle; -} - -extern "C" void log_gpucodec(int level, const char *message) { - std::cout << message << std::endl; -} - -int main() { - Adapters adapters; - adapters.Init(ADAPTER_VENDOR_AMD); - if (adapters.adapters_.size() == 0) { - std::cout << "no amd adapter" << std::endl; - return -1; - } - int64_t luid = LUID(adapters.adapters_[0].get()->desc1_); - DataFormat dataFormat = H264; - void *dup = dxgi_new_capturer(luid); - if (!dup) { - std::cerr << "create duplicator failed" << std::endl; - return -1; - } - int width = dxgi_width(dup); - int height = dxgi_height(dup); - std::cout << "width: " << width << " height: " << height << std::endl; - void *device = dxgi_device(dup); - void *encoder = amf_new_encoder(device, luid, API_DX11, dataFormat, width, - height, 4000, 30, 0xFFFF); - if (!encoder) { - std::cerr << "create encoder failed" << std::endl; - return -1; - } - void *render = CreateDXGIRender(luid, false); - if (!render) { - std::cerr << "create render failed" << std::endl; - return -1; - } - - void *decoder = - amf_new_decoder(DXGIDevice(render), luid, API_DX11, dataFormat, false); - if (!decoder) { - std::cerr << "create decoder failed" << std::endl; - return -1; - } - - while (true) { - void *texture = dxgi_capture(dup, 100); - if (!texture) { - std::cerr << "texture is NULL" << std::endl; - continue; - } - if (0 != amf_encode(encoder, texture, encode_callback, NULL)) { - std::cerr << "encode failed" << std::endl; - continue; - } - if (0 != amf_decode(decoder, (uint8_t *)encode_data, encode_len, - decode_callback, NULL)) { - std::cerr << "decode failed" << std::endl; - continue; - } - if (0 != DXGIRenderTexture(render, decode_shared_handle)) { - std::cerr << "render failed" << std::endl; - continue; - } - } - - // no release temporarily -} \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/MFXTest/MFXTest.sln b/libs/hwcodec/dev/vs/MFXTest/MFXTest.sln deleted file mode 100644 index ce84587a..00000000 --- a/libs/hwcodec/dev/vs/MFXTest/MFXTest.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33627.172 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MFXTest", "MFXTest.vcxproj", "{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x64.ActiveCfg = Debug|x64 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x64.Build.0 = Debug|x64 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x86.ActiveCfg = Debug|Win32 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x86.Build.0 = Debug|Win32 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x64.ActiveCfg = Release|x64 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x64.Build.0 = Release|x64 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x86.ActiveCfg = Release|Win32 - {1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0B559C12-4403-4530-9A4E-7F4DF6235164} - EndGlobalSection -EndGlobal diff --git a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj b/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj deleted file mode 100644 index 44a9e90d..00000000 --- a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {1fbdacb6-9142-40da-9b50-5f591f1dd0ad} - MFXTest - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CSO_DIR="../../render/res";MFX_D3D11_SUPPORT;NOMINMAX=1;MFX_DEPRECATED_OFF;%(PreprocessorDefinitions) - true - D:\rustdesk\gpucodec\externals\libvpl_v2023.4.0\tools\legacy\media_sdk_compatibility_headers;..\..\..\externals\libvpl_v2023.4.0\libvpl;..\..\..\externals\libvpl_v2023.4.0\api;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\include;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\include\vm;..\..\..\externals\nvEncDXGIOutputDuplicationSample;..\..\..\native\common;..\..\..\native\gpucodec;..\..\..\externals\SDL\include;%(AdditionalIncludeDirectories) - - - Console - true - ..\..\..\externals\SDL\lib\x64;%(AdditionalLibraryDirectories) - SDL2.lib;dxgi.lib;d3d11.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.filters b/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.filters deleted file mode 100644 index 683da152..00000000 --- a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.filters +++ /dev/null @@ -1,172 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {bd78eb0e-0894-4f11-a2f5-2cc02731bc52} - - - {dd2d68d6-6559-413b-948b-f718b34cde0a} - - - {fd52358a-9b99-43b4-b717-f3a77580a52b} - - - {bdbd71f9-8ed4-4bdd-a8c3-612f5858504d} - - - {2089080f-479d-4d89-8cf5-7ac8e52b11d1} - - - {3514d21d-4a74-44b9-b21b-bea909cda0b2} - - - {ad9c7b01-cd0a-40a2-afe6-f81133ac0e15} - - - {ad00df31-d9af-432b-b452-b3ab9c2b381c} - - - {b5498eaa-1ff8-4c2b-b5c3-7c71a0a2efcc} - - - {bbca452b-a73f-4d37-a393-627c0db2617c} - - - {cb497035-08af-4b38-9abd-e4616861d366} - - - {85b55a79-fab7-428c-bc6c-fdf0a58b4704} - - - {a3824aee-0800-467f-964b-61a76000e160} - - - - - Source Files - - - Source Files\capture - - - Source Files\render - - - Source Files\common - - - Source Files\common - - - Source Files\codec - - - Source Files\codec - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\windows - - - Source Files\external\vpl\libvpl\src\mfx_config_interface - - - Source Files\external\vpl\libvpl\src\mfx_config_interface - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\libvpl\src - - - Source Files\external\vpl\sample_common - - - Source Files\external\vpl\sample_common - - - Source Files\external\vpl\sample_common - - - Source Files\external\vpl\sample_common - - - Source Files\external\vpl\sample_common - - - Source Files\external\vpl\sample_common\vm - - - Source Files\external\vpl\sample_common\vm - - - Source Files\external\vpl\sample_common\vm - - - Source Files\external\vpl\sample_common\vm - - - Source Files\external\nvEncDXGIOutputDuplicationSample - - - Source Files\codec - - - Source Files\codec - - - Source Files\external\vpl\sample_common - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.user b/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/MFXTest/main.cpp b/libs/hwcodec/dev/vs/MFXTest/main.cpp deleted file mode 100644 index 26fcd203..00000000 --- a/libs/hwcodec/dev/vs/MFXTest/main.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include -#include -#include -#include -#include -#include - -extern "C" { -void *dxgi_new_capturer(int64_t luid); -void *dxgi_device(void *self); -int dxgi_width(const void *self); -int dxgi_height(const void *self); -void *dxgi_capture(void *self, int wait_ms); -void destroy_dxgi_capturer(void *self); - -void *vpl_new_encoder(void *hdl, int64_t luid, API api, DataFormat dataFormat, - int32_t width, int32_t height, int32_t kbs, - int32_t framerate, int32_t gop); -int vpl_encode(void *e, void *tex, EncodeCallback callback, void *obj); -int vpl_destroy_encoder(void *e); - -void *vpl_new_decoder(void *device, int64_t luid, int32_t api, - int32_t dataFormat, bool outputSharedHandle); -int vpl_decode(void *decoder, uint8_t *data, int32_t length, - DecodeCallback callback, void *obj); -int vpl_destroy_decoder(void *decoder); - -void *CreateDXGIRender(long long luid, bool inputSharedHandle); -int DXGIRenderTexture(void *render, HANDLE shared_handle); -void DestroyDXGIRender(void *render); -void *DXGIDevice(void *render); -} - -static const uint8_t *encode_data; -static int32_t encode_len; -static void *decode_shared_handle; - -extern "C" static void encode_callback(const uint8_t *data, int32_t len, - int32_t key, const void *obj) { - encode_data = data; - encode_len = len; -} - -extern "C" static void decode_callback(void *shared_handle, const void *obj) { - decode_shared_handle = shared_handle; -} - -extern "C" void log_gpucodec(int level, const char *message) { - std::cout << message << std::endl; -} -int main() { - Adapters adapters; - adapters.Init(ADAPTER_VENDOR_INTEL); - if (adapters.adapters_.size() == 0) { - std::cout << "no intel adapter" << std::endl; - return -1; - } - int64_t luid = LUID(adapters.adapters_[0].get()->desc1_); - DataFormat dataFormat = H264; - void *dup = dxgi_new_capturer(luid); - if (!dup) { - std::cerr << "create duplicator failed" << std::endl; - return -1; - } - int width = dxgi_width(dup); - int height = dxgi_height(dup); - std::cout << "width: " << width << " height: " << height << std::endl; - void *device = dxgi_device(dup); - void *encoder = vpl_new_encoder(device, luid, API_DX11, dataFormat, width, - height, 4000, 30, 0xFFFF); - if (!encoder) { - std::cerr << "create encoder failed" << std::endl; - return -1; - } - - void *render = CreateDXGIRender(luid, false); - if (!render) { - std::cerr << "create render failed" << std::endl; - return -1; - } - - void *decoder = - vpl_new_decoder(DXGIDevice(render), luid, API_DX11, dataFormat, false); - if (!decoder) { - std::cerr << "create decoder failed" << std::endl; - return -1; - } - - while (true) { - void *texture = dxgi_capture(dup, 100); - if (!texture) { - std::cerr << "texture is NULL" << std::endl; - continue; - } - if (0 != vpl_encode(encoder, texture, encode_callback, NULL)) { - std::cerr << "encode failed" << std::endl; - continue; - } - if (0 != vpl_decode(decoder, (uint8_t *)encode_data, encode_len, - decode_callback, NULL)) { - std::cerr << "decode failed" << std::endl; - continue; - } - if (0 != DXGIRenderTexture(render, decode_shared_handle)) { - std::cerr << "render failed" << std::endl; - continue; - } - } - - // no release temporarily -} \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.sln b/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.sln deleted file mode 100644 index 72f3bfcc..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33627.172 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShaderCompileTool", "ShaderCompileTool.vcxproj", "{AB626EFE-F38C-4587-B79C-29FC898FBC96}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x64.ActiveCfg = Debug|x64 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x64.Build.0 = Debug|x64 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x86.ActiveCfg = Debug|Win32 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x86.Build.0 = Debug|Win32 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x64.ActiveCfg = Release|x64 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x64.Build.0 = Release|x64 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x86.ActiveCfg = Release|Win32 - {AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9A483A95-1588-48EF-A2C9-2B4731AFCAB2} - EndGlobalSection -EndGlobal diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj b/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj deleted file mode 100644 index 8501814c..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {ab626efe-f38c-4587-b79c-29fc898fbc96} - ShaderCompileTool - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - VS - false - Vertex - %(Filename).h - - - - - PS - false - Pixel - %(Filename).h - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.filters b/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.filters deleted file mode 100644 index b1c956c9..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.user b/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/nv_pixel_shader_601.hlsl b/libs/hwcodec/dev/vs/ShaderCompileTool/nv_pixel_shader_601.hlsl deleted file mode 100644 index bd0b532b..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/nv_pixel_shader_601.hlsl +++ /dev/null @@ -1,20 +0,0 @@ -Texture2D g_txFrame0 : register(t0); -Texture2D g_txFrame1 : register(t1); -SamplerState g_Sam : register(s0); - -struct PS_INPUT -{ - float4 Pos : SV_POSITION; - float2 Tex : TEXCOORD0; -}; -float4 PS(PS_INPUT input) : SV_TARGET{ - float y = g_txFrame0.Sample(g_Sam, input.Tex).r; - y = 1.164383561643836 * (y - 0.0625); - float2 uv = g_txFrame1.Sample(g_Sam, input.Tex).rg - float2(0.5f, 0.5f); - float u = uv.x; - float v = uv.y; - float r = saturate(y + 1.596026785714286 * v); - float g = saturate(y - 0.812967647237771 * v - 0.391762290094914 * u); - float b = saturate(y + 2.017232142857142 * u); - return float4(r, g, b, 1.0f); -} \ No newline at end of file diff --git a/libs/hwcodec/dev/vs/ShaderCompileTool/nv_vertex_shader.hlsl b/libs/hwcodec/dev/vs/ShaderCompileTool/nv_vertex_shader.hlsl deleted file mode 100644 index db5aa1b8..00000000 --- a/libs/hwcodec/dev/vs/ShaderCompileTool/nv_vertex_shader.hlsl +++ /dev/null @@ -1,15 +0,0 @@ -struct VS_INPUT -{ - float4 Pos : POSITION; - float2 Tex : TEXCOORD; -}; - -struct VS_OUTPUT -{ - float4 Pos : SV_POSITION; - float2 Tex : TEXCOORD; -}; -VS_OUTPUT VS(VS_INPUT input) -{ - return input; -} \ No newline at end of file diff --git a/libs/hwcodec/examples/align.rs b/libs/hwcodec/examples/align.rs deleted file mode 100644 index 11ddb6df..00000000 --- a/libs/hwcodec/examples/align.rs +++ /dev/null @@ -1,214 +0,0 @@ -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -#[cfg(feature = "vram")] -use hwcodec::{ - common::MAX_GOP, - vram::{DynamicContext, FeatureContext}, -}; -use hwcodec::{ - common::{DataFormat, Quality::*, RateControl::*}, - ffmpeg::AVPixelFormat::*, - ffmpeg_ram::{ - decode::{DecodeContext, Decoder}, - encode::{EncodeContext, Encoder}, - ffmpeg_linesize_offset_length, CodecInfo, - }, -}; -#[cfg(feature = "vram")] -use tool::Tool; - -fn main() { - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); - let max_align = 16; - setup_ram(max_align); - #[cfg(feature = "vram")] - setup_vram(max_align); -} - -fn setup_ram(max_align: i32) { - let encoders = Encoder::available_encoders( - EncodeContext { - name: String::from(""), - mc_name: None, - width: 1920, - height: 1080, - pixfmt: AV_PIX_FMT_NV12, - align: 0, - fps: 30, - gop: 60, - rc: RC_CBR, - quality: Quality_Default, - kbs: 0, - q: -1, - thread_count: 1, - }, - None, - ); - let decoders = Decoder::available_decoders(); - let h264_encoders = encoders - .iter() - .filter(|info| info.name.contains("h264")) - .cloned() - .collect::>(); - let h265_encoders = encoders - .iter() - .filter(|info| info.name.contains("hevc")) - .cloned() - .collect::>(); - let h264_decoders = decoders - .iter() - .filter(|info| info.format == DataFormat::H264) - .cloned() - .collect::>(); - let h265_decoders = decoders - .iter() - .filter(|info| info.format == DataFormat::H265) - .cloned() - .collect::>(); - - let start_width = 1920; - let start_height = 1080; - let step = 2; - - for width in (start_width..=(start_width + max_align)).step_by(step) { - for height in (start_height..=(start_height + max_align)).step_by(step) { - for encode_info in &h264_encoders { - test_ram(width, height, encode_info.clone(), h264_decoders[0].clone()); - } - for decode_info in &h264_decoders { - test_ram(width, height, h264_encoders[0].clone(), decode_info.clone()); - } - for encode_info in &h265_encoders { - test_ram(width, height, encode_info.clone(), h265_decoders[0].clone()); - } - for decode_info in &h265_decoders { - test_ram(width, height, h265_encoders[0].clone(), decode_info.clone()); - } - } - } -} - -fn test_ram(width: i32, height: i32, encode_info: CodecInfo, decode_info: CodecInfo) { - println!( - "Test {}x{}: {} -> {}", - width, height, encode_info.name, decode_info.name - ); - let encode_ctx = EncodeContext { - name: encode_info.name.clone(), - mc_name: None, - width, - height, - pixfmt: AV_PIX_FMT_NV12, - align: 0, - kbs: 0, - fps: 30, - gop: 60, - quality: Quality_Default, - rc: RC_CBR, - thread_count: 1, - q: -1, - }; - let decode_ctx = DecodeContext { - name: decode_info.name.clone(), - device_type: decode_info.hwdevice, - thread_count: 4, - }; - let (_, _, len) = ffmpeg_linesize_offset_length( - encode_ctx.pixfmt, - encode_ctx.width as _, - encode_ctx.height as _, - encode_ctx.align as _, - ) - .unwrap(); - let mut video_encoder = Encoder::new(encode_ctx).unwrap(); - let mut video_decoder = Decoder::new(decode_ctx).unwrap(); - let buf: Vec = vec![0; len as usize]; - let encode_frames = video_encoder.encode(&buf, 0).unwrap(); - assert_eq!(encode_frames.len(), 1); - let docode_frames = video_decoder.decode(&encode_frames[0].data).unwrap(); - assert_eq!(docode_frames.len(), 1); - assert_eq!(docode_frames[0].width, width); - assert_eq!(docode_frames[0].height, height); - println!( - "Pass {}x{}: {} -> {} {:?}", - width, height, encode_info.name, decode_info.name, decode_info.hwdevice - ) -} - -#[cfg(feature = "vram")] -fn setup_vram(max_align: i32) { - let encoders = hwcodec::vram::encode::available(DynamicContext { - device: None, - width: 1920, - height: 1080, - kbitrate: 1000, - framerate: 30, - gop: MAX_GOP as _, - }); - let decoders = hwcodec::vram::decode::available(); - - let start_width = 1920; - let start_height = 1080; - let step = 2; - - for width in (start_width..=(start_width + max_align)).step_by(step) { - for height in (start_height..=(start_height + max_align)).step_by(step) { - for encode_info in &encoders { - if let Some(decoder) = decoders.iter().find(|d| { - d.luid == encode_info.luid && d.data_format == encode_info.data_format - }) { - test_vram(width, height, encode_info.clone(), decoder.clone()); - } - } - for decode_info in &decoders { - if let Some(encoder) = encoders.iter().find(|e| { - e.luid == decode_info.luid && e.data_format == decode_info.data_format - }) { - test_vram(width, height, encoder.clone(), decode_info.clone()); - } - } - } - } -} - -#[cfg(feature = "vram")] -fn test_vram( - width: i32, - height: i32, - encode_info: FeatureContext, - decode_info: hwcodec::vram::DecodeContext, -) { - println!( - "Test {}x{}: {:?} {:?} -> {:?}", - width, height, encode_info.data_format, encode_info.driver, decode_info.driver - ); - - let mut tool = Tool::new(encode_info.luid).unwrap(); - let encode_ctx = hwcodec::vram::EncodeContext { - f: encode_info.clone(), - d: hwcodec::vram::DynamicContext { - device: Some(tool.device()), - width, - height, - kbitrate: 1000, - framerate: 30, - gop: MAX_GOP as _, - }, - }; - let mut encoder = hwcodec::vram::encode::Encoder::new(encode_ctx).unwrap(); - let mut decoder = hwcodec::vram::decode::Decoder::new(hwcodec::vram::DecodeContext { - device: Some(tool.device()), - ..decode_info.clone() - }) - .unwrap(); - let encode_frames = encoder.encode(tool.get_texture(width, height), 0).unwrap(); - assert_eq!(encode_frames.len(), 1); - let decoder_frames = decoder.decode(&encode_frames[0].data).unwrap(); - assert_eq!(decoder_frames.len(), 1); - let (decoded_width, decoded_height) = tool.get_texture_size(decoder_frames[0].texture); - assert_eq!(decoded_width, width); - assert_eq!(decoded_height, height); - println!( - "Pass {}x{}: {:?} {:?} -> {:?}", - width, height, encode_info.data_format, encode_info.driver, decode_info.driver - ); -} diff --git a/libs/hwcodec/examples/available.rs b/libs/hwcodec/examples/available.rs deleted file mode 100644 index 6923611d..00000000 --- a/libs/hwcodec/examples/available.rs +++ /dev/null @@ -1,67 +0,0 @@ -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -use hwcodec::{ - common::{get_gpu_signature, Quality::*, RateControl::*}, - ffmpeg::AVPixelFormat, - ffmpeg_ram::{ - decode::Decoder, - encode::{EncodeContext, Encoder}, - }, -}; - -fn main() { - let start = std::time::Instant::now(); - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); - ram(); - #[cfg(feature = "vram")] - vram(); - log::info!( - "signature: {:?}, elapsed: {:?}", - get_gpu_signature(), - start.elapsed() - ); -} - -fn ram() { - println!("ram:"); - println!("encoders:"); - let ctx = EncodeContext { - name: String::from(""), - mc_name: None, - width: 1280, - height: 720, - pixfmt: AVPixelFormat::AV_PIX_FMT_NV12, - align: 0, - kbs: 1000, - fps: 30, - gop: i32::MAX, - quality: Quality_Default, - rc: RC_CBR, - q: -1, - thread_count: 1, - }; - let encoders = Encoder::available_encoders(ctx.clone(), None); - encoders.iter().map(|e| println!("{:?}", e)).count(); - println!("decoders:"); - let decoders = Decoder::available_decoders(); - decoders.iter().map(|e| println!("{:?}", e)).count(); -} - -#[cfg(feature = "vram")] -fn vram() { - use hwcodec::common::MAX_GOP; - use hwcodec::vram::{decode, encode, DynamicContext}; - println!("vram:"); - println!("encoders:"); - let encoders = encode::available(DynamicContext { - width: 1920, - height: 1080, - kbitrate: 5000, - framerate: 30, - gop: MAX_GOP as _, - device: None, - }); - encoders.iter().map(|e| println!("{:?}", e)).count(); - println!("decoders:"); - let decoders = decode::available(); - decoders.iter().map(|e| println!("{:?}", e)).count(); -} diff --git a/libs/hwcodec/examples/benchmark.rs b/libs/hwcodec/examples/benchmark.rs deleted file mode 100644 index 23282beb..00000000 --- a/libs/hwcodec/examples/benchmark.rs +++ /dev/null @@ -1,147 +0,0 @@ -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -use hwcodec::{ - common::{Quality::*, RateControl::*}, - ffmpeg::AVPixelFormat, - ffmpeg_ram::{ - decode::{DecodeContext, Decoder}, - encode::{EncodeContext, Encoder}, - CodecInfo, CodecInfos, - }, -}; -use rand::random; -use std::io::Write; -use std::time::Instant; - -fn main() { - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); - - let ctx = EncodeContext { - name: String::from(""), - mc_name: None, - width: 1920, - height: 1080, - pixfmt: AVPixelFormat::AV_PIX_FMT_NV12, - align: 0, - kbs: 5000, - fps: 30, - gop: 60, - quality: Quality_Default, - rc: RC_DEFAULT, - thread_count: 4, - q: -1, - }; - let yuv_count = 10; - println!("benchmark"); - let yuvs = prepare_yuv(ctx.width as _, ctx.height as _, yuv_count); - - let encoders = Encoder::available_encoders(ctx.clone(), None); - log::info!("encoders: {:?}", encoders); - let best = CodecInfo::prioritized(encoders.clone()); - for info in encoders { - test_encoder(info.clone(), ctx.clone(), &yuvs, is_best(&best, &info)); - } - - let (h264s, h265s) = prepare_h26x(best, ctx.clone(), &yuvs); - - let decoders = Decoder::available_decoders(); - log::info!("decoders: {:?}", decoders); - let best = CodecInfo::prioritized(decoders.clone()); - for info in decoders { - let h26xs = if info.name.contains("h264") { - &h264s - } else { - &h265s - }; - if h26xs.len() == yuv_count { - test_decoder(info.clone(), h26xs, is_best(&best, &info)); - } - } -} - -fn test_encoder(info: CodecInfo, ctx: EncodeContext, yuvs: &Vec>, best: bool) { - let mut ctx = ctx; - ctx.name = info.name; - let mut encoder = Encoder::new(ctx.clone()).unwrap(); - let start = Instant::now(); - for yuv in yuvs { - let _ = encoder - .encode(yuv, start.elapsed().as_millis() as _) - .unwrap(); - } - println!( - "{}{}: {:?}", - if best { "*" } else { "" }, - ctx.name, - start.elapsed() / yuvs.len() as _ - ); -} - -fn test_decoder(info: CodecInfo, h26xs: &Vec>, best: bool) { - let ctx = DecodeContext { - name: info.name, - device_type: info.hwdevice, - thread_count: 4, - }; - - let mut decoder = Decoder::new(ctx.clone()).unwrap(); - let start = Instant::now(); - let mut cnt = 0; - for h26x in h26xs { - let _ = decoder.decode(h26x).unwrap(); - cnt += 1; - } - let device = format!("{:?}", ctx.device_type).to_lowercase(); - let device = device.split("_").last().unwrap(); - println!( - "{}{} {}: {:?}", - if best { "*" } else { "" }, - ctx.name, - device, - start.elapsed() / cnt - ); -} - -fn prepare_yuv(width: usize, height: usize, count: usize) -> Vec> { - let mut ret = vec![]; - for index in 0..count { - let linesize = width * 3 / 2; - let mut yuv = vec![0u8; linesize * height]; - for y in 0..height { - for x in 0..linesize { - yuv[linesize * y + x] = random(); - } - } - ret.push(yuv); - print!("\rprepare {}/{}", index + 1, count); - std::io::stdout().flush().ok(); - } - println!(); - ret -} - -fn prepare_h26x( - best: CodecInfos, - ctx: EncodeContext, - yuvs: &Vec>, -) -> (Vec>, Vec>) { - let f = |info: Option| { - let mut h26xs = vec![]; - if let Some(info) = info { - let mut ctx = ctx.clone(); - ctx.name = info.name; - let mut encoder = Encoder::new(ctx).unwrap(); - for yuv in yuvs { - let h26x = encoder.encode(yuv, 0).unwrap(); - for frame in h26x { - h26xs.push(frame.data.to_vec()); - } - } - } - h26xs - }; - (f(best.h264), f(best.h265)) -} - -fn is_best(best: &CodecInfos, info: &CodecInfo) -> bool { - Some(info.clone()) == best.h264 || Some(info.clone()) == best.h265 -} diff --git a/libs/hwcodec/examples/codec.rs b/libs/hwcodec/examples/codec.rs deleted file mode 100644 index a4e92dc7..00000000 --- a/libs/hwcodec/examples/codec.rs +++ /dev/null @@ -1,117 +0,0 @@ -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -use hwcodec::{ - common::{Quality::*, RateControl::*}, - ffmpeg::{AVHWDeviceType::*, AVPixelFormat::*}, - ffmpeg_ram::{ - decode::{DecodeContext, Decoder}, - encode::{EncodeContext, Encoder}, - ffmpeg_linesize_offset_length, - }, -}; -use std::{ - fs::File, - io::{Read, Write}, -}; - -fn main() { - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); - - let encode_ctx = EncodeContext { - name: String::from("h264_nvenc"), - mc_name: None, - width: 1920, - height: 1080, - pixfmt: AV_PIX_FMT_NV12, - align: 0, - kbs: 0, - fps: 30, - gop: 60, - quality: Quality_Default, - rc: RC_DEFAULT, - thread_count: 4, - q: -1, - }; - let decode_ctx = DecodeContext { - name: String::from("hevc"), - device_type: AV_HWDEVICE_TYPE_D3D11VA, - thread_count: 4, - }; - let _ = std::thread::spawn(move || test_encode_decode(encode_ctx, decode_ctx)).join(); -} - -fn test_encode_decode(encode_ctx: EncodeContext, decode_ctx: DecodeContext) { - let size: usize; - if let Ok((_, _, len)) = ffmpeg_linesize_offset_length( - encode_ctx.pixfmt, - encode_ctx.width as _, - encode_ctx.height as _, - encode_ctx.align as _, - ) { - size = len as _; - } else { - return; - } - - let mut video_encoder = Encoder::new(encode_ctx).unwrap(); - let mut video_decoder = Decoder::new(decode_ctx).unwrap(); - - let mut yuv_file = File::open("input/1920_1080_decoded.yuv").unwrap(); - let mut encode_file = File::create("output/1920_1080.265").unwrap(); - let mut decode_file = File::create("output/1920_1080_decode.yuv").unwrap(); - - let mut buf = vec![0; size + 64]; - let mut encode_sum = 0; - let mut decode_sum = 0; - let mut encode_size = 0; - let mut counter = 0; - - let mut f = |data: &[u8]| { - let now = std::time::Instant::now(); - if let Ok(encode_frames) = video_encoder.encode(data, 0) { - log::info!("encode:{:?}", now.elapsed()); - encode_sum += now.elapsed().as_micros(); - for encode_frame in encode_frames.iter() { - encode_size += encode_frame.data.len(); - encode_file.write_all(&encode_frame.data).unwrap(); - encode_file.flush().unwrap(); - - let now = std::time::Instant::now(); - if let Ok(docode_frames) = video_decoder.decode(&encode_frame.data) { - log::info!("decode:{:?}", now.elapsed()); - decode_sum += now.elapsed().as_micros(); - counter += 1; - for decode_frame in docode_frames { - log::info!("decode_frame:{}", decode_frame); - for data in decode_frame.data.iter() { - decode_file.write_all(data).unwrap(); - decode_file.flush().unwrap(); - } - } - } - } - } - }; - - loop { - match yuv_file.read(&mut buf[..size]) { - Ok(n) => { - if n > 0 { - f(&buf[..n]); - } else { - break; - } - } - Err(e) => { - log::info!("{:?}", e); - break; - } - } - } - log::info!( - "counter:{}, encode_avg:{}us, decode_avg:{}us, size_avg:{}", - counter, - encode_sum / counter, - decode_sum / counter, - encode_size / counter as usize, - ); -} diff --git a/libs/hwcodec/examples/pipeline_vram.rs b/libs/hwcodec/examples/pipeline_vram.rs deleted file mode 100644 index 92d03b11..00000000 --- a/libs/hwcodec/examples/pipeline_vram.rs +++ /dev/null @@ -1,78 +0,0 @@ -use capture::dxgi; -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -use hwcodec::common::{DataFormat, Driver, MAX_GOP}; -use hwcodec::vram::{ - decode::Decoder, encode::Encoder, DecodeContext, DynamicContext, EncodeContext, FeatureContext, -}; -use render::Render; -use std::{ - io::Write, - path::PathBuf, - time::{Duration, Instant}, -}; - -fn main() { - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "trace")); - let luid = 69524; // 63444; // 59677 - unsafe { - // one luid create render failed on my pc, wouldn't happen in rustdesk - let data_format = DataFormat::H265; - let mut capturer = dxgi::Capturer::new(luid).unwrap(); - let mut render = Render::new(luid, false).unwrap(); - - let en_ctx = EncodeContext { - f: FeatureContext { - driver: Driver::FFMPEG, - vendor: Driver::NV, - data_format, - luid, - }, - d: DynamicContext { - device: Some(capturer.device()), - width: capturer.width(), - height: capturer.height(), - kbitrate: 5000, - framerate: 30, - gop: MAX_GOP as _, - }, - }; - let de_ctx = DecodeContext { - device: Some(render.device()), - driver: Driver::FFMPEG, - vendor: Driver::NV, - data_format, - luid, - }; - - let mut dec = Decoder::new(de_ctx).unwrap(); - let mut enc = Encoder::new(en_ctx).unwrap(); - let filename = PathBuf::from(".\\1.264"); - let mut file = std::fs::File::create(filename).unwrap(); - let mut dup_sum = Duration::ZERO; - let mut enc_sum = Duration::ZERO; - let mut dec_sum = Duration::ZERO; - let mut pts_instant = Instant::now(); - loop { - let start = Instant::now(); - let texture = capturer.capture(100); - if texture.is_null() { - continue; - } - dup_sum += start.elapsed(); - let start = Instant::now(); - let frame = enc - .encode(texture, pts_instant.elapsed().as_millis() as _) - .unwrap(); - enc_sum += start.elapsed(); - for f in frame { - file.write_all(&mut f.data).unwrap(); - let start = Instant::now(); - let frames = dec.decode(&f.data).unwrap(); - dec_sum += start.elapsed(); - for f in frames { - render.render(f.texture).unwrap(); - } - } - } - } -} diff --git a/libs/hwcodec/examples/resolution.rs b/libs/hwcodec/examples/resolution.rs deleted file mode 100644 index 9bf102ae..00000000 --- a/libs/hwcodec/examples/resolution.rs +++ /dev/null @@ -1,128 +0,0 @@ -use env_logger::{init_from_env, Env, DEFAULT_FILTER_ENV}; -use hwcodec::{ - common::{Quality::*, RateControl::*, MAX_GOP}, - ffmpeg::{ - AVHWDeviceType::{self, *}, - AVPixelFormat::*, - }, - ffmpeg_ram::{ - decode::{DecodeContext, Decoder}, - encode::{EncodeContext, Encoder}, - }, -}; -use std::{ - fs::File, - io::{Read, Write}, -}; - -fn main() { - let gpu = true; - let h264 = true; - let hw_type = if gpu { "gpu" } else { "hw" }; - let file_type = if h264 { "h264" } else { "h265" }; - let codec = if h264 { "h264" } else { "hevc" }; - - init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); - let device_type = AV_HWDEVICE_TYPE_CUDA; - let decode_ctx = DecodeContext { - name: String::from(codec), - device_type, - thread_count: 4, - }; - let mut video_decoder = Decoder::new(decode_ctx).unwrap(); - - decode_encode( - &mut video_decoder, - 0, - hw_type, - file_type, - 1600, - 900, - h264, - device_type, - ); - decode_encode( - &mut video_decoder, - 1, - hw_type, - file_type, - 1440, - 900, - h264, - device_type, - ); -} - -fn decode_encode( - video_decoder: &mut Decoder, - index: usize, - hw_type: &str, - file_type: &str, - width: usize, - height: usize, - h264: bool, - device_type: AVHWDeviceType, -) { - let input_enc_filename = format!("input/data_and_line/{hw_type}_{width}_{height}.{file_type}"); - let len_filename = format!("input/data_and_line/{hw_type}_{width}_{height}_{file_type}.txt"); - let enc_ctx = EncodeContext { - name: if h264 { - "h264_nvenc".to_owned() - } else { - "hevc_nvenc".to_owned() - }, - mc_name: None, - width: width as _, - height: height as _, - pixfmt: if device_type == AV_HWDEVICE_TYPE_NONE { - AV_PIX_FMT_YUV420P - } else { - AV_PIX_FMT_NV12 - }, - align: 0, - kbs: 1_000, - fps: 30, - gop: MAX_GOP as _, - quality: Quality_Default, - rc: RC_DEFAULT, - thread_count: 4, - q: -1, - }; - let mut video_encoder = Encoder::new(enc_ctx).unwrap(); - let mut encode_file = - File::create(format!("output/{hw_type}_{width}_{height}.{file_type}")).unwrap(); - - let mut yuv_file = - File::create(format!("output/{hw_type}_{width}_{height}_decode.yuv")).unwrap(); - - let mut file_lens = File::open(len_filename).unwrap(); - let mut file = File::open(input_enc_filename).unwrap(); - let mut file_lens_buf = Vec::new(); - file_lens.read_to_end(&mut file_lens_buf).unwrap(); - let file_lens_str = String::from_utf8_lossy(&file_lens_buf).to_string(); - let lens: Vec = file_lens_str - .split(",") - .filter(|e| !e.is_empty()) - .map(|e| e.parse().unwrap()) - .collect(); - for i in 0..lens.len() { - let mut buf = vec![0; lens[i]]; - file.read(&mut buf).unwrap(); - let frames = video_decoder.decode(&buf).unwrap(); - println!( - "file{}, w:{}, h:{}, fmt:{:?}, linesize:{:?}", - index, frames[0].width, frames[0].height, frames[0].pixfmt, frames[0].linesize - ); - assert!(frames.len() == 1); - let mut encode_buf = Vec::new(); - for d in &mut frames[0].data { - encode_buf.append(d); - } - yuv_file.write_all(&encode_buf).unwrap(); - let frames = video_encoder.encode(&encode_buf, 0).unwrap(); - assert_eq!(frames.len(), 1); - for f in frames { - encode_file.write_all(&f.data).unwrap(); - } - } -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/CMakeLists.txt b/libs/hwcodec/externals/AMF_v1.4.35/CMakeLists.txt deleted file mode 100644 index e5930a10..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(amf) - -set(CMAKE_CXX_STANDARD 11) -cmake_policy(SET CMP0091 NEW) -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -set(AMF_DIR ${CMAKE_SOURCE_DIR}) -set(AMF_COMMON_DIR ${AMF_DIR}/amf/public/common) - -# Source files -set(SOURCES - ${AMF_COMMON_DIR}/AMFFactory.cpp - ${AMF_COMMON_DIR}/AMFSTL.cpp - ${AMF_COMMON_DIR}/Thread.cpp - ${AMF_COMMON_DIR}/TraceAdapter.cpp - ${AMF_COMMON_DIR}/Windows/ThreadWindows.cpp -) - -# Include directories -set(AMF_INCLUDE_DIRS - ${AMF_DIR}/amf - ${AMF_COMMON_DIR} -) -include_directories(${AMF_INCLUDE_DIRS}) - -# Build target -add_library(amf STATIC ${SOURCES}) - -target_link_libraries(amf - ole32 -) \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.cpp deleted file mode 100644 index 74ca38a9..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.cpp +++ /dev/null @@ -1,262 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "AMFFactory.h" -#include "Thread.h" - -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wexit-time-destructors" - #pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - -AMFFactoryHelper g_AMFFactory; -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - -#ifdef AMF_CORE_STATIC -extern "C" -{ - extern AMF_CORE_LINK AMF_RESULT AMF_CDECL_CALL AMFInit(amf_uint64 version, amf::AMFFactory **ppFactory); -} -#endif - -//------------------------------------------------------------------------------------------------- -AMFFactoryHelper::AMFFactoryHelper() : -m_hDLLHandle(NULL), -m_pFactory(NULL), -m_pDebug(NULL), -m_pTrace(NULL), -m_AMFRuntimeVersion(0), -m_iRefCount(0) -{ -} -//------------------------------------------------------------------------------------------------- -AMFFactoryHelper::~AMFFactoryHelper() -{ - Terminate(); -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMFFactoryHelper::Init(const wchar_t* dllName) -{ - dllName; - -#ifndef AMF_CORE_STATIC - if (m_hDLLHandle != NULL) - { - amf_atomic_inc(&m_iRefCount); - return AMF_OK; - } - - const wchar_t* dllName_ = dllName == NULL ? AMF_DLL_NAME : dllName; -#if defined (_WIN32) || defined (__APPLE__) - m_hDLLHandle = amf_load_library(dllName_); -#else - m_hDLLHandle = amf_load_library1(dllName_, false); //load with local flags -#endif - if(m_hDLLHandle == NULL) - { - return AMF_FAIL; - } - - AMFInit_Fn initFun = (AMFInit_Fn)::amf_get_proc_address(m_hDLLHandle, AMF_INIT_FUNCTION_NAME); - if(initFun == NULL) - { - return AMF_FAIL; - } - AMF_RESULT res = initFun(AMF_FULL_VERSION, &m_pFactory); - if(res != AMF_OK) - { - return res; - } - AMFQueryVersion_Fn versionFun = (AMFQueryVersion_Fn)::amf_get_proc_address(m_hDLLHandle, AMF_QUERY_VERSION_FUNCTION_NAME); - if(versionFun == NULL) - { - return AMF_FAIL; - } - res = versionFun(&m_AMFRuntimeVersion); - if(res != AMF_OK) - { - return res; - } -#else - AMF_RESULT res = AMFInit(AMF_FULL_VERSION, &m_pFactory); - if (res != AMF_OK) - { - return res; - } - m_AMFRuntimeVersion = AMF_FULL_VERSION; -#endif - m_pFactory->GetTrace(&m_pTrace); - m_pFactory->GetDebug(&m_pDebug); - - amf_atomic_inc(&m_iRefCount); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMFFactoryHelper::Terminate() -{ - if(m_hDLLHandle != NULL) - { - amf_atomic_dec(&m_iRefCount); - if(m_iRefCount == 0) - { - amf_free_library(m_hDLLHandle); - m_hDLLHandle = NULL; - m_pFactory= NULL; - m_pDebug = NULL; - m_pTrace = NULL; - } - } - - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -amf::AMFFactory* AMFFactoryHelper::GetFactory() -{ - return m_pFactory; -} -//------------------------------------------------------------------------------------------------- -amf::AMFDebug* AMFFactoryHelper::GetDebug() -{ - return m_pDebug; -} -//------------------------------------------------------------------------------------------------- -amf::AMFTrace* AMFFactoryHelper::GetTrace() -{ - return m_pTrace; -} -//------------------------------------------------------------------------------------------------- -amf_uint64 AMFFactoryHelper::AMFQueryVersion() -{ - return m_AMFRuntimeVersion; -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMFFactoryHelper::LoadExternalComponent(amf::AMFContext* pContext, const wchar_t* dll, const char* function, void* reserved, amf::AMFComponent** ppComponent) -{ - // check passed in parameters - if (!pContext || !dll || !function) - { - return AMF_INVALID_ARG; - } - - // check if DLL has already been loaded - amf_handle hDll = NULL; - for (std::vector::iterator it = m_extComponents.begin(); it != m_extComponents.end(); ++it) - { -#if defined(_WIN32) - if (wcsicmp(it->m_DLL.c_str(), dll) == 0) // ignore case on Windows -#elif defined(__linux) // Linux - if (wcscmp(it->m_DLL.c_str(), dll) == 0) // case sensitive on Linux -#endif - { - if (it->m_hDLLHandle != NULL) - { - hDll = it->m_hDLLHandle; - amf_atomic_inc(&it->m_iRefCount); - break; - } - - return AMF_UNEXPECTED; - } - } - // DLL wasn't loaded before so load it now and - // add it to the internal list - if (hDll == NULL) - { - ComponentHolder component; - component.m_iRefCount = 0; - component.m_hDLLHandle = NULL; - component.m_DLL = dll; - -#if defined(_WIN32) || defined(__APPLE__) - hDll = amf_load_library(dll); -#else - hDll = amf_load_library1(dll, false); //global flag set to true -#endif - if (hDll == NULL) - return AMF_FAIL; - - // since LoadLibrary succeeded add the information - // into the internal list so we can properly free - // the DLL later on, even if we fail to get the - // required information from it... - component.m_hDLLHandle = hDll; - amf_atomic_inc(&component.m_iRefCount); - m_extComponents.push_back(component); - } - - // look for function we want in the dll we just loaded - typedef AMF_RESULT(AMF_CDECL_CALL *AMFCreateComponentFunc)(amf::AMFContext*, void* reserved, amf::AMFComponent**); - AMFCreateComponentFunc initFn = (AMFCreateComponentFunc)::amf_get_proc_address(hDll, function); - if (initFn == NULL) - return AMF_FAIL; - - return initFn(pContext, reserved, ppComponent); -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMFFactoryHelper::UnLoadExternalComponent(const wchar_t* dll) -{ - if (!dll) - { - return AMF_INVALID_ARG; - } - for (std::vector::iterator it = m_extComponents.begin(); it != m_extComponents.end(); ++it) - { -#if defined(_WIN32) - if (wcsicmp(it->m_DLL.c_str(), dll) == 0) // ignore case on Windows -#elif defined(__linux) // Linux - if (wcscmp(it->m_DLL.c_str(), dll) == 0) // case sensitive on Linux -#endif - { - if (it->m_hDLLHandle == NULL) - { - return AMF_UNEXPECTED; - } - amf_atomic_dec(&it->m_iRefCount); - if (it->m_iRefCount == 0) - { - amf_free_library(it->m_hDLLHandle); - m_extComponents.erase(it); - } - break; - } - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- - diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.h deleted file mode 100644 index bbeeb04d..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFFactory.h +++ /dev/null @@ -1,89 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_AMFFactory_h -#define AMF_AMFFactory_h - -#pragma once - -#include "../include/core/Factory.h" -#include -#include - - -class AMFFactoryHelper -{ -public: - AMFFactoryHelper(); - virtual ~AMFFactoryHelper(); - - AMF_RESULT Init(const wchar_t* dllName = NULL); - AMF_RESULT Terminate(); - - AMF_RESULT LoadExternalComponent(amf::AMFContext* pContext, const wchar_t* dll, const char* function, void* reserved, amf::AMFComponent** ppComponent); - AMF_RESULT UnLoadExternalComponent(const wchar_t* dll); - - amf::AMFFactory* GetFactory(); - amf::AMFDebug* GetDebug(); - amf::AMFTrace* GetTrace(); - - amf_uint64 AMFQueryVersion(); - - amf_handle GetAMFDLLHandle() { return m_hDLLHandle; } -protected: - struct ComponentHolder - { - amf_handle m_hDLLHandle; - amf_long m_iRefCount; - std::wstring m_DLL; - - ComponentHolder() - { - m_hDLLHandle = NULL; - m_iRefCount = 0; - } - }; - - amf_handle m_hDLLHandle; - amf::AMFFactory* m_pFactory; - amf::AMFDebug* m_pDebug; - amf::AMFTrace* m_pTrace; - amf_uint64 m_AMFRuntimeVersion; - - amf_long m_iRefCount; - - std::vector m_extComponents; -}; - -extern ::AMFFactoryHelper g_AMFFactory; -#endif // AMF_AMFFactory_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFMath.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFMath.h deleted file mode 100644 index bebb1352..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFMath.h +++ /dev/null @@ -1,1279 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#include - -namespace amf -{ - // right-handed system - // +y is up - // +x is to the right - // -z is forward - - const float AMF_PI = 3.141592654f; - const float AMF_1DIV2PI = 0.159154943f; - const float AMF_2PI = 6.283185307f; - const float AMF_PIDIV2 = 1.570796327f; - - const uint32_t AMF_PERMUTE_0X = 0; - const uint32_t AMF_PERMUTE_0Y = 1; - const uint32_t AMF_PERMUTE_0Z = 2; - const uint32_t AMF_PERMUTE_0W = 3; - const uint32_t AMF_PERMUTE_1X = 4; - const uint32_t AMF_PERMUTE_1Y = 5; - const uint32_t AMF_PERMUTE_1Z = 6; - const uint32_t AMF_PERMUTE_1W = 7; - - const uint32_t AMF_SWIZZLE_X = 0; - const uint32_t AMF_SWIZZLE_Y = 1; - const uint32_t AMF_SWIZZLE_Z = 2; - const uint32_t AMF_SWIZZLE_W = 3; - - //--------------------------------------------------------------------------------------------- - class VectorPOD - { - public: - float x; - float y; - float z; - float w; - -// Vector():x(0),y(0),z(0),w(0){} -// Vector(float _x, float _y, float _z, float _w ):x(_x),y(_y),z(_z),w(_w){} - - void Assign(float _x, float _y, float _z, float _w) - { - x= _x; y = _y; z = _z; w = _w; - } - - inline VectorPOD& operator-=(const VectorPOD& other) - { - x -=other.x; y -=other.y; z -=other.z; w -=other.w; - return *this; - } - inline VectorPOD operator-(const VectorPOD& other) const - { - VectorPOD vector; - vector.x = x - other.x; - vector.y = y - other.y; - vector.z = z - other.z; - vector.w = w - other.w; - return vector; - } - inline VectorPOD& operator+=(const VectorPOD& other) - { - x +=other.x; - y +=other.y; - z +=other.z; - w +=other.w; - return *this; - } - inline VectorPOD operator+(const VectorPOD& other) const - { - VectorPOD vector; - vector.x = x + other.x; - vector.y = y + other.y; - vector.z = z + other.z; - vector.w = w + other.w; - return vector; - } - - inline VectorPOD operator*(const VectorPOD& other) const - { - VectorPOD vector; - vector.x = x * other.x; - vector.y = y * other.y; - vector.z = z * other.z; - vector.w = w * other.w; - return vector; - } - inline VectorPOD operator*=(const VectorPOD& other) - { - x*=other.x; - y*=other.y; - z*=other.z; - w*=other.w; - return *this; - } - - inline VectorPOD Swizzle(uint32_t E0, uint32_t E1, uint32_t E2, uint32_t E3) const - { - const uint32_t *aPtr = (const uint32_t* )(this); - - VectorPOD Result; - uint32_t *pWork = (uint32_t*)(&Result); - - pWork[0] = aPtr[E0]; - pWork[1] = aPtr[E1]; - pWork[2] = aPtr[E2]; - pWork[3] = aPtr[E3]; - - return Result; - } - - /* - inline VectorPOD& operator=(const VectorPOD& other) - { - Assign(other.x, other.y, other.z, other.w); - return *this; - } - */ - inline bool operator==(const VectorPOD& other) const - { - return x == other.x && y == other.y && z == other.z && w == other.w; - } - inline bool operator!=(const VectorPOD& other) const { return !operator==(other); } - inline VectorPOD Dot3(const VectorPOD& vec) const - { - float fValue = x * vec.x + y * vec.y + z * vec.z; - VectorPOD Result; - Result.Assign(fValue, fValue, fValue, fValue); - return Result; - } - inline VectorPOD Dot4(const VectorPOD& vec) const - { - float fValue = x * vec.x + y * vec.y + z * vec.z + w * vec.w; - VectorPOD Result; - Result.Assign(fValue, fValue, fValue, fValue); - return Result; - } - - inline VectorPOD LengthSq3() const - { - return Dot3(*this); - } - - inline VectorPOD LengthSq4() const - { - return Dot4(*this); - } - - inline VectorPOD Sqrt() const - { - VectorPOD Result; - Result.x = sqrtf(x); - Result.y = sqrtf(y); - Result.z = sqrtf(z); - Result.w = sqrtf(w); - return Result; - } - inline VectorPOD Length3() const - { - VectorPOD Result; - Result = LengthSq3(); - Result = Result.Sqrt(); - return Result; - } - inline VectorPOD Length4() const - { - VectorPOD Result; - Result = LengthSq4(); - Result = Result.Sqrt(); - return Result; - } - inline VectorPOD Normalize3() const - { - float fLength; - VectorPOD vResult; - - vResult = Length3(); - fLength = vResult.x; - - // Prevent divide by zero - if (fLength > 0) - { - fLength = 1.0f / fLength; - } - - vResult.x = x * fLength; - vResult.y = y * fLength; - vResult.z = z * fLength; - vResult.w = w * fLength; - return vResult; - } - - inline VectorPOD Cross3(const VectorPOD& vec) const - { - VectorPOD vResult; - vResult.Assign( - (y * vec.z) - (z * vec.y), - (z * vec.x) - (x * vec.z), - (x * vec.y) - (y * vec.x), - 0.0f); - return vResult; - } - inline VectorPOD Negate() const - { - VectorPOD Result; - Result.x = -x; - Result.y = -y; - Result.z = -z; - Result.w = -w; - return Result; - } - - inline VectorPOD operator-() const - { - return Negate(); - } - - inline VectorPOD MergeXY(const VectorPOD& vec) const - { - VectorPOD Result; - Result.x = x; - Result.y = vec.x; - Result.z = y; - Result.w = vec.y; - return Result; - } - inline VectorPOD MergeZW(const VectorPOD& vec) const - { - VectorPOD Result; - Result.x = z; - Result.y = vec.z; - Result.z = w; - Result.w = vec.w; - return Result; - } - inline VectorPOD VectorPermute(const VectorPOD& vec, uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t PermuteW ) const - { - const uint32_t *aPtr[2]; - aPtr[0] = (const uint32_t* )(this); - aPtr[1] = (const uint32_t* )(&vec); - - VectorPOD Result; - uint32_t *pWork = (uint32_t*)(&Result); - - const uint32_t i0 = PermuteX & 3; - const uint32_t vi0 = PermuteX >> 2; - pWork[0] = aPtr[vi0][i0]; - - const uint32_t i1 = PermuteY & 3; - const uint32_t vi1 = PermuteY >> 2; - pWork[1] = aPtr[vi1][i1]; - - const uint32_t i2 = PermuteZ & 3; - const uint32_t vi2 = PermuteZ >> 2; - pWork[2] = aPtr[vi2][i2]; - - const uint32_t i3 = PermuteW & 3; - const uint32_t vi3 = PermuteW >> 2; - pWork[3] = aPtr[vi3][i3]; - - return Result; - } - inline VectorPOD Reciprocal() - { - VectorPOD Result; - Result.x = 1.f / x; - Result.y = 1.f / y; - Result.z = 1.f / z; - Result.w = 1.f / w; - return Result; - } - }; - - class Vector : public VectorPOD - { - public: - Vector() - { - x = 0; - y = 0; - z = 0; - w = 0; - } - Vector(float _x, float _y, float _z, float _w ) - { - x = _x; - y = _y; - z = _z; - w = _w; - } - Vector(const VectorPOD& other) - { - operator=(other); - } - Vector& operator=(const VectorPOD& other) - { - x = other.x; - y = other.y; - z = other.z; - w = other.w; - return *this; - } - //--------------------------------------------------------------------------------------------- - - }; - - - //--------------------------------------------------------------------------------------------- - class Quaternion : public Vector - { - public: - Quaternion(){} - Quaternion(const Quaternion& other) : Vector() {Assign(other.x, other.y, other.z, other.w);} - Quaternion(float pitch, float yaw, float roll) {FromEuler(pitch, yaw, roll);} - Quaternion(float _x, float _y, float _z, float _w) {Assign(_x, _y, _z, _w);} - - inline void FromEuler(float pitch, float yaw, float roll) - { - float cy = cosf(yaw * 0.5f); - float sy = sinf(yaw * 0.5f); - float cr = cosf(roll * 0.5f); - float sr = sinf(roll * 0.5f); - float cp = cosf(pitch * 0.5f); - float sp = sinf(pitch * 0.5f); - - w = cp * cr * cy + sp * sr * sy; - x = cp * sr * cy - sp * cr * sy; - y = cp * cr * sy + sp * sr * cy; - z = sp * cr * cy - cp * sr * sy; - - } - - - inline Quaternion& operator=(const Quaternion& other) - { - Assign(other.x, other.y, other.z, other.w); - return *this; - } - - inline bool operator==(const Quaternion& other) const - { - return x == other.x && y == other.y && z == other.z && w == other.w; - } - - inline bool operator!=(const Quaternion& other) const { return !operator==(other); } - - - inline Quaternion operator*(const Quaternion& other) const - { - return Quaternion( - other.w * x + other.x * w + other.y * z - other.z * y, - other.w * y - other.x * z + other.y * w + other.z * x, - other.w * z + other.x * y - other.y * x + other.z * w, - other.w * w - other.x * x - other.y * y - other.z * z - ); - } - - inline const Quaternion& RotateBy(const Quaternion& rotator) - { - *this = rotator * (*this); - return *this; - } - - inline Vector ToEulerAngles() const - { - float yaw, pitch, roll; -#if 0 - // roll (x-axis rotation) - float sinr = 2.0f * (w * x + y * z); - float cosr = 1.0f - 2.0f * (x * x + y * y); - roll = atan2f(sinr, cosr); - - // pitch (y-axis rotation) - float sinp = 2.0f * (w * y - z * x); - if (fabsf(sinp) >= 1) - pitch = copysignf(AMF_PIDIV2, sinp); // use 90 degrees if out of range - else - pitch = asinf(sinp); - - // yaw (z-axis rotation) - float siny = 2.0f * (w * z + x * y); - float cosy = 1.0f - 2.0f * (y * y + z * z); - yaw = atan2f(siny, cosy); - -#else - float sqw = w*w; - float sqx = x*x; - float sqy = y*y; - float sqz = z*z; - float unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor - float test = x*y + z*w; - if (test > 0.499f * unit) { // singularity at north pole - yaw = 2.0f * atan2(x, w); - pitch = AMF_PIDIV2; - roll = 0; - }else if (test < -0.499f*unit) { // singularity at south pole - yaw = -2.0f * atan2(x, w); - pitch = -AMF_PIDIV2; - roll = 0; - } - else - { - yaw = atan2(2.0f * (y*w - x*z), sqx - sqy - sqz + sqw); - pitch = asin(2.0f * test / unit); - roll = atan2(2.0f * (x*w - y * z), -sqx + sqy - sqz + sqw); - } -#endif - return Vector(pitch, yaw, roll, 0); - } - inline Quaternion& operator-=(const Quaternion& other) - { - x -= other.x; y -= other.y; z -= other.z; w -= other.w; - return *this; - } - inline Quaternion operator-(const Quaternion& other) const - { - Quaternion vector; - vector.x = x - other.x; - vector.y = y - other.y; - vector.z = z - other.z; - vector.w = w - other.w; - return vector; - } - inline Quaternion& operator+=(const Quaternion& other) - { - x += other.x; - y += other.y; - z += other.z; - w += other.w; - return *this; - } - inline Quaternion operator+(const Quaternion& other) const - { - Quaternion vector; - vector.x = x + other.x; - vector.y = y + other.y; - vector.z = z + other.z; - vector.w = w + other.w; - return vector; - } - inline Quaternion Conjugate() const - { - Quaternion result(-x, -y, -z, w); - return result; - } - inline Vector DistanceAngles(const Quaternion& newValue) const - { - Vector diff; - amf::Quaternion diffQ = newValue * Conjugate(); - float len = diffQ.Length4().x; - - if (len <= 0.0005f) - { - diff = amf::Vector(2.0f * diffQ.x, 2.0f * diffQ.y, 2.0f * diffQ.z, 0); - } - else - { - float angle = 2.0f * atan2(len, diffQ.w); - diff = amf::Vector(diffQ.x * angle / len, diffQ.y * angle / len, diffQ.z * angle / len, 0); - } - return diff; - } - }; - inline void ScalarSinCos(float* pSin, float* pCos, float Value) - { - // Map Value to y in [-pi,pi], x = 2*pi*quotient + remainder. - float quotient = AMF_1DIV2PI *Value; - if (Value >= 0.0f) - { - quotient = (float)((int)(quotient + 0.5f)); - } - else - { - quotient = (float)((int)(quotient - 0.5f)); - } - float y = Value - AMF_2PI * quotient; - - // Map y to [-pi/2,pi/2] with sin(y) = sin(Value). - float sign; - if (y > AMF_PIDIV2) - { - y = AMF_PI - y; - sign = -1.0f; - } - else if (y < -AMF_PIDIV2) - { - y = -AMF_PI - y; - sign = -1.0f; - } - else - { - sign = +1.0f; - } - - float y2 = y * y; - - // 11-degree minimax approximation - *pSin = ( ( ( ( (-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f ) * y2 + 0.0083333310f ) * y2 - 0.16666667f ) * y2 + 1.0f ) * y; - - // 10-degree minimax approximation - float p = ( ( ( ( -2.6051615e-07f * y2 + 2.4760495e-05f ) * y2 - 0.0013888378f ) * y2 + 0.041666638f ) * y2 - 0.5f ) * y2 + 1.0f; - *pCos = sign*p; - } - - //--------------------------------------------------------------------------------------------- - class Matrix - { - public: - union - { - float m[4][4]; - VectorPOD r[4]; - float k[16]; - }; - - Matrix() {Identity();} - - Matrix(float *_m) { memcpy(m, _m, sizeof(m));} - Matrix(float i0, float i1, float i2, float i3, float i4, float i5, float i6, float i7, - float i8, float i9, float i10, float i11, float i12, float i13, float i14, float i15) - { - k[0] = i0; k[1] = i1; k[2] = i2; k[3] = i3; - k[4] = i4; k[5] = i5; k[6] = i6; k[7] = i7; - k[8] = i8; k[9] = i9; k[10] = i10; k[11] = i11; - k[12] = i12; k[13] = i13; k[14] = i14; k[15] = i15; - } - Matrix(const Matrix& other) = default; - - inline void Identity() - { - k[0] = k[5] = k[10] = k[15] = 1.0f; - k[1] = k[2] = k[3] = k[4] = k[6] = k[7] = k[8] = k[9] = k[11] = k[12] = k[13] = k[14] = 0.0f; - - } - inline Matrix &operator=(const Matrix & other) - { - memcpy(m, other.m, sizeof(m)); - return *this; - } - - inline Matrix operator*(const Matrix& n) const - { - return Matrix( - k[0]*n.k[0] + k[4]*n.k[1] + k[8]*n.k[2] + k[12]*n.k[3], k[1]*n.k[0] + k[5]*n.k[1] + k[9]*n.k[2] + k[13]*n.k[3], k[2]*n.k[0] + k[6]*n.k[1] + k[10]*n.k[2] + k[14]*n.k[3], k[3]*n.k[0] + k[7]*n.k[1] + k[11]*n.k[2] + k[15]*n.k[3], - k[0]*n.k[4] + k[4]*n.k[5] + k[8]*n.k[6] + k[12]*n.k[7], k[1]*n.k[4] + k[5]*n.k[5] + k[9]*n.k[6] + k[13]*n.k[7], k[2]*n.k[4] + k[6]*n.k[5] + k[10]*n.k[6] + k[14]*n.k[7], k[3]*n.k[4] + k[7]*n.k[5] + k[11]*n.k[6] + k[15]*n.k[7], - k[0]*n.k[8] + k[4]*n.k[9] + k[8]*n.k[10] + k[12]*n.k[11], k[1]*n.k[8] + k[5]*n.k[9] + k[9]*n.k[10] + k[13]*n.k[11], k[2]*n.k[8] + k[6]*n.k[9] + k[10]*n.k[10] + k[14]*n.k[11], k[3]*n.k[8] + k[7]*n.k[9] + k[11]*n.k[10] + k[15]*n.k[11], - k[0]*n.k[12] + k[4]*n.k[13] + k[8]*n.k[14] + k[12]*n.k[15], k[1]*n.k[12] + k[5]*n.k[13] + k[9]*n.k[14] + k[13]*n.k[15], k[2]*n.k[12] + k[6]*n.k[13] + k[10]*n.k[14] + k[14]*n.k[15], k[3]*n.k[12] + k[7]*n.k[13] + k[11]*n.k[14] + k[15]*n.k[15]); - } - inline Matrix operator*=(const Matrix& other) - { - *this = *this * other; - return *this; - } - - inline bool operator==(const Matrix& other) const - { - return memcmp(this, &other, sizeof(*this)) == 0; - } - inline bool operator!=(const Matrix& other) const - { - return memcmp(this, &other, sizeof(*this)) != 0; - } - - inline Vector operator*(const Vector& v) const - { - Vector Z(v.z, v.z, v.z, v.z); - Vector Y(v.y, v.y, v.y, v.y); - Vector X(v.x, v.x, v.x, v.x); - - Vector ret; - ret = Z * r[2] + r[3]; - ret = Y * r[1] + ret; - ret = X * r[0] + ret; - - return ret; - } - - void MatrixAffineTransformation(const Vector &Scaling, const Vector &RotationOrigin, const Vector &RotationQuaternion, const Vector &Translation) - { - // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; - - MatrixScalingFromVector(Scaling); - Vector VRotationOrigin (RotationOrigin.x,RotationOrigin.y,RotationOrigin.z, 0); - Matrix MRotation; - MRotation.MatrixRotationQuaternion(RotationQuaternion); - Vector VTranslation (Translation.x, Translation.y, Translation.z, 0); - - r[3] -= VRotationOrigin; - *this *= MRotation; - r[3] += VRotationOrigin; - r[3] += VTranslation; - } - inline void MatrixScalingFromVector(const Vector& Scale) - { - m[0][0] = Scale.x; - m[1][1] = Scale.y; - m[2][2] = Scale.z; - m[3][3] = 1.0f; - - } - void MatrixRotationQuaternion(const Vector& Quaternion) - { - static const Vector Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f}; - - Vector Q0 = Quaternion + Quaternion; - Vector Q1 = Quaternion * Q0; - - Vector V0 = Q1.VectorPermute(Constant1110, AMF_PERMUTE_0Y, AMF_PERMUTE_0X, AMF_PERMUTE_0X, AMF_PERMUTE_1W); - Vector V1 = Q1.VectorPermute(Constant1110, AMF_PERMUTE_0Z, AMF_PERMUTE_0Z, AMF_PERMUTE_0Y, AMF_PERMUTE_1W); - Vector R0 = Constant1110 - V0; - R0 = R0 - V1; - - V0 = Quaternion.Swizzle(AMF_SWIZZLE_X, AMF_SWIZZLE_X, AMF_SWIZZLE_Y, AMF_SWIZZLE_W); - V1 = Q0.Swizzle(AMF_SWIZZLE_Z, AMF_SWIZZLE_Y, AMF_SWIZZLE_Z, AMF_SWIZZLE_W); - V0 = V0 * V1; - - V1 = Vector(Quaternion.w, Quaternion.w, Quaternion.w, Quaternion.w); - Vector V2 = Q0.Swizzle(AMF_SWIZZLE_Y, AMF_SWIZZLE_Z, AMF_SWIZZLE_X, AMF_SWIZZLE_W); - V1 = V1 * V2; - - Vector R1 = V0 + V1; - Vector R2 = V0 - V1; - - V0 = R1.VectorPermute(R2, AMF_PERMUTE_0Y, AMF_PERMUTE_1X, AMF_PERMUTE_1Y, AMF_PERMUTE_0Z); - V1 = R1.VectorPermute(R2, AMF_PERMUTE_0X, AMF_PERMUTE_1Z, AMF_PERMUTE_0X, AMF_PERMUTE_1Z); - - r[0] = R0.VectorPermute(V0, AMF_PERMUTE_0X, AMF_PERMUTE_1X, AMF_PERMUTE_1Y, AMF_PERMUTE_0W); - r[1] = R0.VectorPermute(V0, AMF_PERMUTE_1Z, AMF_PERMUTE_0Y, AMF_PERMUTE_1W, AMF_PERMUTE_0W); - r[2] = R0.VectorPermute(V1, AMF_PERMUTE_1X, AMF_PERMUTE_1Y, AMF_PERMUTE_0Z, AMF_PERMUTE_0W); - r[3] = Vector(0.0f, 0.0f, 0.0f, 1.0f); - } - inline void LookToLH(const Vector& EyePosition, const Vector& EyeDirection, const Vector& UpDirection) - { - Vector R2 = EyeDirection.Normalize3(); - - Vector R0 = UpDirection.Cross3(R2); - R0 = R0.Normalize3(); - - Vector R1 = R2.Cross3(R0); - - Vector NegEyePosition = EyePosition.Negate(); - - Vector D0 = R0.Dot3(NegEyePosition); - Vector D1 = R1.Dot3(NegEyePosition); - Vector D2 = R2.Dot3(NegEyePosition); - - Matrix M; - M.r[0] = Vector(R0.x, R0.y, R0.z, D0.w); - M.r[1] = Vector(R1.x, R1.y, R1.z, D1.w); - M.r[2] = Vector(R2.x, R2.y, R2.z, D2.w); - M.r[3] = Vector(0.0f, 0.0f, 0.0f, 1.0f); - - *this = M.Transpose(); - } - inline Matrix Transpose() const - { - - // Original matrix: - // - // m00m01m02m03 - // m10m11m12m13 - // m20m21m22m23 - // m30m31m32m33 - - Matrix P; - P.r[0] = r[0].MergeXY(r[2]); // m00m20m01m21 - P.r[1] = r[1].MergeXY(r[3]); // m10m30m11m31 - P.r[2] = r[0].MergeZW(r[2]); // m02m22m03m23 - P.r[3] = r[1].MergeZW(r[3]); // m12m32m13m33 - - Matrix MT; - MT.r[0] = P.r[0].MergeXY(P.r[1]); // m00m10m20m30 - MT.r[1] = P.r[0].MergeZW(P.r[1]); // m01m11m21m31 - MT.r[2] = P.r[2].MergeXY(P.r[3]); // m02m12m22m32 - MT.r[3] = P.r[2].MergeZW(P.r[3]); // m03m13m23m33 - return MT; - } - inline void LookAtLH(Vector& EyePosition, Vector& FocusPosition, Vector& UpDirection) - { - Vector EyeDirection = FocusPosition - EyePosition; - LookToLH(EyePosition, EyeDirection, UpDirection); - } - inline void PerspectiveFovLH(float FovAngleY, float AspectRatio, float NearZ, float FarZ) - { - float SinFov; - float CosFov; - ScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); - - float Height = CosFov / SinFov; - float Width = Height / AspectRatio; - float fRange = FarZ / (FarZ-NearZ); - - m[0][0] = Width; - m[0][1] = 0.0f; - m[0][2] = 0.0f; - m[0][3] = 0.0f; - - m[1][0] = 0.0f; - m[1][1] = Height; - m[1][2] = 0.0f; - m[1][3] = 0.0f; - - m[2][0] = 0.0f; - m[2][1] = 0.0f; - m[2][2] = fRange; - m[2][3] = 1.0f; - - m[3][0] = 0.0f; - m[3][1] = 0.0f; - m[3][2] = -fRange * NearZ; - m[3][3] = 0.0f; - } - inline void RotationRollPitchYaw(float Pitch, float Yaw, float Roll) - { - Quaternion Q; - Q.FromEuler( Pitch, Yaw, Roll); - MatrixAffineTransformation(Vector(1.f, 1.f, 1.f, 0.f), Vector(), Q, Vector()); - } - inline Vector Determinant() - { - static const Vector Sign (1.0f, -1.0f, 1.0f, -1.0f); - - Vector V0(r[2].y, r[2].x, r[2].x, r[2].x); - Vector V1(r[3].z, r[3].z, r[3].y, r[3].y); - Vector V2(r[2].y, r[2].x, r[2].x, r[2].x); - Vector V3(r[3].w, r[3].w, r[3].w, r[3].z); - Vector V4(r[2].z, r[2].z, r[2].y, r[2].y); - Vector V5(r[3].w, r[3].w, r[3].w, r[3].z); - - Vector P0 = V0 * V1; - Vector P1 = V2 * V3; - Vector P2 = V4 * V5; - - V0 = Vector(r[2].z, r[2].z, r[2].y, r[2].y); - V1 = Vector(r[3].y, r[3].x, r[3].x, r[3].x); - V2 = Vector(r[2].w, r[2].w, r[2].w, r[2].z); - V3 = Vector(r[3].y, r[3].x, r[3].x, r[3].x); - V4 = Vector(r[2].w, r[2].w, r[2].w, r[2].z); - V5 = Vector(r[3].z, r[3].z, r[3].y, r[3].y); - - P0 -= V0 * V1; - P1 -= V2 * V3; - P2 -= V4 * V5; - - V0 = Vector(r[1].w, r[1].w, r[1].w, r[1].z); - V1 = Vector(r[1].z, r[1].z, r[1].y, r[1].y); - V2 = Vector(r[1].y, r[1].x, r[1].x, r[1].x); - - - Vector S = r[0] * Sign; - Vector R = V0 * P0; - R -= V1 * P1; - R += V2 * P2; - - return S.Dot4(R); - } -#define XM3RANKDECOMPOSE(a, b, c, x, y, z) \ - if((x) < (y)) \ - { \ - if((y) < (z)) \ - { \ - (a) = 2; \ - (b) = 1; \ - (c) = 0; \ - } \ - else \ - { \ - (a) = 1; \ - \ - if((x) < (z)) \ - { \ - (b) = 2; \ - (c) = 0; \ - } \ - else \ - { \ - (b) = 0; \ - (c) = 2; \ - } \ - } \ - } \ - else \ - { \ - if((x) < (z)) \ - { \ - (a) = 2; \ - (b) = 0; \ - (c) = 1; \ - } \ - else \ - { \ - (a) = 0; \ - \ - if((y) < (z)) \ - { \ - (b) = 2; \ - (c) = 1; \ - } \ - else \ - { \ - (b) = 1; \ - (c) = 2; \ - } \ - } \ - } - -#define XM3_DECOMP_EPSILON 0.0001f - - inline amf::Quaternion ConvertMatrixToQuat() - { - amf::Quaternion q; - float r22 = m[2][2]; - if (r22 <= 0.f) // x^2 + y^2 >= z^2 + w^2 - { - float dif10 = m[1][1] - m[0][0]; - float omr22 = 1.f - r22; - if (dif10 <= 0.f) // x^2 >= y^2 - { - float fourXSqr = omr22 - dif10; - float inv4x = 0.5f / sqrtf(fourXSqr); - q.x = fourXSqr*inv4x; - q.y = (m[0][1] + m[1][0])*inv4x; - q.z = (m[0][2] + m[2][0])*inv4x; - q.w = (m[1][2] - m[2][1])*inv4x; - } - else // y^2 >= x^2 - { - float fourYSqr = omr22 + dif10; - float inv4y = 0.5f / sqrtf(fourYSqr); - q.x = (m[0][1] + m[1][0])*inv4y; - q.y = fourYSqr*inv4y; - q.z = (m[1][2] + m[2][1])*inv4y; - q.w = (m[2][0] - m[0][2])*inv4y; - } - } - else // z^2 + w^2 >= x^2 + y^2 - { - float sum10 = m[1][1] + m[0][0]; - float opr22 = 1.f + r22; - if (sum10 <= 0.f) // z^2 >= w^2 - { - float fourZSqr = opr22 - sum10; - float inv4z = 0.5f / sqrtf(fourZSqr); - q.x = (m[0][2] + m[2][0])*inv4z; - q.y = (m[1][2] + m[2][1])*inv4z; - q.z = fourZSqr*inv4z; - q.w = (m[0][1] - m[1][0])*inv4z; - } - else // w^2 >= z^2 - { - float fourWSqr = opr22 + sum10; - float inv4w = 0.5f / sqrtf(fourWSqr); - q.x = (m[1][2] - m[2][1])*inv4w; - q.y = (m[2][0] - m[0][2])*inv4w; - q.z = (m[0][1] - m[1][0])*inv4w; - q.w = fourWSqr*inv4w; - } - } - return q; - } - inline bool DecomposeMatrix(amf::Quaternion &q, amf::Vector &p, amf::Vector &s) - { - static amf::Vector amfXMIdentityR0( 1.0f, 0.0f, 0.0f, 0.0f ); - static amf::Vector amfXMIdentityR1( 0.0f, 1.0f, 0.0f, 0.0f ); - static amf::Vector amfXMIdentityR2( 0.0f, 0.0f, 1.0f, 0.0f ); - static const amf::VectorPOD *pvCanonicalBasis[3] = { - &amfXMIdentityR0, - &amfXMIdentityR1, - &amfXMIdentityR2 - }; - -// p.Assign(-m.m[0][3], -m.m[1][3], -m.m[2][3], 0); - p = r[3]; - - amf::VectorPOD *ppvBasis[3]; - amf::Matrix matTemp; - ppvBasis[0] = &matTemp.r[0]; - ppvBasis[1] = &matTemp.r[1]; - ppvBasis[2] = &matTemp.r[2]; - - matTemp.r[0] = r[0]; - matTemp.r[1] = r[1]; - matTemp.r[2] = r[2]; - matTemp.r[3] = amf::Vector(0.0f, 0.0f, 0.0f, 1.0f ); - - - float *pfScales = (float*)&s; - - size_t a, b, c; - pfScales[0] = ppvBasis[0][0].Length3().x; - pfScales[1] = ppvBasis[1][0].Length3().x; - pfScales[2] = ppvBasis[2][0].Length3().x; - pfScales[3] = 0.f; - - XM3RANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) - - if(pfScales[a] < XM3_DECOMP_EPSILON) - { - ppvBasis[a][0] = pvCanonicalBasis[a][0]; - } - ppvBasis[a][0] = ppvBasis[a][0].Normalize3(); - - if(pfScales[b] < XM3_DECOMP_EPSILON) - { - size_t aa, bb, cc; - float fAbsX, fAbsY, fAbsZ; - - fAbsX = fabsf(ppvBasis[a][0].x); - fAbsY = fabsf(ppvBasis[a][0].y); - fAbsZ = fabsf(ppvBasis[a][0].z); - - XM3RANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) - - ppvBasis[b][0] = ppvBasis[a][0].Cross3(pvCanonicalBasis[cc][0]); - } - - ppvBasis[b][0] = ppvBasis[b][0].Normalize3(); - - if(pfScales[c] < XM3_DECOMP_EPSILON) - { - ppvBasis[c][0] = ppvBasis[a][0].Cross3(ppvBasis[b][0]); - } - - ppvBasis[c][0] = ppvBasis[c][0].Normalize3(); - - - float fDet = matTemp.Determinant().x; - - // use Kramer's rule to check for handedness of coordinate system - if(fDet < 0.0f) - { - // switch coordinate system by negating the scale and inverting the basis vector on the x-axis - pfScales[a] = -pfScales[a]; - ppvBasis[a][0] = ppvBasis[a][0].Negate(); - - fDet = -fDet; - } - - fDet -= 1.0f; - fDet *= fDet; - - if(XM3_DECOMP_EPSILON < fDet) - { - // Non-SRT matrix encountered - return false; - } - - q = matTemp.ConvertMatrixToQuat(); - return true; - } - inline Matrix Inverse(Vector *pDeterminant) - { - - float A2323 = m[2][2] * m[3][3] - m[2][3] * m[3][2]; - float A1323 = m[2][1] * m[3][3] - m[2][3] * m[3][1]; - float A1223 = m[2][1] * m[3][2] - m[2][2] * m[3][1]; - float A0323 = m[2][0] * m[3][3] - m[2][3] * m[3][0]; - float A0223 = m[2][0] * m[3][2] - m[2][2] * m[3][0]; - float A0123 = m[2][0] * m[3][1] - m[2][1] * m[3][0]; - float A2313 = m[1][2] * m[3][3] - m[1][3] * m[3][2]; - float A1313 = m[1][1] * m[3][3] - m[1][3] * m[3][1]; - float A1213 = m[1][1] * m[3][2] - m[1][2] * m[3][1]; - float A2312 = m[1][2] * m[2][3] - m[1][3] * m[2][2]; - float A1312 = m[1][1] * m[2][3] - m[1][3] * m[2][1]; - float A1212 = m[1][1] * m[2][2] - m[1][2] * m[2][1]; - float A0313 = m[1][0] * m[3][3] - m[1][3] * m[3][0]; - float A0213 = m[1][0] * m[3][2] - m[1][2] * m[3][0]; - float A0312 = m[1][0] * m[2][3] - m[1][3] * m[2][0]; - float A0212 = m[1][0] * m[2][2] - m[1][2] * m[2][0]; - float A0113 = m[1][0] * m[3][1] - m[1][1] * m[3][0]; - float A0112 = m[1][0] * m[2][1] - m[1][1] * m[2][0]; - - float det = - m[0][0] * (m[1][1] * A2323 - m[1][2] * A1323 + m[1][3] * A1223) - - m[0][1] * (m[1][0] * A2323 - m[1][2] * A0323 + m[1][3] * A0223) - + m[0][2] * (m[1][0] * A1323 - m[1][1] * A0323 + m[1][3] * A0123) - - m[0][3] * (m[1][0] * A1223 - m[1][1] * A0223 + m[1][2] * A0123); - det = 1.0f / det; - Matrix ret; - ret.m[0][0] = det * (m[1][1] * A2323 - m[1][2] * A1323 + m[1][3] * A1223); - ret.m[0][1] = det * -(m[0][1] * A2323 - m[0][2] * A1323 + m[0][3] * A1223); - ret.m[0][2] = det * (m[0][1] * A2313 - m[0][2] * A1313 + m[0][3] * A1213); - ret.m[0][3] = det * -(m[0][1] * A2312 - m[0][2] * A1312 + m[0][3] * A1212); - ret.m[1][0] = det * -(m[1][0] * A2323 - m[1][2] * A0323 + m[1][3] * A0223); - ret.m[1][1] = det * (m[0][0] * A2323 - m[0][2] * A0323 + m[0][3] * A0223); - ret.m[1][2] = det * -(m[0][0] * A2313 - m[0][2] * A0313 + m[0][3] * A0213); - ret.m[1][3] = det * (m[0][0] * A2312 - m[0][2] * A0312 + m[0][3] * A0212); - ret.m[2][0] = det * (m[1][0] * A1323 - m[1][1] * A0323 + m[1][3] * A0123); - ret.m[2][1] = det * -(m[0][0] * A1323 - m[0][1] * A0323 + m[0][3] * A0123); - ret.m[2][2] = det * (m[0][0] * A1313 - m[0][1] * A0313 + m[0][3] * A0113); - ret.m[2][3] = det * -(m[0][0] * A1312 - m[0][1] * A0312 + m[0][3] * A0112); - ret.m[3][0] = det * -(m[1][0] * A1223 - m[1][1] * A0223 + m[1][2] * A0123); - ret.m[3][1] = det * (m[0][0] * A1223 - m[0][1] * A0223 + m[0][2] * A0123); - ret.m[3][2] = det * -(m[0][0] * A1213 - m[0][1] * A0213 + m[0][2] * A0113); - ret.m[3][3] = det * (m[0][0] * A1212 - m[0][1] * A0212 + m[0][2] * A0112); - - if (pDeterminant != nullptr) - { - *pDeterminant = Vector(det,det,det,det); - } - return ret; - } - - }; - - class Pose - { - public: - typedef enum ValidityFlagBits - { - // validity flags - PF_NONE = 0x0000, - PF_ORIENTATION = 0x0001, - PF_POSITION = 0x0002, - PF_ORIENTATION_VELOCITY = 0x0004, - PF_POSITION_VELOCITY = 0x0008, - PF_ORIENTATION_ACCELERATION = 0x0010, - PF_POSITION_ACCELERATION = 0x0020, - PF_COORDINATES = PF_ORIENTATION | PF_POSITION, - PF_VELOCITY = PF_ORIENTATION_VELOCITY | PF_POSITION_VELOCITY, - PF_ACCELERATION = PF_ORIENTATION_ACCELERATION | PF_POSITION_ACCELERATION, - } ValidityFlagBits; - typedef uint32_t ValidityFlags; - - Pose() : m_ValidityFlags(PF_NONE){} - Pose(const Pose &other) { *this = other; } - Pose& operator=(const Pose &other) = default; - - Pose(const amf::Quaternion& orientation, const amf::Vector& position) - { - Set(orientation, position); - } - Pose(const amf::Quaternion& orientation, const amf::Vector& position, - const amf::Vector& orientationVelocity, const amf::Vector& positionVelocity) - { - Set(orientation, position, orientationVelocity, positionVelocity); - } - Pose(const amf::Quaternion& orientation, const amf::Vector& position, - const amf::Vector& orientationVelocity, const amf::Vector& positionVelocity, - const amf::Vector& orientationAcceleration, const amf::Vector& positionAcceleration) - { - Set(orientation, position, orientationVelocity, positionVelocity, orientationAcceleration, positionAcceleration); - } - void Set(const amf::Quaternion& orientation, const amf::Vector& position) - { - m_Orientation = orientation; - m_Position = position; - m_ValidityFlags = PF_COORDINATES; - } - void Set(const amf::Quaternion& orientation, const amf::Vector& position, - const amf::Vector& orientationVelocity, const amf::Vector& positionVelocity) - { - m_Orientation = orientation; - m_Position = position; - m_OrientationVelocity = orientationVelocity; - m_PositionVelocity = positionVelocity; - m_ValidityFlags = PF_COORDINATES | PF_VELOCITY; - } - - void Set(const amf::Quaternion& orientation, const amf::Vector& position, - const amf::Vector& orientationVelocity, const amf::Vector& positionVelocity, - const amf::Vector& orientationAcceleration, const amf::Vector& positionAcceleration) - { - m_Orientation = orientation; - m_Position = position; - m_OrientationVelocity = orientationVelocity; - m_PositionVelocity = positionVelocity; - m_OrientationAcceleration = orientationAcceleration; - m_PositionAcceleration = positionAcceleration; - m_ValidityFlags = PF_COORDINATES | PF_VELOCITY | PF_ACCELERATION; - } - - - inline const amf::Quaternion& GetOrientation() const { return m_Orientation; } - inline const amf::Vector& GetPosition() const { return m_Position; } - inline const amf::Vector& GetOrientationVelocity() const { return m_OrientationVelocity; } - inline const amf::Vector& GetPositionVelocity() const { return m_PositionVelocity; } - inline const amf::Vector& GetOrientationAcceleration() const { return m_OrientationAcceleration; } - inline const amf::Vector& GetPositionAcceleration() const { return m_PositionAcceleration; } - inline ValidityFlags GetValidityFlags() const { return m_ValidityFlags; } - - inline void SetOrientation(const amf::Quaternion& orienation) - { - m_Orientation = orienation; - m_ValidityFlags |= PF_ORIENTATION; - } - inline void SetPosition(const amf::Vector& position) - { - m_Position = position; - m_ValidityFlags |= PF_POSITION; - } - inline void SetOrientationVelocity(const amf::Vector& orientationVelocity) - { - m_OrientationVelocity = orientationVelocity; - m_ValidityFlags |= PF_ORIENTATION_VELOCITY; - } - inline void SetPositionVelocity(const amf::Vector& positionVelocity) - { - m_PositionVelocity = positionVelocity; - m_ValidityFlags |= PF_POSITION_VELOCITY; - } - inline void SetOrientationAcceleration(const amf::Vector& orientationAcceleration) - { - m_OrientationAcceleration = orientationAcceleration; - m_ValidityFlags |= PF_ORIENTATION_ACCELERATION; - } - inline void SetPositionAcceleration(const amf::Vector& positionAcceleration) - { - m_PositionAcceleration = positionAcceleration; - m_ValidityFlags |= PF_POSITION_ACCELERATION; - } - - protected: - amf::Quaternion m_Orientation; - amf::Vector m_Position; - amf::Vector m_OrientationVelocity; - amf::Vector m_PositionVelocity; - amf::Vector m_OrientationAcceleration; - amf::Vector m_PositionAcceleration; - ValidityFlags m_ValidityFlags; - }; - - //------------------------------------------------------------------------------------------------- - template - class AlphaFilter - { - public: - AlphaFilter(T alpha) : - m_Alpha(alpha), - m_FilteredValue(0) - { - } - - T Apply(T value) - { - m_FilteredValue = m_FilteredValue + m_Alpha * (value - m_FilteredValue); - return m_FilteredValue; - } - - private: - T m_Alpha; - T m_FilteredValue; - }; - - //------------------------------------------------------------------------------------------------- - template - class AlphaBetaFilter - { - public: - AlphaBetaFilter(T alpha, T beta) : - m_Alpha(alpha), - m_Beta(beta), - m_Value(0), - m_PrevValue(0), - m_Velocity(0) - { - } - - T Apply(T value, T dt) - { - m_PrevValue = m_Value; - - m_Value += m_Velocity * dt; - T rk = value - m_Value; - m_Value += m_Alpha * rk; - m_Velocity += (m_Beta * rk) / dt; - - return m_Value; - } - - inline T GetVelocity() const { return m_Velocity; } - - private: - T m_Alpha, - m_Beta; - T m_Value, - m_PrevValue, - m_Velocity; - }; - - //------------------------------------------------------------------------------------------------- - template - class ThresholdFilter - { - public: - ThresholdFilter(T threshold) : - m_Threshold(threshold) - { - } - - T Apply(T value) const - { - T result = value; - if (std::abs(value) < m_Threshold) - { - result = T(0); - } - return result; - } - - private: - T m_Threshold; - }; - - //------------------------------------------------------------------------------------------------- - class Derivative - { - public: - Derivative() {} - - inline static float Calculate(float newVal, float oldVal, float dt) - { - return (newVal - oldVal) / dt; - } - - inline static float Calculate(float dx, float dt) - { - return dx / dt; - } - - static amf::Vector Calculate(const amf::Vector& newVal, const amf::Vector& oldVal, float dt) - { - amf::Vector result; - result.w = Calculate(newVal.w, oldVal.w, dt); - result.x = Calculate(newVal.x, oldVal.x, dt); - result.y = Calculate(newVal.y, oldVal.y, dt); - result.z = Calculate(newVal.z, oldVal.z, dt); - return result; - } - - static amf::Vector Calculate(const amf::Vector& dx, float dt) - { - amf::Vector result; - result.w = Calculate(dx.w, dt); - result.x = Calculate(dx.x, dt); - result.y = Calculate(dx.y, dt); - result.z = Calculate(dx.z, dt); - return result; - } - }; - - - - //--------------------------------------------------------------------------------------------- -} // namespace amf \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.cpp deleted file mode 100644 index 2684d1b5..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "AMFSTL.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(__ANDROID__) - #include -#endif - -#if !defined(__APPLE__) && !defined(_WIN32) -#include -#endif - -#pragma warning(disable: 4996) - -#if defined(__linux) || defined(__APPLE__) -extern "C" -{ - extern int vscwprintf(const wchar_t* p_fmt, va_list p_args); - extern int vscprintf(const char* p_fmt, va_list p_args); -} -#endif - -#ifdef _MSC_VER - #define snprintf _snprintf - #define vscprintf _vscprintf - #define vscwprintf _vscwprintf // Count chars without writing to string - #define vswprintf _vsnwprintf -#endif - - -using namespace amf; - -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wexit-time-destructors" - #pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - -static const amf_string AMF_FORBIDDEN_SYMBOLS = ":? %,;@&=+$<>#\""; -static const amf_string AMF_FORBIDDEN_SYMBOLS_QUERY = ":? %,;@+$<>#\""; - -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - - -//MM: in question: unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`" - -//---------------------------------------------------------------------------------------- -// string conversaion -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_from_unicode_to_utf8(const amf_wstring& str) -{ - amf_string result; - if(0 == str.size()) - { - return result; - } -#if defined(_WIN32) - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); -#endif - - - const wchar_t* pwBuff = str.c_str(); - -#if defined(_WIN32) - int Utf8BuffSize = ::WideCharToMultiByte(CP_UTF8, 0, pwBuff, -1, NULL, 0, NULL, NULL); - if(0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - Utf8BuffSize = ::WideCharToMultiByte(CP_UTF8, 0, pwBuff, -1, &result[0], Utf8BuffSize, NULL, NULL); - Utf8BuffSize--; -#elif defined(__ANDROID__) - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - int Utf8BuffSize = str.length(); - if(0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - - Utf8BuffSize = 0; - for( int i = 0; i < str.length(); i++) - { - //MM TODO Android - not implemented - //int written = wcrtomb(&result[Utf8BuffSize], pwBuff[i], &mbs); - result[Utf8BuffSize] = (char)(pwBuff[i]); - int written = 1; - // temp replacement - Utf8BuffSize += written; - } - setlocale(LC_CTYPE, old_locale); - -#else - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - int Utf8BuffSize = wcstombs(NULL, pwBuff, 0); - if(0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - Utf8BuffSize = wcstombs(&result[0], pwBuff, Utf8BuffSize); - - setlocale(LC_CTYPE, old_locale); -#endif - result.resize(Utf8BuffSize); - - - return result; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_from_utf8_to_unicode(const amf_string& str) -{ - amf_wstring result; - if(0 == str.size()) - { - return result; - } -#if defined(_WIN32) - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); -#endif - - - const char* pUtf8Buff = str.c_str(); - -#if defined(_WIN32) - int UnicodeBuffSize = ::MultiByteToWideChar(CP_UTF8, 0, pUtf8Buff, -1, NULL, 0); - if(0 == UnicodeBuffSize) - { - return result; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - UnicodeBuffSize = ::MultiByteToWideChar(CP_UTF8, 0, pUtf8Buff, -1, &result[0], UnicodeBuffSize); - UnicodeBuffSize--; - -#elif defined(__ANDROID__) - //MM on android mbstowcs cannot be used to define length - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - int len = str.length(); - const char* pt = pUtf8Buff; - int UnicodeBuffSize = 0; - while(len > 0) - { - size_t length = mbrlen (pt, len, &mbs); //MM TODO Android always return 1 - if((length == 0) || (length > len)) - { - break; - } - UnicodeBuffSize++; - len -= length; - pt += length; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - - mbrlen (NULL, 0, &mbs); - len = str.length(); - pt = pUtf8Buff; - UnicodeBuffSize = 0; - while(len > 0) - { - size_t length = mbrlen (pt, len, &mbs); - if((length == 0) || (length > len)) - { - break; - } - mbrtowc(&result[UnicodeBuffSize], pt, length, &mbs); //MM TODO Android always return 1 char - UnicodeBuffSize++; - len -= length; - pt += length; - } - setlocale(LC_CTYPE, old_locale); - - #else - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - int UnicodeBuffSize = mbstowcs(NULL, pUtf8Buff, 0); - if(0 == UnicodeBuffSize) - { - return result; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - UnicodeBuffSize = mbstowcs(&result[0], pUtf8Buff, UnicodeBuffSize); - setlocale(LC_CTYPE, old_locale); -#endif - result.resize(UnicodeBuffSize); - - - return result; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_from_unicode_to_multibyte(const amf_wstring& str) -{ - amf_string result; - if(0 == str.size()) - { - return result; - } - - const wchar_t* pwBuff = str.c_str(); - -#if defined(__ANDROID__) - std::wstring_convert> converter; - result.assign(converter.to_bytes(pwBuff).c_str()); -/* - int Utf8BuffSize = str.length(); - if(0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - - Utf8BuffSize = 0; - for( int i = 0; i < str.length(); i++) - { - //MM TODO Android - not implemented - //int written = wcrtomb(&result[Utf8BuffSize], pwBuff[i], &mbs); - result[Utf8BuffSize] = (char)(pwBuff[i]); - int written = 1; - // temp replacement - Utf8BuffSize += written; - } - result.resize(Utf8BuffSize); -*/ -#else - amf_size Utf8BuffSize = wcstombs(NULL, pwBuff, 0); - if(static_cast(-1) == Utf8BuffSize) - { - return result; - } - - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - Utf8BuffSize = wcstombs(&result[0], pwBuff, Utf8BuffSize); - result.resize(Utf8BuffSize); -#endif - return result; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_from_multibyte_to_unicode(const amf_string& str) -{ - amf_wstring result; - if(0 == str.size()) - { - return result; - } - - const char* pUtf8Buff = str.c_str(); - - -#if defined(__ANDROID__) - //MM on android mbstowcs cannot be used to define length - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - int len = str.length(); - const char* pt = pUtf8Buff; - int UnicodeBuffSize = 0; - while(len > 0) - { - size_t length = mbrlen (pt, len, &mbs); //MM TODO Android always return 1 - if((length == 0) || (length > len)) - { - break; - } - UnicodeBuffSize++; - len -= length; - pt += length; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - - mbrlen (NULL, 0, &mbs); - len = str.length(); - pt = pUtf8Buff; - UnicodeBuffSize = 0; - while(len > 0) - { - size_t length = mbrlen (pt, len, &mbs); - if((length == 0) || (length > len)) - { - break; - } - mbrtowc(&result[UnicodeBuffSize], pt, length, &mbs); //MM TODO Android always return 1 char - UnicodeBuffSize++; - len -= length; - pt += length; - } - #else - amf_size UnicodeBuffSize = mbstowcs(NULL, pUtf8Buff, 0); - if(0 == UnicodeBuffSize) - { - return result; - } - - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - UnicodeBuffSize = mbstowcs(&result[0], pUtf8Buff, UnicodeBuffSize); -#endif - result.resize(UnicodeBuffSize); - return result; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_from_string_to_hex_string(const amf_string& str) -{ - amf_string ret; - char buf[10]; - for(int i = 0; i < (int)str.length(); i++) - { - sprintf(buf, "%02X", (unsigned char)str[i]); - ret += buf; - } - - return ret; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_from_hex_string_to_string(const amf_string& str) -{ - amf_string ret; - char buf[3] = { - 0, 0, 0 - }; - for(int i = 0; i < (int)str.length(); i += 2) - { - buf[0] = str[i]; - buf[1] = str[i + 1]; - int tmp = 0; - sscanf(buf, "%2X", &tmp); - ret += (char)tmp; - } - return ret; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_string_to_lower(const amf_string& str) -{ - std::locale loc; - amf_string out = str.c_str(); - size_t iLen = out.length(); - for(size_t i = 0; i < iLen; i++) - { - out[i] = std::tolower (out[i], loc); - } - return out; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_string_to_lower(const amf_wstring& str) -{ - std::locale loc; - amf_wstring out = str.c_str(); - size_t iLen = out.length(); - for(size_t i = 0; i < iLen; i++) - { - out[i] = std::tolower (out[i], loc); - } - return out; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_string_to_upper(const amf_string& str) -{ - std::locale loc; - amf_string out = str.c_str(); - size_t iLen = out.length(); - for(size_t i = 0; i < iLen; i++) - { - out[i] = std::toupper (out[i], loc); - } - return out; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_string_to_upper(const amf_wstring& str) -{ - std::locale loc; - amf_wstring out = str.c_str(); - size_t iLen = out.length(); - for(size_t i = 0; i < iLen; i++) - { - out[i] = std::toupper (out[i], loc); - } - return out; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_convert_path_to_os_accepted_path(const amf_wstring& path) -{ - amf_wstring result = path; - amf_wstring::size_type pos = 0; - while(pos != amf_string::npos) - { - pos = result.find(L'/', pos); - if(pos == amf_wstring::npos) - { - break; - } - result[pos] = PATH_SEPARATOR_WCHAR; - pos++; - } - return result; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_convert_path_to_url_accepted_path(const amf_wstring& path) -{ - amf_wstring result = path; - amf_wstring::size_type pos = 0; - while(pos != amf_string::npos) - { - pos = result.find(L'\\', pos); - if(pos == amf_wstring::npos) - { - break; - } - result[pos] = L'/'; - pos++; - } - return result; -} -//---------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------------ -amf_string AMF_STD_CALL amf::amf_from_unicode_to_url_utf8(const amf_wstring& data, bool bQuery) // converts to UTF8 and replace fobidden symbols -{ - amf_string converted = amf_from_unicode_to_utf8(amf_convert_path_to_url_accepted_path(data)); - // convert all necessary symbols to hex - amf_string Result; - - amf_size num = converted.length(); - char buf[20]; - for(amf_size i = 0; i < num; i++) - { - if((converted[i] <= 0x20) || (converted[i] >= 0x7F) || - (bQuery && ( AMF_FORBIDDEN_SYMBOLS.find(converted[i]) != amf_string::npos) ) || - (!bQuery && ( AMF_FORBIDDEN_SYMBOLS_QUERY.find(converted[i]) != amf_string::npos) )) - { - snprintf(buf, sizeof(buf), "%%%02X", (unsigned int)(unsigned char)converted[i]); - } - else - { - buf[0] = converted[i]; - buf[1] = 0; - } - Result += buf; - } - return Result; -} -//------------------------------------------------------------------------------------------------------------ -amf_wstring AMF_STD_CALL amf::amf_from_url_utf8_to_unicode(const amf_string& data) -{ - amf_string Result; - amf_string::size_type pos = 0; - while(pos != amf_string::npos) - { - amf_string::size_type old_pos = pos; - pos = data.find('%', pos); - if(pos == amf_string::npos) - { - Result += data.substr(old_pos); - break; - } - if(pos - old_pos > 0) - { - Result += data.substr(old_pos, pos - old_pos); - } - char buf[5] = { - '0', 'x', 0, 0, 0 - }; - buf[2] = data[pos + 1]; - buf[3] = data[pos + 2]; - char* ret = NULL; - - Result += (char)strtol(buf, &ret, 16); - pos += 3; - } - - amf_wstring converted = amf_from_utf8_to_unicode(Result); - - return converted; -} -//---------------------------------------------------------------------------------------------- -amf_size AMF_STD_CALL amf::amf_string_ci_find(const amf_wstring& left, const amf_wstring& right, amf_size off) -{ - amf_wstring _left = amf_string_to_lower(left); - amf_wstring _right = amf_string_to_lower(right); - return _left.find(_right, off); -} -//---------------------------------------------------------------------------------------------- -amf_size AMF_STD_CALL amf::amf_string_ci_rfind(const amf_wstring& left, const amf_wstring& right, amf_size off) -{ - amf_wstring _left = amf_string_to_lower(left); - amf_wstring _right = amf_string_to_lower(right); - return _left.rfind(_right, off); -} -//---------------------------------------------------------------------------------------------- -amf_int AMF_STD_CALL amf::amf_string_ci_compare(const amf_wstring& left, const amf_wstring& right) -{ - amf_wstring _left = amf_string_to_lower(left); - amf_wstring _right = amf_string_to_lower(right); - return _left.compare(_right); -} -//---------------------------------------------------------------------------------------------- -amf_int AMF_STD_CALL amf::amf_string_ci_compare(const amf_string& left, const amf_string& right) -{ - amf_string _left = amf_string_to_lower(left); - amf_string _right = amf_string_to_lower(right); - return _left.compare(_right); -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_string_format(const wchar_t* format, ...) -{ - va_list arglist; - va_start(arglist, format); - amf_wstring text = amf_string_formatVA(format, arglist); - va_end(arglist); - - return text; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_string_format(const char* format, ...) -{ - va_list arglist; - va_start(arglist, format); - amf_string text = amf_string_formatVA(format, arglist); - va_end(arglist); - - return text; -} -//---------------------------------------------------------------------------------------- -amf_wstring AMF_STD_CALL amf::amf_string_formatVA(const wchar_t* format, va_list args) -{ -#if (defined(__linux) || defined(__APPLE__)) && (!defined(__ANDROID__)) - //replace %s with %ls - amf_wstring text(format); - amf_wstring textReplaced; - textReplaced.reserve(text.length() * 2); - bool percentFlag = false; - for(amf_wstring::iterator i = text.begin(); i != text.end(); ++i) - { - if(percentFlag && (*i == L's')) - { - textReplaced.push_back(L'l'); - textReplaced.push_back(L's'); - } - else if(percentFlag && (*i == L'S')) - { - textReplaced.push_back(L's'); - } - else - { - textReplaced.push_back(*i); - } - percentFlag = (*i != L'%') ? false : !percentFlag; - } - - format = textReplaced.c_str(); -#endif //#if defined(__linux) - va_list argcopy; -#ifdef _WIN32 - argcopy = args; -#else - va_copy(argcopy, args); -#endif - int size = vscwprintf(format, argcopy); - - va_end(argcopy); - - - std::vector buf(size + 1); - wchar_t* pBuf = &buf[0]; - vswprintf(pBuf, size + 1, format, args); - return pBuf; -} -//---------------------------------------------------------------------------------------- -amf_string AMF_STD_CALL amf::amf_string_formatVA(const char* format, va_list args) -{ - va_list argcopy; - -#ifdef _WIN32 - argcopy = args; -#else - va_copy(argcopy, args); -#endif - int size = vscprintf(format, args); - - va_end(argcopy); - - std::vector buf(size + 1); - char* pBuf = &buf[0]; - vsnprintf(pBuf, size + 1, format, args); - return pBuf; -} -#if (defined(__linux) || defined(__APPLE__)) && !defined(__ANDROID__) -int vscprintf(const char* format, va_list argptr) -{ - char* p_tmp_buf; - size_t tmp_buf_size; - FILE* fd = open_memstream(&p_tmp_buf, &tmp_buf_size); - if(fd == 0) - { - return -1; - } - va_list arg_copy; - va_copy(arg_copy, argptr); - vfprintf(fd, format, arg_copy); - va_end(arg_copy); - fclose(fd); - free(p_tmp_buf); - return tmp_buf_size; -} - -int vscwprintf(const wchar_t* format, va_list argptr) -{ - wchar_t* p_tmp_buf; - size_t tmp_buf_size; - FILE* fd = open_wmemstream(&p_tmp_buf, &tmp_buf_size); - if(fd == 0) - { - return -1; - } - va_list arg_copy; - va_copy(arg_copy, argptr); - vfwprintf(fd, format, argptr); - va_end(arg_copy); - fclose(fd); - free(p_tmp_buf); - return tmp_buf_size; -} -#endif - -//---------------------------------------------------------------------------------------- -void* AMF_STD_CALL amf_alloc(size_t count) -{ - return malloc(count); -} -//---------------------------------------------------------------------------------------- -void AMF_STD_CALL amf_free(void* ptr) -{ - free(ptr); -} -//---------------------------------------------------------------------------------------- -void* AMF_STD_CALL amf_aligned_alloc(size_t count, size_t alignment) -{ -#if defined(_WIN32) - return _aligned_malloc(count, alignment); -#elif defined (__APPLE__) - void* p = nullptr; - posix_memalign(&p, alignment, count); - return p; -#elif defined(__linux) - return memalign(alignment, count); -#endif -} -//---------------------------------------------------------------------------------------- -void AMF_STD_CALL amf_aligned_free(void* ptr) -{ -#if defined(_WIN32) - return _aligned_free(ptr); -#else - return free(ptr); -#endif -} -//---------------------------------------------------------------------------------------- -#if defined (__ANDROID__) -template -static bool isOneOf(CHAR_T p_ch, const CHAR_T* p_set) -{ - for (const CHAR_T* current = p_set; *current != 0; ++current) - { - if (*current == p_ch) - return true; - } - return false; -} - -static void processWidthAndPrecision(amf_string& p_fmt, va_list& p_args) -{ - for (size_t i = 0; i < p_fmt.length(); i++) - { - if (p_fmt[i] == '*') - { - int value = va_arg(p_args, int); - char valueString[64]; - sprintf(valueString, "%d", value); - p_fmt.replace(i, 1, valueString); - } - } -} - -typedef size_t(*outputStreamDelegateW)(void* p_context, size_t p_offset, const wchar_t* p_stringToAdd, size_t p_length); -static size_t amf_wprintfCore(outputStreamDelegateW p_outDelegate, void* p_context, const wchar_t* p_fmt, va_list p_args) -{ - static const wchar_t formatSpecifiers[] = L"cCdiouxXeEfgGaAnpsSZ"; - bool inFormat = false; - const wchar_t* beginCurrentFormat = NULL; - amf_wstring::size_type formatLength = 0; - amf_wstring currentFormat; - amf_wstring currentArgumentString; - size_t totalCount = 0; - - for (const wchar_t* fmt = p_fmt; *fmt != L'\0'; ++fmt) - { - if (*fmt == L'%') - { - inFormat = !inFormat; - if (inFormat) // Beginning of a format substring - fmt points at the opening % - { - beginCurrentFormat = fmt; // Save the pointer to the current format substring - formatLength = 0; - } - else // This was a percent character %% - don't bother - { - beginCurrentFormat = NULL; - } - currentFormat.clear(); - } - if (inFormat) - { - ++formatLength; - - if (isOneOf(*fmt, formatSpecifiers)) - { // end of the format specifier - inFormat = false; - currentFormat.assign(beginCurrentFormat, formatLength); // currentFormat now contains a modified format string for the current parameter - amf_string currentFormatMB = amf_from_unicode_to_multibyte(currentFormat.c_str()); - //processWidthAndPrecision(currentFormatMB, &p_args[0]); // This would extract additional arguments for width and precision and replace * with their values - for (size_t i = 0; i < currentFormatMB.length(); i++) - { - if (currentFormatMB[i] == '*') - { - int value = va_arg(p_args, int); - char valueString[64]; - sprintf(valueString, "%d", value); - currentFormatMB.replace(i, 1, valueString); - } - } - - switch (*fmt) - { - case L'c': - { - wchar_t ch; - switch (*(fmt - 1)) - { - case L'h': - ch = static_cast(va_arg(p_args, int)); - break; - case L'l': - case L'w': - ch = va_arg(p_args, unsigned int); - break; - default: - ch = va_arg(p_args, unsigned int); // In a wchar_t version of printf %c means wchar_t - } - currentArgumentString = ch; - } - break; - case L'C': - { - wchar_t ch; - switch (*(fmt - 1)) - { - case L'h': - ch = static_cast(va_arg(p_args, int)); - break; - case L'l': - case L'w': - ch = va_arg(p_args, unsigned int); - break; - default: - ch = static_cast(va_arg(p_args, int)); // In a wchar_t version of printf %C means char - } - currentArgumentString = ch; - } - break; - case L's': - { - const void* str = va_arg(p_args, const void*); - if (str != NULL) - { - const wchar_t* str_wchar = nullptr; - switch (*(fmt - 1)) - { - case L'h': - currentArgumentString = amf_from_utf8_to_unicode(reinterpret_cast(str)); - str_wchar = currentArgumentString.c_str(); - break; - case L'l': - case L'w': - currentArgumentString = str_wchar = reinterpret_cast(str); - break; - default: - currentArgumentString = str_wchar = reinterpret_cast(str); - } - } - else - { - currentArgumentString = L"(null)"; - } - } - break; - case L'S': - { - const void* str = va_arg(p_args, const void*); - if (str != NULL) - { - switch (*(fmt - 1)) - { - case (wchar_t)'h': - currentArgumentString = amf_from_utf8_to_unicode(reinterpret_cast(str)); - break; - case L'l': - case L'w': - currentArgumentString = reinterpret_cast(str); - break; - default: - currentArgumentString = amf_from_utf8_to_unicode(reinterpret_cast(str)); - } - } - else - { - currentArgumentString = L"(null)"; - } - } - break; - // All integer formats - case L'i': - case L'd': - case L'u': - case L'o': - case L'x': - case L'X': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - switch (*(fmt - 1)) - { - case L'l': - if (*(fmt - 2) == L'l') // long long - { - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long long)); - } - else - { - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long)); - } - break; - case L'h': - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, int)); - break; -#ifdef _WIN32 - case L'I': // I is Microsoft-specific -#else - case L'z': // z and t are C99-specific, but seem to be unsupported in VC - case L't': -#endif - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, size_t)); - break; - default: - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, int)); - break; - } - currentArgumentString = amf_from_utf8_to_unicode(tempBuffer); - } - break; - // All floating point formats - case L'e': - case L'E': - case L'f': - case L'g': - case L'G': - case L'a': - case L'A': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - switch (*(fmt - 1)) - { - case L'l': - case L'L': - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long double)); - break; - default: - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, double)); - break; - } - currentArgumentString = amf_from_utf8_to_unicode(tempBuffer); - } - break; - // Pointer - case L'p': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, const void*)); - currentArgumentString = amf_from_utf8_to_unicode(tempBuffer); - } - break; - case L'n': - { - int* dest = va_arg(p_args, int*); - *dest = static_cast(totalCount); - currentArgumentString.clear(); - } - break; - } - size_t length = currentArgumentString.length(); - if (p_outDelegate != NULL) // If destination buffer is NULL, just count the characters - { - p_outDelegate(p_context, totalCount, currentArgumentString.c_str(), length); - } - totalCount += length; - } // if (isOneOf(*fmt, formatSpecifiers)) - } // if (inFormat) - else - { // Just copy the character into the output buffer - if (p_outDelegate != NULL) // If destination buffer is NULL, just count the characters - { - p_outDelegate(p_context, totalCount, fmt, 1); - } - ++totalCount; - } - } - return totalCount; -} - -typedef size_t(*outputStreamDelegate)(void* p_context, size_t p_offset, const char* p_stringToAdd, size_t p_length); -static size_t amf_printfCore(outputStreamDelegate p_outDelegate, void* p_context, const char* p_fmt, va_list p_args) -{ - static const char formatSpecifiers[] = "cCdiouxXeEfgGaAnpsSZ"; - bool inFormat = false; - const char* beginCurrentFormat = NULL; - amf_string::size_type formatLength = 0; - amf_string currentFormat; - amf_string currentArgumentString; - size_t totalCount = 0; - - for (const char* fmt = p_fmt; *fmt != '\0'; ++fmt) - { - if (*fmt == '%') - { - inFormat = !inFormat; - if (inFormat) // Beginning of a format substring - fmt points at the opening % - { - beginCurrentFormat = fmt; // Save the pointer to the current format substring - formatLength = 0; - } - else // This was a percent character %% - don't bother - { - beginCurrentFormat = NULL; - } - currentFormat.clear(); - } - if (inFormat) - { - ++formatLength; - - if (isOneOf(*fmt, formatSpecifiers)) - { // end of the format specifier - inFormat = false; - currentFormat.assign(beginCurrentFormat, formatLength); // currentFormat now contains a modified format string for the current parameter - amf_string currentFormatMB = currentFormat.c_str(); - //processWidthAndPrecision(currentFormatMB, &p_args[0]); // This would extract additional arguments for width and precision and replace * with their values - for (size_t i = 0; i < currentFormatMB.length(); i++) - { - if (currentFormatMB[i] == '*') - { - int value = va_arg(p_args, int); - char valueString[64]; - sprintf(valueString, "%d", value); - currentFormatMB.replace(i, 1, valueString); - } - } - - switch (*fmt) - { - case 'c': - { - char ch; - switch (*(fmt - 1)) - { - case 'h': - ch = static_cast(va_arg(p_args, int)); - break; - case 'l': - case 'w': - ch = va_arg(p_args, unsigned int); - break; - default: - ch = va_arg(p_args, unsigned int); // In a wchar_t version of printf %c means wchar_t - } - currentArgumentString = ch; - } - break; - case 'C': - { - char ch; - switch (*(fmt - 1)) - { - case 'h': - ch = static_cast(va_arg(p_args, int)); - break; - case 'l': - case 'w': - ch = va_arg(p_args, unsigned int); - break; - default: - ch = static_cast(va_arg(p_args, int)); // In a wchar_t version of printf %C means char - } - currentArgumentString = ch; - } - break; - case 's': - { - const void* str = va_arg(p_args, const void*); - if (str != NULL) - { - switch (*(fmt - 1)) - { - case 'h': - currentArgumentString = reinterpret_cast(str); - break; - case 'l': - case 'w': - currentArgumentString = amf_from_unicode_to_utf8(reinterpret_cast(str)); - break; - default: - currentArgumentString = reinterpret_cast(str); - } - } - else - { - currentArgumentString = "(null)"; - } - } - break; - case L'S': - { - const void* str = va_arg(p_args, const void*); - if (str != NULL) - { - switch (*(fmt - 1)) - { - case 'h': - currentArgumentString = reinterpret_cast(str); - break; - case 'l': - case 'w': - currentArgumentString = amf_from_unicode_to_utf8(reinterpret_cast(str)); - break; - default: - currentArgumentString = amf_from_unicode_to_utf8(reinterpret_cast(str)); - } - } - else - { - currentArgumentString = "(null)"; - } - } - break; - // All integer formats - case L'i': - case L'd': - case L'u': - case L'o': - case L'x': - case L'X': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - switch (*(fmt - 1)) - { - case L'l': - if (*(fmt - 1) == L'l') // long long - { - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long long)); - } - else - { - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long)); - } - break; - case L'h': - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, int)); - break; -#ifdef _WIN32 - case L'I': // I is Microsoft-specific -#else - case L'z': // z and t are C99-specific, but seem to be unsupported in VC - case L't': -#endif - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, size_t)); - break; - default: - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, int)); - break; - } - currentArgumentString = tempBuffer; - } - break; - // All floating point formats - case L'e': - case L'E': - case L'f': - case L'g': - case L'G': - case L'a': - case L'A': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - switch (*(fmt - 1)) - { - case L'l': - case L'L': - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, long double)); - break; - default: - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, double)); - break; - } - currentArgumentString = tempBuffer; - } - break; - // Pointer - case L'p': - { - char tempBuffer[64]; // 64 bytes should be enough for any numeric format - sprintf(tempBuffer, currentFormatMB.c_str(), va_arg(p_args, const void*)); - currentArgumentString = tempBuffer; - } - break; - case L'n': - { - int* dest = va_arg(p_args, int*); - *dest = static_cast(totalCount); - currentArgumentString.clear(); - } - break; - } - size_t length = currentArgumentString.length(); - if (p_outDelegate != NULL) // If destination buffer is NULL, just count the characters - { - p_outDelegate(p_context, totalCount, currentArgumentString.c_str(), length); - } - totalCount += length; - } // if (isOneOf(*fmt, formatSpecifiers)) - } // if (inFormat) - else - { // Just copy the character into the output buffer - if (p_outDelegate != NULL) // If destination buffer is NULL, just count the characters - { - p_outDelegate(p_context, totalCount, fmt, 1); - } - ++totalCount; - } - } - return totalCount; -} - - -typedef struct { - wchar_t* m_Buf; - size_t m_Size; -} MemBufferContextW; - -typedef struct { - char* m_Buf; - size_t m_Size; -} MemBufferContext; - -static size_t writeToMem(void* p_context, size_t p_offset, const wchar_t* p_stringToAdd, size_t p_length) -{ - wchar_t* buf = &(reinterpret_cast(p_context)->m_Buf[p_offset]); - size_t bufSize = reinterpret_cast(p_context)->m_Size - 1; // -1 to accommodate a trailing '\0' - for (int i = 0; i < p_length && i < bufSize; i++) - { - *buf++ = p_stringToAdd[i]; - } - return p_length; -} - -static size_t writeToFile(void* p_context, size_t, const wchar_t* p_stringToAdd, size_t p_length) -{ - return fwrite(p_stringToAdd, sizeof(wchar_t), p_length, reinterpret_cast(p_context)); -} - -extern "C" -{ - int vswprintf(wchar_t* p_buf, size_t p_size, const wchar_t* p_fmt, va_list p_args) - { - MemBufferContextW context = { p_buf, p_size }; - int bytesWritten = (int)amf_wprintfCore(writeToMem, &context, p_fmt, p_args); - p_buf[bytesWritten] = L'\0'; - return bytesWritten; - } - - int wsprintf(wchar_t* p_buf, const wchar_t* p_fmt, ...) - { - va_list argptr; - va_start(argptr, p_fmt); - return vswprintf(p_buf, static_cast(-1), p_fmt, argptr); - } - - int swprintf(wchar_t* p_buf, size_t p_size, const wchar_t* p_fmt, ...) - { - va_list argptr; - va_start(argptr, p_fmt); - return vswprintf(p_buf, p_size, p_fmt, argptr); - } - - int vfwprintf(FILE* p_stream, const wchar_t* p_fmt, va_list p_args) - { - return (int)amf_wprintfCore(writeToFile, p_stream, p_fmt, p_args); - } - - int fwprintf(FILE* p_stream, const wchar_t* p_fmt, ...) - { - va_list argptr; - va_start(argptr, p_fmt); - return vfwprintf(p_stream, p_fmt, argptr); - } - -#if !defined(__APPLE__) - int vscwprintf(const wchar_t* p_fmt, va_list p_args) - { - return (int)amf_wprintfCore(NULL, NULL, p_fmt, p_args); - } - - int vscprintf(const char* p_fmt, va_list p_args) - { - return (int)amf_printfCore(NULL, NULL, p_fmt, p_args); - } -#endif -} -#endif - -//-------------------------------------------------------------------------------- -// Mac doens't have _wcsicmp(0 - poor man implementation -//-------------------------------------------------------------------------------- -#ifdef __APPLE__ -extern "C" -{ - int _wcsicmp(const wchar_t* s1, const wchar_t* s2) - { - amf_wstring low_s1 = s1; - amf_wstring low_s2 = s2; - std::transform(low_s1.begin(), low_s1.end(), low_s1.begin(), ::tolower); - std::transform(low_s2.begin(), low_s2.end(), low_s2.begin(), ::tolower); - - return wcscmp(low_s1.c_str(), low_s2.c_str()); - } -} -#endif diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.h deleted file mode 100644 index cf6f72d3..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/AMFSTL.h +++ /dev/null @@ -1,362 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_AMFSTL_h -#define AMF_AMFSTL_h - -#pragma once - -#if defined(__GNUC__) - //disable gcc warinings on STL code - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Weffc++" - #include //default stl allocator -#else - - #include //default stl allocator -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../include/core/Interface.h" - -#if defined(__cplusplus) -extern "C" -{ -#endif - // allocator - void* AMF_STD_CALL amf_alloc(amf_size count); - void AMF_STD_CALL amf_free(void* ptr); - void* AMF_STD_CALL amf_aligned_alloc(size_t count, size_t alignment); - void AMF_STD_CALL amf_aligned_free(void* ptr); -#if defined(__cplusplus) -} -#endif - -namespace amf -{ -#pragma warning(push) - -#pragma warning(disable: 4996) // was declared deprecated - //------------------------------------------------------------------------------------------------- - // STL allocator redefined - will allocate all memory in "C" runtime of Common.DLL - //------------------------------------------------------------------------------------------------- - template - class amf_allocator : public std::allocator<_Ty> - { - public: - amf_allocator() : std::allocator<_Ty>() - {} - amf_allocator(const amf_allocator<_Ty>& rhs) : std::allocator<_Ty>(rhs) - {} - template amf_allocator(const amf_allocator<_Other>& rhs) : std::allocator<_Ty>(rhs) - {} - template struct rebind // convert an allocator<_Ty> to an allocator <_Other> - { - typedef amf_allocator<_Other> other; - }; - void deallocate(_Ty* const _Ptr, const size_t _Count) - { - _Count; - amf_free((void*)_Ptr); - } - _Ty* allocate(const size_t _Count, const void* = static_cast(0)) - { // allocate array of _Count el ements - return static_cast<_Ty*>(amf_alloc(_Count * sizeof(_Ty))); - } - }; - - - - - //------------------------------------------------------------------------------------------------- - // STL container templates with changed memory allocation - //------------------------------------------------------------------------------------------------- - template - class amf_vector - : public std::vector<_Ty, amf_allocator<_Ty> > - { - public: - typedef std::vector<_Ty, amf_allocator<_Ty> > _base; - - amf_vector() : _base() {} - explicit amf_vector(size_t _Count) : _base(_Count) {} //MM GCC has strange compile error. to get around replaced size_type with size_t - amf_vector(size_t _Count, const _Ty& _Val) : _base(_Count,_Val) {} - }; - - template - class amf_list - : public std::list<_Ty, amf_allocator<_Ty> > - {}; - - template - class amf_deque - : public std::deque<_Ty, amf_allocator<_Ty> > - {}; - - template - class amf_queue - : public std::queue<_Ty, amf_deque<_Ty> > - {}; - - template > - class amf_map - : public std::map<_Kty, _Ty, _Pr, amf_allocator> > - {}; - - template > - class amf_set - : public std::set<_Kty, _Pr, amf_allocator<_Kty> > - {}; - - template - class amf_limited_deque - : public amf_deque<_Ty> // circular queue of pointers to blocks - { - public: - typedef amf_deque<_Ty> _base; - amf_limited_deque(size_t size_limit) : _base(), _size_limit(size_limit) - { // construct empty deque - } - size_t size_limit() - { - return _size_limit; - } - - void set_size_limit(size_t size_limit) - { - _size_limit = size_limit; - while(_base::size() > _size_limit) - { - _base::pop_front(); - } - } - - _Ty push_front(const _Ty& _Val) - { // insert element at beginning - _Ty ret; - if(_size_limit > 0) - { - _base::push_front(_Val); - if(_base::size() > _size_limit) - { - ret = _base::back(); - _base::pop_back(); - } - } - return ret; - } - void push_front_ex(const _Ty& _Val) - { // insert element at beginning - _base::push_front(_Val); - } - - _Ty push_back(const _Ty& _Val) - { // insert element at beginning - _Ty ret; - if(_size_limit > 0) - { - _base::push_back(_Val); - if(_base::size() > _size_limit) - { - ret = _base::front(); - _base::pop_front(); - } - } - return ret; - } - - protected: - size_t _size_limit; - }; -#pragma warning(pop) - //--------------------------------------------------------------- -#if defined(__GNUC__) - //disable gcc warinings on STL code - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Weffc++" -#endif - - template - class AMFInterfacePtr_TAdapted : public AMFInterfacePtr_T<_Interf> - { - public: - AMFInterfacePtr_TAdapted* operator&() - { - return this; - } - - AMFInterfacePtr_TAdapted() - : AMFInterfacePtr_T<_Interf>() - {} - - AMFInterfacePtr_TAdapted(_Interf* pOther) - : AMFInterfacePtr_T<_Interf>(pOther) - {} - - AMFInterfacePtr_TAdapted(const AMFInterfacePtr_T<_Interf>& other) - : AMFInterfacePtr_T<_Interf>(other) - {} - }; - - template - class amf_vector > - : public std::vector, amf_allocator > > - { - public: - typedef AMFInterfacePtr_T<_Interf>& reference; - typedef std::vector, amf_allocator > > baseclass; - reference operator[](size_t n) - { - return baseclass::operator[](n); - } - }; - - template - class amf_deque > - : public std::deque, amf_allocator > > - {}; - - template - class amf_list > - : public std::list, amf_allocator > > - {}; -#if defined(__GNUC__) - // restore gcc warnings - #pragma GCC diagnostic pop -#endif -} -//------------------------------------------------------------------------------------------------- -// string classes -//------------------------------------------------------------------------------------------------- - -typedef std::basic_string, amf::amf_allocator > amf_string; -typedef std::basic_string, amf::amf_allocator > amf_wstring; - -template -std::size_t amf_string_hash(TAmfString const& s) noexcept -{ -#if defined(_WIN64) || defined(__x86_64__) - constexpr size_t fnvOffsetBasis = 14695981039346656037ULL; - constexpr size_t fnvPrime = 1099511628211ULL; -#else // defined(_WIN64) || defined(__x86_64__) - constexpr size_t fnvOffsetBasis = 2166136261U; - constexpr size_t fnvPrime = 16777619U; -#endif // defined(_WIN64) || defined(__x86_64__) - - const unsigned char* const pStr = reinterpret_cast(s.c_str()); - const size_t count = s.size() * sizeof(typename TAmfString::value_type); - size_t value = fnvOffsetBasis; - for (size_t i = 0; i < count; ++i) - { - value ^= static_cast(pStr[i]); - value *= fnvPrime; - } - return value; -} - -template<> -struct std::hash -{ - std::size_t operator()(amf_wstring const& s) const noexcept - { - return amf_string_hash(s); - } -}; - -template<> -struct std::hash -{ - std::size_t operator()(amf_string const& s) const noexcept - { - return amf_string_hash(s); - } -}; - -namespace amf -{ - //------------------------------------------------------------------------------------------------- - // string conversion - //------------------------------------------------------------------------------------------------- - amf_string AMF_STD_CALL amf_from_unicode_to_utf8(const amf_wstring& str); - amf_wstring AMF_STD_CALL amf_from_utf8_to_unicode(const amf_string& str); - amf_string AMF_STD_CALL amf_from_unicode_to_multibyte(const amf_wstring& str); - amf_wstring AMF_STD_CALL amf_from_multibyte_to_unicode(const amf_string& str); - amf_string AMF_STD_CALL amf_from_string_to_hex_string(const amf_string& str); - amf_string AMF_STD_CALL amf_from_hex_string_to_string(const amf_string& str); - - amf_string AMF_STD_CALL amf_string_to_lower(const amf_string& str); - amf_wstring AMF_STD_CALL amf_string_to_lower(const amf_wstring& str); - amf_string AMF_STD_CALL amf_string_to_upper(const amf_string& str); - amf_wstring AMF_STD_CALL amf_string_to_upper(const amf_wstring& str); - - amf_string AMF_STD_CALL amf_from_unicode_to_url_utf8(const amf_wstring& data, bool bQuery = false); // converts to UTF8 and replace fobidden symbols - amf_wstring AMF_STD_CALL amf_from_url_utf8_to_unicode(const amf_string& data); - - amf_wstring AMF_STD_CALL amf_convert_path_to_os_accepted_path(const amf_wstring& path); - amf_wstring AMF_STD_CALL amf_convert_path_to_url_accepted_path(const amf_wstring& path); - - //------------------------------------------------------------------------------------------------- - // string helpers - //------------------------------------------------------------------------------------------------- - amf_wstring AMF_STD_CALL amf_string_format(const wchar_t* format, ...); - amf_string AMF_STD_CALL amf_string_format(const char* format, ...); - - amf_wstring AMF_STD_CALL amf_string_formatVA(const wchar_t* format, va_list args); - amf_string AMF_STD_CALL amf_string_formatVA(const char* format, va_list args); - - amf_int AMF_STD_CALL amf_string_ci_compare(const amf_wstring& left, const amf_wstring& right); - amf_int AMF_STD_CALL amf_string_ci_compare(const amf_string& left, const amf_string& right); - - amf_size AMF_STD_CALL amf_string_ci_find(const amf_wstring& left, const amf_wstring& right, amf_size off = 0); - amf_size AMF_STD_CALL amf_string_ci_rfind(const amf_wstring& left, const amf_wstring& right, amf_size off = amf_wstring::npos); - //------------------------------------------------------------------------------------------------- -} // namespace amf - - - - -#if defined(__GNUC__) - // restore gcc warnings - #pragma GCC diagnostic pop -#endif - -#endif // AMF_AMFSTL_h - diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ByteArray.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ByteArray.h deleted file mode 100644 index 766f2d81..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ByteArray.h +++ /dev/null @@ -1,136 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_ByteArray_h -#define AMF_ByteArray_h - - -#pragma once -#include "../include/core/Platform.h" -#define INIT_ARRAY_SIZE 1024 -#define ARRAY_MAX_SIZE (1LL << 60LL) // extremely large maximum size -//------------------------------------------------------------------------ -class AMFByteArray -{ -protected: - amf_uint8 *m_pData; - amf_size m_iSize; - amf_size m_iMaxSize; -public: - AMFByteArray() : m_pData(0), m_iSize(0), m_iMaxSize(0) - { - } - AMFByteArray(const AMFByteArray &other) : m_pData(0), m_iSize(0), m_iMaxSize(0) - { - *this = other; - } - AMFByteArray(amf_size num) : m_pData(0), m_iSize(0), m_iMaxSize(0) - { - SetSize(num); - } - virtual ~AMFByteArray() - { - if (m_pData != 0) - { - delete[] m_pData; - } - } - void SetSize(amf_size num) - { - if (num == m_iSize) - { - return; - } - if (num < m_iSize) - { - memset(m_pData + num, 0, m_iMaxSize - num); - } - else if (num > m_iMaxSize) - { - // This is done to prevent the following error from surfacing - // for the pNewData allocation on some compilers: - // -Werror=alloc-size-larger-than= - amf_size newSize = (num / INIT_ARRAY_SIZE) * INIT_ARRAY_SIZE + INIT_ARRAY_SIZE; - if (newSize > ARRAY_MAX_SIZE) - { - return; - } - m_iMaxSize = newSize; - - amf_uint8 *pNewData = new amf_uint8[m_iMaxSize]; - memset(pNewData, 0, m_iMaxSize); - if (m_pData != NULL) - { - memcpy(pNewData, m_pData, m_iSize); - delete[] m_pData; - } - m_pData = pNewData; - } - m_iSize = num; - } - void Copy(const AMFByteArray &old) - { - if (m_iMaxSize < old.m_iSize) - { - m_iMaxSize = old.m_iMaxSize; - if (m_pData != NULL) - { - delete[] m_pData; - } - m_pData = new amf_uint8[m_iMaxSize]; - memset(m_pData, 0, m_iMaxSize); - } - memcpy(m_pData, old.m_pData, old.m_iSize); - m_iSize = old.m_iSize; - } - amf_uint8 operator[] (amf_size iPos) const - { - return m_pData[iPos]; - } - amf_uint8& operator[] (amf_size iPos) - { - return m_pData[iPos]; - } - AMFByteArray& operator=(const AMFByteArray &other) - { - SetSize(other.GetSize()); - if (GetSize() > 0) - { - memcpy(GetData(), other.GetData(), GetSize()); - } - return *this; - } - amf_uint8 *GetData() const { return m_pData; } - amf_size GetSize() const { return m_iSize; } -}; -#endif // AMF_ByteArray_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CPUCaps.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CPUCaps.h deleted file mode 100644 index a8ac7e20..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CPUCaps.h +++ /dev/null @@ -1,275 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#include -#else -#include -#endif - -class InstructionSet -{ - // forward declarations - class InstructionSet_Internal; - -public: - // getters - static std::string Vendor(void) { return CPU_Rep.vendor_; } - static std::string Brand(void) { return CPU_Rep.brand_; } - - static bool SSE3(void) { return CPU_Rep.f_1_ECX_[0]; } - static bool PCLMULQDQ(void) { return CPU_Rep.f_1_ECX_[1]; } - static bool MONITOR(void) { return CPU_Rep.f_1_ECX_[3]; } - static bool SSSE3(void) { return CPU_Rep.f_1_ECX_[9]; } - static bool FMA(void) { return CPU_Rep.f_1_ECX_[12]; } - static bool CMPXCHG16B(void) { return CPU_Rep.f_1_ECX_[13]; } - static bool SSE41(void) { return CPU_Rep.f_1_ECX_[19]; } - static bool SSE42(void) { return CPU_Rep.f_1_ECX_[20]; } - static bool MOVBE(void) { return CPU_Rep.f_1_ECX_[22]; } - static bool POPCNT(void) { return CPU_Rep.f_1_ECX_[23]; } - static bool AES(void) { return CPU_Rep.f_1_ECX_[25]; } - static bool XSAVE(void) { return CPU_Rep.f_1_ECX_[26]; } - static bool OSXSAVE(void) { return CPU_Rep.f_1_ECX_[27]; } - static bool AVX(void) { return CPU_Rep.f_1_ECX_[28]; } - static bool F16C(void) { return CPU_Rep.f_1_ECX_[29]; } - static bool RDRAND(void) { return CPU_Rep.f_1_ECX_[30]; } - - static bool MSR(void) { return CPU_Rep.f_1_EDX_[5]; } - static bool CX8(void) { return CPU_Rep.f_1_EDX_[8]; } - static bool SEP(void) { return CPU_Rep.f_1_EDX_[11]; } - static bool CMOV(void) { return CPU_Rep.f_1_EDX_[15]; } - static bool CLFSH(void) { return CPU_Rep.f_1_EDX_[19]; } - static bool MMX(void) { return CPU_Rep.f_1_EDX_[23]; } - static bool FXSR(void) { return CPU_Rep.f_1_EDX_[24]; } - static bool SSE(void) { return CPU_Rep.f_1_EDX_[25]; } - static bool SSE2(void) { return CPU_Rep.f_1_EDX_[26]; } - - static bool FSGSBASE(void) { return CPU_Rep.f_7_EBX_[0]; } - static bool BMI1(void) { return CPU_Rep.f_7_EBX_[3]; } - static bool HLE(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_7_EBX_[4]; } - static bool AVX2(void) { return CPU_Rep.f_7_EBX_[5]; } - static bool BMI2(void) { return CPU_Rep.f_7_EBX_[8]; } - static bool ERMS(void) { return CPU_Rep.f_7_EBX_[9]; } - static bool INVPCID(void) { return CPU_Rep.f_7_EBX_[10]; } - static bool RTM(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_7_EBX_[11]; } - static bool AVX512F(void) { return CPU_Rep.f_7_EBX_[16]; } - static bool RDSEED(void) { return CPU_Rep.f_7_EBX_[18]; } - static bool ADX(void) { return CPU_Rep.f_7_EBX_[19]; } - static bool AVX512PF(void) { return CPU_Rep.f_7_EBX_[26]; } - static bool AVX512ER(void) { return CPU_Rep.f_7_EBX_[27]; } - static bool AVX512CD(void) { return CPU_Rep.f_7_EBX_[28]; } - static bool SHA(void) { return CPU_Rep.f_7_EBX_[29]; } - static bool AVX512BW(void) { return CPU_Rep.f_7_EBX_[30]; } - static bool AVX512VL(void) { return CPU_Rep.f_7_EBX_[31]; } - - static bool PREFETCHWT1(void) { return CPU_Rep.f_7_ECX_[0]; } - - static bool LAHF(void) { return CPU_Rep.f_81_ECX_[0]; } - static bool LZCNT(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_ECX_[5]; } - static bool ABM(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[5]; } - static bool SSE4a(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[6]; } - static bool XOP(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[11]; } - static bool TBM(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_ECX_[21]; } - - static bool SYSCALL(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_EDX_[11]; } - static bool MMXEXT(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[22]; } - static bool RDTSCP(void) { return CPU_Rep.isIntel_ && CPU_Rep.f_81_EDX_[27]; } - static bool _3DNOWEXT(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[30]; } - static bool _3DNOW(void) { return CPU_Rep.isAMD_ && CPU_Rep.f_81_EDX_[31]; } - -private: - static const InstructionSet_Internal CPU_Rep; - - class InstructionSet_Internal - { - protected: - void GetCpuID - ( - int32_t registers[4], //out - int32_t functionID, - int32_t subfunctionID = 0 - ) - { - #ifdef _WIN32 - if(!subfunctionID) - { - __cpuid((int *)registers, (int)functionID); - } - else - { - __cpuidex((int *)registers, (int)functionID, subfunctionID); - } - #else - - asm volatile - ( - "cpuid": - "=a" (registers[0]), - "=b" (registers[1]), - "=c" (registers[2]), - "=d" (registers[3]): - "a" (functionID), - "c" (subfunctionID) - ); - - #endif - } - public: - InstructionSet_Internal() - : nIds_( 0 ), - nExIds_( 0 ), - isIntel_( false ), - isAMD_( false ), - f_1_ECX_( 0 ), - f_1_EDX_( 0 ), - f_7_EBX_( 0 ), - f_7_ECX_( 0 ), - f_81_ECX_( 0 ), - f_81_EDX_( 0 ) - { - //int cpuInfo[4] = {-1}; - std::array cpui; - - // Calling __cpuid with 0x0 as the function_id argument - // gets the number of the highest valid function ID. - - //todo: verify - //__cpuid(cpui.data(), 0); - GetCpuID(cpui.data(), 0); - - nIds_ = cpui[0]; - - for (int i = 0; i <= nIds_; ++i) - { - //todo: verify - //__cpuidex(cpui.data(), i, 0); - GetCpuID(cpui.data(), i, 0); - - data_.push_back(cpui); - } - - // Capture vendor string - char vendor[0x20]; - std::memset(vendor, 0, sizeof(vendor)); - *reinterpret_cast(vendor) = data_[0][1]; - *reinterpret_cast(vendor + 4) = data_[0][3]; - *reinterpret_cast(vendor + 8) = data_[0][2]; - vendor_ = vendor; - if (vendor_ == "GenuineIntel") - { - isIntel_ = true; - } - else if (vendor_ == "AuthenticAMD") - { - isAMD_ = true; - } - - // load bitset with flags for function 0x00000001 - if (nIds_ >= 1) - { - f_1_ECX_ = data_[1][2]; - f_1_EDX_ = data_[1][3]; - } - - // load bitset with flags for function 0x00000007 - if (nIds_ >= 7) - { - f_7_EBX_ = data_[7][1]; - f_7_ECX_ = data_[7][2]; - } - - // Calling __cpuid with 0x80000000 as the function_id argument - // gets the number of the highest valid extended ID. - //todo: verify - //__cpuid(cpui.data(), 0x80000000); - GetCpuID(cpui.data(), 0x80000000); - - nExIds_ = cpui[0]; - - char brand[0x40]; - memset(brand, 0, sizeof(brand)); - - for (int i = 0x80000000; i <= nExIds_; ++i) - { - //todo: verify - //__cpuidex(cpui.data(), i, 0); - GetCpuID(cpui.data(), i, 0); - - extdata_.push_back(cpui); - } - - // load bitset with flags for function 0x80000001 - if (nExIds_ >= 0x80000001) - { - f_81_ECX_ = extdata_[1][2]; - f_81_EDX_ = extdata_[1][3]; - } - - // Interpret CPU brand string if reported - if (nExIds_ >= 0x80000004) - { - memcpy(brand, extdata_[2].data(), sizeof(cpui)); - memcpy(brand + 16, extdata_[3].data(), sizeof(cpui)); - memcpy(brand + 32, extdata_[4].data(), sizeof(cpui)); - brand_ = brand; - } - }; - - virtual ~InstructionSet_Internal() - { - int i = 0; - ++i; - } - - int nIds_; - int nExIds_; - std::string vendor_; - std::string brand_; - bool isIntel_; - bool isAMD_; - std::bitset<32> f_1_ECX_; - std::bitset<32> f_1_EDX_; - std::bitset<32> f_7_EBX_; - std::bitset<32> f_7_ECX_; - std::bitset<32> f_81_ECX_; - std::bitset<32> f_81_EDX_; - std::vector> data_; - std::vector> extdata_; - }; -}; diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.cpp deleted file mode 100644 index 2fe7786b..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "CurrentTimeImpl.h" - -namespace amf -{ - - //------------------------------------------------------------------------------------------------- - AMFCurrentTimeImpl::AMFCurrentTimeImpl() - : m_timeOfFirstCall(-1) - { - } - - //------------------------------------------------------------------------------------------------- - AMFCurrentTimeImpl::~AMFCurrentTimeImpl() - { - m_timeOfFirstCall = -1; - } - - //------------------------------------------------------------------------------------------------- - amf_pts AMF_STD_CALL AMFCurrentTimeImpl::Get() - { - amf::AMFLock lock(&m_sync); - - // We want pts time to start at 0 and subsequent - // times to be relative to that - if (m_timeOfFirstCall < 0) - { - m_timeOfFirstCall = amf_high_precision_clock(); - return 0; - } - return (amf_high_precision_clock() - m_timeOfFirstCall); // In nanoseconds - } - - //------------------------------------------------------------------------------------------------- - void AMF_STD_CALL AMFCurrentTimeImpl::Reset() - { - m_timeOfFirstCall = -1; - } -} \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.h deleted file mode 100644 index 50e68748..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/CurrentTimeImpl.h +++ /dev/null @@ -1,69 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_CurrentTimeImpl_h -#define AMF_CurrentTimeImpl_h - -#include "../include/core/CurrentTime.h" -#include "InterfaceImpl.h" -#include "Thread.h" - -namespace amf -{ - -class AMFCurrentTimeImpl : public AMFInterfaceImpl -{ -public: - AMFCurrentTimeImpl(); - ~AMFCurrentTimeImpl(); - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(AMFCurrentTime) - AMF_END_INTERFACE_MAP - - virtual amf_pts AMF_STD_CALL Get(); - - virtual void AMF_STD_CALL Reset(); - -private: - amf_pts m_timeOfFirstCall; - mutable AMFCriticalSection m_sync; -}; - -//---------------------------------------------------------------------------------------------- -// smart pointer -//---------------------------------------------------------------------------------------------- -typedef AMFInterfacePtr_T AMFCurrentTimePtr; -//----------------------------------------------------------------------------------------------} -} -#endif // AMF_CurrentTimeImpl_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStream.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStream.h deleted file mode 100644 index 929c4bb1..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStream.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** - *************************************************************************************************** - * @file DataStream.h - * @brief AMFDataStream declaration - *************************************************************************************************** - */ -#ifndef AMF_DataStream_h -#define AMF_DataStream_h -#pragma once - -#include "../include/core/Interface.h" - -namespace amf -{ - // currently supports only - // file:// - // memory:// - - // eventually can be extended with: - // rtsp:// - // rtmp:// - // http:// - // etc - - //---------------------------------------------------------------------------------------------- - enum AMF_STREAM_OPEN - { - AMFSO_READ = 0, - AMFSO_WRITE = 1, - AMFSO_READ_WRITE = 2, - AMFSO_APPEND = 3, - }; - //---------------------------------------------------------------------------------------------- - enum AMF_FILE_SHARE - { - AMFFS_EXCLUSIVE = 0, - AMFFS_SHARE_READ = 1, - AMFFS_SHARE_WRITE = 2, - AMFFS_SHARE_READ_WRITE = 3, - }; - //---------------------------------------------------------------------------------------------- - enum AMF_SEEK_ORIGIN - { - AMF_SEEK_BEGIN = 0, - AMF_SEEK_CURRENT = 1, - AMF_SEEK_END = 2, - }; - //---------------------------------------------------------------------------------------------- - // AMFDataStream interface - //---------------------------------------------------------------------------------------------- - class AMF_NO_VTABLE AMFDataStream : public AMFInterface - { - public: - AMF_DECLARE_IID(0xdb08fe70, 0xb743, 0x4c26, 0xb2, 0x77, 0xa5, 0xc8, 0xe8, 0x14, 0xda, 0x4) - - // interface - virtual AMF_RESULT AMF_STD_CALL Open(const wchar_t* pFileUrl, AMF_STREAM_OPEN eOpenType, AMF_FILE_SHARE eShareType) = 0; - virtual AMF_RESULT AMF_STD_CALL Close() = 0; - virtual AMF_RESULT AMF_STD_CALL Read(void* pData, amf_size iSize, amf_size* pRead) = 0; - virtual AMF_RESULT AMF_STD_CALL Write(const void* pData, amf_size iSize, amf_size* pWritten) = 0; - virtual AMF_RESULT AMF_STD_CALL Seek(AMF_SEEK_ORIGIN eOrigin, amf_int64 iPosition, amf_int64* pNewPosition) = 0; - virtual AMF_RESULT AMF_STD_CALL GetPosition(amf_int64* pPosition) = 0; - virtual AMF_RESULT AMF_STD_CALL GetSize(amf_int64* pSize) = 0; - virtual bool AMF_STD_CALL IsSeekable() = 0; - - static AMF_RESULT AMF_STD_CALL OpenDataStream(const wchar_t* pFileUrl, AMF_STREAM_OPEN eOpenType, AMF_FILE_SHARE eShareType, AMFDataStream** str); - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFDataStreamPtr; - //---------------------------------------------------------------------------------------------- - -} //namespace amf - -#endif // AMF_DataStream_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFactory.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFactory.cpp deleted file mode 100644 index a02b7077..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFactory.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "DataStream.h" -#include "DataStreamMemory.h" -#include "DataStreamFile.h" -#include "TraceAdapter.h" -#include - -using namespace amf; - - -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL amf::AMFDataStream::OpenDataStream(const wchar_t* pFileUrl, AMF_STREAM_OPEN eOpenType, AMF_FILE_SHARE eShareType, AMFDataStream** str) -{ - AMF_RETURN_IF_FALSE(pFileUrl != NULL, AMF_INVALID_ARG); - - AMF_RESULT res = AMF_NOT_SUPPORTED; - std::wstring url(pFileUrl); - - std::wstring protocol; - std::wstring path; - std::wstring::size_type found_pos = url.find(L"://", 0); - if(found_pos != std::wstring::npos) - { - protocol = url.substr(0, found_pos); - path = url.substr(found_pos + 3); - } - else - { - protocol = L"file"; - path = url; - } - AMFDataStreamPtr ptr = NULL; - if(protocol == L"file") - { - ptr = new AMFDataStreamFileImpl; - res = AMF_OK; - } - if(protocol == L"memory") - { - ptr = new AMFDataStreamMemoryImpl(); - res = AMF_OK; - } - if( res == AMF_OK ) - { - res = ptr->Open(path.c_str(), eOpenType, eShareType); - if( res != AMF_OK ) - { - return res; - } - *str = ptr.Detach(); - return AMF_OK; - } - return res; -} -//------------------------------------------------------------------------------------------------- diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.cpp deleted file mode 100644 index 206274e7..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.cpp +++ /dev/null @@ -1,271 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "TraceAdapter.h" -#include "DataStreamFile.h" - -#pragma warning(disable: 4996) -#if defined(_WIN32) -#include -#endif - -#include -#include -#include - -#if defined(_WIN32) - #define amf_close _close - #define amf_read _read - #define amf_write _write - #define amf_seek64 _lseeki64 -#elif defined(__linux)// Linux - #include - #define amf_close close - #define amf_read read - #define amf_write write - #define amf_seek64 lseek64 -#elif defined(__APPLE__) - #include - #define amf_close close - #define amf_read read - #define amf_write write - #define amf_seek64 lseek -#endif - -using namespace amf; - -#define AMF_FACILITY L"AMFDataStreamFileImpl" - -#define AMF_FILE_PROTOCOL L"file" - -//------------------------------------------------------------------------------------------------- -AMFDataStreamFileImpl::AMFDataStreamFileImpl() - : m_iFileDescriptor(-1), m_Path() -{} -//------------------------------------------------------------------------------------------------- -AMFDataStreamFileImpl::~AMFDataStreamFileImpl() -{ - Close(); -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::Close() -{ - AMF_RESULT err = AMF_OK; - if(m_iFileDescriptor != -1) - { - const int status = amf_close(m_iFileDescriptor); - if(status != 0) - { - err = AMF_FAIL; - } - m_iFileDescriptor = -1; - } - return err; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::Read(void* pData, amf_size iSize, amf_size* pRead) -{ - AMF_RETURN_IF_FALSE(m_iFileDescriptor != -1, AMF_FILE_NOT_OPEN, L"Read() - File not open"); - AMF_RESULT err = AMF_OK; - - int ready = amf_read(m_iFileDescriptor, pData, (amf_uint)iSize); - - if(pRead != NULL) - { - *pRead = ready; - } - if(ready == 0) // eof - { - err = AMF_EOF; - } - else if(ready == -1) - { - err = AMF_FAIL; - } - return err; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::Write(const void* pData, amf_size iSize, amf_size* pWritten) -{ - AMF_RETURN_IF_FALSE(m_iFileDescriptor != -1, AMF_FILE_NOT_OPEN, L"Write() - File not Open"); - AMF_RESULT err = AMF_OK; - amf_uint32 written = amf_write(m_iFileDescriptor, pData, (amf_uint)iSize); - - if(pWritten != NULL) - { - *pWritten = written; - } - if(written != iSize) // check errors - { - err = AMF_FAIL; - } - return err; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::Seek(AMF_SEEK_ORIGIN eOrigin, amf_int64 iPosition, amf_int64* pNewPosition) -{ - AMF_RETURN_IF_FALSE(m_iFileDescriptor != -1, AMF_FILE_NOT_OPEN, L"Seek() - File not Open"); - - int org = 0; - - switch(eOrigin) - { - case AMF_SEEK_BEGIN: - org = SEEK_SET; - break; - - case AMF_SEEK_CURRENT: - org = SEEK_CUR; - break; - - case AMF_SEEK_END: - org = SEEK_END; - break; - } - amf_int64 new_pos = 0; - - new_pos = amf_seek64(m_iFileDescriptor, iPosition, org); - if(new_pos == -1L) // check errors - { - return AMF_FAIL; - } - if(pNewPosition != NULL) - { - *pNewPosition = new_pos; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::GetPosition(amf_int64* pPosition) -{ - AMF_RETURN_IF_FALSE(pPosition != NULL, AMF_INVALID_POINTER); - AMF_RETURN_IF_FALSE(m_iFileDescriptor != -1, AMF_FILE_NOT_OPEN, L"GetPosition() - File not Open"); - *pPosition = amf_seek64(m_iFileDescriptor, 0, SEEK_CUR); - if(*pPosition == -1L) - { - return AMF_FAIL; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::GetSize(amf_int64* pSize) -{ - AMF_RETURN_IF_FALSE(pSize != NULL, AMF_INVALID_POINTER); - AMF_RETURN_IF_FALSE(m_iFileDescriptor != -1, AMF_FILE_NOT_OPEN, L"GetSize() - File not open"); - - amf_int64 cur_pos = amf_seek64(m_iFileDescriptor, 0, SEEK_CUR); - *pSize = amf_seek64(m_iFileDescriptor, 0, SEEK_END); - amf_seek64(m_iFileDescriptor, cur_pos, SEEK_SET); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -bool AMF_STD_CALL AMFDataStreamFileImpl::IsSeekable() -{ - return true; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamFileImpl::Open(const wchar_t* pFilePath, AMF_STREAM_OPEN eOpenType, AMF_FILE_SHARE eShareType) -{ - if(m_iFileDescriptor != -1) - { - Close(); - } - AMF_RETURN_IF_FALSE(pFilePath != NULL, AMF_INVALID_ARG); - - m_Path = pFilePath; - - -#if defined(_WIN32) - int access = _O_BINARY; -#else - int access = 0; -#endif - - switch(eOpenType) - { - case AMFSO_READ: - access |= O_RDONLY; - break; - - case AMFSO_WRITE: - access |= O_CREAT | O_TRUNC | O_WRONLY; - break; - - case AMFSO_READ_WRITE: - access |= O_CREAT | O_TRUNC | O_RDWR; - break; - - case AMFSO_APPEND: - access |= O_CREAT | O_APPEND | O_RDWR; - break; - } - -#ifdef _WIN32 - int shflag = 0; - switch(eShareType) - { - case AMFFS_EXCLUSIVE: - shflag = _SH_DENYRW; - break; - - case AMFFS_SHARE_READ: - shflag = _SH_DENYWR; - break; - - case AMFFS_SHARE_WRITE: - shflag = _SH_DENYRD; - break; - - case AMFFS_SHARE_READ_WRITE: - shflag = _SH_DENYNO; - break; - } -#endif - -#ifdef O_BINARY - access |= O_BINARY; -#endif - -#ifdef _WIN32 - m_iFileDescriptor = _wsopen(m_Path.c_str(), access, shflag, 0666); -#else - amf_string str = amf_from_unicode_to_utf8(m_Path); - m_iFileDescriptor = open(str.c_str(), access, 0666); -#endif - - if(m_iFileDescriptor == -1) - { - return AMF_FAIL; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.h deleted file mode 100644 index d76cba63..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamFile.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_DataStreamFile_h -#define AMF_DataStreamFile_h - -#pragma once - -#include "DataStream.h" -#include "InterfaceImpl.h" -#include "AMFSTL.h" -#include - -namespace amf -{ - class AMFDataStreamFileImpl : public AMFInterfaceImpl - { - public: - AMFDataStreamFileImpl(); - virtual ~AMFDataStreamFileImpl(); - // interface - virtual AMF_RESULT AMF_STD_CALL Close(); - virtual AMF_RESULT AMF_STD_CALL Read(void* pData, amf_size iSize, amf_size* pRead); - virtual AMF_RESULT AMF_STD_CALL Write(const void* pData, amf_size iSize, amf_size* pWritten); - virtual AMF_RESULT AMF_STD_CALL Seek(AMF_SEEK_ORIGIN eOrigin, amf_int64 iPosition, amf_int64* pNewPosition); - virtual AMF_RESULT AMF_STD_CALL GetPosition(amf_int64* pPosition); - virtual AMF_RESULT AMF_STD_CALL GetSize(amf_int64* pSize); - virtual bool AMF_STD_CALL IsSeekable(); - - // local - // aways pass full URL just in case - virtual AMF_RESULT AMF_STD_CALL Open(const wchar_t* pFilePath, AMF_STREAM_OPEN eOpenType, AMF_FILE_SHARE eShareType); - protected: - int m_iFileDescriptor; - amf_wstring m_Path; - }; -} //namespace amf -#endif // AMF_DataStreamFile_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.cpp deleted file mode 100644 index 2676c35d..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.cpp +++ /dev/null @@ -1,175 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "Thread.h" -#include "TraceAdapter.h" -#include "DataStreamMemory.h" - -using namespace amf; - -#define AMF_FACILITY L"AMFDataStreamMemoryImpl" - -//------------------------------------------------------------------------------------------------- -AMFDataStreamMemoryImpl::AMFDataStreamMemoryImpl() - : m_pMemory(NULL), - m_uiMemorySize(0), - m_uiAllocatedSize(0), - m_pos(0) -{} -//------------------------------------------------------------------------------------------------- -AMFDataStreamMemoryImpl::~AMFDataStreamMemoryImpl() -{ - Close(); -} -//------------------------------------------------------------------------------------------------- -// interface -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::Close() -{ - if(m_pMemory != NULL) - { - amf_virtual_free(m_pMemory); - } - m_pMemory = NULL, - m_uiMemorySize = 0, - m_uiAllocatedSize = 0, - m_pos = 0; - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMFDataStreamMemoryImpl::Realloc(amf_size iSize) -{ - if(iSize > m_uiMemorySize) - { - amf_uint8* pNewMemory = (amf_uint8*)amf_virtual_alloc(iSize); - if(pNewMemory == NULL) - { - return AMF_OUT_OF_MEMORY; - } - m_uiAllocatedSize = iSize; - if(m_pMemory != NULL) - { - memcpy(pNewMemory, m_pMemory, m_uiMemorySize); - amf_virtual_free(m_pMemory); - } - - m_pMemory = pNewMemory; - } - m_uiMemorySize = iSize; - if(m_pos > m_uiMemorySize) - { - m_pos = m_uiMemorySize; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::Read(void* pData, amf_size iSize, amf_size* pRead) -{ - AMF_RETURN_IF_FALSE(pData != NULL, AMF_INVALID_POINTER, L"Read() - pData==NULL"); - AMF_RETURN_IF_FALSE(m_pMemory != NULL, AMF_NOT_INITIALIZED, L"Read() - Stream is not allocated"); - - amf_size toRead = AMF_MIN(iSize, m_uiMemorySize - m_pos); - memcpy(pData, m_pMemory + m_pos, toRead); - m_pos += toRead; - if(pRead != NULL) - { - *pRead = toRead; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::Write(const void* pData, amf_size iSize, amf_size* pWritten) -{ - AMF_RETURN_IF_FALSE(pData != NULL, AMF_INVALID_POINTER, L"Write() - pData==NULL"); - AMF_RETURN_IF_FAILED(Realloc(m_pos + iSize), L"Write() - Stream is not allocated"); - - amf_size toWrite = AMF_MIN(iSize, m_uiMemorySize - m_pos); - memcpy(m_pMemory + m_pos, pData, toWrite); - m_pos += toWrite; - if(pWritten != NULL) - { - *pWritten = toWrite; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::Seek(AMF_SEEK_ORIGIN eOrigin, amf_int64 iPosition, amf_int64* pNewPosition) -{ - switch(eOrigin) - { - case AMF_SEEK_BEGIN: - m_pos = (amf_size)iPosition; - break; - - case AMF_SEEK_CURRENT: - m_pos += (amf_size)iPosition; - break; - - case AMF_SEEK_END: - m_pos = m_uiMemorySize - (amf_size)iPosition; - break; - } - - if(m_pos > m_uiMemorySize) - { - m_pos = m_uiMemorySize; - } - if(pNewPosition != NULL) - { - *pNewPosition = m_pos; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::GetPosition(amf_int64* pPosition) -{ - AMF_RETURN_IF_FALSE(pPosition != NULL, AMF_INVALID_POINTER, L"GetPosition() - pPosition==NULL"); - *pPosition = m_pos; - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT AMF_STD_CALL AMFDataStreamMemoryImpl::GetSize(amf_int64* pSize) -{ - AMF_RETURN_IF_FALSE(pSize != NULL, AMF_INVALID_POINTER, L"GetPosition() - pSize==NULL"); - *pSize = m_uiMemorySize; - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -bool AMF_STD_CALL AMFDataStreamMemoryImpl::IsSeekable() -{ - return true; -} -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.h deleted file mode 100644 index 378473ee..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/DataStreamMemory.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_DataStreamMemory_h -#define AMF_DataStreamMemory_h - -#pragma once - -#include "DataStream.h" -#include "InterfaceImpl.h" - -namespace amf -{ - class AMFDataStreamMemoryImpl : public AMFInterfaceImpl - { - public: - AMFDataStreamMemoryImpl(); - virtual ~AMFDataStreamMemoryImpl(); - // interface - virtual AMF_RESULT AMF_STD_CALL Open(const wchar_t* /*pFileUrl*/, AMF_STREAM_OPEN /*eOpenType*/, AMF_FILE_SHARE /*eShareType*/) - { - //pFileUrl; - //eOpenType; - //eShareType; - return AMF_OK; - } - virtual AMF_RESULT AMF_STD_CALL Close(); - virtual AMF_RESULT AMF_STD_CALL Read(void* pData, amf_size iSize, amf_size* pRead); - virtual AMF_RESULT AMF_STD_CALL Write(const void* pData, amf_size iSize, amf_size* pWritten); - virtual AMF_RESULT AMF_STD_CALL Seek(AMF_SEEK_ORIGIN eOrigin, amf_int64 iPosition, amf_int64* pNewPosition); - virtual AMF_RESULT AMF_STD_CALL GetPosition(amf_int64* pPosition); - virtual AMF_RESULT AMF_STD_CALL GetSize(amf_int64* pSize); - virtual bool AMF_STD_CALL IsSeekable(); - - protected: - AMF_RESULT Realloc(amf_size iSize); - - amf_uint8* m_pMemory; - amf_size m_uiMemorySize; - amf_size m_uiAllocatedSize; - amf_size m_pos; - private: - AMFDataStreamMemoryImpl(const AMFDataStreamMemoryImpl&); - AMFDataStreamMemoryImpl& operator=(const AMFDataStreamMemoryImpl&); - }; -} //namespace amf - -#endif // AMF_DataStreamMemory_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.cpp deleted file mode 100644 index 520c2d4f..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.cpp +++ /dev/null @@ -1,250 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "IOCapsImpl.h" - -namespace amf -{ - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - AMFIOCapsImpl::SurfaceFormat::SurfaceFormat() : - m_Format(AMF_SURFACE_UNKNOWN), - m_Native(false) - { - } - - AMFIOCapsImpl::SurfaceFormat::SurfaceFormat(AMF_SURFACE_FORMAT format, amf_bool native) : - m_Format(format), - m_Native(native) - { - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - AMFIOCapsImpl::MemoryType::MemoryType() : - m_Type(AMF_MEMORY_UNKNOWN), - m_Native(false) - { - } - - AMFIOCapsImpl::MemoryType::MemoryType(AMF_MEMORY_TYPE type, amf_bool native) : - m_Type(type), - m_Native(native) - { - } - - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - AMFIOCapsImpl::AMFIOCapsImpl() : - m_MinWidth(-1), - m_MaxWidth(-1), - m_MinHeight(-1), - m_MaxHeight(-1), - m_VertAlign(-1), - m_InterlacedSupported(false) - { - } - - AMFIOCapsImpl::AMFIOCapsImpl(amf_int32 minWidth, amf_int32 maxWidth, - amf_int32 minHeight, amf_int32 maxHeight, - amf_int32 vertAlign, amf_bool interlacedSupport, - amf_int32 numOfNativeFormats, const AMF_SURFACE_FORMAT* nativeFormats, - amf_int32 numOfNonNativeFormats, const AMF_SURFACE_FORMAT* nonNativeFormats, - amf_int32 numOfNativeMemTypes, const AMF_MEMORY_TYPE* nativeMemTypes, - amf_int32 numOfNonNativeMemTypes, const AMF_MEMORY_TYPE* nonNativeMemTypes) - { - m_MinWidth = minWidth; - m_MaxWidth = maxWidth; - m_MinHeight = minHeight; - m_MaxHeight = maxHeight; - m_VertAlign = vertAlign; - m_InterlacedSupported = interlacedSupport; - PopulateSurfaceFormats(numOfNativeFormats, nativeFormats, true); - PopulateSurfaceFormats(numOfNonNativeFormats, nonNativeFormats, false); - PopulateMemoryTypes(numOfNativeMemTypes, nativeMemTypes, true); - PopulateMemoryTypes(numOfNonNativeMemTypes, nonNativeMemTypes, false); - } - - void AMFIOCapsImpl::PopulateSurfaceFormats(amf_int32 numOfFormats, const AMF_SURFACE_FORMAT* formats, amf_bool native) - { - if (formats != NULL) - { - for (amf_int32 i = 0; i < numOfFormats; i++) - { - bool found = false; - for(amf_size exists_idx = 0; exists_idx < m_SurfaceFormats.size(); exists_idx++) - { - if(m_SurfaceFormats[exists_idx].GetFormat() == formats[i]) - { - found = true; - } - } - if(!found) - { - m_SurfaceFormats.push_back(SurfaceFormat(formats[i], native)); - } - } - } - } - - void AMFIOCapsImpl::PopulateMemoryTypes(amf_int32 numOfTypes, const AMF_MEMORY_TYPE* memTypes, amf_bool native) - { - if (memTypes != NULL) - { - for (amf_int32 i = 0; i < numOfTypes; i++) - { - bool found = false; - for(amf_size exists_idx = 0; exists_idx < m_MemoryTypes.size(); exists_idx++) - { - if(m_MemoryTypes[exists_idx].GetType() == memTypes[i]) - { - found = true; - } - } - if(!found) - { - m_MemoryTypes.push_back(MemoryType(memTypes[i], native)); - } - } - } - } - - // Get supported resolution ranges in pixels/lines: - void AMF_STD_CALL AMFIOCapsImpl::GetWidthRange(amf_int32* minWidth, amf_int32* maxWidth) const - { - if (minWidth != NULL) - { - *minWidth = m_MinWidth; - } - if (maxWidth != NULL) - { - *maxWidth = m_MaxWidth; - } - } - - void AMF_STD_CALL AMFIOCapsImpl::GetHeightRange(amf_int32* minHeight, amf_int32* maxHeight) const - { - if (minHeight != NULL) - { - *minHeight = m_MinHeight; - } - if (maxHeight != NULL) - { - *maxHeight = m_MaxHeight; - } - } - - // Get memory alignment in lines: - // Vertical aligmnent should be multiples of this number - amf_int32 AMF_STD_CALL AMFIOCapsImpl::GetVertAlign() const - { - return m_VertAlign; - } - - // Enumerate supported surface pixel formats: - amf_int32 AMF_STD_CALL AMFIOCapsImpl::GetNumOfFormats() const - { - return (amf_int32)m_SurfaceFormats.size(); - } - - AMF_RESULT AMF_STD_CALL AMFIOCapsImpl::GetFormatAt(amf_int32 index, AMF_SURFACE_FORMAT* format, bool* native) const - { - if (index >= 0 && index < static_cast(m_SurfaceFormats.size())) - { - SurfaceFormat curFormat(m_SurfaceFormats.at(index)); - if (format != NULL) - { - *format = curFormat.GetFormat(); - } - if (native != NULL) - { - *native = curFormat.IsNative(); - } - return AMF_OK; - } - else - { - return AMF_INVALID_ARG; - } - } - - // Enumerate supported surface formats: - amf_int32 AMF_STD_CALL AMFIOCapsImpl::GetNumOfMemoryTypes() const - { - return (amf_int32)m_MemoryTypes.size(); - } - - AMF_RESULT AMF_STD_CALL AMFIOCapsImpl::GetMemoryTypeAt(amf_int32 index, AMF_MEMORY_TYPE* memType, bool* native) const - { - if (index >= 0 && index < static_cast(m_MemoryTypes.size())) - { - MemoryType curType(m_MemoryTypes.at(index)); - if (memType != NULL) - { - *memType = curType.GetType(); - } - if (native != NULL) - { - *native = curType.IsNative(); - } - return AMF_OK; - } - else - { - return AMF_INVALID_ARG; - } - } - - // interlaced support: - amf_bool AMF_STD_CALL AMFIOCapsImpl::IsInterlacedSupported() const - { - return m_InterlacedSupported; - } - - void AMFIOCapsImpl::SetResolution(amf_int32 minWidth, amf_int32 maxWidth, amf_int32 minHeight, amf_int32 maxHeight) - { - m_MinWidth = minWidth; - m_MaxWidth = maxWidth; - m_MinHeight = minHeight; - m_MaxHeight = maxHeight; - } - - void AMFIOCapsImpl::SetVertAlign(amf_int32 vertAlign) - { - m_VertAlign = vertAlign; - } - - void AMFIOCapsImpl::SetInterlacedSupport(amf_bool interlaced) - { - m_InterlacedSupported = interlaced; - } - -} \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.h deleted file mode 100644 index 912fafd1..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/IOCapsImpl.h +++ /dev/null @@ -1,132 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_IOCapsImpl_h -#define AMF_IOCapsImpl_h - -#pragma once - -#include "InterfaceImpl.h" -#include "../include/components/ComponentCaps.h" -#include - -namespace amf -{ - class AMFIOCapsImpl : public AMFInterfaceImpl - { - protected: - class SurfaceFormat - { - public: - typedef std::vector Collection; - public: - SurfaceFormat(); - SurfaceFormat(AMF_SURFACE_FORMAT format, amf_bool native); - - inline AMF_SURFACE_FORMAT GetFormat() const throw() { return m_Format; } - inline amf_bool IsNative() const throw() { return m_Native; } - private: - AMF_SURFACE_FORMAT m_Format; - amf_bool m_Native; - }; - - class MemoryType - { - public: - typedef std::vector Collection; - public: - MemoryType(); - MemoryType(AMF_MEMORY_TYPE type, amf_bool native); - - inline AMF_MEMORY_TYPE GetType() const throw() { return m_Type; } - inline amf_bool IsNative() const throw() { return m_Native; } - private: - AMF_MEMORY_TYPE m_Type; - amf_bool m_Native; - }; - - struct Resolution - { - amf_int32 m_Width; - amf_int32 m_Height; - }; - - protected: - AMFIOCapsImpl(); - AMFIOCapsImpl(amf_int32 minWidth, amf_int32 maxWidth, - amf_int32 minHeight, amf_int32 maxHeight, - amf_int32 vertAlign, amf_bool interlacedSupport, - amf_int32 numOfNativeFormats, const AMF_SURFACE_FORMAT* nativeFormats, - amf_int32 numOfNonNativeFormats, const AMF_SURFACE_FORMAT* nonNativeFormats, - amf_int32 numOfNativeMemTypes, const AMF_MEMORY_TYPE* nativeMemTypes, - amf_int32 numOfNonNativeMemTypes, const AMF_MEMORY_TYPE* nonNativeMemTypes); - - public: - // Get supported resolution ranges in pixels/lines: - virtual void AMF_STD_CALL GetWidthRange(amf_int32* minWidth, amf_int32* maxWidth) const; - virtual void AMF_STD_CALL GetHeightRange(amf_int32* minHeight, amf_int32* maxHeight) const; - - // Get memory alignment in lines: - // Vertical aligmnent should be multiples of this number - virtual amf_int32 AMF_STD_CALL GetVertAlign() const; - - // Enumerate supported surface pixel formats: - virtual amf_int32 AMF_STD_CALL GetNumOfFormats() const; - virtual AMF_RESULT AMF_STD_CALL GetFormatAt(amf_int32 index, AMF_SURFACE_FORMAT* format, amf_bool* native) const; - - // Enumerate supported surface formats: - virtual amf_int32 AMF_STD_CALL GetNumOfMemoryTypes() const; - virtual AMF_RESULT AMF_STD_CALL GetMemoryTypeAt(amf_int32 index, AMF_MEMORY_TYPE* memType, amf_bool* native) const; - - // interlaced support: - virtual amf_bool AMF_STD_CALL IsInterlacedSupported() const; - - protected: - void SetResolution(amf_int32 minWidth, amf_int32 maxWidth, amf_int32 minHeight, amf_int32 maxHeight); - void SetVertAlign(amf_int32 alignment); - void SetInterlacedSupport(amf_bool interlaced); - void PopulateSurfaceFormats(amf_int32 numOfFormats, const AMF_SURFACE_FORMAT* formats, amf_bool native); - void PopulateMemoryTypes(amf_int32 numOfTypes, const AMF_MEMORY_TYPE* memTypes, amf_bool native); - - - protected: - amf_int32 m_MinWidth; - amf_int32 m_MaxWidth; - amf_int32 m_MinHeight; - amf_int32 m_MaxHeight; - amf_int32 m_VertAlign; - amf_bool m_InterlacedSupported; - SurfaceFormat::Collection m_SurfaceFormats; - MemoryType::Collection m_MemoryTypes; - }; -} -#endif // AMF_IOCapsImpl_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/InterfaceImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/InterfaceImpl.h deleted file mode 100644 index f3627f9a..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/InterfaceImpl.h +++ /dev/null @@ -1,214 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_InterfaceImpl_h -#define AMF_InterfaceImpl_h - -#pragma once - -#include "../include/core/Interface.h" -#include "Thread.h" - -#pragma warning(disable : 4511) -namespace amf -{ - #define AMF_BEGIN_INTERFACE_MAP \ - virtual AMF_RESULT AMF_STD_CALL QueryInterface(const amf::AMFGuid & interfaceID, void** ppInterface) \ - { \ - AMF_RESULT err = AMF_NO_INTERFACE; \ - - - #define AMF_INTERFACE_ENTRY(T) \ - if(AMFCompareGUIDs(interfaceID, T::IID())) \ - { \ - *ppInterface = (void*)static_cast(this); \ - this->Acquire(); \ - err = AMF_OK; \ - } \ - else \ - - #define AMF_INTERFACE_ENTRY_THIS(T, _TI) \ - if(AMFCompareGUIDs(interfaceID, T::IID())) \ - { \ - *ppInterface = (void*)static_cast(static_cast<_TI*>(this)); \ - this->Acquire(); \ - err = AMF_OK; \ - } \ - else \ - - #define AMF_INTERFACE_MULTI_ENTRY(T) \ - if(AMFCompareGUIDs(interfaceID, T::IID())) \ - { \ - *ppInterface = (void*)static_cast(this); \ - AcquireInternal(); \ - err = AMF_OK; \ - } \ - else \ - - #define AMF_INTERFACE_CHAIN_ENTRY(T) \ - if(static_cast(*this).T::QueryInterface(interfaceID, ppInterface) == AMF_OK) \ - {err = AMF_OK;} \ - else \ - - //good as an example but we should not use aggregate pattern without big reason - very hard to debug - #define AMF_INTERFACE_AGREGATED_ENTRY(T, _Ptr) \ - if(AMFCompareGUIDs(interfaceID, T::IID())) \ - { \ - T* ptr = static_cast(_Ptr); \ - *ppInterface = (void*)ptr; \ - ptr->Acquire(); \ - err = AMF_OK; \ - } \ - else \ - - #define AMF_INTERFACE_CHAIN_AGREGATED_ENTRY(T, _Ptr) \ - if(err = static_cast(_Ptr)->QueryInterface(interfaceID, ppInterface)) { \ - } \ - else \ - - #define AMF_END_INTERFACE_MAP \ - {} \ - return err; \ - } \ - - - //--------------------------------------------------------------- - class AMFInterfaceBase - { - protected: - amf_long m_refCount; - virtual ~AMFInterfaceBase() -#if __GNUC__ == 11 //WORKAROUND for gcc-11 bug - __attribute__ ((noinline)) -#endif - {} - public: - AMFInterfaceBase() : m_refCount(0) - {} - virtual amf_long AMF_STD_CALL AcquireInternal() - { - amf_long newVal = amf_atomic_inc(&m_refCount); - return newVal; - } - virtual amf_long AMF_STD_CALL ReleaseInternal() - { - amf_long newVal = amf_atomic_dec(&m_refCount); - if(newVal == 0) - { - delete this; - } - return newVal; - } - virtual amf_long AMF_STD_CALL RefCountInternal() - { - return m_refCount; - } - }; - //--------------------------------------------------------------- - template - class AMFInterfaceImpl : public _Base, public AMFInterfaceBase - { - protected: - virtual ~AMFInterfaceImpl() - {} - public: - AMFInterfaceImpl(_Param1 param1, _Param2 param2, _Param3 param3) : _Base(param1, param2, param3) - {} - AMFInterfaceImpl(_Param1 param1, _Param2 param2) : _Base(param1, param2) - {} - AMFInterfaceImpl(_Param1 param1) : _Base(param1) - {} - AMFInterfaceImpl() - {} - virtual amf_long AMF_STD_CALL Acquire() - { - return AMFInterfaceBase::AcquireInternal(); - } - virtual amf_long AMF_STD_CALL Release() - { - return AMFInterfaceBase::ReleaseInternal(); - } - virtual amf_long AMF_STD_CALL RefCount() - { - return AMFInterfaceBase::RefCountInternal(); - } - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(AMFInterface) - AMF_INTERFACE_ENTRY(_Base) - AMF_END_INTERFACE_MAP - }; - - //--------------------------------------------------------------- - template - class AMFInterfaceMultiImpl : public _Base - { - protected: - virtual ~AMFInterfaceMultiImpl() - {} - public: - AMFInterfaceMultiImpl(_Param1 param1, _Param2 param2, _Param3 param3, _Param4 param4, _Param5 param5, _Param6 param6) : _Base(param1, param2, param3, param4, param5, param6) - {} - AMFInterfaceMultiImpl(_Param1 param1, _Param2 param2, _Param3 param3, _Param4 param4, _Param5 param5) : _Base(param1, param2, param3, param4, param5) - {} - AMFInterfaceMultiImpl(_Param1 param1, _Param2 param2, _Param3 param3, _Param4 param4) : _Base(param1, param2, param3, param4) - {} - AMFInterfaceMultiImpl(_Param1 param1, _Param2 param2, _Param3 param3) : _Base(param1, param2, param3) - {} - AMFInterfaceMultiImpl(_Param1 param1, _Param2 param2) : _Base(param1, param2) - {} - AMFInterfaceMultiImpl(_Param1 param1) : _Base(param1) - {} - AMFInterfaceMultiImpl() - {} - virtual amf_long AMF_STD_CALL Acquire() - { - return AMFInterfaceBase::AcquireInternal(); - } - virtual amf_long AMF_STD_CALL Release() - { - return AMFInterfaceBase::ReleaseInternal(); - } - virtual amf_long AMF_STD_CALL RefCount() - { - return AMFInterfaceBase::RefCountInternal(); - } - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY_THIS(AMFInterface, _BaseInterface) - AMF_INTERFACE_CHAIN_ENTRY(_Base) - AMF_END_INTERFACE_MAP - }; - - -} // namespace amf -#endif // AMF_InterfaceImpl_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Json.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Json.h deleted file mode 100644 index b6b90aed..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Json.h +++ /dev/null @@ -1,318 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#include "public/include/core/Interface.h" -#include "public/include/core/Variant.h" -#include -#include - -namespace amf -{ - class JSONParser : public amf::AMFInterface - { - public: - //----------------------------------------------------------------------------------------- - enum Result - { - OK, - MISSING_QUOTE, - MISSING_BRACE, - MISSING_BRACKET, - MISSING_DELIMITER, - MISSING_VALUE, - UNEXPECTED_END, - DUPLICATE_NAME, - INVALID_ARG, - INVALID_VALUE - }; - //----------------------------------------------------------------------------------------- - typedef amf::AMFInterfacePtr_T Ptr; - AMF_DECLARE_IID(0x14aefb78, 0x80af, 0x4ee1, 0x82, 0x9f, 0xa2, 0xfc, 0xc7, 0xae, 0xab, 0x33) - //----------------------------------------------------------------------------------------- - class Error - { - public: - Error(JSONParser::Result error) : - m_Ofs(0), - m_Error(error) - { - } - - Error(size_t ofs, JSONParser::Result error) : - m_Ofs(ofs), - m_Error(error) - { - } - - inline size_t GetOffset() const { return m_Ofs; } - inline JSONParser::Result GetResult() const { return m_Error; } - - private: - size_t m_Ofs; - JSONParser::Result m_Error; - }; - //----------------------------------------------------------------------------------------- - struct OutputFormatDesc - { - - bool bHumanReadable; - bool bNewLineBeforeBrace; - char cOffsetWith; - uint8_t nOffsetSize; - }; - //----------------------------------------------------------------------------------------- - class Element : public amf::AMFInterface - { - public: - typedef amf::AMFInterfacePtr_T Ptr; - AMF_DECLARE_IID(0xd2d71993, 0xbbcb, 0x420f, 0xbc, 0xdd, 0xd8, 0xd6, 0xb6, 0x2e, 0x46, 0x5e) - - virtual Error Parse(const std::string& str, size_t start, size_t end) = 0; - virtual std::string Stringify() const = 0; - virtual std::string StringifyFormatted(const OutputFormatDesc& format, int indent) const = 0; - }; - //----------------------------------------------------------------------------------------- - class Value : public Element - { - public: - typedef amf::AMFInterfacePtr_T Ptr; - AMF_DECLARE_IID(0xba0e44d4, 0xa487, 0x4d64, 0xa4, 0x94, 0x93, 0x9b, 0xfd, 0x76, 0x72, 0x32) - - virtual void SetValue(const std::string& val) = 0; - virtual void SetValueAsInt32(int32_t val) = 0; - virtual void SetValueAsUInt32(uint32_t val) = 0; - virtual void SetValueAsInt64(int64_t val) = 0; - virtual void SetValueAsUInt64(uint64_t val) = 0; - virtual void SetValueAsDouble(double val) = 0; - virtual void SetValueAsFloat(float val) = 0; - virtual void SetValueAsBool(bool val) = 0; - virtual void SetValueAsTime(time_t date, bool utc) = 0; - virtual void SetToNull() = 0; - - virtual const std::string& GetValue() const = 0; - virtual int32_t GetValueAsInt32() const = 0; - virtual uint32_t GetValueAsUInt32() const = 0; - virtual int64_t GetValueAsInt64() const = 0; - virtual uint64_t GetValueAsUInt64() const = 0; - virtual double GetValueAsDouble() const = 0; - virtual float GetValueAsFloat() const = 0; - virtual bool GetValueAsBool() const = 0; - virtual time_t GetValueAsTime() const = 0; - virtual bool IsNull() const = 0; - }; - //----------------------------------------------------------------------------------------- - class Node : public Element - { - public: - typedef amf::AMFInterfacePtr_T Ptr; - AMF_DECLARE_IID(0x6623d6b8, 0x533d, 0x4824, 0x9d, 0x3b, 0x45, 0x1a, 0xa8, 0xc3, 0x7b, 0x5d) - - virtual size_t GetElementCount() const = 0; - virtual JSONParser::Element* GetElementByName(const std::string& name) const = 0; - virtual JSONParser::Result AddElement(const std::string& name, Element* element) = 0; - virtual JSONParser::Element* GetElementAt(size_t idx, std::string& name) const = 0; - }; - //----------------------------------------------------------------------------------------- - class Array : public Element - { - public: - typedef amf::AMFInterfacePtr_T Ptr; - AMF_DECLARE_IID(0x8c066a6d, 0xb377, 0x44e8, 0x8c, 0xf5, 0xf8, 0xbf, 0x88, 0x85, 0xbb, 0xe9) - - virtual size_t GetElementCount() const = 0; - virtual JSONParser::Element* GetElementAt(size_t idx) const = 0; - virtual void AddElement(Element* element) = 0; - }; - //----------------------------------------------------------------------------------------- - virtual Result Parse(const std::string& str, Node** root) = 0; // Parse a JSON string into a tree of DOM elements - virtual std::string Stringify(const Node* root) const = 0; // Convert a DOM to a JSON string - virtual std::string StringifyFormatted(const Node* root, const OutputFormatDesc& format, int indent = 0) const = 0; - - virtual Result CreateNode(Node** node) const = 0; - virtual Result CreateValue(Value** value) const = 0; - virtual Result CreateArray(Array** array) const = 0; - - virtual size_t GetLastErrorOffset() const = 0; // Returns the offset of the last syntax error (same as what is passed in the exception if thrown) - }; - - extern "C" - { - // Helpers - #define TAG_JSON_VALUE "Val" - - void SetBoolValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, bool val); - void CreateBoolValue(amf::JSONParser* parser, amf::JSONParser::Value** node, bool val); - bool GetBoolValue(const amf::JSONParser::Node* root, const char* name, bool& val); - bool GetBoolFromJSON(const amf::JSONParser::Value* element, bool& val); - - void SetDoubleValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, double val); - void CreateDoubleValue(amf::JSONParser* parser, amf::JSONParser::Value** node, double val); - bool GetDoubleValue(const amf::JSONParser::Node* root, const char* name, double& val); - bool GetDoubleFromJSON(const amf::JSONParser::Value* element, double& val); - - void SetFloatValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, float val); - void CreateFloatValue(amf::JSONParser* parser, amf::JSONParser::Value** node, float val); - bool GetFloatValue(const amf::JSONParser::Node* root, const char* name, float& val); - bool GetFloatFromJSON(const amf::JSONParser::Value* element, float& val); - - void SetInt64Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, int64_t val); - void CreateInt64Value(amf::JSONParser* parser, amf::JSONParser::Value** node, const int64_t val); - bool GetInt64Value(const amf::JSONParser::Node* root, const char* name, int64_t& val); - bool GetInt64FromJSON(const amf::JSONParser::Value* element, int64_t& val); - - void SetUInt64Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, uint64_t val); - bool GetUInt64Value(const amf::JSONParser::Node* root, const char* name, uint64_t& val); - bool GetUInt64FromJSON(const amf::JSONParser::Value* element, uint64_t& val); - - void SetInt32Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, int32_t val); - bool GetInt32Value(const amf::JSONParser::Node* root, const char* name, int32_t& val); - bool GetInt32FromJSON(const amf::JSONParser::Value* element, int32_t& val); - - void SetUInt32Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, uint32_t val); - bool GetUInt32Value(const amf::JSONParser::Node* root, const char* name, uint32_t& val); - bool GetUInt32FromJSON(const amf::JSONParser::Value* element, uint32_t& val); - - void SetUInt32Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const uint32_t* val, size_t size); - void CreateUInt32Array(amf::JSONParser* parser, amf::JSONParser::Array** array, const uint32_t* val, size_t size); - bool GetUInt32Array(const amf::JSONParser::Node* root, const char* name, uint32_t* val, size_t& size); - bool GetUInt32ArrayFromJSON(const amf::JSONParser::Array* element, uint32_t* val, size_t& size); - - void SetInt32Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const int32_t* val, size_t size); - void CreateInt32Array(amf::JSONParser* parser, amf::JSONParser::Array** array, const int32_t* val, size_t size); - bool GetInt32Array(const amf::JSONParser::Node* root, const char* name, int32_t* val, size_t& size); - bool GetInt32ArrayFromJSON(const amf::JSONParser::Array* element, int32_t* val, size_t& size); - - void SetInt64Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const int64_t* val, size_t size); - bool GetInt64Array(const amf::JSONParser::Node* root, const char* name, int64_t* val, size_t& size); - bool GetInt64ArrayFromJSON(const amf::JSONParser::Array* element, int64_t* val, size_t& size); - - void SetFloatArray(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const float* val, size_t size); - void CreateFloatArray(amf::JSONParser* parser, amf::JSONParser::Array** array, const float* val, size_t size); - bool GetFloatArray(const amf::JSONParser::Node* root, const char* name, float* val, size_t& size); - bool GetFloatArrayFromJSON(const amf::JSONParser::Array* element, float* val, size_t& size); - - void SetDoubleArray(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const double* val, size_t size); - bool GetDoubleArray(const amf::JSONParser::Node* root, const char* name, double* val, size_t& size); - bool GetDoubleArrayFromJSON(const amf::JSONParser::Array* element, double* val, size_t& size); - - void SetSizeValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFSize& val); - void CreateSizeValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFSize& val); - bool GetSizeValue(const amf::JSONParser::Node* root, const char* name, AMFSize& val); - bool GetSizeFromJSON(const amf::JSONParser::Element* element, AMFSize& val); - - void SetRectValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRect& val); - void CreateRectValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRect& val); - bool GetRectValue(const amf::JSONParser::Node* root, const char* name, AMFRect& val); - bool GetRectFromJSON(const amf::JSONParser::Element* element, AMFRect& val); - - void SetPointValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFPoint& val); - void CreatePointValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFPoint& val); - bool GetPointValue(const amf::JSONParser::Node* root, const char* name, AMFPoint& val); - bool GetPointFromJSON(const amf::JSONParser::Element* element, AMFPoint& val); - - void SetRateValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRate& val); - void CreateRateValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRate& val); - bool GetRateValue(const amf::JSONParser::Node* root, const char* name, AMFRate& val); - bool GetRateFromJSON(const amf::JSONParser::Element* element, AMFRate& val); - - void SetRatioValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRatio& val); - void CreateRatioValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRatio& val); - bool GetRatioValue(const amf::JSONParser::Node* root, const char* name, AMFRatio& val); - bool GetRatioFromJSON(const amf::JSONParser::Element* element, AMFRatio& val); - - void SetColorValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFColor& val); - void CreateColorValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFColor& val); - bool GetColorValue(const amf::JSONParser::Node* root, const char* name, AMFColor& val); - bool GetColorFromJSON(const amf::JSONParser::Element* element, AMFColor& val); - - void SetFloatSizeValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatSize& val); - void CreateFloatSizeValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatSize& val); - bool GetFloatSizeValue(const amf::JSONParser::Node* root, const char* name, AMFFloatSize& val); - bool GetFloatSizeFromJSON(const amf::JSONParser::Element* element, AMFFloatSize& val); - - void SetFloatPoint2DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatPoint2D& val); - void CreateFloatPoint2DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatPoint2D& val); - bool GetFloatPoint2DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatPoint2D& val); - bool GetFloatPoint2DFromJSON(const amf::JSONParser::Element* element, AMFFloatPoint2D& val); - - void SetFloatPoint3DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatPoint3D& val); - void CreateFloatPoint3DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatPoint3D& val); - bool GetFloatPoint3DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatPoint3D& val); - bool GetFloatPoint3DFromJSON(const amf::JSONParser::Element* element, AMFFloatPoint3D& val); - - void SetFloatVector4DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatVector4D& val); - void CreateFloatVector4DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatVector4D& val); - bool GetFloatVector4DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatVector4D& val); - bool GetFloatVector4DFromJSON(const amf::JSONParser::Element* element, AMFFloatVector4D& val); - - void SetStringValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const std::string& val); - void CreateStringValue(amf::JSONParser* parser, amf::JSONParser::Value** node, const std::string& val); - bool GetStringValue(const amf::JSONParser::Node* root, const char* name, std::string& val); - bool GetStringFromJSON(const amf::JSONParser::Value* element, std::string& val); - - void SetInterfaceValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, /*const*/ AMFInterface* pVal); - void CreateInterfaceValue(amf::JSONParser* parser, amf::JSONParser::Node** node, /*const*/ AMFInterface* pval); - bool GetInterfaceValue(const amf::JSONParser::Node* root, const char* name, AMFInterface* ppVal); - bool GetInterfaceFromJSON(const amf::JSONParser::Element* element, AMFInterface* ppVal); - - void SetVariantValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const amf::AMFVariant& value); - void SetVariantToJSON(amf::JSONParser* parser, amf::JSONParser::Node** node, const amf::AMFVariant& value); - bool GetVariantValue(const amf::JSONParser::Node* root, const char* name, amf::AMFVariant& val); - bool GetVariantFromJSON(const amf::JSONParser::Node* element, amf::AMFVariant& val); - - // variant value only; variant type assumed to be pre-set - void CreateVariantValue(amf::JSONParser* parser, amf::JSONParser::Element** el, const amf::AMFVariant& value); - bool GetVariantValueFromJSON(const amf::JSONParser::Element* element, amf::AMFVariant& val); - } - - class AMFInterfaceJSONSerializable : public amf::AMFInterface - { - public: - // {EC40A26C-1345-4281-9B6C-362DDD6E05B5} - AMF_DECLARE_IID(0xec40a26c, 0x1345, 0x4281, 0x9b, 0x6c, 0x36, 0x2d, 0xdd, 0x6e, 0x5, 0xb5) - // - virtual AMF_RESULT AMF_STD_CALL ToJson(amf::JSONParser* parser, amf::JSONParser::Node* node) const = 0; - - // - virtual AMF_RESULT AMF_STD_CALL FromJson(const amf::JSONParser::Node* node) = 0; - }; - typedef AMFInterfacePtr_T AMFInterfaceJSONSerializablePtr; -} - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL CreateJSONParser(amf::JSONParser** parser); - #define AMF_JSON_PARSER_FACTORY "CreateJSONParser" -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.cpp deleted file mode 100644 index 5896b9f2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.cpp +++ /dev/null @@ -1,1877 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - - -#include "JsonImpl.h" -#include -#include -#include -#include - -#pragma warning(disable: 4996) - -static amf::JSONParser::OutputFormatDesc defaultFormat = {}; - -///////////////////////////// Element //////////////////////////////////////// -amf::JSONParserImpl::ElementHelper::ElementHelper() -{ -} - -size_t amf::JSONParserImpl::ElementHelper::FindClosure(const std::string& str, char opener, char closer, size_t start) -{ - size_t endPos = start; - - if (opener != closer) - { - int openerCnt = 0; - int closerCnt = 0; - - bool inQuote = false; - bool backslashEscape = false; - - for (size_t i = start; i < str.length(); i++) - { - char sym = str.at(i); - - // skip openers/closers that are inside quotes - if (sym == '\\' && backslashEscape == false) { - backslashEscape = true; - continue; - } - if (sym == '"' && backslashEscape == false) - { - inQuote = !inQuote; - } - - backslashEscape = false; - if (inQuote == true) - { - continue; - } - - if (sym == opener) - { - ++openerCnt; - } - else if (sym == closer) - { - ++closerCnt; - if (openerCnt == closerCnt) - { - endPos = i; - break; - } - } - } - } - else - { - for (size_t i = start+1; i < str.length(); i++) - { - if (str.at(i) == closer) - { - endPos = i; - break; - } - } - } - return endPos; -} - -amf::JSONParser::Error amf::JSONParserImpl::ElementHelper::CreateElement(const std::string& str, size_t start, size_t& valueStart, size_t& valueEnd, JSONParser::Element** val) -{ - *val = nullptr; - static const char* specialCharsStart = "\t\n\r "; - static const char* specialCharsEnd = "\t\n\r,:}] "; - valueStart = str.find_first_not_of(specialCharsStart, start); - bool bParse = true; - if (valueStart == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - else - { - switch (str.at(valueStart)) - { - case '{': - valueEnd = FindClosure(str, '{', '}', valueStart); - if (valueEnd == str.npos) - { - return Error(start, JSONParser::MISSING_BRACE); - } - else - { - ++valueEnd; - } - *val = new NodeImpl(); - break; - case '[': - valueEnd = FindClosure(str, '[', ']', valueStart); - if (valueEnd == str.npos) - { - return Error(start, JSONParser::MISSING_BRACKET); - - } - else - { - ++valueEnd; - } - *val = new ArrayImpl(); - - break; - - case '\"': - { - valueEnd = FindClosure(str, '\"', '\"', valueStart); - if (valueEnd == str.npos) - { - return Error(start, JSONParser::MISSING_QUOTE); - } - else - { - ++valueEnd; - } - ValueImpl *valImpl = new ValueImpl(); - valImpl->SetValue(str.substr(valueStart +1, valueEnd - valueStart - 2) ); - *val = valImpl; - bParse = false; - break; - } - - default: - { - - if (valueStart == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - else - { - valueEnd = str.find_first_of(specialCharsEnd, valueStart); - if (valueEnd == str.npos) - { - return Error(valueStart, JSONParser::MISSING_DELIMITER); - } - } - *val = new ValueImpl(); - break; - } - } - - if (*val != nullptr && bParse == true) - { - (*val)->Parse(str, valueStart, valueEnd); - } - } - return Error(valueStart, JSONParser::OK); -} - -void amf::JSONParserImpl::ElementHelper::InsertTabs(std::string& target, int count, const OutputFormatDesc& format) const -{ - if (format.bHumanReadable) - { - int whitespacesToInsert = count * format.nOffsetSize; - for (int i = 0; i < whitespacesToInsert; i++) - { - target += format.cOffsetWith; - } - } -} - -///////////////////////////// Value //////////////////////////////////////// -static const char* const NULL_STR = "null"; -static const char* const TRUE_STR = "true"; -static const char* const FALSE_STR = "false"; -amf::JSONParserImpl::ValueImpl::ValueImpl() : - ElementHelper(), - m_eType(VT_Unknown) -{ -} - -bool amf::JSONParserImpl::ValueImpl::IsNull() const -{ - return m_eType == VT_Null; -} - -const std::string& amf::JSONParserImpl::ValueImpl::GetValue() const -{ - return m_Value; -} - -void amf::JSONParserImpl::ValueImpl::SetValue(const std::string& val) -{ - m_Value = val; - m_eType = VT_String; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsInt32(int32_t val) -{ - std::stringstream str; - str << val; - m_Value = str.str(); - m_eType = VT_Numeric; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsUInt32(uint32_t val) -{ - std::stringstream str; - str << val; - m_Value = str.str(); - m_eType = VT_Numeric; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsInt64(int64_t val) -{ - std::stringstream str; - str << val; - m_Value = str.str(); - m_eType = VT_Numeric; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsUInt64(uint64_t val) -{ - std::stringstream str; - str << val; - m_Value = str.str(); - m_eType = VT_Numeric; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsDouble(double val) -{ - char buf[100]; - sprintf(buf, "%.16lf", val); - m_Value = buf; - if (m_Value.compare("-nan(ind)") == 0) - { - SetToNull(); - } - else - { - m_eType = VT_Numeric; - } - - //trim trailing zeroes - if (m_Value.find_first_of(".") != std::string::npos) - { - std::size_t found = m_Value.find_last_not_of("0"); - if (found != std::string::npos) - { - if (m_Value[found] == '.') - m_Value.erase(found); - else - m_Value.erase(found + 1); - } - else // case value == 0 - { - m_Value.erase(1); - } - } -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsFloat(float val) -{ - SetValueAsDouble(static_cast(val)); -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsBool(bool val) -{ - m_Value = val ? TRUE_STR : FALSE_STR; - m_eType = VT_Bool; -} - -void amf::JSONParserImpl::ValueImpl::SetValueAsTime(time_t date, bool utc) -{ - int64_t val = (utc == true) ? date : std::mktime(std::localtime(&date)); - std::stringstream str; - str << val; - m_Value = str.str(); - m_eType = VT_Numeric; -} - -void amf::JSONParserImpl::ValueImpl::SetToNull() -{ - m_Value = NULL_STR; - m_eType = VT_Null; -} - - -int32_t amf::JSONParserImpl::ValueImpl::GetValueAsInt32() const -{ - int val = 0; - if(!m_Value.empty()) - { - val = strtol(m_Value.c_str(), nullptr, 10); - } - return (int32_t)val; -} -uint32_t amf::JSONParserImpl::ValueImpl::GetValueAsUInt32() const -{ - unsigned int val = 0; - if(!m_Value.empty()) - { - val = strtoul(m_Value.c_str(), nullptr, 10); - } - return (uint32_t)val; -} -int64_t amf::JSONParserImpl::ValueImpl::GetValueAsInt64() const -{ - long long val = 0; - if(!m_Value.empty()) - { - val = strtoll(m_Value.c_str(), nullptr, 10); - } - return val; -} - -uint64_t amf::JSONParserImpl::ValueImpl::GetValueAsUInt64() const -{ - uint64_t val = 0; - if(!m_Value.empty()) - { - val = strtoull(m_Value.c_str(), nullptr, 10); - } - return val; -} - -double amf::JSONParserImpl::ValueImpl::GetValueAsDouble() const -{ - double val = 0; - if (!m_Value.empty()) - { - val = strtod(m_Value.c_str(), nullptr); - } - return val; -} -float amf::JSONParserImpl::ValueImpl::GetValueAsFloat() const -{ - float val = 0; - if(!m_Value.empty()) - { - val = static_cast(strtod(m_Value.c_str(), nullptr)); - } - return val; -} -bool amf::JSONParserImpl::ValueImpl::GetValueAsBool() const -{ - bool retVal = false; - if (!m_Value.empty()) - { - if (m_eType == VT_Bool) - { - retVal = (m_Value.compare(TRUE_STR) == 0); - } - else - { - double val = 0; - val = strtod(m_Value.c_str(), nullptr); - retVal = val != 0; - } - } - return retVal; -} - -time_t amf::JSONParserImpl::ValueImpl::GetValueAsTime() const -{ - if (!m_Value.empty() && m_eType == VT_String) - { - return strtoll(m_Value.c_str(), nullptr, 10); - } - - return 0; -} - - -amf::JSONParser::Error amf::JSONParserImpl::ValueImpl::Parse(const std::string& str, size_t start, size_t end) -{ - static const char* specialCharacters = "\"\'\n\r,[{}]"; // whitespaces excluded - if(start == end) - { - m_Value = ""; - m_eType = VT_String; - } - else - { - size_t startPos = str.find_first_not_of(specialCharacters, start); - if (startPos == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - startPos = str.find_first_not_of(" \t", startPos); // trim start whitespaces - if (startPos == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - size_t endPos = str.find_first_of(specialCharacters, startPos+1); // exclude spaces from search - if (endPos == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - endPos = str.find_last_not_of(" \t", endPos); // trim end whitespaces - if (endPos == str.npos) - { - return Error(start, JSONParser::MISSING_VALUE); - } - m_Value.assign(str, startPos, endPos - startPos); - // Determine Special Types - if(m_Value.compare(NULL_STR) == 0) - { - m_eType = VT_Null; - } - else if(m_Value.compare(TRUE_STR) == 0 || m_Value.compare(FALSE_STR) == 0) - { - m_eType = VT_Bool; - } - else - { - m_eType = VT_Numeric; - } - - } - return Error(start, JSONParser::OK); -} - -std::string amf::JSONParserImpl::ValueImpl::Stringify() const -{ - return StringifyFormatted(defaultFormat, 0); -} - -std::string amf::JSONParserImpl::ValueImpl::StringifyFormatted(const OutputFormatDesc&, int /*indent*/) const -{ - std::string jsonValue; - if ((m_eType == VT_String || m_Value.length() == 0) && IsNull() == false) - { - jsonValue += '\"'; - } - jsonValue += m_Value; - if ((m_eType == VT_String || m_Value.length() == 0) && IsNull() == false) - { - jsonValue += '\"'; - } - return jsonValue; -} - -///////////////////////////// Node //////////////////////////////////////// -amf::JSONParserImpl::NodeImpl::NodeImpl() : - ElementHelper() -{ -} - -size_t amf::JSONParserImpl::NodeImpl::GetElementCount() const -{ - return m_Elements.size(); -} - -amf::JSONParser::Error amf::JSONParserImpl::NodeImpl::Parse(const std::string& str, size_t start, size_t end) -{ - size_t curHead = start; - bool continueParsing = true; - - do - { - size_t nameStart = str.find_first_of('\"', curHead); - size_t nextClosingBrace = str.find_first_of('}', curHead); - - // Additional check for empty elements: - // If empty element isn't last in the file - // '"' character check might fail to parse correctly - // resulting in adding next elements as children - if (nextClosingBrace < nameStart) - { - return Error(start, JSONParser::OK); - } - - if (nameStart == str.npos) - { - if(start + 1 == end) - { - return Error(start, JSONParser::OK); - } - return Error(start, JSONParser::MISSING_QUOTE); - } - - size_t nameEnd = str.find_first_of('\"', nameStart + 1); - if (nameEnd == str.npos) - { - return Error(nameStart, JSONParser::MISSING_QUOTE); - } - - std::string name; - name.assign(str, nameStart + 1, nameEnd - nameStart - 1); - size_t delimPos = str.find_first_of(':', nameEnd + 1); - if (delimPos == str.npos) - { - return Error(nameStart, JSONParser::MISSING_DELIMITER); - } - - size_t valueStart = delimPos+1; //str.find_first_of("\"[{", delimPos + 1); - if (valueStart == str.npos) - { - return Error(nameStart, JSONParser::MISSING_VALUE); - } - size_t valueEnd = 0; - Element* val; - Error createErr = CreateElement(str, valueStart, valueStart, valueEnd, &val); - if (createErr.GetResult() != OK) - { - return createErr; - } - - size_t commaPos = str.find_first_not_of(" \t\n\r", valueEnd); - if (commaPos == str.npos) - { - return Error(nameStart, JSONParser::UNEXPECTED_END); - } - else if (str.at(commaPos) != ',') - { - continueParsing = false; - } - else - { - curHead = commaPos+1; - } - JSONParser::Result res = AddElement(name, val); - if (res != JSONParser::OK) - { - return Error(nameStart, res); - } - } - while (continueParsing == true); - return Error(start, JSONParser::OK); -} - -std::string amf::JSONParserImpl::NodeImpl::Stringify() const -{ - return StringifyFormatted(defaultFormat, 0); -} - -std::string amf::JSONParserImpl::NodeImpl::StringifyFormatted(const OutputFormatDesc& format, int indent) const -{ - bool first = true; - std::string jsonValue; - - InsertTabs(jsonValue, indent, format); - jsonValue += '{'; - for (ElementMap::const_iterator it = m_Elements.begin(); it != m_Elements.end(); ++it) - { - if (first == false) - { - jsonValue += ','; - } - else - { - first = false; - } - if (format.bHumanReadable == true) - { - jsonValue += '\n'; - } - InsertTabs(jsonValue, indent + 1, format); - - jsonValue += '\"'; - jsonValue += it->first; - jsonValue += format.bHumanReadable == true ? "\" : " : "\":"; - if (format.bHumanReadable == true) - { - amf::JSONParserImpl::Value::Ptr value(it->second); - if (value == nullptr && format.bNewLineBeforeBrace == true) - { - jsonValue += '\n'; - } - } - jsonValue += it->second == nullptr ? "null" : it->second->StringifyFormatted(format, indent + 1); - } - if (format.bHumanReadable == true && format.bNewLineBeforeBrace == true) - { - jsonValue += '\n'; - } - InsertTabs(jsonValue, indent, format); - jsonValue += '}'; - return jsonValue; -} - -amf::JSONParser::Element* amf::JSONParserImpl::NodeImpl::GetElementByName(const std::string& name) const -{ - Element* found(nullptr); - ElementMap::const_iterator it = m_Elements.find(name); - if (it != m_Elements.end()) - { - found = it->second; - } - return found; -} - -amf::JSONParser::Result amf::JSONParserImpl::NodeImpl::AddElement(const std::string& name, amf::JSONParser::Element* element) -{ - JSONParser::Result result = OK; - if (m_Elements.find(name) == m_Elements.end()) - { - m_Elements.insert(std::pair(name, Element::Ptr(element))); - } - else - { - result = JSONParser::DUPLICATE_NAME; - } - return result; -} - -amf::JSONParser::Element* amf::JSONParserImpl::NodeImpl::GetElementAt(size_t idx, std::string& name) const -{ - if (m_Elements.size() <= idx) - { - return nullptr; - } - ElementMap::const_iterator it = m_Elements.begin(); - for (size_t i = 0; i < idx; i++) - { - it++; - } - name = it->first; - return it->second; -} - -///////////////////////////// Array //////////////////////////////////////// -amf::JSONParserImpl::ArrayImpl::ArrayImpl() : - ElementHelper() -{ -} - -amf::JSONParser::Error amf::JSONParserImpl::ArrayImpl::Parse(const std::string& str, size_t start, size_t end) -{ - bool continueParsing = true; - size_t valueStart; - size_t valueEnd = start+1; - do - { - valueStart = str.find_first_not_of("\t\r\n", valueEnd); - if (valueStart == str.npos) - { - return Error(valueEnd, JSONParser::MISSING_VALUE); - } - if(valueStart + 1 == end) - { - break; - } - Element* val = nullptr; - Error createErr = CreateElement(str, valueStart, valueStart, valueEnd, &val); - if (createErr.GetResult() != OK) - { - return createErr; - } - AddElement(Element::Ptr(val)); - size_t commaPos = str.find_first_not_of(" \t\n\r", valueEnd); - if (commaPos == str.npos) - { - return Error(valueStart, JSONParser::UNEXPECTED_END); - } - else if (str.at(commaPos) != ',') - { - continueParsing = false; - } - else - { - valueEnd = commaPos+1; - } - } while (continueParsing == true); - return Error(valueStart, JSONParser::OK); -} - -void amf::JSONParserImpl::ArrayImpl::AddElement(Element* element) -{ - m_Elements.push_back(Element::Ptr(element)); -} - -std::string amf::JSONParserImpl::ArrayImpl::Stringify() const -{ - return StringifyFormatted(defaultFormat, 0); -} - -std::string amf::JSONParserImpl::ArrayImpl::StringifyFormatted(const OutputFormatDesc& format, int indent) const -{ - bool first = true; - std::string jsonValue; - InsertTabs(jsonValue, indent, format); - - jsonValue += '['; - bool newLineBeforeClosingBrace = false; - for (ElementVector::const_iterator it = m_Elements.begin(); it != m_Elements.end(); ++it) - { - if (first == false) - { - jsonValue += ','; - } - else - { - first = false; - } - if (format.bHumanReadable == true) - { - amf::JSONParserImpl::Node::Ptr node(*it); - if (node != nullptr) - { - jsonValue += '\n'; - newLineBeforeClosingBrace = true; - } - } - jsonValue += *it == nullptr ? "null" : (*it)->StringifyFormatted(format, indent + 1); - } - if (format.bHumanReadable == true && newLineBeforeClosingBrace == true) - { - jsonValue += '\n'; - } - InsertTabs(jsonValue, indent, format); - - jsonValue += ']'; - - return jsonValue; - -} - -size_t amf::JSONParserImpl::ArrayImpl::GetElementCount() const -{ - return m_Elements.size(); -} - -amf::JSONParser::Element* amf::JSONParserImpl::ArrayImpl::GetElementAt(size_t idx) const -{ - return m_Elements[idx]; -} - -///////////////////////////// JSONParser //////////////////////////////////////// -amf::JSONParserImpl::JSONParserImpl() : - m_LastErrorOfs(0) -{ -} - -amf::JSONParser::Result amf::JSONParserImpl::Parse(const std::string& str, amf::JSONParser::Node** root) -{ - amf::JSONParser::Result result = OK; - if (root == nullptr) - { - result = INVALID_ARG; - } - else - { - amf::JSONParser::Node* rootNode(nullptr); - size_t start = str.find_first_of('{'); - size_t end = str.find_last_of('}', str.length()); - if (start != str.npos && end != str.npos) - { - rootNode = new NodeImpl(); - Error parseErr = rootNode->Parse(str, start, end); - if (parseErr.GetResult() != OK) - { - result = parseErr.GetResult(); - m_LastErrorOfs = parseErr.GetOffset(); - } - else - { - *root = rootNode; - (*root)->Acquire(); - } - } - else - { - result = MISSING_BRACE; - } - } - return result; -} - -std::string amf::JSONParserImpl::Stringify(const JSONParser::Node* root) const -{ - return StringifyFormatted(root, defaultFormat, 0); -} - -std::string amf::JSONParserImpl::StringifyFormatted(const Node* root, const OutputFormatDesc& format, int indent) const -{ - std::string jsonStr; - if (root != nullptr) - { - jsonStr = root->StringifyFormatted(format, indent); - } - return jsonStr; -} - -size_t amf::JSONParserImpl::GetLastErrorOffset() const -{ - return m_LastErrorOfs; -} - -amf::JSONParserImpl::Result amf::JSONParserImpl::CreateNode(Node** node) const -{ - Result result = INVALID_ARG; - if (node != nullptr) - { - *node = new NodeImpl(); - (*node)->Acquire(); - result = OK; - } - return result; -} - -amf::JSONParserImpl::Result amf::JSONParserImpl::CreateValue(Value** value) const -{ - Result result = INVALID_ARG; - if (value != nullptr) - { - *value = new ValueImpl(); - (*value)->Acquire(); - result = OK; - } - return result; -} - -amf::JSONParserImpl::Result amf::JSONParserImpl::CreateArray(Array** array) const -{ - Result result = INVALID_ARG; - if (array != nullptr) - { - *array = new ArrayImpl(); - (*array)->Acquire(); - result = OK; - } - return result; -} - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL CreateJSONParser(amf::JSONParser** parser) - { - AMF_RESULT result; - if (parser != nullptr) - { - *parser = new amf::JSONParserImpl(); - (*parser)->Acquire(); - result = AMF_OK; - } - else - { - result = AMF_INVALID_ARG; - } - return result; - } - -#define JSON_SET_VALUE(CREATOR, parser, root, name, val) do { \ - amf::JSONParser::Value::Ptr node; \ - CREATOR(parser, &node, val); \ - root->AddElement(name, node); \ - } while(0) - -#define JSON_SET_ARRAY(CREATOR, parser, root, name, val, size) do { \ - if (size == 0) { return; } \ - amf::JSONParser::Array::Ptr node; \ - CREATOR(parser, &node, val, size); \ - root->AddElement(name, node); \ - } while(0) - -#define JSON_SET_OBJECT(CREATOR, parser, root, name, val) do { \ - amf::JSONParser::Array::Ptr node; \ - CREATOR(parser, &node, val); \ - root->AddElement(name, node); \ - } while(0) - - void amf::SetDoubleValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, double val) - { - JSON_SET_VALUE(CreateDoubleValue, parser, root, name, val); - } - - void amf::CreateDoubleValue(amf::JSONParser* parser, amf::JSONParser::Value** node, double val) - { - parser->CreateValue(node); - (*node)->SetValueAsDouble(val); - } - - void amf::SetFloatValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, float val) - { - JSON_SET_VALUE(CreateFloatValue, parser, root, name, val); - } - - void amf::CreateFloatValue(amf::JSONParser* parser, amf::JSONParser::Value** node, float val) - { - parser->CreateValue(node); - (*node)->SetValueAsFloat(val); - } - - void amf::SetInt64Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const int64_t* val, size_t size) - { - if (size == 0) - { - return; - } - amf::JSONParser::Array::Ptr array; - parser->CreateArray(&array); - for (size_t i = 0; i < size; i++) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsInt64(val[i]); - array->AddElement(node); - } - root->AddElement(name, array); - } - - void amf::SetInt32Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const int32_t* val, size_t size) - { - JSON_SET_ARRAY(CreateInt32Array, parser, root, name, val, size); - } - - void amf::CreateInt32Array(amf::JSONParser* parser, amf::JSONParser::Array** array, const int32_t* val, size_t size) - { - parser->CreateArray(array); - for (size_t i = 0; i < size; i++) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsInt32(val[i]); - (*array)->AddElement(node); - } - } - - void amf::SetUInt32Array(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const uint32_t* val, size_t size) - { - JSON_SET_ARRAY(CreateUInt32Array, parser, root, name, val, size); - } - - void amf::CreateUInt32Array(amf::JSONParser* parser, amf::JSONParser::Array** array, const uint32_t* val, size_t size) - { - parser->CreateArray(array); - for (size_t i = 0; i < size; i++) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsUInt32(val[i]); - (*array)->AddElement(node); - } - } - - void amf::SetFloatArray(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const float* val, size_t size) - { - JSON_SET_ARRAY(CreateFloatArray, parser, root, name, val, size); - } - - void amf::CreateFloatArray(amf::JSONParser* parser, amf::JSONParser::Array** array, const float* val, size_t size) - { - parser->CreateArray(array); - for (size_t i = 0; i < size; i++) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsFloat(val[i]); - (*array)->AddElement(node); - } - } - - void amf::SetDoubleArray(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const double* val, size_t size) - { - if (size == 0) - { - return; - } - amf::JSONParser::Array::Ptr array; - parser->CreateArray(&array); - for (size_t i = 0; i < size; i++) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsDouble(val[i]); - array->AddElement(node); - } - root->AddElement(name, array); - } - - void amf::SetBoolValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, bool val) - { - JSON_SET_VALUE(CreateBoolValue, parser, root, name, val); - } - - void amf::CreateBoolValue(amf::JSONParser* parser, amf::JSONParser::Value** node, bool val) - { - parser->CreateValue(node); - (*node)->SetValueAsBool(val); - } - - void amf::SetInt64Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, int64_t val) - { - JSON_SET_VALUE(CreateInt64Value, parser, root, name, val); - } - - void amf::CreateInt64Value(amf::JSONParser* parser, amf::JSONParser::Value** node, int64_t val) - { - parser->CreateValue(node); - (*node)->SetValueAsInt64(val); - } - - void amf::SetUInt64Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, uint64_t val) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsUInt64(val); - root->AddElement(name, node); - } - - void amf::SetInt32Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, int32_t val) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsInt32(val); - root->AddElement(name, node); - } - - void amf::SetUInt32Value(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, uint32_t val) - { - amf::JSONParser::Value::Ptr node; - parser->CreateValue(&node); - node->SetValueAsUInt32(val); - root->AddElement(name, node); - } - - void amf::SetSizeValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFSize& val) - { - JSON_SET_OBJECT(CreateSizeValue, parser, root, name, val); - } - - void amf::CreateSizeValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFSize& val) - { - int32_t arrayVal[] = { val.width, val.height }; - CreateInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetRectValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRect& val) - { - JSON_SET_OBJECT(CreateRectValue, parser, root, name, val); - } - - void amf::CreateRectValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRect& val) - { - int32_t arrayVal[] = { val.left, val.top, val.right, val.bottom }; - CreateInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetPointValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFPoint& val) - { - JSON_SET_OBJECT(CreatePointValue, parser, root, name, val); - } - - void amf::CreatePointValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFPoint& val) - { - int32_t arrayVal[] = { val.x, val.y }; - CreateInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetRateValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRate& val) - { - JSON_SET_OBJECT(CreateRateValue, parser, root, name, val); - } - - void amf::CreateRateValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRate& val) - { - uint32_t arrayVal[] = { val.num, val.den }; - CreateUInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetRatioValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFRatio& val) - { - JSON_SET_OBJECT(CreateRatioValue, parser, root, name, val); - } - - void amf::CreateRatioValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFRatio& val) - { - uint32_t arrayVal[] = { val.num, val.den }; - CreateUInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetColorValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFColor& val) - { - JSON_SET_OBJECT(CreateColorValue, parser, root, name, val); - } - - void amf::CreateColorValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFColor& val) - { - uint32_t arrayVal[] = { val.a, val.r, val.g, val.b }; - CreateUInt32Array(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetFloatSizeValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatSize& val) - { - JSON_SET_OBJECT(CreateFloatSizeValue, parser, root, name, val); - } - - void amf::CreateFloatSizeValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatSize& val) - { - amf_float arrayVal[] = { val.width, val.height }; - CreateFloatArray(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetFloatPoint2DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatPoint2D& val) - { - JSON_SET_OBJECT(CreateFloatPoint2DValue, parser, root, name, val); - } - - void amf::CreateFloatPoint2DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatPoint2D& val) - { - amf_float arrayVal[] = { val.x, val.y }; - CreateFloatArray(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetFloatPoint3DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatPoint3D& val) - { - JSON_SET_OBJECT(CreateFloatPoint3DValue, parser, root, name, val); - } - - void amf::CreateFloatPoint3DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatPoint3D& val) - { - amf_float arrayVal[] = { val.x, val.y, val.z }; - CreateFloatArray(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetFloatVector4DValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const AMFFloatVector4D& val) - { - JSON_SET_OBJECT(CreateFloatVector4DValue, parser, root, name, val); - } - - void amf::CreateFloatVector4DValue(amf::JSONParser* parser, amf::JSONParser::Array** array, const AMFFloatVector4D& val) - { - amf_float arrayVal[] = { val.x, val.y, val.z, val.w }; - CreateFloatArray(parser, array, arrayVal, amf_countof(arrayVal)); - } - - void amf::SetStringValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const std::string& val) - { - JSON_SET_VALUE(CreateStringValue, parser, root, name, val); - - } - void amf::CreateStringValue(amf::JSONParser* parser, amf::JSONParser::Value** node, const std::string& val) - { - parser->CreateValue(node); - if (val.empty()) - { - (*node)->SetToNull(); - } - else - { - (*node)->SetValue(val); - } - } - - void amf::SetInterfaceValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, /*const */AMFInterface* pVal) - { - amf::JSONParser::Node::Ptr node; - amf::CreateInterfaceValue(parser, &node, pVal); - root->AddElement(name, node); - } - - void amf::CreateInterfaceValue(amf::JSONParser* parser, amf::JSONParser::Node** node, /*const*/ AMFInterface* pVal) - { - parser->CreateNode(node); - - const AMFInterfaceJSONSerializablePtr p(pVal); - - if (p != nullptr) - { - p->ToJson(parser, *node); - } - - } - - static const int variantTypeNameCount = 18; - static const char* variantTypeNameMap[variantTypeNameCount] = - { - "empty", //AMF_VARIANT_EMPTY = 0, - "bool", //AMF_VARIANT_BOOL = 1, - "int64", //AMF_VARIANT_INT64 = 2, - "double", //AMF_VARIANT_DOUBLE = 3, - "rect", //AMF_VARIANT_RECT = 4, - "size", //AMF_VARIANT_SIZE = 5, - "point", //AMF_VARIANT_POINT = 6, - "rate", //AMF_VARIANT_RATE = 7, - "ratio", //AMF_VARIANT_RATIO = 8, - "color", //AMF_VARIANT_COLOR = 9, - "string", //AMF_VARIANT_STRING = 10, // value is char* - "wstring", //AMF_VARIANT_WSTRING = 11, // value is wchar_t* - "interface", //AMF_VARIANT_INTERFACE = 12, // value is AMFInterface* - "float", //AMF_VARIANT_FLOAT = 13, - "fsize", //AMF_VARIANT_FLOAT_SIZE = 14, - "fpoint2D", //AMF_VARIANT_FLOAT_POINT2D = 15, - "fpoint3D", //AMF_VARIANT_FLOAT_POINT3D = 16, - "fvect4", //AMF_VARIANT_FLOAT_VECTOR4D = 17 - }; - - void amf::SetVariantValue(amf::JSONParser* parser, amf::JSONParser::Node* root, const char* name, const amf::AMFVariant& value) - { - amf::JSONParser::Node::Ptr node; - amf::SetVariantToJSON(parser, &node, value); - root->AddElement(name, node); - } - - void amf::SetVariantToJSON(amf::JSONParser * parser, amf::JSONParser::Node ** node, const amf::AMFVariant & value) - { - parser->CreateNode(node); - SetStringValue(parser, *node, "Type", variantTypeNameMap[value.type]); - - amf::JSONParser::Element::Ptr el; - CreateVariantValue(parser, &el, value); - (*node)->AddElement(TAG_JSON_VALUE, el); - } - - void amf::CreateVariantValue(amf::JSONParser* parser, amf::JSONParser::Element** el, const amf::AMFVariant& value) - { - switch (value.type) - { - case amf::AMF_VARIANT_EMPTY: - break; - case amf::AMF_VARIANT_BOOL: - CreateBoolValue(parser, (amf::JSONParser::Value**)el, value.boolValue); - break; - case amf::AMF_VARIANT_INT64: - CreateInt64Value(parser, (amf::JSONParser::Value**)el, value.int64Value); - break; - case amf::AMF_VARIANT_FLOAT: - CreateFloatValue(parser, (amf::JSONParser::Value**)el, value.ToFloat()); - break; - case amf::AMF_VARIANT_DOUBLE: - CreateDoubleValue(parser, (amf::JSONParser::Value**)el, value.ToDouble()); - break; - case amf::AMF_VARIANT_STRING: - CreateStringValue(parser, (amf::JSONParser::Value**)el, value.ToString().c_str()); - break; - case amf::AMF_VARIANT_WSTRING: - CreateStringValue(parser, (amf::JSONParser::Value**)el, value.ToString().c_str()); - break; - case amf::AMF_VARIANT_RECT: - CreateRectValue(parser, (amf::JSONParser::Array**)el, value.ToRect()); - break; - case amf::AMF_VARIANT_SIZE: - CreateSizeValue(parser, (amf::JSONParser::Array**)el, value.ToSize()); - break; - case amf::AMF_VARIANT_POINT: - CreatePointValue(parser, (amf::JSONParser::Array**)el, value.ToPoint()); - break; - case amf::AMF_VARIANT_RATE: - CreateRateValue(parser, (amf::JSONParser::Array**)el, value.ToRate()); - break; - case amf::AMF_VARIANT_RATIO: - CreateRatioValue(parser, (amf::JSONParser::Array**)el, value.ToRatio()); - break; - case amf::AMF_VARIANT_COLOR: - CreateColorValue(parser, (amf::JSONParser::Array**)el, value.ToColor()); - break; - case amf::AMF_VARIANT_FLOAT_SIZE: - CreateFloatSizeValue(parser, (amf::JSONParser::Array**)el, value.ToFloatSize()); - break; - case amf::AMF_VARIANT_FLOAT_POINT2D: - CreateFloatPoint2DValue(parser, (amf::JSONParser::Array**)el, value.ToFloatPoint2D()); - break; - case amf::AMF_VARIANT_FLOAT_POINT3D: - CreateFloatPoint3DValue(parser, (amf::JSONParser::Array**)el, value.ToFloatPoint3D()); - break; - case amf::AMF_VARIANT_FLOAT_VECTOR4D: - CreateFloatVector4DValue(parser, (amf::JSONParser::Array**)el, value.ToFloatVector4D()); - break; - case amf::AMF_VARIANT_INTERFACE: - CreateInterfaceValue(parser, (amf::JSONParser::Node**)el, value.ToInterface()); - break; - default: - break; - } - } - - bool amf::GetInt32Value(const amf::JSONParser::Node* root, const char *name, int32_t &val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetInt32FromJSON(element, val); - } - - bool amf::GetInt32FromJSON(const amf::JSONParser::Value* element, int32_t& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsInt32(); - result = true; - } - return result; - } - - bool amf::GetUInt32Value(const amf::JSONParser::Node* root, const char* name, uint32_t& val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetUInt32FromJSON(element, val); - } - - bool amf::GetUInt32FromJSON(const amf::JSONParser::Value* element, uint32_t& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsUInt32(); - result = true; - } - return result; - } - - bool amf::GetInt64Value(const amf::JSONParser::Node* root, const char* name, int64_t& val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetInt64FromJSON(element, val); - } - - bool amf::GetInt64FromJSON(const amf::JSONParser::Value* element, int64_t& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsInt64(); - result = true; - } - return result; - } - - bool amf::GetUInt64Value(const amf::JSONParser::Node* root, const char* name, uint64_t& val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetUInt64FromJSON(element, val); - } - - bool amf::GetUInt64FromJSON(const amf::JSONParser::Value* element, uint64_t& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsUInt64(); - result = true; - } - return result; - } - - bool amf::GetDoubleValue(const amf::JSONParser::Node* root, const char* name, double& val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetDoubleFromJSON(element, val); - } - - bool amf::GetDoubleFromJSON(const amf::JSONParser::Value * element, double & val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsDouble(); - result = true; - } - return result; - } - - bool amf::GetFloatValue(const amf::JSONParser::Node* root, const char *name, float &val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetFloatFromJSON(element, val); - } - - bool amf::GetFloatFromJSON(const amf::JSONParser::Value* element, float& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsFloat(); - result = true; - } - return result; - } - - bool amf::GetFloatArray(const amf::JSONParser::Node* root, const char *name, float *val, size_t &size) - { - amf::JSONParser::Array::Ptr element(root->GetElementByName(name)); - return amf::GetFloatArrayFromJSON(element, val, size); - } - - bool amf::GetFloatArrayFromJSON(const amf::JSONParser::Array* element, float* val, size_t& size) - { - bool result = false; - if (element != nullptr) - { - size = AMF_MIN(element->GetElementCount(), size); - for (size_t i = 0; i < size; i++) - { - - val[i] = ((const amf::JSONParser::Value*)(element->GetElementAt(i)))->GetValueAsFloat(); - } - result = true; - } - return result; - } - - bool amf::GetDoubleArray(const amf::JSONParser::Node* root, const char* name, double* val, size_t& size) - { - amf::JSONParser::Array::Ptr element(root->GetElementByName(name)); - return amf::GetDoubleArrayFromJSON(element, val, size); - } - - bool amf::GetDoubleArrayFromJSON(const amf::JSONParser::Array* element, double* val, size_t& size) - { - bool result = false; - if (element != nullptr) - { - size = AMF_MIN(element->GetElementCount(), size); - for (size_t i = 0; i < size; i++) - { - - val[i] = ((const amf::JSONParser::Value*)(element->GetElementAt(i)))->GetValueAsDouble(); - } - result = true; - } - return result; - } - - bool amf::GetInt64Array(const amf::JSONParser::Node* root, const char *name, int64_t *val, size_t &size) - { - amf::JSONParser::Array::Ptr element(root->GetElementByName(name)); - return amf::GetInt64ArrayFromJSON(element, val, size); - } - - bool amf::GetInt64ArrayFromJSON(const amf::JSONParser::Array * element, int64_t * val, size_t & size) - { - bool result = false; - if (element != nullptr) - { - size = AMF_MIN(element->GetElementCount(), size); - for (size_t i = 0; i < size; i++) - { - - val[i] = ((const amf::JSONParser::Value*)(element->GetElementAt(i)))->GetValueAsInt64(); - } - result = true; - } - return result; - } - - bool amf::GetInt32Array(const amf::JSONParser::Node* root, const char* name, int32_t* val, size_t& size) - { - amf::JSONParser::Array::Ptr element(root->GetElementByName(name)); - return amf::GetInt32ArrayFromJSON(element, val, size); - } - - bool amf::GetInt32ArrayFromJSON(const amf::JSONParser::Array* element, int32_t* val, size_t& size) - { - bool result = false; - if (element != nullptr) - { - size = AMF_MIN(element->GetElementCount(), size); - for (size_t i = 0; i < size; i++) - { - val[i] = ((const amf::JSONParser::Value*)(element->GetElementAt(i)))->GetValueAsInt32(); - } - result = true; - } - return result; - } - - bool amf::GetUInt32Array(const amf::JSONParser::Node* root, const char *name, uint32_t *val, size_t &size) - { - amf::JSONParser::Array::Ptr element(root->GetElementByName(name)); - return amf::GetUInt32ArrayFromJSON(element, val, size); - } - - bool amf::GetUInt32ArrayFromJSON(const amf::JSONParser::Array * element, uint32_t * val, size_t & size) - { - bool result = false; - if (element != nullptr) - { - size = AMF_MIN(element->GetElementCount(), size); - for (size_t i = 0; i < size; i++) - { - - val[i] = ((const amf::JSONParser::Value*)(element->GetElementAt(i)))->GetValueAsUInt32(); - } - result = true; - } - return result; - } - - bool amf::GetBoolValue(const amf::JSONParser::Node* root, const char* name, bool& val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetBoolFromJSON(element, val); - } - - bool amf::GetBoolFromJSON(const amf::JSONParser::Value* element, bool& val) - { - bool result = false; - if (element != nullptr) - { - val = element->GetValueAsBool(); - result = true; - } - return result; - } - - bool amf::GetSizeValue(const amf::JSONParser::Node* root, const char* name, AMFSize& val) - { - return amf::GetSizeFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetSizeFromJSON(const amf::JSONParser::Element* element, AMFSize& val) - { - int32_t arrayVal[2] = {}; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.width = arrayVal[0]; - val.height = arrayVal[1]; - } - return ret; - } - - bool amf::GetPointValue(const amf::JSONParser::Node* root, const char* name, AMFPoint& val) - { - return amf::GetPointFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetPointFromJSON(const amf::JSONParser::Element* element, AMFPoint& val) - { - int32_t arrayVal[2]; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.x = arrayVal[0]; - val.y = arrayVal[1]; - } - return ret; - } - - bool amf::GetRectValue(const amf::JSONParser::Node* root, const char* name, AMFRect& val) - { - return amf::GetRectFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetRectFromJSON(const amf::JSONParser::Element* element, AMFRect& val) - { - int32_t arrayVal[4]; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.left = arrayVal[0]; - val.top = arrayVal[1]; - val.right = arrayVal[2]; - val.bottom = arrayVal[3]; - } - return ret; - } - - bool amf::GetRateValue(const amf::JSONParser::Node* root, const char* name, AMFRate& val) - { - return amf::GetRateFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetRateFromJSON(const amf::JSONParser::Element* element, AMFRate & val) - { - uint32_t arrayVal[2]; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetUInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.num = arrayVal[0]; - val.den = arrayVal[1]; - } - return ret; - } - - bool amf::GetRatioValue(const amf::JSONParser::Node* root, const char* name, AMFRatio& val) - { - return amf::GetRatioFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetRatioFromJSON(const amf::JSONParser::Element* element, AMFRatio & val) - { - uint32_t arrayVal[2]; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetUInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.num = arrayVal[0]; - val.den = arrayVal[1]; - } - return ret; - } - - bool amf::GetColorValue(const amf::JSONParser::Node* root, const char* name, AMFColor& val) - { - return amf::GetColorFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetColorFromJSON(const amf::JSONParser::Element* element, AMFColor & val) - { - uint32_t arrayVal[4]; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetUInt32ArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.a = static_cast(arrayVal[0]); - val.r = static_cast(arrayVal[1]); - val.g = static_cast(arrayVal[2]); - val.b = static_cast(arrayVal[3]); - } - return ret; - } - - bool amf::GetFloatSizeValue(const amf::JSONParser::Node* root, const char* name, AMFFloatSize& val) - { - return amf::GetFloatSizeFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetFloatSizeFromJSON(const amf::JSONParser::Element* element, AMFFloatSize & val) - { - float arrayVal[2] = {}; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetFloatArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.width = arrayVal[0]; - val.height = arrayVal[1]; - } - return ret; - } - - bool amf::GetFloatPoint2DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatPoint2D& val) - { - return amf::GetFloatPoint2DFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetFloatPoint2DFromJSON(const amf::JSONParser::Element* element, AMFFloatPoint2D & val) - { - float arrayVal[2] = {}; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetFloatArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.x = arrayVal[0]; - val.y = arrayVal[1]; - } - return ret; - } - - bool amf::GetFloatPoint3DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatPoint3D& val) - { - return amf::GetFloatPoint3DFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetFloatPoint3DFromJSON(const amf::JSONParser::Element* element, AMFFloatPoint3D & val) - { - float arrayVal[3] = {}; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetFloatArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.x = arrayVal[0]; - val.y = arrayVal[1]; - val.z = arrayVal[2]; - } - return ret; - } - - bool amf::GetFloatVector4DValue(const amf::JSONParser::Node* root, const char* name, AMFFloatVector4D& val) - { - return amf::GetFloatVector4DFromJSON(root->GetElementByName(name), val); - } - - bool amf::GetFloatVector4DFromJSON(const amf::JSONParser::Element* element, AMFFloatVector4D & val) - { - float arrayVal[4] = {}; - size_t size = amf_countof(arrayVal); - amf::JSONParser::Array::Ptr array(const_cast(element)); - bool ret = (array != nullptr ? GetFloatArrayFromJSON(array, arrayVal, size) : false); - if (ret) - { - val.x = arrayVal[0]; - val.y = arrayVal[1]; - val.z = arrayVal[2]; - val.w = arrayVal[3]; - } - return ret; - } - - bool amf::GetStringValue(const amf::JSONParser::Node* root, const char *name, std::string &val) - { - amf::JSONParser::Value::Ptr element(root->GetElementByName(name)); - return amf::GetStringFromJSON(element, val); - } - - bool amf::GetStringFromJSON(const amf::JSONParser::Value* element, std::string& val) - { - bool result = false; - if (element != nullptr && element->IsNull() == false) - { - val = element->GetValue(); - result = true; - } - return result; - } - - bool amf::GetInterfaceValue(const amf::JSONParser::Node* root, const char* name, AMFInterface* pVal) - { - return amf::GetInterfaceFromJSON(root->GetElementByName(name), pVal); - } - - bool amf::GetInterfaceFromJSON(const amf::JSONParser::Element* element, AMFInterface* pVal) - { - const amf::JSONParser::Node* node = (const amf::JSONParser::Node*) element; - AMFInterfaceJSONSerializablePtr p(pVal); - bool result = false; - if (p != nullptr) - { - p->FromJson(node); - result = true; - } - - return result; - } - - bool amf::GetVariantValue(const amf::JSONParser::Node* root, const char *name, amf::AMFVariant& val) - { - amf::JSONParser::Node::Ptr element(root->GetElementByName(name)); - return amf::GetVariantFromJSON(element, val); - } - - bool amf::GetVariantFromJSON(const amf::JSONParser::Node * element, amf::AMFVariant & val) - { - bool result = false; - if (element != nullptr) - { - std::string propName, propType; - if (GetStringValue(element, "Type", propType) == true) - { - for (int i = 0; i < variantTypeNameCount; i++) - { - if (propType == variantTypeNameMap[i]) - { - val.type = (AMF_VARIANT_TYPE)i; - result = true; - break; - } - } - - if (result == true) - { - result = GetVariantValueFromJSON(element->GetElementByName(TAG_JSON_VALUE), val); - } - } - } - return result; - } - - //assumes val.type is pre-filled and valid - bool amf::GetVariantValueFromJSON(const amf::JSONParser::Element* element, amf::AMFVariant& val) - { - bool result = false; - switch (val.type) - { - case amf::AMF_VARIANT_EMPTY: - break; - case amf::AMF_VARIANT_BOOL: - result = GetBoolFromJSON((const amf::JSONParser::Value*)element, val.boolValue); - break; - case amf::AMF_VARIANT_INT64: - result = GetInt64FromJSON((const amf::JSONParser::Value*)element, val.int64Value); - break; - case amf::AMF_VARIANT_FLOAT: - result = GetFloatFromJSON((const amf::JSONParser::Value*)element, val.floatValue); - break; - case amf::AMF_VARIANT_DOUBLE: - result = GetDoubleFromJSON((const amf::JSONParser::Value*)element, val.doubleValue); - break; - case amf::AMF_VARIANT_STRING: - { - val.type = amf::AMF_VARIANT_EMPTY; - std::string value; - result = GetStringFromJSON((const amf::JSONParser::Value*)element, value); - val = value.c_str(); - } - break; - case amf::AMF_VARIANT_WSTRING: - { - val.type = amf::AMF_VARIANT_EMPTY; - std::string value; - result = GetStringFromJSON((const amf::JSONParser::Value*)element, value); - val = value.c_str(); - val.ChangeType(amf::AMF_VARIANT_WSTRING); - } - break; - case amf::AMF_VARIANT_RECT: - result = GetRectFromJSON(element, val.rectValue); - break; - case amf::AMF_VARIANT_SIZE: - result = GetSizeFromJSON(element, val.sizeValue); - break; - case amf::AMF_VARIANT_POINT: - result = GetPointFromJSON(element, val.pointValue); - break; - case amf::AMF_VARIANT_RATE: - result = GetRateFromJSON(element, val.rateValue); - break; - case amf::AMF_VARIANT_RATIO: - result = GetRatioFromJSON(element, val.ratioValue); - break; - case amf::AMF_VARIANT_COLOR: - result = GetColorFromJSON(element, val.colorValue); - break; - case amf::AMF_VARIANT_FLOAT_SIZE: - result = GetFloatSizeFromJSON(element, val.floatSizeValue); - break; - case amf::AMF_VARIANT_FLOAT_POINT2D: - result = GetFloatPoint2DFromJSON(element, val.floatPoint2DValue); - break; - case amf::AMF_VARIANT_FLOAT_POINT3D: - result = GetFloatPoint3DFromJSON(element, val.floatPoint3DValue); - break; - case amf::AMF_VARIANT_FLOAT_VECTOR4D: - result = GetFloatVector4DFromJSON(element, val.floatVector4DValue); - break; - case amf::AMF_VARIANT_INTERFACE: - result = GetInterfaceFromJSON(element, val.pInterface); - break; - default: - break; - } - return result; - } -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.h deleted file mode 100644 index 70f52d24..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/JsonImpl.h +++ /dev/null @@ -1,185 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#pragma once - -#include "Json.h" -#include "InterfaceImpl.h" -#include -#include - -namespace amf -{ - //----------------------------------------------------------------------------------------- - class JSONParserImpl : - public AMFInterfaceImpl - { - public: - //----------------------------------------------------------------------------------------- - class ElementHelper - { - protected: - ElementHelper(); - - Error CreateElement(const std::string& str, size_t start, size_t& valueStart, size_t& valueEnd, JSONParser::Element** val); - size_t FindClosure(const std::string& str, char opener, char closer, size_t start); - void InsertTabs(std::string& target, int count, const OutputFormatDesc& format) const; - protected: - }; - //----------------------------------------------------------------------------------------- - class ValueImpl : - public AMFInterfaceImpl, - public ElementHelper - { - public: - ValueImpl(); - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(JSONParser::Element) - AMF_INTERFACE_ENTRY(JSONParser::Value) - AMF_END_INTERFACE_MAP - - - virtual JSONParser::Error Parse(const std::string& str, size_t start, size_t end); - virtual std::string Stringify() const; - virtual std::string StringifyFormatted(const OutputFormatDesc& format, int indent) const; - - virtual void SetValue(const std::string& val); - virtual void SetValueAsInt32(int32_t val); - virtual void SetValueAsUInt32(uint32_t val); - virtual void SetValueAsInt64(int64_t val); - virtual void SetValueAsUInt64(uint64_t val); - virtual void SetValueAsDouble(double val); - virtual void SetValueAsFloat(float val); - virtual void SetValueAsBool(bool val); - virtual void SetValueAsTime(time_t date, bool utc); - virtual void SetToNull(); - - virtual const std::string& GetValue() const; - virtual int32_t GetValueAsInt32() const; - virtual uint32_t GetValueAsUInt32() const; - virtual int64_t GetValueAsInt64() const; - virtual uint64_t GetValueAsUInt64() const; - virtual double GetValueAsDouble() const; - virtual float GetValueAsFloat() const; - virtual bool GetValueAsBool() const; - virtual time_t GetValueAsTime() const; - virtual bool IsNull() const; - - private: - enum VALUE_TYPE - { - VT_Unknown = 0, - VT_Null = 1, - VT_Bool = 2, - VT_String = 3, - VT_Numeric = 4, - }; - VALUE_TYPE m_eType; - std::string m_Value; - }; - //----------------------------------------------------------------------------------------- - class NodeImpl : - public AMFInterfaceImpl, - public ElementHelper - { - public: - typedef std::map ElementMap; - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(JSONParser::Element) - AMF_INTERFACE_ENTRY(JSONParser::Node) - AMF_END_INTERFACE_MAP - - NodeImpl(); - - virtual JSONParser::Error Parse(const std::string& str, size_t start, size_t end); - virtual std::string Stringify() const; - virtual std::string StringifyFormatted(const OutputFormatDesc& format, int indent) const; - - - virtual size_t GetElementCount() const; - virtual JSONParser::Element* GetElementByName(const std::string& name) const; - virtual JSONParser::Result AddElement(const std::string& name, JSONParser::Element* element); - virtual JSONParser::Element* GetElementAt(size_t idx, std::string& name) const; - - const ElementMap& GetElements() const { return m_Elements; } - - private: - ElementMap m_Elements; - }; - //----------------------------------------------------------------------------------------- - class ArrayImpl : - public AMFInterfaceImpl, - public ElementHelper - { - public: - typedef std::vector ElementVector; - - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(JSONParser::Element) - AMF_INTERFACE_ENTRY(JSONParser::Array) - AMF_END_INTERFACE_MAP - - ArrayImpl(); - - virtual JSONParser::Error Parse(const std::string& str, size_t start, size_t end); - virtual std::string Stringify() const; - virtual std::string StringifyFormatted(const OutputFormatDesc& format, int indent) const; - - virtual size_t GetElementCount() const; - virtual JSONParser::Element* GetElementAt(size_t idx) const; - virtual void AddElement(Element* element); - - private: - ElementVector m_Elements; - }; - //----------------------------------------------------------------------------------------- - JSONParserImpl(); - - virtual JSONParser::Result Parse(const std::string& str, Node** root); - virtual std::string Stringify(const Node* root) const; - virtual std::string StringifyFormatted(const Node* root, const OutputFormatDesc& format, int indent) const; - - virtual size_t GetLastErrorOffset() const; - - virtual Result CreateNode(Node** node) const; - virtual Result CreateValue(Value** value) const; - virtual Result CreateArray(Array** array) const; - - private: - size_t m_LastErrorOfs; - }; -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.cpp deleted file mode 100644 index 2f45dc2b..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file PulseAudioImprotTable.cpp -/// @brief pulseaudio import table -///------------------------------------------------------------------------- -#include "CairoImportTable.h" -#include "public/common/TraceAdapter.h" -#include "../Thread.h" - -using namespace amf; - -#define GET_SO_ENTRYPOINT(m, h, f) m = reinterpret_cast(amf_get_proc_address(h, #f)); \ - AMF_RETURN_IF_FALSE(nullptr != m, AMF_FAIL, L"Failed to acquire entrypoint %S", #f); - -//------------------------------------------------------------------------------------------------- -CairoImportTable::CairoImportTable() -{} - -//------------------------------------------------------------------------------------------------- -CairoImportTable::~CairoImportTable() -{ - UnloadFunctionsTable(); -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT CairoImportTable::LoadFunctionsTable() -{ - if (nullptr == m_hLibCairoSO) - { - m_hLibCairoSO = amf_load_library(L"libcairo.so.2"); - AMF_RETURN_IF_FALSE(nullptr != m_hLibCairoSO, AMF_FAIL, L"Failed to load libcairo.so.2"); - } - - GET_SO_ENTRYPOINT(m_cairo_image_surface_create_from_png_stream, m_hLibCairoSO, cairo_image_surface_create_from_png_stream); - GET_SO_ENTRYPOINT(m_cairo_surface_destroy, m_hLibCairoSO, cairo_surface_destroy); - GET_SO_ENTRYPOINT(m_cairo_image_surface_get_width, m_hLibCairoSO, cairo_image_surface_get_width); - GET_SO_ENTRYPOINT(m_cairo_image_surface_get_height, m_hLibCairoSO, cairo_image_surface_get_height); - GET_SO_ENTRYPOINT(m_cairo_image_surface_get_stride, m_hLibCairoSO, cairo_image_surface_get_stride); - GET_SO_ENTRYPOINT(m_cairo_image_surface_get_format, m_hLibCairoSO, cairo_image_surface_get_format); - GET_SO_ENTRYPOINT(m_cairo_image_surface_get_data, m_hLibCairoSO, cairo_image_surface_get_data); - - return AMF_OK; -} - -void CairoImportTable::UnloadFunctionsTable() -{ - if (nullptr != m_hLibCairoSO) - { - amf_free_library(m_hLibCairoSO); - m_hLibCairoSO = nullptr; - } - - m_cairo_image_surface_create_from_png_stream = nullptr; - m_cairo_surface_destroy = nullptr; - m_cairo_image_surface_get_width = nullptr; - m_cairo_image_surface_get_height = nullptr; - m_cairo_image_surface_get_stride = nullptr; - m_cairo_image_surface_get_format = nullptr; - m_cairo_image_surface_get_data = nullptr; -} \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.h deleted file mode 100644 index b9182572..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/CairoImportTable.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file CairoImportTable.h -/// @brief Cairo import table -///------------------------------------------------------------------------- -#pragma once - -#include "../../include/core/Result.h" - -#include -#include - -struct CairoImportTable{ - - CairoImportTable(); - ~CairoImportTable(); - - AMF_RESULT LoadFunctionsTable(); - void UnloadFunctionsTable(); - - decltype(&cairo_image_surface_create_from_png_stream) m_cairo_image_surface_create_from_png_stream = nullptr; - decltype(&cairo_surface_destroy) m_cairo_surface_destroy = nullptr; - decltype(&cairo_image_surface_get_width) m_cairo_image_surface_get_width = nullptr; - decltype(&cairo_image_surface_get_height) m_cairo_image_surface_get_height = nullptr; - decltype(&cairo_image_surface_get_stride) m_cairo_image_surface_get_stride = nullptr; - decltype(&cairo_image_surface_get_format) m_cairo_image_surface_get_format = nullptr; - decltype(&cairo_image_surface_get_data) m_cairo_image_surface_get_data = nullptr; - - amf_handle m_hLibCairoSO = nullptr; - -}; - -typedef std::shared_ptr CairoImportTablePtr; \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.cpp deleted file mode 100644 index ca78fd1b..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; AV1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#include "DRMDevice.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define AMF_FACILITY L"DRMDevice" - -struct FormatMapEntry -{ - amf::AMF_SURFACE_FORMAT formatAMF; - uint32_t formatDRM; -}; -static const FormatMapEntry formatMap [] = -{ -#ifdef DRM_FORMAT_R8 - { amf::AMF_SURFACE_GRAY8, DRM_FORMAT_R8 }, -#endif -#ifdef DRM_FORMAT_R16 -// { , DRM_FORMAT_R16 }, -// { , DRM_FORMAT_R16 | DRM_FORMAT_BIG_ENDIAN }, -#endif -// { , DRM_FORMAT_BGR233 }, -// { , DRM_FORMAT_XRGB1555 }, -// { , DRM_FORMAT_XRGB1555 | DRM_FORMAT_BIG_ENDIAN }, -// { , DRM_FORMAT_XBGR1555 }, -// { , DRM_FORMAT_XBGR1555 | DRM_FORMAT_BIG_ENDIAN }, -// { , DRM_FORMAT_RGB565 }, -// { , DRM_FORMAT_RGB565 | DRM_FORMAT_BIG_ENDIAN }, -// { , DRM_FORMAT_BGR565 }, -// { , DRM_FORMAT_BGR565 | DRM_FORMAT_BIG_ENDIAN }, -// { , DRM_FORMAT_RGB888 }, -// { , DRM_FORMAT_BGR888 }, - { amf::AMF_SURFACE_BGRA, DRM_FORMAT_BGRX8888 }, - { amf::AMF_SURFACE_RGBA, DRM_FORMAT_RGBX8888 }, - { amf::AMF_SURFACE_BGRA, DRM_FORMAT_XBGR8888 }, - { amf::AMF_SURFACE_BGRA /*AMF_SURFACE_ARGB*/, DRM_FORMAT_XRGB8888 }, - { amf::AMF_SURFACE_RGBA, DRM_FORMAT_BGRA8888 }, - { amf::AMF_SURFACE_ARGB, DRM_FORMAT_ARGB8888 }, - { amf::AMF_SURFACE_YUY2, DRM_FORMAT_YUYV }, -// { , DRM_FORMAT_YVYU }, - { amf::AMF_SURFACE_UYVY, DRM_FORMAT_UYVY }, -}; - -amf::AMF_SURFACE_FORMAT AMF_STD_CALL FromDRMtoAMF(uint32_t formatDRM) -{ - for(int i = 0; i < amf_countof(formatMap); i++) - { - if(formatMap[i].formatDRM == formatDRM) - { - return formatMap[i].formatAMF; - } - } - return amf::AMF_SURFACE_UNKNOWN; -} - -drmModeFB2Ptr AMF_STD_CALL AMFdrmModeGetFB2(int fd, uint32_t fb_id) -{ - struct drm_mode_fb_cmd2 get = { - .fb_id = fb_id, - }; - drmModeFB2Ptr ret; - int err; - - err = drmIoctl(fd, DRM_IOCTL_MODE_GETFB2, &get); - if (err != 0) - return NULL; - - ret = (drmModeFB2Ptr)drmMalloc(sizeof(drmModeFB2)); - if (!ret) - return NULL; - - ret->fb_id = fb_id; - ret->width = get.width; - ret->height = get.height; - ret->pixel_format = get.pixel_format; - ret->flags = get.flags; - ret->modifier = get.modifier[0]; - memcpy(ret->handles, get.handles, sizeof(uint32_t) * 4); - memcpy(ret->pitches, get.pitches, sizeof(uint32_t) * 4); - memcpy(ret->offsets, get.offsets, sizeof(uint32_t) * 4); - - return ret; -} - -void AMF_STD_CALL AMFdrmModeFreeFB2(drmModeFB2Ptr ptr) -{ - drmFree(ptr); -} - -DRMDevice::DRMDevice() {} - -DRMDevice::~DRMDevice() -{ - Terminate(); -} - -AMF_RESULT AMF_STD_CALL DRMDevice::InitFromVulkan(int pciDomain, int pciBus, int pciDevice, int pciFunction) -{ - int dirfd = open("/dev/dri/by-path", O_RDONLY); - AMF_RETURN_IF_FALSE(dirfd != -1, AMF_FAIL, L"Couldn't open /dev/dri/by-path") - DIR *pDir = fdopendir(dirfd); - if (pDir == nullptr) - { - close(dirfd); - return AMF_FAIL; - } - - struct dirent *entry; - while ((entry = readdir(pDir)) != NULL) - { - int entryDomain = -1, entryBus = -1, entryDevice = -1, entryFunction = -1, length = -1; - - int res = sscanf(entry->d_name, "pci-%x:%x:%x.%x-card%n", - &entryDomain, &entryBus, &entryDevice, &entryFunction, &length); - //check if matches pattern - if (res != 4 || length != strlen(entry->d_name)) - { - continue; - } - if (entryDomain == pciDomain && entryBus == pciBus && entryDevice == pciDevice && entryFunction == pciFunction) - { - m_fd = openat(dirfd, entry->d_name, O_RDWR | O_CLOEXEC); - m_pathToCard = entry->d_name; - break; - } - } - - closedir(pDir); //implicitly closes dirfd - if (m_fd < 0) - { - return AMF_FAIL; - } - return SetupDevice(); -} - -AMF_RESULT AMF_STD_CALL DRMDevice::InitFromPath(const char* pathToCard) -{ - m_fd = open(pathToCard, O_RDWR | O_CLOEXEC); - m_pathToCard = pathToCard; - - if (m_fd < 0) - { - return AMF_FAIL; - } - return SetupDevice(); -} - -AMF_RESULT DRMDevice::SetupDevice() -{ - drmVersionPtr version = drmGetVersion(m_fd); - AMF_RETURN_IF_FALSE(version != nullptr, AMF_FAIL, L"drmGetVersion() failed from %S", m_pathToCard.c_str()); - - AMFTraceDebug(AMF_FACILITY, L"Opened DRM device %S: driver name %S version %d.%d.%d", m_pathToCard.c_str(), version->name, - version->version_major, version->version_minor, version->version_patchlevel); - - drmFreeVersion(version); - - uint64_t valueExport = 0; - int err = drmGetCap(m_fd, DRM_PRIME_CAP_EXPORT, &valueExport); - - err = drmSetClientCap(m_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); - if (err < 0) - { - AMFTraceWarning(AMF_FACILITY, L"drmSetClientCap(DRM_CLIENT_CAP_UNIVERSAL_PLANES) Failed with %d", err); - } - drmSetClientCap(m_fd, DRM_CLIENT_CAP_ATOMIC, 1); - - return AMF_OK; -} - -AMF_RESULT AMF_STD_CALL DRMDevice::Terminate() -{ - if (m_fd >= 0) - { - close(m_fd); - m_fd = -1; - } - m_pathToCard = ""; - return AMF_OK; -} - -int AMF_STD_CALL DRMDevice::GetFD() const -{ - return m_fd; -} - -std::string AMF_STD_CALL DRMDevice::GetPathToCard() const -{ - return m_pathToCard; -} - -AMF_RESULT AMF_STD_CALL DRMDevice::GetCRTCs(std::vector& crtcs) const -{ - AMF_RETURN_IF_FALSE(m_fd >= 0, AMF_FAIL, L"Not Initialized"); - - AMFdrmModeResPtr resources = drmModeGetResources(m_fd); - AMF_RETURN_IF_FALSE(resources.p != nullptr, AMF_FAIL, L"drmModeGetResources() return nullptr"); - - crtcs.clear(); - for(int i = 0; i < resources.p->count_crtcs; i ++) - { - AMFdrmModeCrtcPtr crtc = drmModeGetCrtc(m_fd, resources.p->crtcs[i]); - - AMFRect crop = {}; - amf::AMF_SURFACE_FORMAT formatAMF = amf::AMF_SURFACE_UNKNOWN; - int formatDRM = 0; - int handle = 0; - if(GetCrtcInfo(crtc, crop, formatDRM, formatAMF, handle) != AMF_OK) - { - continue; - } - AMFTraceDebug(AMF_FACILITY, L" CRTC id=%d fb=%d crop(%d,%d,%d,%d)", crtc.p->crtc_id, crtc.p->buffer_id, crop.left, crop.top, crop.right, crop.bottom); - - DRMCRTC drmCrtc = {}; - drmCrtc.crtcID = crtc.p->crtc_id; - drmCrtc.fbID = crtc.p->buffer_id; - drmCrtc.crop = crop; - drmCrtc.formatDRM = formatDRM; - drmCrtc.formatAMF = formatAMF; - drmCrtc.handle = handle; - crtcs.push_back(drmCrtc); - } - return AMF_OK; -} - - -AMF_RESULT AMF_STD_CALL DRMDevice::GetCrtcInfo(const AMFdrmModeCrtcPtr& crtc, AMFRect &crop, int& formatDRM, amf::AMF_SURFACE_FORMAT& formatAMF, int& handle) const -{ - if(crtc.p == nullptr) - { - return AMF_FAIL; - } - if(crtc.p->buffer_id == 0) - { - return AMF_FAIL; - } - // check if active - AMFdrmModeObjectPropertiesPtr properties = drmModeObjectGetProperties (m_fd, crtc.p->crtc_id, DRM_MODE_OBJECT_CRTC); - if(properties.p == nullptr) - { - return AMF_FAIL; - } - - for(int k = 0; k < properties.p->count_props; k++) - { - AMFdrmModePropertyPtr prop = drmModeGetProperty(m_fd, properties.p->props[k]); - - if(std::string(prop.p->name) == "ACTIVE" && properties.p->prop_values[k] == 0) - { - return AMF_FAIL; - } - } - // check FB - - AMFdrmModeFB2Ptr fb2 = AMFdrmModeGetFB2(m_fd, crtc.p->buffer_id); - if(fb2.p == nullptr) - { - return AMF_FAIL; - } - - crop.left = crtc.p->x; - crop.top = crtc.p->y; - crop.right = crtc.p->x + crtc.p->width; - crop.bottom = crtc.p->y + crtc.p->height; - formatDRM = fb2.p->pixel_format; - formatAMF= FromDRMtoAMF(fb2.p->pixel_format); - handle = fb2.p->handles[0]; - - return AMF_OK; -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.h deleted file mode 100644 index 1e10cbb0..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/DRMDevice.h +++ /dev/null @@ -1,123 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; AV1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#pragma once -#include -#include -#include "public/common/TraceAdapter.h" -#include "public/include/core/Surface.h" - -#include -#include -#include -#include -#include -#include - -// These classed provide a nice interface to a DRM card using libdrm - -amf::AMF_SURFACE_FORMAT AMF_STD_CALL FromDRMtoAMF(uint32_t formatDRM); -drmModeFB2Ptr AMF_STD_CALL AMFdrmModeGetFB2(int fd, uint32_t fb_id); -void AMF_STD_CALL AMFdrmModeFreeFB2(drmModeFB2Ptr ptr); - -template -class AMFAutoDRMPtr -{ - public: - AMFAutoDRMPtr() : p(nullptr){} - AMFAutoDRMPtr(type ptr) : p(ptr){} - ~AMFAutoDRMPtr() - { - Clear(); - } - AMFAutoDRMPtr& operator=(type ptr) - { - if(p != ptr) - { - Clear(); - p = ptr; - } - return *this; - } - void Clear() - { - if(p != nullptr) - { - function(p); - p = nullptr; - } - } - - type p; - - private: - AMFAutoDRMPtr& operator=(const AMFAutoDRMPtr& other); -}; - -typedef AMFAutoDRMPtr AMFdrmModePlanePtr; -typedef AMFAutoDRMPtr AMFdrmModeFBPtr; -typedef AMFAutoDRMPtr AMFdrmModeFB2Ptr; -typedef AMFAutoDRMPtr AMFdrmModePlaneResPtr; -typedef AMFAutoDRMPtr AMFdrmModeObjectPropertiesPtr; -typedef AMFAutoDRMPtr AMFdrmModePropertyPtr; -typedef AMFAutoDRMPtr AMFdrmModeCrtcPtr; -typedef AMFAutoDRMPtr AMFdrmModeResPtr; - -struct DRMCRTC { - int crtcID; - int fbID; - AMFRect crop; - int formatDRM; - amf::AMF_SURFACE_FORMAT formatAMF; - int handle; -}; - -class DRMDevice { -public: - DRMDevice(); - ~DRMDevice(); - - AMF_RESULT AMF_STD_CALL InitFromVulkan(int pciDomain, int pciBus, int pciDevice, int pciFunction); - AMF_RESULT AMF_STD_CALL InitFromPath(const char* pathToCard); - - AMF_RESULT AMF_STD_CALL Terminate(); - - int AMF_STD_CALL GetFD() const; - std::string AMF_STD_CALL GetPathToCard() const; - - AMF_RESULT AMF_STD_CALL GetCRTCs(std::vector& crtcs) const; - AMF_RESULT AMF_STD_CALL GetCrtcInfo(const AMFdrmModeCrtcPtr& crtc, AMFRect &crop, int& formatDRM, amf::AMF_SURFACE_FORMAT& formatAMF, int& handle) const; -private: - AMF_RESULT SetupDevice(); - - int m_fd = -1; - std::string m_pathToCard; -}; \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.cpp deleted file mode 100644 index 94f0dc3c..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file PulseAudioImprotTable.cpp -/// @brief pulseaudio import table -///------------------------------------------------------------------------- -#include "PulseAudioImportTable.h" -#include "public/common/TraceAdapter.h" -#include "../Thread.h" - -using namespace amf; - -#define GET_SO_ENTRYPOINT(m, h, f) m = reinterpret_cast(amf_get_proc_address(h, #f)); \ - AMF_RETURN_IF_FALSE(nullptr != m, AMF_FAIL, L"Failed to acquire entrypoint %S", #f); - -//------------------------------------------------------------------------------------------------- -PulseAudioImportTable::PulseAudioImportTable() -{} - -//------------------------------------------------------------------------------------------------- -PulseAudioImportTable::~PulseAudioImportTable() -{ - UnloadFunctionsTable(); -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT PulseAudioImportTable::LoadFunctionsTable() -{ - // Load pulseaudio simple api shared library and pulseaudio shared library. - if (nullptr == m_hLibPulseSimpleSO) - { - m_hLibPulseSimpleSO = amf_load_library(L"libpulse-simple.so.0"); - AMF_RETURN_IF_FALSE(nullptr != m_hLibPulseSimpleSO, AMF_FAIL, L"Failed to load libpulse-simple.so.0"); - } - - if (nullptr == m_hLibPulseSO) - { - m_hLibPulseSO = amf_load_library(L"libpulse.so.0"); - AMF_RETURN_IF_FALSE(nullptr != m_hLibPulseSO, AMF_FAIL, L"Failed to load libpulse.so.0"); - } - - // Load pulseaudio mainloop functions. - GET_SO_ENTRYPOINT(m_pPA_Mainloop_Free, m_hLibPulseSO, pa_mainloop_free); - GET_SO_ENTRYPOINT(m_pPA_Mainloop_New, m_hLibPulseSO, pa_mainloop_new); - GET_SO_ENTRYPOINT(m_pPA_Mainloop_Quit, m_hLibPulseSO, pa_mainloop_quit); - GET_SO_ENTRYPOINT(m_pPA_Mainloop_Get_API, m_hLibPulseSO, pa_mainloop_get_api); - GET_SO_ENTRYPOINT(m_pPA_Mainloop_Run, m_hLibPulseSO, pa_mainloop_run); - - // Load pulseaudio context functions. - GET_SO_ENTRYPOINT(m_pPA_Context_Unref, m_hLibPulseSO, pa_context_unref); - GET_SO_ENTRYPOINT(m_pPA_Context_Load_Module, m_hLibPulseSO, pa_context_load_module); - GET_SO_ENTRYPOINT(m_pPA_Context_Unload_Module, m_hLibPulseSO, pa_context_unload_module); - GET_SO_ENTRYPOINT(m_pPA_Context_New, m_hLibPulseSO, pa_context_new); - GET_SO_ENTRYPOINT(m_pPA_Context_Get_State, m_hLibPulseSO, pa_context_get_state); - GET_SO_ENTRYPOINT(m_pPA_Context_Set_State_Callback, m_hLibPulseSO, pa_context_set_state_callback); - GET_SO_ENTRYPOINT(m_pPA_Context_Get_Server_Info, m_hLibPulseSO, pa_context_get_server_info); - GET_SO_ENTRYPOINT(m_pPA_Context_Connect, m_hLibPulseSO, pa_context_connect); - GET_SO_ENTRYPOINT(m_pPA_Context_Disconnect, m_hLibPulseSO, pa_context_disconnect); - - GET_SO_ENTRYPOINT(m_pPA_Context_Get_Sink_Info_By_Name, m_hLibPulseSO, pa_context_get_sink_info_by_name); - GET_SO_ENTRYPOINT(m_pPA_Context_Get_Sink_Info_List, m_hLibPulseSO, pa_context_get_sink_info_list); - GET_SO_ENTRYPOINT(m_pPA_Context_Get_Source_Info_List, m_hLibPulseSO, pa_context_get_source_info_list); - - // Load other pulse audio functions. - GET_SO_ENTRYPOINT(m_pPA_Operation_Unref, m_hLibPulseSO, pa_operation_unref); - GET_SO_ENTRYPOINT(m_pPA_Strerror, m_hLibPulseSO, pa_strerror); - - // Load pulse audio simple api functions. - GET_SO_ENTRYPOINT(m_pPA_Simple_New, m_hLibPulseSimpleSO, pa_simple_new); - GET_SO_ENTRYPOINT(m_pPA_Simple_Free, m_hLibPulseSimpleSO, pa_simple_free); - GET_SO_ENTRYPOINT(m_pPA_Simple_Write, m_hLibPulseSimpleSO, pa_simple_write); - GET_SO_ENTRYPOINT(m_pPA_Simple_Read, m_hLibPulseSimpleSO, pa_simple_read); - GET_SO_ENTRYPOINT(m_pPA_Simple_Flush, m_hLibPulseSimpleSO, pa_simple_flush); - GET_SO_ENTRYPOINT(m_pPA_Simple_Get_Latency, m_hLibPulseSimpleSO, pa_simple_get_latency); - - - return AMF_OK; -} - -void PulseAudioImportTable::UnloadFunctionsTable() -{ - if (nullptr != m_hLibPulseSimpleSO) - { - amf_free_library(m_hLibPulseSimpleSO); - m_hLibPulseSO = nullptr; - } - - if (nullptr != m_hLibPulseSO) - { - amf_free_library(m_hLibPulseSO); - m_hLibPulseSO = nullptr; - } - - m_pPA_Mainloop_Free = nullptr; - m_pPA_Mainloop_Quit = nullptr; - m_pPA_Mainloop_New = nullptr; - m_pPA_Mainloop_Get_API = nullptr; - m_pPA_Mainloop_Run = nullptr; - - // Context functions. - m_pPA_Context_Unref = nullptr; - m_pPA_Context_Load_Module = nullptr; - m_pPA_Context_Unload_Module = nullptr; - m_pPA_Context_New = nullptr; - m_pPA_Context_Get_State = nullptr; - m_pPA_Context_Set_State_Callback = nullptr; - m_pPA_Context_Get_Server_Info = nullptr; - m_pPA_Context_Connect = nullptr; - m_pPA_Context_Disconnect = nullptr; - - m_pPA_Context_Get_Sink_Info_By_Name = nullptr; - m_pPA_Context_Get_Sink_Info_List = nullptr; - m_pPA_Context_Get_Source_Info_List = nullptr; - - // Others - m_pPA_Operation_Unref = nullptr; - m_pPA_Strerror = nullptr; - - // PulseAudio Simple API functions. - m_pPA_Simple_New = nullptr; - m_pPA_Simple_Free = nullptr; - m_pPA_Simple_Write = nullptr; - m_pPA_Simple_Read = nullptr; - m_pPA_Simple_Flush = nullptr; - m_pPA_Simple_Get_Latency = nullptr; -} \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.h deleted file mode 100644 index c773b97a..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/PulseAudioImportTable.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file PulseAudioImportTable.h -/// @brief pulseaudio import table -///------------------------------------------------------------------------- -#pragma once - -#include "../../include/core/Result.h" - -#include -#include -#include - -struct PulseAudioImportTable{ - - PulseAudioImportTable(); - ~PulseAudioImportTable(); - - AMF_RESULT LoadFunctionsTable(); - void UnloadFunctionsTable(); - - // PulseAudio functions. - // Mainloop functions. - decltype(&pa_mainloop_free) m_pPA_Mainloop_Free = nullptr; - decltype(&pa_mainloop_quit) m_pPA_Mainloop_Quit = nullptr; - decltype(&pa_mainloop_new) m_pPA_Mainloop_New = nullptr; - decltype(&pa_mainloop_get_api) m_pPA_Mainloop_Get_API = nullptr; - decltype(&pa_mainloop_run) m_pPA_Mainloop_Run = nullptr; - - // Context functions. - decltype(&pa_context_unref) m_pPA_Context_Unref = nullptr; - decltype(&pa_context_load_module) m_pPA_Context_Load_Module = nullptr; - decltype(&pa_context_unload_module) m_pPA_Context_Unload_Module = nullptr; - decltype(&pa_context_new) m_pPA_Context_New = nullptr; - decltype(&pa_context_get_state) m_pPA_Context_Get_State = nullptr; - decltype(&pa_context_set_state_callback) m_pPA_Context_Set_State_Callback = nullptr; - decltype(&pa_context_get_server_info) m_pPA_Context_Get_Server_Info = nullptr; - decltype(&pa_context_connect) m_pPA_Context_Connect = nullptr; - decltype(&pa_context_disconnect) m_pPA_Context_Disconnect = nullptr; - - decltype(&pa_context_get_sink_info_by_name) m_pPA_Context_Get_Sink_Info_By_Name = nullptr; - decltype(&pa_context_get_sink_info_list) m_pPA_Context_Get_Sink_Info_List = nullptr; - decltype(&pa_context_get_source_info_list) m_pPA_Context_Get_Source_Info_List = nullptr; - - // Others - decltype(&pa_operation_unref) m_pPA_Operation_Unref = nullptr; - decltype(&pa_strerror) m_pPA_Strerror = nullptr; - - // PulseAudio Simple API functions. - decltype(&pa_simple_new) m_pPA_Simple_New = nullptr; - decltype(&pa_simple_free) m_pPA_Simple_Free = nullptr; - decltype(&pa_simple_write) m_pPA_Simple_Write = nullptr; - decltype(&pa_simple_read) m_pPA_Simple_Read = nullptr; - decltype(&pa_simple_flush) m_pPA_Simple_Flush = nullptr; - decltype(&pa_simple_get_latency) m_pPA_Simple_Get_Latency = nullptr; - - amf_handle m_hLibPulseSO = nullptr; - amf_handle m_hLibPulseSimpleSO = nullptr; -}; - -typedef std::shared_ptr PulseAudioImportTablePtr; \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/ThreadLinux.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/ThreadLinux.cpp deleted file mode 100644 index 2855423f..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/ThreadLinux.cpp +++ /dev/null @@ -1,757 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - - -#include "../Thread.h" - - -#if defined (__linux) || (__APPLE__) - -#if defined(__GNUC__) - //disable gcc warinings on STL code - #pragma GCC diagnostic ignored "-Weffc++" -#endif - -#define POSIX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined(__APPLE__) -#include -#endif - -#if defined(__ANDROID__) -#include -#endif - -#include -#include -#include - -#include "../AMFSTL.h" - -using namespace amf; - -extern "C" void AMF_STD_CALL amf_debug_trace(const wchar_t* text); - - -void perror(const char* errorModule) -{ - char buf[128]; -#if defined(__ANDROID__) || (__APPLE__) - strerror_r(errno, buf, sizeof(buf)); - fprintf(stderr, "%s: %s", buf, errorModule); -#else - char* err = strerror_r(errno, buf, sizeof(buf)); - fprintf(stderr, "%s: %s", err, errorModule); -#endif - - exit(1); -} - -#if defined(__APPLE__) -amf_uint64 AMF_STD_CALL get_current_thread_id() -{ - return reinterpret_cast(pthread_self()); -} -#else -amf_uint32 AMF_STD_CALL get_current_thread_id() -{ - return static_cast(pthread_self()); -} -#endif - - -// int clock_gettime(clockid_t clk_id, struct timespec *tp); -//---------------------------------------------------------------------------------------- -// threading -//---------------------------------------------------------------------------------------- -amf_long AMF_STD_CALL amf_atomic_inc(amf_long* X) -{ - return __sync_add_and_fetch(X, 1); -} -//---------------------------------------------------------------------------------------- -amf_long AMF_STD_CALL amf_atomic_dec(amf_long* X) -{ - return __sync_sub_and_fetch(X, 1); -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_STD_CALL amf_create_critical_section() -{ - pthread_mutex_t* mutex = new pthread_mutex_t; - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(mutex, &attr); - - return (amf_handle)mutex; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_delete_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)cs; - int err = pthread_mutex_destroy(mutex); - delete mutex; - return err == 0; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_enter_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)cs; - return pthread_mutex_lock(mutex) == 0; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_critical_section(amf_handle cs, amf_ulong ulTimeout) -{ - if(cs == NULL) - { - return false; - } - return amf_wait_for_mutex(cs, ulTimeout); -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_leave_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)cs; - return pthread_mutex_unlock(mutex) == 0; -} -//---------------------------------------------------------------------------------------- -struct MyEvent -{ - bool m_manual_reset; - pthread_cond_t m_cond; - pthread_mutex_t m_mutex; - bool m_triggered; -}; -//---------------------------------------------------------------------------------------- - -amf_handle AMF_STD_CALL amf_create_event(bool initially_owned, bool manual_reset, const wchar_t* name) -{ - MyEvent* event = new MyEvent; - - - // Linux does not natively support Named Condition variables - // so raise an error. - // Implement this using boost (NamedCondition), Qt, or some other framework. - if(name != NULL) - { - perror("Named Events not supported under Linux yet"); - exit(1); - } - event->m_manual_reset = manual_reset; - pthread_cond_t cond_tmp = PTHREAD_COND_INITIALIZER; - event->m_cond = cond_tmp; - pthread_mutex_t mutex_tmp = PTHREAD_MUTEX_INITIALIZER; - event->m_mutex = mutex_tmp; - - event->m_triggered = false; - if(initially_owned) - { - amf_set_event((amf_handle)event); - } - - return (amf_handle)event; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_delete_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - MyEvent* event = (MyEvent*)hevent; - int err1 = pthread_mutex_destroy(&event->m_mutex); - int err2 = pthread_cond_destroy(&event->m_cond); - delete event; - return err1 == 0 && err2 == 0; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_set_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - MyEvent* event = (MyEvent*)hevent; - pthread_mutex_lock(&event->m_mutex); - event->m_triggered = true; - int err1 = pthread_cond_broadcast(&event->m_cond); - pthread_mutex_unlock(&event->m_mutex); - - return err1 == 0; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_reset_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - MyEvent* event = (MyEvent*)hevent; - pthread_mutex_lock(&event->m_mutex); - event->m_triggered = false; - int err = pthread_mutex_unlock(&event->m_mutex); - - return err == 0; -} -//---------------------------------------------------------------------------------------- -static bool AMF_STD_CALL amf_wait_for_event_int(amf_handle hevent, unsigned long timeout, bool bTimeoutErr) -{ - if(hevent == NULL) - { - return false; - } - bool ret = true; - int err = 0; - MyEvent* event = (MyEvent*)hevent; - pthread_mutex_lock(&event->m_mutex); - - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - amf_uint64 start_time = ((amf_uint64)ts.tv_sec) * 1000 + ((amf_uint64)ts.tv_nsec) / 1000000; //to msec - - if(event->m_manual_reset) - { - while(!event->m_triggered) - { - if(timeout == AMF_INFINITE) - { - err = pthread_cond_wait(&event->m_cond, &event->m_mutex); //MM todo - timeout is not supported - ret = err == 0; - } - else - { - clock_gettime(CLOCK_REALTIME, &ts); - amf_uint64 current_time = ((amf_uint64)ts.tv_sec) * 1000 + ((amf_uint64)ts.tv_nsec) / 1000000; //to msec - if(current_time - start_time > (amf_uint64)timeout) - { - ret = bTimeoutErr ? false : true; - break; - } - amf_uint64 to_wait = start_time + timeout; - - timespec abstime; - abstime.tv_sec = (time_t)(to_wait / 1000); // timeout is in millisec - abstime.tv_nsec = (time_t)((to_wait - ((amf_uint64)abstime.tv_sec) * 1000) * 1000000); // the rest to nanosec - - err = pthread_cond_timedwait(&event->m_cond, &event->m_mutex, &abstime); - ret = err == 0; - } - } - } - else - { - if(event->m_triggered) - { - ret = true; - } - else - { - if (timeout == AMF_INFINITE) { - err = pthread_cond_wait(&event->m_cond, &event->m_mutex); - } else { - start_time += timeout; - timespec abstime; - abstime.tv_sec = (time_t) (start_time / 1000); // timeout is in millisec - abstime.tv_nsec = (time_t) ((start_time - (amf_uint64) (abstime.tv_sec) * 1000) * - 1000000); // the rest to nanosec - err = pthread_cond_timedwait(&event->m_cond, &event->m_mutex, &abstime); - } - - if (bTimeoutErr) { - ret = (err == 0); - } else { - ret = (err == 0 || err == ETIMEDOUT); - } - } - if(ret == true) - { - event->m_triggered = false; - } - } - pthread_mutex_unlock(&event->m_mutex); - - return ret; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_wait_for_event(amf_handle hevent, unsigned long timeout) -{ - return amf_wait_for_event_int(hevent, timeout, true); -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_wait_for_event_timeout(amf_handle hevent, amf_ulong ulTimeout) -{ - return amf_wait_for_event_int(hevent, ulTimeout, false); -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_STD_CALL amf_create_mutex(bool initially_owned, const wchar_t* name) -{ - pthread_mutex_t* mutex = new pthread_mutex_t; - pthread_mutex_t mutex_tmp = PTHREAD_MUTEX_INITIALIZER; - *mutex = mutex_tmp; - - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(mutex, &attr); - - if(initially_owned) - { - pthread_mutex_lock(mutex); - } - return (amf_handle)mutex; -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_STD_CALL amf_open_mutex(const wchar_t* pName) -{ - assert(false); - return 0; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_delete_mutex(amf_handle hmutex) -{ - if(hmutex == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)hmutex; - int err = pthread_mutex_destroy(mutex); - delete mutex; - return err == 0; -} -//---------------------------------------------------------------------------------------- - -#if defined(__APPLE__) -int sem_timedwait1(sem_t* semaphore, const struct timespec* timeout) -{ - struct timeval timenow; - struct timespec sleepytime; - int retcode; - - /// This is just to avoid a completely busy wait - sleepytime.tv_sec = 0; - sleepytime.tv_nsec = 10000000; // 10ms - - while((retcode = sem_trywait(semaphore)) != 0) - { - gettimeofday (&timenow, NULL); - - if((timenow.tv_sec >= timeout->tv_sec) && ((timenow.tv_usec * 1000) >= timeout->tv_nsec)) - { - return retcode; - } - nanosleep (&sleepytime, NULL); - } - return retcode; -} -#endif - -#if defined(__ANDROID__) || defined(__APPLE__) -int pthread_mutex_timedlock1(pthread_mutex_t* mutex, const struct timespec* timeout) -{ - struct timeval timenow; - struct timespec sleepytime; - int retcode; - - /// This is just to avoid a completely busy wait - sleepytime.tv_sec = 0; - sleepytime.tv_nsec = 10000000; // 10ms - - while((retcode = pthread_mutex_trylock (mutex)) == EBUSY) - { - gettimeofday (&timenow, NULL); - - if((timenow.tv_sec >= timeout->tv_sec) && ((timenow.tv_usec * 1000) >= timeout->tv_nsec)) - { - return ETIMEDOUT; - } - nanosleep (&sleepytime, NULL); - } - return retcode; -} -#endif - -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_wait_for_mutex(amf_handle hmutex, unsigned long timeout) -{ - if(hmutex == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)hmutex; - if(timeout == AMF_INFINITE) - { - return pthread_mutex_lock(mutex) == 0; - } - - // ulTimeout is in milliseconds - long timeout_sec = timeout / 1000; /* Seconds */; - long timeout_nsec = (timeout - (timeout / 1000) * 1000) * 1000000; - - timespec wait_time; //absolute time - clock_gettime(CLOCK_REALTIME, &wait_time); - - wait_time.tv_sec += timeout_sec; - wait_time.tv_nsec += timeout_nsec; - - if (wait_time.tv_nsec >= 1000000000) - { - wait_time.tv_sec++; - wait_time.tv_nsec -= 1000000000; - } - -#if defined(__ANDROID__) || defined (__APPLE__) - return pthread_mutex_timedlock1(mutex, &wait_time) == 0; -#else - return pthread_mutex_timedlock(mutex, &wait_time) == 0; -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_release_mutex(amf_handle hmutex) -{ - if(hmutex == NULL) - { - return false; - } - pthread_mutex_t* mutex = (pthread_mutex_t*)hmutex; - return pthread_mutex_unlock(mutex) == 0; -} - -//---------------------------------------------------------------------------------------- -amf_handle AMF_STD_CALL amf_create_semaphore(amf_long iInitCount, amf_long iMaxCount, const wchar_t* /*pName*/) -{ - if(iMaxCount == 0 || iInitCount > iMaxCount) - { - return NULL; - } - - sem_t* semaphore = new sem_t; - if(sem_init(semaphore, 0, iInitCount) != 0) - { - delete semaphore; - return NULL; - } - return (amf_handle)semaphore; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_delete_semaphore(amf_handle hsemaphore) -{ - if(hsemaphore == NULL) - { - return false; - } - bool ret = true; - sem_t* semaphore = (sem_t*)hsemaphore; - ret = (0==sem_destroy(semaphore)) ? 1:0; - delete semaphore; - return ret; -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_wait_for_semaphore(amf_handle hsemaphore, amf_ulong timeout) -{ - if(hsemaphore == NULL) - { - return true; - } - - // ulTimeout is in milliseconds - long timeout_sec = timeout / 1000; /* Seconds */; - long timeout_nsec = (timeout - (timeout / 1000) * 1000) * 1000000; - - timespec wait_time; //absolute time - clock_gettime(CLOCK_REALTIME, &wait_time); - - wait_time.tv_sec += timeout_sec; - wait_time.tv_nsec += timeout_nsec; - - if (wait_time.tv_nsec >= 1000000000) - { - wait_time.tv_sec++; - wait_time.tv_nsec -= 1000000000; - } - - sem_t* semaphore = (sem_t*)hsemaphore; - if(timeout != AMF_INFINITE) - { - #if defined(__APPLE__) - return sem_timedwait1 (semaphore, &wait_time) == 0; // errno=ETIMEDOU - #else - return sem_timedwait (semaphore, &wait_time) == 0; // errno=ETIMEDOUT - #endif - } - else - { - return sem_wait(semaphore) == 0; - } -} -//---------------------------------------------------------------------------------------- -bool AMF_STD_CALL amf_release_semaphore(amf_handle hsemaphore, amf_long iCount, amf_long* iOldCount) -{ - if(hsemaphore == NULL) - { - return false; - } - sem_t* semaphore = (sem_t*)hsemaphore; - - if(iOldCount != NULL) - { - int iTmp = 0; - sem_getvalue(semaphore, &iTmp); - *iOldCount = iTmp; - } - - for(int i = 0; i < iCount; i++) - { - sem_post(semaphore); - } - return true; -} -//------------------------------------------------------------------------------ -/* - * Delay is specified in milliseconds. - * Function will return prematurely if msDelay value is invalid. - * - * */ -void AMF_STD_CALL amf_sleep(amf_ulong msDelay) -{ -#if defined(NANOSLEEP_DONTUSE) - struct timespec sts, sts_remaining; - int iErrorCode; - - ts.tv_sec = msDelay / 1000; - ts.tv_nsec = (msDelay - sts.tv_sec * 1000) * 1000000; // nanosec - // put in code to measure sleep clock jitter - do - { - iErrorCode = nanosleep(&sts, &sts_remaining); - if(iErrorCode) - { - switch(errno) - { - case EINTR: - sts = sts_remaining; - break; - - case EFAULT: - case EINVAL: - case default: - perror("amf_sleep"); - return; - /* TODO: how to log errors? */ - } - } - } while(iErrorCode); -#else - usleep(msDelay * 1000); -#endif -} - -//---------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------- -// memory -//---------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------- -void AMF_STD_CALL amf_debug_trace(const wchar_t* text) -{ -#if defined(__ANDROID__) - __android_log_write(ANDROID_LOG_DEBUG, "AMF_TRACE", amf_from_unicode_to_multibyte(text).c_str()); -#else - fprintf(stderr, "%ls", text); -#endif -} - -void* AMF_STD_CALL amf_virtual_alloc(size_t size) -{ - void* mem = NULL; -#if defined(__ANDROID__) - mem = memalign(sysconf(_SC_PAGESIZE), size); - if(mem == NULL) - { - amf_debug_trace(L"Failed to alloc memory using memalign() function."); - } -#else - int exitCode = posix_memalign(&mem, sysconf(_SC_PAGESIZE), size); - if(exitCode != 0) - { - amf_debug_trace(L"Failed to alloc memory using posix_memaling() function."); - } -#endif - - return mem; -} -//------------------------------------------------------------------------------------------------------- -void AMF_STD_CALL amf_virtual_free(void* ptr) -{ - free(ptr); // according to linux help memory allocated by memalign() must be freed by free() -} -//---------------------------------------------------------------------------------------- - -amf_handle AMF_STD_CALL amf_load_library(const wchar_t* filename) -{ - void *ret = dlopen(amf_from_unicode_to_multibyte(filename).c_str(), RTLD_NOW | RTLD_GLOBAL); - if(ret ==0 ) - { - const char *err = dlerror(); - int a=1; - } - return ret; -} - -amf_handle AMF_STD_CALL amf_load_library1(const wchar_t* filename, bool bGlobal) -{ - void *ret; - if (bGlobal) { - ret = dlopen(amf_from_unicode_to_multibyte(filename).c_str(), RTLD_NOW | RTLD_GLOBAL); - } else { -#if defined(__ANDROID__) || (__APPLE__) - ret = dlopen(amf_from_unicode_to_multibyte(filename).c_str(), RTLD_NOW | RTLD_LOCAL); -#else - ret = dlopen(amf_from_unicode_to_multibyte(filename).c_str(), RTLD_NOW | RTLD_LOCAL| RTLD_DEEPBIND); -#endif - } - - if(ret == 0) - { - const char *err = dlerror(); - int a=1; - } - return ret; -} - -void* AMF_STD_CALL amf_get_proc_address(amf_handle module, const char* procName) -{ - return dlsym(module, procName); -} -//------------------------------------------------------------------------------------------------- -int AMF_STD_CALL amf_free_library(amf_handle module) -{ - return dlclose(module) == 0; -} -void AMF_STD_CALL amf_increase_timer_precision() -{ -} -void AMF_STD_CALL amf_restore_timer_precision() -{ -} -//---------------------------------------------------------------------------------------- -double AMF_STD_CALL amf_clock() -{ - //MM: clock() Win32 - returns time from beginning of the program - //MM: clock() works different in Linux - returns consumed processor time - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - double cur_time = ((double)ts.tv_sec) + ((double)ts.tv_nsec) / 1000000000.; //to sec - return cur_time; -} -//---------------------------------------------------------------------------------------- -amf_int64 AMF_STD_CALL get_time_in_seconds_with_fraction() -{ - struct timeval tv; - - gettimeofday(&tv, NULL); - - amf_int64 ntp_time = ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)); - return ntp_time; -} -//--------------------------------------------------------------------------------------- -amf_pts AMF_STD_CALL amf_high_precision_clock() -{ - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - return ts.tv_sec * 10000000LL + ts.tv_nsec / 100.; //to nanosec -} -//--------------------------------------------------------------------------------------- -// Returns number of physical cores -amf_int32 AMF_STD_CALL amf_get_cpu_cores() -{ - // NOTE: get_nprocs is preffered way to get online cores on linux but it will - // return number of logical cores. Uncomment line bellow if that's the behaviour needed - //return get_nprocs(); - - const char CPUINFO_CORES_COUNT[] = "cpu cores"; - - std::ifstream cpuinfo("/proc/cpuinfo"); - std::string line; - - while (std::getline(cpuinfo, line)) - { - if (line.compare(0, strlen(CPUINFO_CORES_COUNT), CPUINFO_CORES_COUNT) == 0) - { - size_t pos = line.rfind(':') + 2; - if (pos == std::string::npos) - { - continue; - } - - std::string tmp = line.substr(pos); - const char* value = tmp.c_str(); - int cores_online = std::atoi(value); - // Make sure we always return at least 1 - return std::max(1, cores_online); - } - } - - // Failure, return default - return 1; -} -//-------------------------------------------------------------------------------- -// the end -//-------------------------------------------------------------------------------- - -#endif diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XDisplay.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XDisplay.h deleted file mode 100644 index 40bde7a9..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XDisplay.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; AV1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#pragma once -#include -#include -#include - -//this pattern makes it impossible to use the x11 Display* pointer without first calling XLockDisplay -class XDisplay { -public: - typedef std::shared_ptr Ptr; - - XDisplay() - : m_pDisplay(XOpenDisplay(nullptr)) - , m_shouldClose(true) - {} - XDisplay(Display* dpy) - : m_pDisplay(dpy) - , m_shouldClose(false) - {} - ~XDisplay() { if(IsValid() && m_shouldClose) XCloseDisplay(m_pDisplay); } - - bool IsValid() { return m_pDisplay != nullptr; } - -private: - Display* m_pDisplay; - bool m_shouldClose = false; - friend class XDisplayPtr; -}; - -class XDisplayPtr { -public: - - XDisplayPtr() = delete; - XDisplayPtr(const XDisplayPtr&) = delete; - XDisplayPtr& operator=(const XDisplayPtr&) =delete; - - explicit XDisplayPtr(std::shared_ptr display) : m_pDisplay(display) { XLockDisplay(m_pDisplay->m_pDisplay); } - ~XDisplayPtr() { XUnlockDisplay(m_pDisplay->m_pDisplay); } - - //XDisplayPtr acts like a normal Display* pointer, but the only way to obtain it is by locking the Display - operator Display*() { return m_pDisplay->m_pDisplay; } - -private: - XDisplay::Ptr m_pDisplay; -}; diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XrandrPtrs.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XrandrPtrs.h deleted file mode 100644 index 2a2a33de..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Linux/XrandrPtrs.h +++ /dev/null @@ -1,11 +0,0 @@ -///------------------------------------------------------------------------- -/// Copyright © 2020-2022 Advanced Micro Devices, Inc. All rights reserved. -///------------------------------------------------------------------------- - -#pragma once - -#include -#include - -typedef std::shared_ptr XRRScreenResourcesPtr; -typedef std::shared_ptr XRRCrtcInfoPtr; \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ObservableImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ObservableImpl.h deleted file mode 100644 index 8353f999..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/ObservableImpl.h +++ /dev/null @@ -1,144 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** - *************************************************************************************************** - * @file ObservableImpl.h - * @brief AMFObservableImpl common template declaration - *************************************************************************************************** - */ -#ifndef AMF_ObservableImpl_h -#define AMF_ObservableImpl_h -#pragma once - -#include "Thread.h" -#include - -namespace amf -{ - template - class AMFObservableImpl - { - private: - typedef std::list ObserversList; - ObserversList m_observers; - public: - AMFObservableImpl() : m_observers() - {} - virtual ~AMFObservableImpl() - { - assert(m_observers.size() == 0); - } - virtual void AMF_STD_CALL AddObserver(Observer* pObserver) - { - if (pObserver == nullptr) - { - return; - } - - amf_bool found = false; - AMFLock lock(&m_sc); - - for (typename ObserversList::iterator it = m_observers.begin(); it != m_observers.end(); it++) - { - if (*it == pObserver) - { - found = true; - break; - } - } - if (found == false) - { - m_observers.push_back(pObserver); - } - } - - virtual void AMF_STD_CALL RemoveObserver(Observer* pObserver) - { - AMFLock lock(&m_sc); - m_observers.remove(pObserver); - } - - protected: - void AMF_STD_CALL ClearObservers() - { - AMFLock lock(&m_sc); - m_observers.clear(); - } - - void AMF_STD_CALL NotifyObservers(void (AMF_STD_CALL Observer::* pEvent)()) - { - ObserversList tempList; - { - AMFLock lock(&m_sc); - tempList = m_observers; - } - for (typename ObserversList::iterator it = tempList.begin(); it != tempList.end(); ++it) - { - Observer* pObserver = *it; - (pObserver->*pEvent)(); - } - } - - template - void AMF_STD_CALL NotifyObservers(void (AMF_STD_CALL Observer::* pEvent)(TArg0), TArg0 arg0) - { - ObserversList tempList; - { - AMFLock lock(&m_sc); - tempList = m_observers; - } - for (typename ObserversList::iterator it = tempList.begin(); it != tempList.end(); ++it) - { - Observer* pObserver = *it; - (pObserver->*pEvent)(arg0); - } - } - template - void AMF_STD_CALL NotifyObservers(void (AMF_STD_CALL Observer::* pEvent)(TArg0, TArg1), TArg0 arg0, TArg1 arg1) - { - ObserversList tempList; - { - AMFLock lock(&m_sc); - tempList = m_observers; - } - for (typename ObserversList::iterator it = tempList.begin(); it != tempList.end(); it++) - { - Observer* pObserver = *it; - (pObserver->*pEvent)(arg0, arg1); - } - } - private: - AMFCriticalSection m_sc; - }; -} -#endif //AMF_ObservableImpl_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.cpp deleted file mode 100644 index 5ee067a9..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.cpp +++ /dev/null @@ -1,563 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file OpenGLImportTable.cpp -/// @brief OpenGL import table -///------------------------------------------------------------------------- -#include "OpenGLImportTable.h" -#include "public/common/TraceAdapter.h" -#include "public/common/Thread.h" - -using namespace amf; - -#define AMF_FACILITY L"OpenGLImportTable" - -//------------------------------------------------------------------------------------------------- - - -#define TRY_GET_DLL_ENTRY_POINT_CORE(w) \ -w = reinterpret_cast(amf_get_proc_address(m_hOpenGLDll, #w)); - -#define GET_DLL_ENTRY_POINT_CORE(w)\ -TRY_GET_DLL_ENTRY_POINT_CORE(w)\ -AMF_RETURN_IF_FALSE(w != nullptr, AMF_NOT_FOUND, L"Failed to aquire entry point %S", #w); - -// On windows, some functions are defined in the core opengl32.dll (especially the core old ones) -// and some are not and we have to use wglGetProcAddress. Its a problem because the ones defined in -// opengl32.dll are not included in the wglGetProcAddress and vice versa -#if defined(_WIN32) - -#define TRY_GET_DLL_ENTRY_POINT(w) \ -{\ - void const * const p = (void*)wglGetProcAddress(#w);\ - if (p == nullptr || p == (void*)0x1 || p == (void*)0x2 || p == (void*)0x3 || p == (void*)-1)\ - {\ - TRY_GET_DLL_ENTRY_POINT_CORE(w);\ - }\ - else\ - {\ - w = reinterpret_cast(p);\ - }\ -} - -#else -#define TRY_GET_DLL_ENTRY_POINT(w) TRY_GET_DLL_ENTRY_POINT_CORE(w) -#endif - -#define GET_DLL_ENTRY_POINT(w)\ -TRY_GET_DLL_ENTRY_POINT(w)\ -AMF_RETURN_IF_FALSE(w != nullptr, AMF_NOT_FOUND, L"Failed to aquire entry point %S", #w); - -OpenGLImportTable::OpenGLImportTable() : - m_hOpenGLDll(nullptr), - glGetError(nullptr), - glGetString(nullptr), -// glGetStringi(nullptr), - glEnable(nullptr), - glClear(nullptr), - glClearAccum(nullptr), - glClearColor(nullptr), - glClearDepth(nullptr), - glClearIndex(nullptr), - glClearStencil(nullptr), - glDrawArrays(nullptr), - glViewport(nullptr), - glFinish(nullptr), -#if defined(_WIN32) - wglCreateContext(nullptr), - wglDeleteContext(nullptr), - wglGetCurrentContext(nullptr), - wglGetCurrentDC(nullptr), - wglMakeCurrent(nullptr), - wglGetProcAddress(nullptr), - wglGetExtensionsStringARB(nullptr), - wglSwapIntervalEXT(nullptr), - - wndClass{}, - hDummyWnd(nullptr), - hDummyDC(nullptr), - hDummyOGLContext(nullptr), -#elif defined(__ANDROID__) - eglInitialize(nullptr), - eglGetDisplay(nullptr), - eglChooseConfig(nullptr), - eglCreateContext(nullptr), - eglDestroyImageKHR(nullptr), - eglCreateImageKHR(nullptr), - eglSwapInterval(nullptr), - glEGLImageTargetTexture2DOES(nullptr), - glReadPixels(nullptr), -#elif defined(__linux) - glXDestroyContext(nullptr), - glXDestroyWindow(nullptr), - glXSwapBuffers(nullptr), - glXQueryExtension(nullptr), - glXChooseFBConfig(nullptr), - glXCreateWindow(nullptr), - glXCreateNewContext(nullptr), - glXMakeCurrent(nullptr), - glXGetCurrentContext(nullptr), - glXGetCurrentDrawable(nullptr), - glXQueryExtensionsString(nullptr), - glXSwapIntervalEXT(nullptr), -#endif - - glBindTexture(nullptr), - glDeleteTextures(nullptr), - glGenTextures(nullptr), - glGetTexImage(nullptr), - glGetTexLevelParameteriv(nullptr), - glTexParameteri(nullptr), - glTexImage2D(nullptr), - glActiveTexture(nullptr), - - glBindFramebuffer(nullptr), -// glBindRenderbuffer(nullptr), - glBlitFramebuffer(nullptr), - glCheckFramebufferStatus(nullptr), - glDeleteFramebuffers(nullptr), -// glDeleteRenderbuffers(nullptr), -// glFramebufferRenderbuffer(nullptr), -// glFramebufferTexture1D(nullptr), - glFramebufferTexture2D(nullptr), -// glFramebufferTexture3D(nullptr), - glFramebufferTextureLayer(nullptr), - glGenFramebuffers(nullptr), -// glGenRenderbuffers(nullptr), -// glGenerateMipmap(nullptr), -// glGetFramebufferAttachmentParameteriv(nullptr), -// glGetRenderbufferParameteriv(nullptr), -// glIsFramebuffer(nullptr), -// glIsRenderbuffer(nullptr), -// glRenderbufferStorage(nullptr), -// glRenderbufferStorageMultisample(nullptr), - - glGenBuffers(nullptr), - glBindBuffer(nullptr), - glBufferData(nullptr), - glBufferSubData(nullptr), - glDeleteBuffers(nullptr), - - glVertexAttribPointer(nullptr), -// glVertexAttribLPointer(nullptr), -// glVertexAttribIPointer(nullptr), - glBindVertexBuffer(nullptr), - glDisableVertexAttribArray(nullptr), - glEnableVertexAttribArray(nullptr), - - glBindVertexArray(nullptr), - glDeleteVertexArrays(nullptr), - glGenVertexArrays(nullptr), - glIsVertexArray(nullptr), - - glCreateShader(nullptr), - glShaderSource(nullptr), - glCompileShader(nullptr), - glGetShaderInfoLog(nullptr), - glGetShaderSource(nullptr), - glGetShaderiv(nullptr), - glCreateProgram(nullptr), - glAttachShader(nullptr), - glLinkProgram(nullptr), - glGetProgramInfoLog(nullptr), - glGetProgramiv(nullptr), - glValidateProgram(nullptr), - glUseProgram(nullptr), - glDeleteShader(nullptr), - glDeleteProgram(nullptr), - - glGetUniformLocation(nullptr), -// glUniform1f(nullptr), -// glUniform1fv(nullptr), - glUniform1i(nullptr), -// glUniform1iv(nullptr), -// glUniform2f(nullptr), -// glUniform2fv(nullptr), -// glUniform2i(nullptr), -// glUniform2iv(nullptr), -// glUniform3f(nullptr), -// glUniform3fv(nullptr), -// glUniform3i(nullptr), -// glUniform3iv(nullptr), -// glUniform4f(nullptr), - glUniform4fv(nullptr), -// glUniform4i(nullptr), -// glUniform4iv(nullptr), -// glUniformMatrix2fv(nullptr), -// glUniformMatrix3fv(nullptr), -// glUniformMatrix4fv(nullptr), - - glBindBufferBase(nullptr), - glBindBufferRange(nullptr), - glGetUniformBlockIndex(nullptr), - glUniformBlockBinding(nullptr), - - glBindSampler(nullptr), - glDeleteSamplers(nullptr), - glGenSamplers(nullptr), -// glGetSamplerParameterIiv(nullptr), -// glGetSamplerParameterIuiv(nullptr), -// glGetSamplerParameterfv(nullptr), -// glGetSamplerParameteriv(nullptr), -// glIsSampler(nullptr), -// glSamplerParameterIiv(nullptr), -// glSamplerParameterIuiv(nullptr), - glSamplerParameterf(nullptr), - glSamplerParameterfv(nullptr), - glSamplerParameteri(nullptr) -// glSamplerParameteriv(nullptr) - -{ -} - -OpenGLImportTable::~OpenGLImportTable() -{ - if (m_hOpenGLDll != nullptr) - { - amf_free_library(m_hOpenGLDll); - } - m_hOpenGLDll = nullptr; - -#if defined(_WIN32) - DestroyDummy(); -#endif -} - -AMF_RESULT OpenGLImportTable::LoadFunctionsTable() -{ - if (m_hOpenGLDll != nullptr) - { - return AMF_OK; - } -#if defined(_WIN32) - m_hOpenGLDll = amf_load_library(L"opengl32.dll"); -#elif defined(__ANDROID__) - m_hOpenGLDll = amf_load_library1(L"libGLES.so", true); -#elif defined(__linux__) - m_hOpenGLDll = amf_load_library1(L"libGL.so.1", true); -#endif - - if (m_hOpenGLDll == nullptr) - { - AMFTraceError(L"OpenGLImportTable", L"amf_load_library() failed to load opengl dll!"); - return AMF_FAIL; - } - - // Core - GET_DLL_ENTRY_POINT_CORE(glGetError); - GET_DLL_ENTRY_POINT_CORE(glGetString); - - GET_DLL_ENTRY_POINT_CORE(glEnable); - GET_DLL_ENTRY_POINT_CORE(glClear); - GET_DLL_ENTRY_POINT_CORE(glClearAccum); - GET_DLL_ENTRY_POINT_CORE(glClearColor); - GET_DLL_ENTRY_POINT_CORE(glClearDepth); - GET_DLL_ENTRY_POINT_CORE(glClearIndex); - GET_DLL_ENTRY_POINT_CORE(glClearStencil); - GET_DLL_ENTRY_POINT_CORE(glDrawArrays); - GET_DLL_ENTRY_POINT_CORE(glViewport); - GET_DLL_ENTRY_POINT_CORE(glFinish); - - // Core (platform-dependent) -#if defined(_WIN32) - GET_DLL_ENTRY_POINT_CORE(wglCreateContext); - GET_DLL_ENTRY_POINT_CORE(wglDeleteContext); - GET_DLL_ENTRY_POINT_CORE(wglGetCurrentContext); - GET_DLL_ENTRY_POINT_CORE(wglGetCurrentDC); - GET_DLL_ENTRY_POINT_CORE(wglMakeCurrent); - GET_DLL_ENTRY_POINT_CORE(wglGetProcAddress); -#elif defined(__ANDROID__) - GET_DLL_ENTRY_POINT_CORE(eglInitialize); - GET_DLL_ENTRY_POINT_CORE(eglGetDisplay); - GET_DLL_ENTRY_POINT_CORE(eglChooseConfig); - GET_DLL_ENTRY_POINT_CORE(eglCreateContext); - GET_DLL_ENTRY_POINT_CORE(eglDestroyImageKHR); - GET_DLL_ENTRY_POINT_CORE(eglCreateImageKHR); - GET_DLL_ENTRY_POINT_CORE(glEGLImageTargetTexture2DOES); - GET_DLL_ENTRY_POINT_CORE(glReadPixels); -#elif defined(__linux) - GET_DLL_ENTRY_POINT_CORE(glXDestroyContext); - GET_DLL_ENTRY_POINT_CORE(glXDestroyWindow); - GET_DLL_ENTRY_POINT_CORE(glXSwapBuffers); - GET_DLL_ENTRY_POINT_CORE(glXQueryExtension); - GET_DLL_ENTRY_POINT_CORE(glXChooseFBConfig); - GET_DLL_ENTRY_POINT_CORE(glXCreateWindow); - GET_DLL_ENTRY_POINT_CORE(glXCreateNewContext); - GET_DLL_ENTRY_POINT_CORE(glXMakeCurrent); - GET_DLL_ENTRY_POINT_CORE(glXGetCurrentContext); - GET_DLL_ENTRY_POINT_CORE(glXGetCurrentDrawable); -#endif - - // Textures - GET_DLL_ENTRY_POINT_CORE(glBindTexture); - GET_DLL_ENTRY_POINT_CORE(glDeleteTextures); - GET_DLL_ENTRY_POINT_CORE(glGenTextures); - GET_DLL_ENTRY_POINT_CORE(glGetTexImage); - GET_DLL_ENTRY_POINT_CORE(glGetTexLevelParameteriv); - GET_DLL_ENTRY_POINT_CORE(glTexParameteri); - GET_DLL_ENTRY_POINT_CORE(glTexImage2D); - - // For windows, we need to use wglGetProcAddress to get some - // addresses however that requires a context. We can just create - // a small dummy context/window and then delete it when we are done -#if defined(_WIN32) - { - AMF_RESULT res = CreateDummy(); - if (res != AMF_OK) - { - DestroyDummy(); - AMF_RETURN_IF_FAILED(res, L"CreateDummy() failed"); - } - } -#endif - - AMF_RESULT res = LoadContextFunctionsTable(); - AMF_RETURN_IF_FAILED(res, L"LoadContextFunctionsTable() failed"); - -#if defined(_WIN32) - DestroyDummy(); -#endif - - return AMF_OK; -} - -AMF_RESULT OpenGLImportTable::LoadContextFunctionsTable() -{ - if (m_hOpenGLDll == nullptr) - { - AMF_RETURN_IF_FAILED(LoadFunctionsTable()); - } - -#if defined(_WIN32) - HGLRC context = wglGetCurrentContext(); - AMF_RETURN_IF_FALSE(context != nullptr, AMF_NOT_INITIALIZED, L"LoadContextFunctionsTable() - context is not initialized"); -#endif - - // Core -// GET_DLL_ENTRY_POINT(glGetStringi); - -#if defined(_WIN32) - TRY_GET_DLL_ENTRY_POINT(wglGetExtensionsStringARB); - TRY_GET_DLL_ENTRY_POINT(wglSwapIntervalEXT); -#elif defined(__ANDROID__) - TRY_GET_DLL_ENTRY_POINT(eglSwapInterval); -#elif defined(__linux) - TRY_GET_DLL_ENTRY_POINT(glXQueryExtensionsString); - TRY_GET_DLL_ENTRY_POINT(glXSwapIntervalEXT); -#endif - - // Textures - GET_DLL_ENTRY_POINT(glActiveTexture); - - // Frame buffer and render buffer objects - GET_DLL_ENTRY_POINT(glBindFramebuffer); -// GET_DLL_ENTRY_POINT(glBindRenderbuffer); - GET_DLL_ENTRY_POINT(glBlitFramebuffer); - GET_DLL_ENTRY_POINT(glCheckFramebufferStatus); - GET_DLL_ENTRY_POINT(glDeleteFramebuffers); -// GET_DLL_ENTRY_POINT(glDeleteRenderbuffers); -// GET_DLL_ENTRY_POINT(glFramebufferRenderbuffer); -// GET_DLL_ENTRY_POINT(glFramebufferTexture1D); - GET_DLL_ENTRY_POINT(glFramebufferTexture2D); -// GET_DLL_ENTRY_POINT(glFramebufferTexture3D); - GET_DLL_ENTRY_POINT(glFramebufferTextureLayer); - GET_DLL_ENTRY_POINT(glGenFramebuffers); -// GET_DLL_ENTRY_POINT(glGenRenderbuffers); -// GET_DLL_ENTRY_POINT(glGenerateMipmap); -// GET_DLL_ENTRY_POINT(glGetFramebufferAttachmentParameteriv); -// GET_DLL_ENTRY_POINT(glGetRenderbufferParameteriv); -// GET_DLL_ENTRY_POINT(glIsFramebuffer); -// GET_DLL_ENTRY_POINT(glIsRenderbuffer); -// GET_DLL_ENTRY_POINT(glRenderbufferStorage); -// GET_DLL_ENTRY_POINT(glRenderbufferStorageMultisample); - - // Buffers - GET_DLL_ENTRY_POINT(glGenBuffers); - GET_DLL_ENTRY_POINT(glBindBuffer); - GET_DLL_ENTRY_POINT(glBufferData); - GET_DLL_ENTRY_POINT(glBufferSubData); - GET_DLL_ENTRY_POINT(glDeleteBuffers); - - // Vertex buffer attributes - GET_DLL_ENTRY_POINT(glVertexAttribPointer); -// GET_DLL_ENTRY_POINT(glVertexAttribLPointer); -// GET_DLL_ENTRY_POINT(glVertexAttribIPointer); - GET_DLL_ENTRY_POINT(glBindVertexBuffer); - GET_DLL_ENTRY_POINT(glDisableVertexAttribArray); - GET_DLL_ENTRY_POINT(glEnableVertexAttribArray); - - GET_DLL_ENTRY_POINT(glBindVertexArray); - GET_DLL_ENTRY_POINT(glDeleteVertexArrays); - GET_DLL_ENTRY_POINT(glGenVertexArrays); - GET_DLL_ENTRY_POINT(glIsVertexArray); - - // Shaders - GET_DLL_ENTRY_POINT(glCreateShader); - GET_DLL_ENTRY_POINT(glShaderSource); - GET_DLL_ENTRY_POINT(glCompileShader); - GET_DLL_ENTRY_POINT(glGetShaderInfoLog); - GET_DLL_ENTRY_POINT(glGetShaderSource); - GET_DLL_ENTRY_POINT(glGetShaderiv); - GET_DLL_ENTRY_POINT(glCreateProgram); - GET_DLL_ENTRY_POINT(glAttachShader); - GET_DLL_ENTRY_POINT(glLinkProgram); - GET_DLL_ENTRY_POINT(glGetProgramInfoLog); - GET_DLL_ENTRY_POINT(glGetProgramiv); - GET_DLL_ENTRY_POINT(glValidateProgram); - GET_DLL_ENTRY_POINT(glUseProgram); - GET_DLL_ENTRY_POINT(glDeleteShader); - GET_DLL_ENTRY_POINT(glDeleteProgram); - - // Uniforms - GET_DLL_ENTRY_POINT(glGetUniformLocation); -// GET_DLL_ENTRY_POINT(glUniform1f); -// GET_DLL_ENTRY_POINT(glUniform1fv); - GET_DLL_ENTRY_POINT(glUniform1i); -// GET_DLL_ENTRY_POINT(glUniform1iv); -// GET_DLL_ENTRY_POINT(glUniform2f); -// GET_DLL_ENTRY_POINT(glUniform2fv); -// GET_DLL_ENTRY_POINT(glUniform2i); -// GET_DLL_ENTRY_POINT(glUniform2iv); -// GET_DLL_ENTRY_POINT(glUniform3f); -// GET_DLL_ENTRY_POINT(glUniform3fv); -// GET_DLL_ENTRY_POINT(glUniform3i); -// GET_DLL_ENTRY_POINT(glUniform3iv); -// GET_DLL_ENTRY_POINT(glUniform4f); - GET_DLL_ENTRY_POINT(glUniform4fv); -// GET_DLL_ENTRY_POINT(glUniform4i); -// GET_DLL_ENTRY_POINT(glUniform4iv); -// GET_DLL_ENTRY_POINT(glUniformMatrix2fv); -// GET_DLL_ENTRY_POINT(glUniformMatrix3fv); -// GET_DLL_ENTRY_POINT(glUniformMatrix4fv); - - // Uniform buffer objects - GET_DLL_ENTRY_POINT(glBindBufferBase); - GET_DLL_ENTRY_POINT(glBindBufferRange); - GET_DLL_ENTRY_POINT(glGetUniformBlockIndex); - GET_DLL_ENTRY_POINT(glUniformBlockBinding); - - // Sampler objects - GET_DLL_ENTRY_POINT(glBindSampler); - GET_DLL_ENTRY_POINT(glDeleteSamplers); - GET_DLL_ENTRY_POINT(glGenSamplers); -// GET_DLL_ENTRY_POINT(glGetSamplerParameterIiv); -// GET_DLL_ENTRY_POINT(glGetSamplerParameterIuiv); -// GET_DLL_ENTRY_POINT(glGetSamplerParameterfv); -// GET_DLL_ENTRY_POINT(glGetSamplerParameteriv); -// GET_DLL_ENTRY_POINT(glIsSampler); -// GET_DLL_ENTRY_POINT(glSamplerParameterIiv); -// GET_DLL_ENTRY_POINT(glSamplerParameterIuiv); - GET_DLL_ENTRY_POINT(glSamplerParameterf); - GET_DLL_ENTRY_POINT(glSamplerParameterfv); - GET_DLL_ENTRY_POINT(glSamplerParameteri); -// GET_DLL_ENTRY_POINT(glSamplerParameteriv); - - return AMF_OK; -} - -#if defined(_WIN32) -AMF_RESULT OpenGLImportTable::CreateDummy() -{ - DestroyDummy(); - - wndClass = { 0 }; - wndClass.cbSize = sizeof(wndClass); - wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndClass.lpfnWndProc = DefWindowProcW; - wndClass.hInstance = GetModuleHandle(0); - wndClass.lpszClassName = L"OpenGL_Dummy_Class"; - - int ret = RegisterClassExW(&wndClass); - AMF_RETURN_IF_FALSE(ret != 0, AMF_FAIL, L"CreateDummy() - RegisterClassA() failed, error=%d", GetLastError()); - - hDummyWnd = CreateWindowExW(0, wndClass.lpszClassName, L"Dummy OpenGL Window", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, wndClass.hInstance, 0); - AMF_RETURN_IF_FALSE(hDummyWnd != nullptr, AMF_FAIL, L"CreateDummy() - CreateWindowExA() failed to create window"); - - hDummyDC = GetDC(hDummyWnd); - - PIXELFORMATDESCRIPTOR pfd = {}; - pfd.nSize = sizeof(pfd); - pfd.nVersion = 1; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.cColorBits = 32; - pfd.cAlphaBits = 8; - pfd.iLayerType = PFD_MAIN_PLANE; - pfd.cDepthBits = 24; - pfd.cStencilBits = 8; - - int pixel_format = ChoosePixelFormat(hDummyDC, &pfd); - AMF_RETURN_IF_FALSE(pixel_format != 0, AMF_FAIL, L"CreateDummy() - ChoosePixelFormat() failed to find a suitable pixel format."); - - ret = SetPixelFormat(hDummyDC, pixel_format, &pfd); - AMF_RETURN_IF_FALSE(ret != 0, AMF_FAIL, L"CreateDummy() - SetPixelFormat() failed"); - - hDummyOGLContext = wglCreateContext(hDummyDC); - AMF_RETURN_IF_FALSE(hDummyOGLContext != nullptr, AMF_FAIL, L"CreateDummy() - wglCreateContext() failed"); - - ret = !wglMakeCurrent(hDummyDC, hDummyOGLContext); - AMF_RETURN_IF_FALSE(hDummyOGLContext != nullptr, AMF_FAIL, L"CreateDummy() - wglMakeCurrent() failed"); - - return AMF_OK; -} - - -AMF_RESULT OpenGLImportTable::DestroyDummy() -{ - if (hDummyOGLContext != nullptr) - { - wglDeleteContext(hDummyOGLContext); - hDummyOGLContext = nullptr; - } - - if (hDummyWnd != nullptr || hDummyDC != nullptr) - { - if (wglMakeCurrent != nullptr) - { - wglMakeCurrent(hDummyDC, 0); - } - - ReleaseDC(hDummyWnd, hDummyDC); - DestroyWindow(hDummyWnd); - hDummyWnd = nullptr; - hDummyDC = nullptr; - } - - if (wndClass.lpszClassName != nullptr) - { - UnregisterClassW(wndClass.lpszClassName, wndClass.hInstance); - wndClass = {}; - } - - return AMF_OK; -} -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.h deleted file mode 100644 index e1595aa2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/OpenGLImportTable.h +++ /dev/null @@ -1,540 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file OpenGLImportTable.h -/// @brief OpenGL import table -///------------------------------------------------------------------------- -#pragma once - -#include "public/include/core/Result.h" -#include "public/common/AMFSTL.h" - -#if defined(_WIN32) -#include -#include -#include -#elif defined(__ANDROID__) -////todo:AA #include // requires ndk r5 or newer -#define GL_GLEXT_PROTOTYPES -#define EGL_EGLEXT_PROTOTYPES - -#include // requires ndk r5 or newer -#include -#include // requires ndk r5 or newer -#include // requires ndk r5 or newer -#include -#include -////todo:AA #include -// #include -#include -#if !defined(CLOCK_MONOTONIC_RAW) -#define CLOCK_MONOTONIC_RAW 4 -#endif -////todo:AA #include - -////todo:AA using namespace android; -#if !defined(GL_CLAMP) -#define GL_CLAMP GL_CLAMP_TO_EDGE -#endif - -#elif defined(__linux) -#include -#include -#endif - -#ifndef AMF_GLAPI - #if defined(_WIN32) - #define AMF_GLAPI WINGDIAPI - #elif defined(__ANDROID__) - #define AMF_GLAPI GL_API - #else // __linux - #define AMF_GLAPI - #endif -#endif - -#ifndef AMF_GLAPIENTRY - #if defined(_WIN32) - #define AMF_GLAPIENTRY APIENTRY - #elif defined(__ANDROID__) - #define AMF_GLAPIENTRY GL_APIENTRY - #elif defined(__linux) - #define AMF_GLAPIENTRY GLAPIENTRY - #else - #define AMF_GLAPIENTRY - #endif -#endif - - -typedef char GLchar; -#if defined(__ANDROID__) -typedef double GLclampd; -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#else -typedef ptrdiff_t GLintptr; -#endif - -#ifdef _WIN32 -typedef size_t GLsizeiptr; // Defined in glx.h on linux -#endif - - -// Core -typedef AMF_GLAPI GLenum (AMF_GLAPIENTRY* glGetError_fn) (void); -typedef AMF_GLAPI const GLubyte* (AMF_GLAPIENTRY* glGetString_fn) (GLenum name); -typedef AMF_GLAPI const GLubyte* (AMF_GLAPIENTRY* glGetStringi_fn) (GLenum name, GLuint index); - -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glEnable_fn) (GLenum cap); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClear_fn) (GLbitfield mask); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClearAccum_fn) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClearColor_fn) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClearDepth_fn) (GLclampd depth); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClearIndex_fn) (GLfloat c); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glClearStencil_fn) (GLint s); - -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDrawArrays_fn) (GLenum mode, GLint first, GLsizei count); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glViewport_fn) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFinish_fn) (void); - -// Textures -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindTexture_fn) (GLenum target, GLuint texture); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteTextures_fn) (GLsizei n, const GLuint* textures); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenTextures_fn) (GLsizei n, GLuint* textures); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetTexImage_fn) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid* pixels); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetTexLevelParameteriv_fn) (GLenum target, GLint level, GLenum pname, GLint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glTexParameteri_fn) (GLenum target, GLenum pname, GLint param); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glTexImage2D_fn) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, const GLvoid* pixels); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glActiveTexture_fn) (GLenum texture); - -// Framebuffer and Renderbuffer objects - EXT: GL_ARB_framebuffer_object -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindFramebuffer_fn) (GLenum target, GLuint framebuffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindRenderbuffer_fn) (GLenum target, GLuint renderbuffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBlitFramebuffer_fn) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef AMF_GLAPI GLenum (AMF_GLAPIENTRY* glCheckFramebufferStatus_fn) (GLenum target); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteFramebuffers_fn) (GLsizei n, const GLuint* framebuffers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteRenderbuffers_fn) (GLsizei n, const GLuint* renderbuffers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFramebufferRenderbuffer_fn) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFramebufferTexture1D_fn) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFramebufferTexture2D_fn) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFramebufferTexture3D_fn) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glFramebufferTextureLayer_fn) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenFramebuffers_fn) (GLsizei n, GLuint* framebuffers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenRenderbuffers_fn) (GLsizei n, GLuint* renderbuffers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenerateMipmap_fn) (GLenum target); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetFramebufferAttachmentParameteriv_fn) (GLenum target, GLenum attachment, GLenum pname, GLint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetRenderbufferParameteriv_fn) (GLenum target, GLenum pname, GLint* params); -typedef AMF_GLAPI GLboolean (AMF_GLAPIENTRY* glIsFramebuffer_fn) (GLuint framebuffer); -typedef AMF_GLAPI GLboolean (AMF_GLAPIENTRY* glIsRenderbuffer_fn) (GLuint renderbuffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glRenderbufferStorage_fn) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glRenderbufferStorageMultisample_fn) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -// Buffers -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenBuffers_fn) (GLsizei n, GLuint* buffers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindBuffer_fn) (GLenum target, GLuint buffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBufferData_fn) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBufferSubData_fn) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteBuffers_fn) (GLsizei n, const GLuint* buffers); - -// Vertex attributes -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glVertexAttribPointer_fn) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glVertexAttribLPointer_fn) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glVertexAttribIPointer_fn) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindVertexBuffer_fn) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDisableVertexAttribArray_fn) (GLuint index); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glEnableVertexAttribArray_fn) (GLuint index); - -// Vertex array objects -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindVertexArray_fn) (GLuint array); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteVertexArrays_fn) (GLsizei n, const GLuint* arrays); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenVertexArrays_fn) (GLsizei n, GLuint* arrays); -typedef AMF_GLAPI GLboolean (AMF_GLAPIENTRY* glIsVertexArray_fn) (GLuint array); - -// Shaders -typedef AMF_GLAPI GLuint (AMF_GLAPIENTRY* glCreateShader_fn) (GLenum type); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glShaderSource_fn) (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glCompileShader_fn) (GLuint shader); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetShaderInfoLog_fn) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetShaderSource_fn) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetShaderiv_fn) (GLuint shader, GLenum pname, GLint* param); -typedef AMF_GLAPI GLuint (AMF_GLAPIENTRY* glCreateProgram_fn) (void); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glAttachShader_fn) (GLuint program, GLuint shader); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glLinkProgram_fn) (GLuint program); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetProgramInfoLog_fn) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetProgramiv_fn) (GLuint program, GLenum pname, GLint* param); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glValidateProgram_fn) (GLuint program); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUseProgram_fn) (GLuint program); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteShader_fn) (GLuint shader); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteProgram_fn) (GLuint program); - -// Uniforms -typedef AMF_GLAPI GLint (AMF_GLAPIENTRY* glGetUniformLocation_fn) (GLuint program, const GLchar* name); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform1f_fn) (GLint location, GLfloat v0); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform1fv_fn) (GLint location, GLsizei count, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform1i_fn) (GLint location, GLint v0); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform1iv_fn) (GLint location, GLsizei count, const GLint* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform2f_fn) (GLint location, GLfloat v0, GLfloat v1); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform2fv_fn) (GLint location, GLsizei count, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform2i_fn) (GLint location, GLint v0, GLint v1); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform2iv_fn) (GLint location, GLsizei count, const GLint* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform3f_fn) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform3fv_fn) (GLint location, GLsizei count, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform3i_fn) (GLint location, GLint v0, GLint v1, GLint v2); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform3iv_fn) (GLint location, GLsizei count, const GLint* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform4f_fn) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform4fv_fn) (GLint location, GLsizei count, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform4i_fn) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniform4iv_fn) (GLint location, GLsizei count, const GLint* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniformMatrix2fv_fn) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniformMatrix3fv_fn) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniformMatrix4fv_fn) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); - -// Uniform block objects - EXT: ARB_Uniform_Buffer_Object -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindBufferBase_fn) (GLenum target, GLuint index, GLuint buffer); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindBufferRange_fn) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef AMF_GLAPI GLuint (AMF_GLAPIENTRY* glGetUniformBlockIndex_fn) (GLuint program, const GLchar* uniformBlockName); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glUniformBlockBinding_fn) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); - - -// Sampler Objects - EXT: GL_ARB_sampler_objects -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glBindSampler_fn) (GLuint unit, GLuint sampler); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glDeleteSamplers_fn) (GLsizei count, const GLuint* samplers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGenSamplers_fn) (GLsizei count, GLuint* samplers); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetSamplerParameterIiv_fn) (GLuint sampler, GLenum pname, GLint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetSamplerParameterIuiv_fn) (GLuint sampler, GLenum pname, GLuint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetSamplerParameterfv_fn) (GLuint sampler, GLenum pname, GLfloat* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glGetSamplerParameteriv_fn) (GLuint sampler, GLenum pname, GLint* params); -typedef AMF_GLAPI GLboolean (AMF_GLAPIENTRY* glIsSampler_fn) (GLuint sampler); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameterIiv_fn) (GLuint sampler, GLenum pname, const GLint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameterIuiv_fn) (GLuint sampler, GLenum pname, const GLuint* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameterf_fn) (GLuint sampler, GLenum pname, GLfloat param); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameterfv_fn) (GLuint sampler, GLenum pname, const GLfloat* params); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameteri_fn) (GLuint sampler, GLenum pname, GLint param); -typedef AMF_GLAPI void (AMF_GLAPIENTRY* glSamplerParameteriv_fn) (GLuint sampler, GLenum pname, const GLint* params); - - -#if defined(_WIN32) -typedef WINGDIAPI HGLRC (WINAPI* wglCreateContext_fn) (HDC); -typedef WINGDIAPI BOOL (WINAPI* wglDeleteContext_fn) (HGLRC); -typedef WINGDIAPI HGLRC (WINAPI* wglGetCurrentContext_fn) (VOID); -typedef WINGDIAPI HDC (WINAPI* wglGetCurrentDC_fn) (VOID); -typedef WINGDIAPI BOOL (WINAPI* wglMakeCurrent_fn) (HDC, HGLRC); -typedef WINGDIAPI PROC (WINAPI* wglGetProcAddress_fn) (LPCSTR func); -typedef WINGDIAPI const char* (WINAPI* wglGetExtensionsStringARB_fn) (HDC hdc); -typedef WINGDIAPI BOOL (WINAPI* wglSwapIntervalEXT_fn) (int interval); -#elif defined(__ANDROID__) -typedef EGLAPI EGLBoolean (EGLAPIENTRY* eglInitialize_fn) (EGLDisplay dpy, EGLint* major, EGLint* minor); -typedef EGLAPI EGLDisplay (EGLAPIENTRY* eglGetDisplay_fn) (EGLNativeDisplayType display_id); -typedef EGLAPI EGLBoolean (EGLAPIENTRY* eglChooseConfig_fn) (EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config); -typedef EGLAPI EGLContext (EGLAPIENTRY* eglCreateContext_fn) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint* attrib_list); -typedef EGLAPI EGLBoolean (EGLAPIENTRY* eglDestroyImageKHR_fn) (EGLDisplay dpy, EGLImageKHR image); -typedef EGLAPI EGLImageKHR (EGLAPIENTRY* eglCreateImageKHR_fn) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list); -typedef EGLAPI EGLBoolean (EGLAPIENTRY* eglSwapInterval_fn) (EGLDisplay dpy, EGLint interval); -typedef GL_API void (GL_APIENTRY* glEGLImageTargetTexture2DOES_fn) (GLenum target, GLeglImageOES image); -typedef GL_API void (GL_APIENTRY* glReadPixels_fn) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); -#elif defined(__linux) -typedef void (GLAPIENTRY* glXDestroyContext_fn) (Display* dpy, GLXContext ctx); -typedef void (GLAPIENTRY* glXDestroyWindow_fn) (Display* dpy, GLXWindow window); -typedef void (GLAPIENTRY* glXSwapBuffers_fn) (Display* dpy, GLXDrawable drawable); -typedef Bool (GLAPIENTRY* glXQueryExtension_fn) (Display* dpy, int* errorb, int* event); -typedef GLXFBConfig* (GLAPIENTRY* glXChooseFBConfig_fn) (Display* dpy, int screen, const int* attribList, int* nitems ); -typedef GLXWindow (GLAPIENTRY* glXCreateWindow_fn) (Display* dpy, GLXFBConfig config, Window win, const int* attribList ); -typedef GLXContext (GLAPIENTRY* glXCreateNewContext_fn) (Display* dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct ); -typedef Bool (GLAPIENTRY* glXMakeCurrent_fn) (Display* dpy, GLXDrawable drawable, GLXContext ctx); -typedef GLXContext (GLAPIENTRY* glXGetCurrentContext_fn) (void); -typedef GLXDrawable (GLAPIENTRY* glXGetCurrentDrawable_fn) (void); -typedef const char* (GLAPIENTRY* glXQueryExtensionsString_fn) (Display* dpy, int screen); -typedef void (GLAPIENTRY* glXSwapIntervalEXT_fn) (Display* dpy, GLXDrawable drawable, int interval); -#endif - -// Target -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_QUERY_BUFFER 0x9192 -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 - -// Attachments -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT_UNIT(x) (GL_COLOR_ATTACHMENT0 + x) -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 - -// Frame Buffer Status -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 - -// Texture unit -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE_UNIT(x) (GL_TEXTURE0 + x) - -// Usage -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA - -// Shader Type -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_COMPUTE_SHADER 0x91B9 - -// Shader Info -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 - -// Sampler params -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D - -struct OpenGLImportTable -{ - OpenGLImportTable(); - ~OpenGLImportTable(); - - AMF_RESULT LoadFunctionsTable(); - AMF_RESULT LoadContextFunctionsTable(); - - amf_handle m_hOpenGLDll; - - // Core - glGetError_fn glGetError; - glGetString_fn glGetString; -// glGetStringi_fn glGetStringi; - - glEnable_fn glEnable; - glClear_fn glClear; - glClearAccum_fn glClearAccum; - glClearColor_fn glClearColor; - glClearDepth_fn glClearDepth; - glClearIndex_fn glClearIndex; - glClearStencil_fn glClearStencil; - glDrawArrays_fn glDrawArrays; - glViewport_fn glViewport; - glFinish_fn glFinish; - - // Core (platform-dependent) -#if defined(_WIN32) - wglCreateContext_fn wglCreateContext; - wglDeleteContext_fn wglDeleteContext; - wglGetCurrentContext_fn wglGetCurrentContext; - wglGetCurrentDC_fn wglGetCurrentDC; - wglMakeCurrent_fn wglMakeCurrent; - wglGetProcAddress_fn wglGetProcAddress; - wglGetExtensionsStringARB_fn wglGetExtensionsStringARB; - wglSwapIntervalEXT_fn wglSwapIntervalEXT; -#elif defined(__ANDROID__) - eglInitialize_fn eglInitialize; - eglGetDisplay_fn eglGetDisplay; - eglChooseConfig_fn eglChooseConfig; - eglCreateContext_fn eglCreateContext; - eglDestroyImageKHR_fn eglDestroyImageKHR; - eglCreateImageKHR_fn eglCreateImageKHR; - eglSwapInterval_fn eglSwapInterval; - glEGLImageTargetTexture2DOES_fn glEGLImageTargetTexture2DOES; - glReadPixels_fn glReadPixels; -#elif defined(__linux) - glXDestroyContext_fn glXDestroyContext; - glXDestroyWindow_fn glXDestroyWindow; - glXSwapBuffers_fn glXSwapBuffers; - glXQueryExtension_fn glXQueryExtension; - glXChooseFBConfig_fn glXChooseFBConfig; - glXCreateWindow_fn glXCreateWindow; - glXCreateNewContext_fn glXCreateNewContext; - glXMakeCurrent_fn glXMakeCurrent; - glXGetCurrentContext_fn glXGetCurrentContext; - glXGetCurrentDrawable_fn glXGetCurrentDrawable; - glXQueryExtensionsString_fn glXQueryExtensionsString; - glXSwapIntervalEXT_fn glXSwapIntervalEXT; -#endif - - // Textures - glBindTexture_fn glBindTexture; - glDeleteTextures_fn glDeleteTextures; - glGenTextures_fn glGenTextures; - glGetTexImage_fn glGetTexImage; - glGetTexLevelParameteriv_fn glGetTexLevelParameteriv; - glTexParameteri_fn glTexParameteri; - glTexImage2D_fn glTexImage2D; - glActiveTexture_fn glActiveTexture; - - // Frame buffer and render buffer objects - glBindFramebuffer_fn glBindFramebuffer; -// glBindRenderbuffer_fn glBindRenderbuffer; - glBlitFramebuffer_fn glBlitFramebuffer; - glCheckFramebufferStatus_fn glCheckFramebufferStatus; - glDeleteFramebuffers_fn glDeleteFramebuffers; -// glDeleteRenderbuffers_fn glDeleteRenderbuffers; -// glFramebufferRenderbuffer_fn glFramebufferRenderbuffer; -// glFramebufferTexture1D_fn glFramebufferTexture1D; - glFramebufferTexture2D_fn glFramebufferTexture2D; -// glFramebufferTexture3D_fn glFramebufferTexture3D; - glFramebufferTextureLayer_fn glFramebufferTextureLayer; - glGenFramebuffers_fn glGenFramebuffers; -// glGenRenderbuffers_fn glGenRenderbuffers; -// glGenerateMipmap_fn glGenerateMipmap; -// glGetFramebufferAttachmentParameteriv_fn glGetFramebufferAttachmentParameteriv; -// glGetRenderbufferParameteriv_fn glGetRenderbufferParameteriv; -// glIsFramebuffer_fn glIsFramebuffer; -// glIsRenderbuffer_fn glIsRenderbuffer; -// glRenderbufferStorage_fn glRenderbufferStorage; -// glRenderbufferStorageMultisample_fn glRenderbufferStorageMultisample; - - // Buffers - glGenBuffers_fn glGenBuffers; - glBindBuffer_fn glBindBuffer; - glBufferData_fn glBufferData; - glBufferSubData_fn glBufferSubData; - glDeleteBuffers_fn glDeleteBuffers; - - // Vertex attributes - glVertexAttribPointer_fn glVertexAttribPointer; -// glVertexAttribLPointer_fn glVertexAttribLPointer; -// glVertexAttribIPointer_fn glVertexAttribIPointer; - glBindVertexBuffer_fn glBindVertexBuffer; - glDisableVertexAttribArray_fn glDisableVertexAttribArray; - glEnableVertexAttribArray_fn glEnableVertexAttribArray; - - // Vertex array objects - glBindVertexArray_fn glBindVertexArray; - glDeleteVertexArrays_fn glDeleteVertexArrays; - glGenVertexArrays_fn glGenVertexArrays; - glIsVertexArray_fn glIsVertexArray; - - // Shaders - glCreateShader_fn glCreateShader; - glShaderSource_fn glShaderSource; - glCompileShader_fn glCompileShader; - glGetShaderInfoLog_fn glGetShaderInfoLog; - glGetShaderSource_fn glGetShaderSource; - glGetShaderiv_fn glGetShaderiv; - glCreateProgram_fn glCreateProgram; - glAttachShader_fn glAttachShader; - glLinkProgram_fn glLinkProgram; - glGetProgramInfoLog_fn glGetProgramInfoLog; - glGetProgramiv_fn glGetProgramiv; - glValidateProgram_fn glValidateProgram; - glUseProgram_fn glUseProgram; - glDeleteShader_fn glDeleteShader; - glDeleteProgram_fn glDeleteProgram; - - // Uniforms - glGetUniformLocation_fn glGetUniformLocation; -// glUniform1f_fn glUniform1f; -// glUniform1fv_fn glUniform1fv; - glUniform1i_fn glUniform1i; -// glUniform1iv_fn glUniform1iv; -// glUniform2f_fn glUniform2f; -// glUniform2fv_fn glUniform2fv; -// glUniform2i_fn glUniform2i; -// glUniform2iv_fn glUniform2iv; -// glUniform3f_fn glUniform3f; -// glUniform3fv_fn glUniform3fv; -// glUniform3i_fn glUniform3i; -// glUniform3iv_fn glUniform3iv; -// glUniform4f_fn glUniform4f; - glUniform4fv_fn glUniform4fv; -// glUniform4i_fn glUniform4i; -// glUniform4iv_fn glUniform4iv; -// glUniformMatrix2fv_fn glUniformMatrix2fv; -// glUniformMatrix3fv_fn glUniformMatrix3fv; -// glUniformMatrix4fv_fn glUniformMatrix4fv; - - // Uniform buffer objects - glBindBufferBase_fn glBindBufferBase; - glBindBufferRange_fn glBindBufferRange; - glGetUniformBlockIndex_fn glGetUniformBlockIndex; - glUniformBlockBinding_fn glUniformBlockBinding; - - // Sampler objects - glBindSampler_fn glBindSampler; - glDeleteSamplers_fn glDeleteSamplers; - glGenSamplers_fn glGenSamplers; -// glGetSamplerParameterIiv_fn glGetSamplerParameterIiv; -// glGetSamplerParameterIuiv_fn glGetSamplerParameterIuiv; -// glGetSamplerParameterfv_fn glGetSamplerParameterfv; -// glGetSamplerParameteriv_fn glGetSamplerParameteriv; -// glIsSampler_fn glIsSampler; -// glSamplerParameterIiv_fn glSamplerParameterIiv; -// glSamplerParameterIuiv_fn glSamplerParameterIuiv; - glSamplerParameterf_fn glSamplerParameterf; - glSamplerParameterfv_fn glSamplerParameterfv; - glSamplerParameteri_fn glSamplerParameteri; -// glSamplerParameteriv_fn glSamplerParameteriv; - -private: - -#if defined(_WIN32) - WNDCLASSEX wndClass; - HWND hDummyWnd; - HDC hDummyDC; - HGLRC hDummyOGLContext; - - AMF_RESULT CreateDummy(); - AMF_RESULT DestroyDummy(); -#endif -}; \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.cpp deleted file mode 100644 index 0b24cfef..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.cpp +++ /dev/null @@ -1,472 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include -#include "PropertyStorageExImpl.h" -#include "PropertyStorageImpl.h" -#include "TraceAdapter.h" - -#pragma warning(disable: 4996) - -using namespace amf; - -#define AMF_FACILITY L"AMFPropertyStorageExImpl" -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wexit-time-destructors" - #pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - -amf::AMFCriticalSection amf::ms_csAMFPropertyStorageExImplMaps; -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - -//------------------------------------------------------------------------------------------------- -AMF_RESULT amf::CastVariantToAMFProperty(amf::AMFVariantStruct* pDest, const amf::AMFVariantStruct* pSrc, amf::AMF_VARIANT_TYPE eType, - amf::AMF_PROPERTY_CONTENT_TYPE /*contentType*/, - const amf::AMFEnumDescriptionEntry* pEnumDescription) -{ - AMF_RETURN_IF_INVALID_POINTER(pDest); - - AMF_RESULT err = AMF_OK; - switch (eType) - { - case AMF_VARIANT_INTERFACE: - if (pSrc->type == eType) - { - err = AMFVariantCopy(pDest, pSrc); - } - else - { - pDest->type = AMF_VARIANT_INTERFACE; - pDest->pInterface = nullptr; - } - break; - - case AMF_VARIANT_INT64: - { - if(pEnumDescription) - { - const AMFEnumDescriptionEntry* pEnumDescriptionCache = pEnumDescription; - err = AMFVariantChangeType(pDest, pSrc, AMF_VARIANT_INT64); - bool found = false; - if(err == AMF_OK) - { - //mean numeric came. validating - while(pEnumDescriptionCache->name) - { - if(pEnumDescriptionCache->value == AMFVariantGetInt64(pDest)) - { - AMFVariantAssignInt64(pDest, pEnumDescriptionCache->value); - found = true; - break; - } - pEnumDescriptionCache++; - } - err = found ? AMF_OK : AMF_INVALID_ARG; - } - if(!found) - { - pEnumDescriptionCache = pEnumDescription; - err = AMFVariantChangeType(pDest, pSrc, AMF_VARIANT_WSTRING); - if(err == AMF_OK) - { - //string came. validating and assigning numeric - found = false; - while(pEnumDescriptionCache->name) - { - if(amf_wstring(pEnumDescriptionCache->name) == AMFVariantGetWString(pDest)) - { - AMFVariantAssignInt64(pDest, pEnumDescriptionCache->value); - found = true; - break; - } - pEnumDescriptionCache++; - } - err = found ? AMF_OK : AMF_INVALID_ARG; - } - } - } - else - { - err = AMFVariantChangeType(pDest, pSrc, AMF_VARIANT_INT64); - } - } - break; - - default: - err = AMFVariantChangeType(pDest, pSrc, eType); - break; - } - return err; -} -//------------------------------------------------------------------------------------------------- -AMFPropertyInfoImpl::AMFPropertyInfoImpl(const wchar_t* name, const wchar_t* desc, AMF_VARIANT_TYPE type, AMF_PROPERTY_CONTENT_TYPE contentType, - AMFVariantStruct defaultValue, AMFVariantStruct minValue, AMFVariantStruct maxValue, bool allowChangeInRuntime, - const AMFEnumDescriptionEntry* pEnumDescription) : m_name(), m_desc() -{ - AMF_PROPERTY_ACCESS_TYPE accessTypeTmp = allowChangeInRuntime ? AMF_PROPERTY_ACCESS_FULL : AMF_PROPERTY_ACCESS_READ_WRITE; - Init(name, desc, type, contentType, defaultValue, minValue, maxValue, accessTypeTmp, pEnumDescription); -} -//------------------------------------------------------------------------------------------------- -AMFPropertyInfoImpl::AMFPropertyInfoImpl(const wchar_t* name, const wchar_t* desc, AMF_VARIANT_TYPE type, AMF_PROPERTY_CONTENT_TYPE contentType, - AMFVariantStruct defaultValue, AMFVariantStruct minValue, AMFVariantStruct maxValue, AMF_PROPERTY_ACCESS_TYPE accessType, - const AMFEnumDescriptionEntry* pEnumDescription) : m_name(), m_desc() -{ - Init(name, desc, type, contentType, defaultValue, minValue, maxValue, accessType, pEnumDescription); -} -//------------------------------------------------------------------------------------------------- -AMFPropertyInfoImpl::AMFPropertyInfoImpl() : m_name(), m_desc() -{ - AMFVariantInit(&this->defaultValue); - AMFVariantInit(&this->minValue); - AMFVariantInit(&this->maxValue); - - name = L""; - desc = L""; - type = AMF_VARIANT_EMPTY; - contentType = AMF_PROPERTY_CONTENT_TYPE(-1); - accessType = AMF_PROPERTY_ACCESS_FULL; -} -//------------------------------------------------------------------------------------------------- -void AMFPropertyInfoImpl::Init(const wchar_t* name_, const wchar_t* desc_, AMF_VARIANT_TYPE type_, AMF_PROPERTY_CONTENT_TYPE contentType_, - AMFVariantStruct defaultValue_, AMFVariantStruct minValue_, AMFVariantStruct maxValue_, AMF_PROPERTY_ACCESS_TYPE accessType_, - const AMFEnumDescriptionEntry* pEnumDescription_) -{ - m_name = name_; - name = m_name.c_str(); - - m_desc = desc_; - desc = m_desc.c_str(); - - type = type_; - contentType = contentType_; - accessType = accessType_; - AMFVariantInit(&defaultValue); - AMFVariantInit(&minValue); - AMFVariantInit(&maxValue); - pEnumDescription = pEnumDescription_; - - switch(type) - { - case AMF_VARIANT_BOOL: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignBool(&defaultValue, false); - } - } - break; - case AMF_VARIANT_RECT: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignRect(&defaultValue, AMFConstructRect(0, 0, 0, 0)); - } - } - break; - case AMF_VARIANT_SIZE: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignSize(&defaultValue, AMFConstructSize(0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignSize(&minValue, AMFConstructSize(INT_MIN, INT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignSize(&maxValue, AMFConstructSize(INT_MAX, INT_MAX)); - } - } - break; - case AMF_VARIANT_POINT: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignPoint(&defaultValue, AMFConstructPoint(0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignPoint(&minValue, AMFConstructPoint(INT_MIN, INT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignPoint(&maxValue, AMFConstructPoint(INT_MAX, INT_MAX)); - } - } - break; - case AMF_VARIANT_RATE: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignRate(&defaultValue, AMFConstructRate(0, 0)); - } - if (CastVariantToAMFProperty(&this->minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignRate(&this->minValue, AMFConstructRate(0, 1)); - } - if (CastVariantToAMFProperty(&this->maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignRate(&this->maxValue, AMFConstructRate(INT_MAX, INT_MAX)); - } - } - break; - case AMF_VARIANT_RATIO: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignRatio(&defaultValue, AMFConstructRatio(0, 0)); - } - } - break; - case AMF_VARIANT_COLOR: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignColor(&defaultValue, AMFConstructColor(0, 0, 0, 255)); - } - } - break; - - case AMF_VARIANT_INT64: - { - if(pEnumDescription) - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignInt64(&defaultValue, pEnumDescription->value); - } - } - else //AMF_PROPERTY_CONTENT_DEFAULT - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignInt64(&defaultValue, 0); - } - if(CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignInt64(&minValue, INT_MIN); - } - if(CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignInt64(&maxValue, INT_MAX); - } - } - } - break; - - case AMF_VARIANT_DOUBLE: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignDouble(&defaultValue, 0); - } - if(CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignDouble(&minValue, DBL_MIN); - } - if(CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignDouble(&maxValue, DBL_MAX); - } - } - break; - - case AMF_VARIANT_STRING: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignString(&maxValue, ""); - } - } - break; - - case AMF_VARIANT_WSTRING: - { - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignWString(&maxValue, L""); - } - } - break; - - case AMF_VARIANT_INTERFACE: - if(CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignWString(&maxValue, L""); - } - break; - case AMF_VARIANT_FLOAT: - { - if (CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloat(&defaultValue, 0); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloat(&minValue, FLT_MIN); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloat(&maxValue, FLT_MAX); - } - } - break; - case AMF_VARIANT_FLOAT_SIZE: - { - if (CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatSize(&defaultValue, AMFConstructFloatSize(0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatSize(&minValue, AMFConstructFloatSize(FLT_MIN, FLT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatSize(&maxValue, AMFConstructFloatSize(FLT_MAX, FLT_MAX)); - } - } - break; - case AMF_VARIANT_FLOAT_POINT2D: - { - if (CastVariantToAMFProperty(&defaultValue, &defaultValue, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint2D(&defaultValue, AMFConstructFloatPoint2D(0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint2D(&minValue, AMFConstructFloatPoint2D(FLT_MIN, FLT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint2D(&maxValue, AMFConstructFloatPoint2D(FLT_MAX, FLT_MAX)); - } - } - break; - case AMF_VARIANT_FLOAT_POINT3D: - { - if (CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint3D(&defaultValue, AMFConstructFloatPoint3D(0, 0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint3D(&minValue, AMFConstructFloatPoint3D(FLT_MIN, FLT_MIN, FLT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatPoint3D(&maxValue, AMFConstructFloatPoint3D(FLT_MAX, FLT_MAX, FLT_MAX)); - } - } - break; - case AMF_VARIANT_FLOAT_VECTOR4D: - { - if (CastVariantToAMFProperty(&defaultValue, &defaultValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatVector4D(&defaultValue, AMFConstructFloatVector4D(0, 0, 0, 0)); - } - if (CastVariantToAMFProperty(&minValue, &minValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatVector4D(&minValue, AMFConstructFloatVector4D(FLT_MIN, FLT_MIN, FLT_MIN, FLT_MIN)); - } - if (CastVariantToAMFProperty(&maxValue, &maxValue_, type, contentType, pEnumDescription) != AMF_OK) - { - AMFVariantAssignFloatVector4D(&maxValue, AMFConstructFloatVector4D(FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX)); - } - } - break; - default: - break; - } - - value = defaultValue; -} - -AMFPropertyInfoImpl::AMFPropertyInfoImpl(const AMFPropertyInfoImpl& propertyInfo) : AMFPropertyInfo(), m_name(), m_desc() -{ - Init(propertyInfo.name, propertyInfo.desc, propertyInfo.type, propertyInfo.contentType, propertyInfo.defaultValue, propertyInfo.minValue, propertyInfo.maxValue, propertyInfo.accessType, propertyInfo.pEnumDescription); -} -//------------------------------------------------------------------------------------------------- -AMFPropertyInfoImpl& AMFPropertyInfoImpl::operator=(const AMFPropertyInfoImpl& propertyInfo) -{ - // store name and desc inside instance in m_sName and m_sDesc recpectively; - // m_pName and m_pDesc are pointed to our local copies - this->m_name = propertyInfo.name; - this->m_desc = propertyInfo.desc; - this->name = m_name.c_str(); - this->desc = m_desc.c_str(); - - this->type = propertyInfo.type; - this->contentType = propertyInfo.contentType; - this->accessType = propertyInfo.accessType; - AMFVariantCopy(&this->defaultValue, &propertyInfo.defaultValue); - AMFVariantCopy(&this->minValue, &propertyInfo.minValue); - AMFVariantCopy(&this->maxValue, &propertyInfo.maxValue); - this->pEnumDescription = propertyInfo.pEnumDescription; - - this->value = propertyInfo.value; - this->userModified = propertyInfo.userModified; - - return *this; -} -//------------------------------------------------------------------------------------------------- -AMFPropertyInfoImpl::~AMFPropertyInfoImpl() -{ - AMFVariantClear(&this->defaultValue); - AMFVariantClear(&this->minValue); - AMFVariantClear(&this->maxValue); -} -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.h deleted file mode 100644 index 463436f6..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageExImpl.h +++ /dev/null @@ -1,617 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -///------------------------------------------------------------------------- -/// @file PropertyStorageExImpl.h -/// @brief AMFPropertyStorageExImpl header -///------------------------------------------------------------------------- -#ifndef AMF_PropertyStorageExImpl_h -#define AMF_PropertyStorageExImpl_h -#pragma once - -#include "../include/core/PropertyStorageEx.h" -#include "Thread.h" -#include "InterfaceImpl.h" -#include "ObservableImpl.h" -#include "TraceAdapter.h" -#include -#include -#include - -namespace amf -{ - - AMF_RESULT CastVariantToAMFProperty(AMFVariantStruct* pDest, const AMFVariantStruct* pSrc, AMF_VARIANT_TYPE eType, - AMF_PROPERTY_CONTENT_TYPE contentType, - const AMFEnumDescriptionEntry* pEnumDescription = 0); - - //--------------------------------------------------------------------------------------------- - class AMFPropertyInfoImpl : public AMFPropertyInfo - { - private: - amf_wstring m_name; - amf_wstring m_desc; - - void Init(const wchar_t* name, const wchar_t* desc, AMF_VARIANT_TYPE type, AMF_PROPERTY_CONTENT_TYPE contentType, - AMFVariantStruct defaultValue, AMFVariantStruct minValue, AMFVariantStruct maxValue, AMF_PROPERTY_ACCESS_TYPE accessType, - const AMFEnumDescriptionEntry* pEnumDescription); - - public: - AMFVariant value; - amf_bool userModified = false; - - public: - AMFPropertyInfoImpl(const wchar_t* name, const wchar_t* desc, AMF_VARIANT_TYPE type, AMF_PROPERTY_CONTENT_TYPE contentType, - AMFVariantStruct defaultValue, AMFVariantStruct minValue, AMFVariantStruct maxValue, bool allowChangeInRuntime, - const AMFEnumDescriptionEntry* pEnumDescription); - AMFPropertyInfoImpl(const wchar_t* name, const wchar_t* desc, AMF_VARIANT_TYPE type, AMF_PROPERTY_CONTENT_TYPE contentType, - AMFVariantStruct defaultValue, AMFVariantStruct minValue, AMFVariantStruct maxValue, AMF_PROPERTY_ACCESS_TYPE accessType, - const AMFEnumDescriptionEntry* pEnumDescription); - AMFPropertyInfoImpl(); - - AMFPropertyInfoImpl(const AMFPropertyInfoImpl& propertyInfo); - AMFPropertyInfoImpl& operator=(const AMFPropertyInfoImpl& propertyInfo); - - virtual ~AMFPropertyInfoImpl(); - - virtual void OnPropertyChanged() { } - }; - - typedef amf_map > PropertyInfoMap; - - //--------------------------------------------------------------------------------------------- - template class AMFPropertyStorageExImpl : - public _TBase, - public AMFObservableImpl - { - protected: - PropertyInfoMap m_PropertiesInfo; - AMFCriticalSection m_Sync; //thread-safety lock. - - public: - AMFPropertyStorageExImpl() - { - } - - virtual ~AMFPropertyStorageExImpl() - { - } - - - // interface access - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(AMFPropertyStorage) - AMF_INTERFACE_ENTRY(AMFPropertyStorageEx) - AMF_END_INTERFACE_MAP - - - using _TBase::GetProperty; - using _TBase::SetProperty; - - // interface - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL Clear() - { - ResetDefaultValues(); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL AddTo(AMFPropertyStorage* pDest, bool overwrite, bool /*deep*/) const - { - AMF_RETURN_IF_INVALID_POINTER(pDest); - - if (pDest != this) - { - AMFLock lock(const_cast(&m_Sync)); - for (PropertyInfoMap::const_iterator it = m_PropertiesInfo.begin(); it != m_PropertiesInfo.end(); it++) - { - if (!overwrite && pDest->HasProperty(it->first.c_str())) - { - continue; - } - - AMF_RESULT err = pDest->SetProperty(it->first.c_str(), it->second->value); - if (err != AMF_INVALID_ARG) // not validated - skip it - { - AMF_RETURN_IF_FAILED(err, L"AddTo() - failed to copy property=%s", it->first.c_str()); - } - } - } - - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL CopyTo(AMFPropertyStorage* pDest, bool deep) const - { - AMF_RETURN_IF_INVALID_POINTER(pDest); - - if (pDest != this) - { - pDest->Clear(); - return AddTo(pDest, true, deep); - } - - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL SetProperty(const wchar_t* name, AMFVariantStruct value) - { - AMF_RETURN_IF_INVALID_POINTER(name); - - const AMFPropertyInfo* pParamInfo = NULL; - AMF_RESULT err = GetPropertyInfo(name, &pParamInfo); - if (err != AMF_OK) - { - return err; - } - - if (pParamInfo && !pParamInfo->AllowedWrite()) - { - return AMF_ACCESS_DENIED; - } - return SetPrivateProperty(name, value); - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetProperty(const wchar_t* name, AMFVariantStruct* pValue) const - { - AMF_RETURN_IF_INVALID_POINTER(name); - AMF_RETURN_IF_INVALID_POINTER(pValue); - - const AMFPropertyInfo* pParamInfo = NULL; - AMF_RESULT err = GetPropertyInfo(name, &pParamInfo); - if (err != AMF_OK) - { - return err; - } - - if (pParamInfo && !pParamInfo->AllowedRead()) - { - return AMF_ACCESS_DENIED; - } - return GetPrivateProperty(name, pValue); - } - //------------------------------------------------------------------------------------------------- - virtual bool AMF_STD_CALL HasProperty(const wchar_t* name) const - { - const AMFPropertyInfo* pParamInfo = NULL; - AMF_RESULT err = GetPropertyInfo(name, &pParamInfo); - return (err != AMF_OK) ? false : true; - } - //------------------------------------------------------------------------------------------------- - virtual amf_size AMF_STD_CALL GetPropertyCount() const - { - return m_PropertiesInfo.size(); - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetPropertyAt(amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue) const - { - AMF_RETURN_IF_INVALID_POINTER(name); - AMF_RETURN_IF_INVALID_POINTER(pValue); - AMF_RETURN_IF_FALSE(nameSize != 0, AMF_INVALID_ARG); - AMF_RETURN_IF_FALSE(index < m_PropertiesInfo.size(), AMF_INVALID_ARG); - - PropertyInfoMap::const_iterator found = m_PropertiesInfo.begin(); - for (amf_size i = 0; i < index; i++) - { - found++; - } - - size_t copySize = AMF_MIN(nameSize-1, found->first.length()); - memcpy(name, found->first.c_str(), copySize * sizeof(wchar_t)); - name[copySize] = 0; - AMFLock lock(const_cast(&m_Sync)); - AMFVariantCopy(pValue, &found->second->value); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual amf_size AMF_STD_CALL GetPropertiesInfoCount() const - { - return m_PropertiesInfo.size(); - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetPropertyInfo(amf_size szInd, const AMFPropertyInfo** ppParamInfo) const - { - AMF_RETURN_IF_INVALID_POINTER(ppParamInfo); - AMF_RETURN_IF_FALSE(szInd < m_PropertiesInfo.size(), AMF_INVALID_ARG); - - PropertyInfoMap::const_iterator it = m_PropertiesInfo.begin(); - for (; szInd > 0; --szInd) - { - it++; - } - - *ppParamInfo = it->second.get(); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetPropertyInfo(const wchar_t* name, const AMFPropertyInfo** ppParamInfo) const - { - AMF_RETURN_IF_INVALID_POINTER(name); - AMF_RETURN_IF_INVALID_POINTER(ppParamInfo); - - PropertyInfoMap::const_iterator it = m_PropertiesInfo.find(name); - if (it != m_PropertiesInfo.end()) - { - *ppParamInfo = it->second.get(); - return AMF_OK; - } - - return AMF_NOT_FOUND; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL ValidateProperty(const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated) const - { - AMF_RETURN_IF_INVALID_POINTER(name); - AMF_RETURN_IF_INVALID_POINTER(pOutValidated); - - AMF_RESULT err = AMF_OK; - const AMFPropertyInfo* pParamInfo = NULL; - - AMF_RETURN_IF_FAILED(GetPropertyInfo(name, &pParamInfo), L"Property=%s", name); - AMF_RETURN_IF_FAILED(CastVariantToAMFProperty(pOutValidated, &value, pParamInfo->type, pParamInfo->contentType, pParamInfo->pEnumDescription), L"Property=%s", name); - - switch(pParamInfo->type) - { - case AMF_VARIANT_INT64: - if((pParamInfo->minValue.type != AMF_VARIANT_EMPTY && AMFVariantGetInt64(pOutValidated) < AMFVariantGetInt64(&pParamInfo->minValue)) || - (pParamInfo->maxValue.type != AMF_VARIANT_EMPTY && AMFVariantGetInt64(pOutValidated) > AMFVariantGetInt64(&pParamInfo->maxValue)) ) - { - err = AMF_OUT_OF_RANGE; - } - break; - - case AMF_VARIANT_DOUBLE: - if((AMFVariantGetDouble(pOutValidated) < AMFVariantGetDouble(&pParamInfo->minValue)) || - (AMFVariantGetDouble(pOutValidated) > AMFVariantGetDouble(&pParamInfo->maxValue)) ) - { - err = AMF_OUT_OF_RANGE; - } - break; - case AMF_VARIANT_FLOAT: - if ((AMFVariantGetFloat(pOutValidated) < AMFVariantGetFloat(&pParamInfo->minValue)) || - (AMFVariantGetFloat(pOutValidated) > AMFVariantGetFloat(&pParamInfo->maxValue))) - { - err = AMF_OUT_OF_RANGE; - } - break; - case AMF_VARIANT_RATE: - { - // NOTE: denominator can't be 0 - const AMFRate& validatedSize = AMFVariantGetRate(pOutValidated); - AMFRate minSize = AMFConstructRate(0, 1); - AMFRate maxSize = AMFConstructRate(INT_MAX, INT_MAX); - if (pParamInfo->minValue.type != AMF_VARIANT_EMPTY) - { - minSize = AMFVariantGetRate(&pParamInfo->minValue); - } - if (pParamInfo->maxValue.type != AMF_VARIANT_EMPTY) - { - maxSize = AMFVariantGetRate(&pParamInfo->maxValue); - } - if (validatedSize.num < minSize.num || validatedSize.num > maxSize.num || - validatedSize.den < minSize.den || validatedSize.den > maxSize.den) - { - err = AMF_OUT_OF_RANGE; - } - } - break; - case AMF_VARIANT_SIZE: - { - AMFSize validatedSize = AMFVariantGetSize(pOutValidated); - AMFSize minSize = AMFConstructSize(0, 0); - AMFSize maxSize = AMFConstructSize(INT_MAX, INT_MAX); - if (pParamInfo->minValue.type != AMF_VARIANT_EMPTY) - { - minSize = AMFVariantGetSize(&pParamInfo->minValue); - } - if (pParamInfo->maxValue.type != AMF_VARIANT_EMPTY) - { - maxSize = AMFVariantGetSize(&pParamInfo->maxValue); - } - if (validatedSize.width < minSize.width || validatedSize.height < minSize.height || - validatedSize.width > maxSize.width || validatedSize.height > maxSize.height) - { - err = AMF_OUT_OF_RANGE; - } - } - break; - case AMF_VARIANT_FLOAT_SIZE: - { - AMFFloatSize validatedSize = AMFVariantGetFloatSize(pOutValidated); - AMFFloatSize minSize = AMFConstructFloatSize(0, 0); - AMFFloatSize maxSize = AMFConstructFloatSize(FLT_MIN, FLT_MAX); - if (pParamInfo->minValue.type != AMF_VARIANT_EMPTY) - { - minSize = AMFVariantGetFloatSize(&pParamInfo->minValue); - } - if (pParamInfo->maxValue.type != AMF_VARIANT_EMPTY) - { - maxSize = AMFVariantGetFloatSize(&pParamInfo->maxValue); - } - if (validatedSize.width < minSize.width || validatedSize.height < minSize.height || - validatedSize.width > maxSize.width || validatedSize.height > maxSize.height) - { - err = AMF_OUT_OF_RANGE; - } - } - break; - default: // GK: Clang issues a warning when not every value of an enum is handled in a switch-case - break; - } - return err; - } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL OnPropertyChanged(const wchar_t* /*name*/){ } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL AddObserver(AMFPropertyStorageObserver* pObserver) - { - AMFLock lock(&m_Sync); - AMFObservableImpl::AddObserver(pObserver); - } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL RemoveObserver(AMFPropertyStorageObserver* pObserver) - { - AMFLock lock(&m_Sync); - AMFObservableImpl::RemoveObserver(pObserver); - } - //------------------------------------------------------------------------------------------------- - protected: - //------------------------------------------------------------------------------------------------- - AMF_RESULT SetAccessType(const wchar_t* name, AMF_PROPERTY_ACCESS_TYPE accessType) - { - AMF_RETURN_IF_INVALID_POINTER(name); - - PropertyInfoMap::iterator found = m_PropertiesInfo.find(name); - AMF_RETURN_IF_FALSE(found != m_PropertiesInfo.end(), AMF_NOT_FOUND); - - if (found->second->accessType == accessType) - { - return AMF_OK; - } - - found->second->accessType = accessType; - OnPropertyChanged(name); - NotifyObservers(&AMFPropertyStorageObserver::OnPropertyChanged, name); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - AMF_RESULT SetPrivateProperty(const wchar_t* name, AMFVariantStruct value) - { - AMF_RETURN_IF_INVALID_POINTER(name); - - AMFVariant validatedValue; - AMF_RESULT validateResult = ValidateProperty(name, value, &validatedValue); - if (validateResult != AMF_OK) - { - return validateResult; - } - - PropertyInfoMap::iterator found = m_PropertiesInfo.find(name); - if (found == m_PropertiesInfo.end()) - { - return AMF_NOT_FOUND; - } - { - AMFLock lock(&m_Sync); - - if (found->second->value == validatedValue) - { - return AMF_OK; - } - found->second->value = validatedValue; - } - found->second->OnPropertyChanged(); - OnPropertyChanged(name); - NotifyObservers(&AMFPropertyStorageObserver::OnPropertyChanged, name); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - AMF_RESULT GetPrivateProperty(const wchar_t* name, AMFVariantStruct* pValue) const - { - AMF_RETURN_IF_INVALID_POINTER(name); - AMF_RETURN_IF_INVALID_POINTER(pValue); - - - PropertyInfoMap::const_iterator found = m_PropertiesInfo.find(name); - if (found != m_PropertiesInfo.end()) - { - AMFLock lock(const_cast(&m_Sync)); - AMFVariantCopy(pValue, &found->second->value); - return AMF_OK; - } - - // NOTE: needed for internal components that don't automatically - // expose their properties in the main map... - const AMFPropertyInfo* pParamInfo; - if (GetPropertyInfo(name, &pParamInfo) == AMF_OK) - { - AMFLock lock(const_cast(&m_Sync)); - AMFVariantCopy(pValue, &pParamInfo->defaultValue); - return AMF_OK; - } - - return AMF_NOT_FOUND; - } - //------------------------------------------------------------------------------------------------- - template - AMF_RESULT AMF_STD_CALL SetPrivateProperty(const wchar_t* name, const _T& value) - { - AMF_RESULT err = SetPrivateProperty(name, static_cast(AMFVariant(value))); - return err; - } - //------------------------------------------------------------------------------------------------- - template - AMF_RESULT AMF_STD_CALL GetPrivateProperty(const wchar_t* name, _T* pValue) const - { - AMFVariant var; - AMF_RESULT err = GetPrivateProperty(name, static_cast(&var)); - if(err == AMF_OK) - { - *pValue = static_cast<_T>(var); - } - return err; - } - //------------------------------------------------------------------------------------------------- - bool HasPrivateProperty(const wchar_t* name) const - { - return m_PropertiesInfo.find(name) != m_PropertiesInfo.end(); - } - //------------------------------------------------------------------------------------------------- - bool IsRuntimeChange(const wchar_t* name) const - { - PropertyInfoMap::const_iterator it = m_PropertiesInfo.find(name); - return (it != m_PropertiesInfo.end()) ? it->second->AllowedChangeInRuntime() : false; - } - //------------------------------------------------------------------------------------------------- - void ResetDefaultValues() - { - AMFLock lock(&m_Sync); - // copy defaults to property storage - for (PropertyInfoMap::iterator it = m_PropertiesInfo.begin(); it != m_PropertiesInfo.end(); ++it) - { - AMFPropertyInfoImpl* info = it->second.get(); - - info->value = info->defaultValue; - info->userModified = false; - } - } - //------------------------------------------------------------------------------------------------- - - private: - AMFPropertyStorageExImpl(const AMFPropertyStorageExImpl&); - AMFPropertyStorageExImpl& operator=(const AMFPropertyStorageExImpl&); - }; - extern AMFCriticalSection ms_csAMFPropertyStorageExImplMaps; - //--------------------------------------------------------------------------------------------- - - -#define AMFPrimitivePropertyInfoMapBegin \ - { \ - amf::AMFPropertyInfoImpl* s_PropertiesInfo[] = \ - { - -#define AMFPrimitivePropertyInfoMapEnd \ - }; \ - for (amf_size i = 0; i < sizeof(s_PropertiesInfo) / sizeof(s_PropertiesInfo[0]); ++i) \ - { \ - amf::AMFPropertyInfoImpl* pPropInfo = s_PropertiesInfo[i]; \ - m_PropertiesInfo[pPropInfo->name].reset(pPropInfo); \ - } \ - } - - - #define AMFPropertyInfoBool(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_BOOL, 0, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoEnum(_name, _desc, _defaultValue, pEnumDescription, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_INT64, 0, amf::AMFVariant(amf_int64(_defaultValue)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, pEnumDescription) - - #define AMFPropertyInfoInt64(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_INT64, 0, amf::AMFVariant(amf_int64(_defaultValue)), \ - amf::AMFVariant(amf_int64(_minValue)), amf::AMFVariant(amf_int64(_maxValue)), _AccessType, 0) - - #define AMFPropertyInfoDouble(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_DOUBLE, 0, amf::AMFVariant(amf_double(_defaultValue)), \ - amf::AMFVariant(amf_double(_minValue)), amf::AMFVariant(amf_double(_maxValue)), _AccessType, 0) - - #define AMFPropertyInfoFloat(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_FLOAT, 0, amf::AMFVariant(amf_float(_defaultValue)), \ - amf::AMFVariant(amf_float(_minValue)), amf::AMFVariant(amf_float(_maxValue)), _AccessType, 0) - - - #define AMFPropertyInfoRect(_name, _desc, defaultLeft, defaultTop, defaultRight, defaultBottom, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_RECT, 0, amf::AMFVariant(AMFConstructRect(defaultLeft, defaultTop, defaultRight, defaultBottom)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoPoint(_name, _desc, defaultX, defaultY, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_POINT, 0, amf::AMFVariant(AMFConstructPoint(defaultX, defaultY)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoSize(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_SIZE, 0, amf::AMFVariant(AMFSize(_defaultValue)), \ - amf::AMFVariant(AMFSize(_minValue)), amf::AMFVariant(AMFSize(_maxValue)), _AccessType, 0) - - #define AMFPropertyInfoFloatSize(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_FLOAT_SIZE, 0, amf::AMFVariant(AMFFloatSize(_defaultValue)), \ - amf::AMFVariant(AMFFloatSize(_minValue)), amf::AMFVariant(AMFFloatSize(_maxValue)), _AccessType, 0) - - #define AMFPropertyInfoRate(_name, _desc, defaultNum, defaultDen, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_RATE, 0, amf::AMFVariant(AMFConstructRate(defaultNum, defaultDen)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoRateEx(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_RATE, 0, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(_minValue), amf::AMFVariant(_maxValue), _AccessType, 0) - - #define AMFPropertyInfoRatio(_name, _desc, defaultNum, defaultDen, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_RATIO, 0, amf::AMFVariant(AMFConstructRatio(defaultNum, defaultDen)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoColor(_name, _desc, defaultR, defaultG, defaultB, defaultA, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_COLOR, 0, amf::AMFVariant(AMFConstructColor(defaultR, defaultG, defaultB, defaultA)), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - - #define AMFPropertyInfoString(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_STRING, 0, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoWString(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_WSTRING, 0, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoInterface(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_INTERFACE, 0, amf::AMFVariant(amf::AMFInterfacePtr(_defaultValue)), \ - amf::AMFVariant(amf::AMFInterfacePtr()), amf::AMFVariant(amf::AMFInterfacePtr()), _AccessType, 0) - - - #define AMFPropertyInfoXML(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_STRING, AMF_PROPERTY_CONTENT_XML, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoPath(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_WSTRING, AMF_PROPERTY_CONTENT_FILE_OPEN_PATH, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoSavePath(_name, _desc, _defaultValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_WSTRING, AMF_PROPERTY_CONTENT_FILE_SAVE_PATH, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(), amf::AMFVariant(), _AccessType, 0) - - #define AMFPropertyInfoFloatVector4D(_name, _desc, _defaultValue, _minValue, _maxValue, _AccessType) \ - new amf::AMFPropertyInfoImpl(_name, _desc, amf::AMF_VARIANT_FLOAT_VECTOR4D, 0, amf::AMFVariant(_defaultValue), \ - amf::AMFVariant(_minValue), amf::AMFVariant(_maxValue), _AccessType, 0) - -} // namespace amf - -#endif // #ifndef AMF_PropertyStorageExImpl_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageImpl.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageImpl.h deleted file mode 100644 index d65484f8..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/PropertyStorageImpl.h +++ /dev/null @@ -1,194 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file PropertyStorageImpl.h -/// @brief AMFPropertyStorageImpl header -///------------------------------------------------------------------------- -#ifndef AMF_PropertyStorageImpl_h -#define AMF_PropertyStorageImpl_h -#pragma once - -#include "../include/core/PropertyStorage.h" -#include "Thread.h" -#include "InterfaceImpl.h" -#include "ObservableImpl.h" -#include "TraceAdapter.h" - -namespace amf -{ - //--------------------------------------------------------------------------------------------- - template class AMFPropertyStorageImpl : - public _TBase, - public AMFObservableImpl - { - public: - //------------------------------------------------------------------------------------------------- - AMFPropertyStorageImpl() : m_PropertyValues() - { - } - //------------------------------------------------------------------------------------------------- - virtual ~AMFPropertyStorageImpl() - { - } - //------------------------------------------------------------------------------------------------- - // interface access - AMF_BEGIN_INTERFACE_MAP - AMF_INTERFACE_ENTRY(AMFPropertyStorage) - AMF_END_INTERFACE_MAP - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL SetProperty(const wchar_t* pName, AMFVariantStruct value) - { - AMF_RETURN_IF_INVALID_POINTER(pName); - - m_PropertyValues[pName] = value; - OnPropertyChanged(pName); - NotifyObservers(&AMFPropertyStorageObserver::OnPropertyChanged, pName); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetProperty(const wchar_t* pName, AMFVariantStruct* pValue) const - { - AMF_RETURN_IF_INVALID_POINTER(pName); - AMF_RETURN_IF_INVALID_POINTER(pValue); - - amf_wstring name(pName); - amf_map::const_iterator found = m_PropertyValues.find(name); - if(found != m_PropertyValues.end()) - { - AMFVariantCopy(pValue, &found->second); - return AMF_OK; - } - return AMF_NOT_FOUND; - } - //------------------------------------------------------------------------------------------------- - virtual bool AMF_STD_CALL HasProperty(const wchar_t* pName) const - { - AMF_ASSERT(pName != NULL); - return m_PropertyValues.find(pName) != m_PropertyValues.end(); - } - //------------------------------------------------------------------------------------------------- - virtual amf_size AMF_STD_CALL GetPropertyCount() const - { - return m_PropertyValues.size(); - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL GetPropertyAt(amf_size index, wchar_t* pName, amf_size nameSize, AMFVariantStruct* pValue) const - { - AMF_RETURN_IF_INVALID_POINTER(pName); - AMF_RETURN_IF_INVALID_POINTER(pValue); - AMF_RETURN_IF_FALSE(nameSize != 0, AMF_INVALID_ARG); - amf_map::const_iterator found = m_PropertyValues.begin(); - if(found == m_PropertyValues.end()) - { - return AMF_INVALID_ARG; - } - for( amf_size i = 0; i < index; i++) - { - found++; - if(found == m_PropertyValues.end()) - { - return AMF_INVALID_ARG; - } - } - size_t copySize = AMF_MIN(nameSize-1, found->first.length()); - memcpy(pName, found->first.c_str(), copySize * sizeof(wchar_t)); - pName[copySize] = 0; - AMFVariantCopy(pValue, &found->second); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL Clear() - { - m_PropertyValues.clear(); - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL AddTo(AMFPropertyStorage* pDest, bool overwrite, bool /*deep*/) const - { - AMF_RETURN_IF_INVALID_POINTER(pDest); - AMF_RESULT err = AMF_OK; - amf_map::const_iterator it = m_PropertyValues.begin(); - - for(; it != m_PropertyValues.end(); it++) - { - if(!HasProperty(it->first.c_str())) // ignore properties which aren't accessible - { - continue; - } - - if(!overwrite) - { - if(pDest->HasProperty(it->first.c_str())) - { - continue; - } - } - { - err = pDest->SetProperty(it->first.c_str(), it->second); - } - if(err == AMF_ACCESS_DENIED) - { - continue; - } - AMF_RETURN_IF_FAILED(err, L"AddTo() - failed to copy property=%s", it->first.c_str()); - } - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - virtual AMF_RESULT AMF_STD_CALL CopyTo(AMFPropertyStorage* pDest, bool deep) const - { - AMF_RETURN_IF_INVALID_POINTER(pDest); - if(pDest != this) - { - pDest->Clear(); - return AddTo(pDest, true, deep); - } - else - { - return AMF_OK; - } - } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL OnPropertyChanged(const wchar_t* /*name*/) { } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL AddObserver(AMFPropertyStorageObserver* pObserver) { AMFObservableImpl::AddObserver(pObserver); } - //------------------------------------------------------------------------------------------------- - virtual void AMF_STD_CALL RemoveObserver(AMFPropertyStorageObserver* pObserver) { AMFObservableImpl::RemoveObserver(pObserver); } - //------------------------------------------------------------------------------------------------- - protected: - //------------------------------------------------------------------------------------------------- - amf_map m_PropertyValues; - }; - //--------------------------------------------------------------------------------------------- - //--------------------------------------------------------------------------------------------- -} -#endif // AMF_PropertyStorageImpl_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.cpp deleted file mode 100644 index 429b4dc9..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.cpp +++ /dev/null @@ -1,624 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#if defined(_WIN32) -#include -#else -#include -#endif -#include "Thread.h" - -#if defined(METRO_APP) - #include - #include -#endif - - - -namespace amf -{ - //---------------------------------------------------------------------------- - AMFEvent::AMFEvent(bool bInitiallyOwned, bool bManualReset, const wchar_t* pName) : m_hSyncObject() - { - m_hSyncObject = amf_create_event(bInitiallyOwned, bManualReset, pName); - } - //---------------------------------------------------------------------------- - AMFEvent::~AMFEvent() - { - amf_delete_event(m_hSyncObject); - } - //---------------------------------------------------------------------------- - bool AMFEvent::Lock(amf_ulong ulTimeout) - { - return amf_wait_for_event(m_hSyncObject, ulTimeout); - } - //---------------------------------------------------------------------------- - bool AMFEvent::LockTimeout(amf_ulong ulTimeout) - { - return amf_wait_for_event_timeout(m_hSyncObject, ulTimeout); - } - //---------------------------------------------------------------------------- - bool AMFEvent::Unlock() - { - return true; - } - //---------------------------------------------------------------------------- - bool AMFEvent::SetEvent() - { - return amf_set_event(m_hSyncObject); - } - //---------------------------------------------------------------------------- - bool AMFEvent::ResetEvent() - { - return amf_reset_event(m_hSyncObject); - } - //---------------------------------------------------------------------------- - //---------------------------------------------------------------------------- - AMFMutex::AMFMutex(bool bInitiallyOwned, const wchar_t* pName - #if defined(_WIN32) - , bool bOpenExistent - #endif - ):m_hSyncObject() - { - #if defined(_WIN32) - if(bOpenExistent) - { - m_hSyncObject = amf_open_mutex(pName); - } - else - #else - //#pragma message AMF_TODO("Open mutex!!! missing functionality in Linux!!!") - #endif - { - m_hSyncObject = amf_create_mutex(bInitiallyOwned, pName); - } - } - //---------------------------------------------------------------------------- - AMFMutex::~AMFMutex() - { - if(m_hSyncObject) - { - amf_delete_mutex(m_hSyncObject); - } - } - //---------------------------------------------------------------------------- - bool AMFMutex::Lock(amf_ulong ulTimeout) - { - if(m_hSyncObject) - { - return amf_wait_for_mutex(m_hSyncObject, ulTimeout); - } - else - { - return false; - } - } - //---------------------------------------------------------------------------- - bool AMFMutex::Unlock() - { - if(m_hSyncObject) - { - return amf_release_mutex(m_hSyncObject); - } - else - { - return false; - } - } - //---------------------------------------------------------------------------- - bool AMFMutex::IsValid() - { - return m_hSyncObject != NULL; - } - //---------------------------------------------------------------------------- - //---------------------------------------------------------------------------- - AMFCriticalSection::AMFCriticalSection() : m_Sect() - { - m_Sect = amf_create_critical_section(); - } - //---------------------------------------------------------------------------- - AMFCriticalSection::~AMFCriticalSection() - { - amf_delete_critical_section(m_Sect); - } - //---------------------------------------------------------------------------- - bool AMFCriticalSection::Lock(amf_ulong ulTimeout) - { - return (ulTimeout != AMF_INFINITE) ? amf_wait_critical_section(m_Sect, ulTimeout) - : amf_enter_critical_section(m_Sect); - } - //---------------------------------------------------------------------------- - bool AMFCriticalSection::Unlock() - { - return amf_leave_critical_section(m_Sect); - } - //---------------------------------------------------------------------------- - AMFSemaphore::AMFSemaphore(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName) - : m_hSemaphore(NULL) - { - Create(iInitCount, iMaxCount, pName); - } - //---------------------------------------------------------------------------- - AMFSemaphore::~AMFSemaphore() - { - amf_delete_semaphore(m_hSemaphore); - } - //---------------------------------------------------------------------------- - bool AMFSemaphore::Create(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName) - { - if(m_hSemaphore != NULL) // delete old one - { - amf_delete_semaphore(m_hSemaphore); - m_hSemaphore = NULL; - } - if(iMaxCount > 0) - { - m_hSemaphore = amf_create_semaphore(iInitCount, iMaxCount, pName); - } - return true; - } - //---------------------------------------------------------------------------- - bool AMFSemaphore::Lock(amf_ulong ulTimeout) - { - return amf_wait_for_semaphore(m_hSemaphore, ulTimeout); - } - //---------------------------------------------------------------------------- - bool AMFSemaphore::Unlock() - { - amf_long iOldCount = 0; - return amf_release_semaphore(m_hSemaphore, 1, &iOldCount); - } - //---------------------------------------------------------------------------- - AMFLock::AMFLock(AMFSyncBase* pBase, amf_ulong ulTimeout) - : m_pBase(pBase), - m_bLocked() - { - m_bLocked = Lock(ulTimeout); - } - //---------------------------------------------------------------------------- - AMFLock::~AMFLock() - { - if (IsLocked() == true) - { - Unlock(); - } - } - //---------------------------------------------------------------------------- - bool AMFLock::Lock(amf_ulong ulTimeout) - { - if(m_pBase == NULL) - { - return false; - } - m_bLocked = m_pBase->Lock(ulTimeout); - return m_bLocked; - } - //---------------------------------------------------------------------------- - bool AMFLock::Unlock() - { - if(m_pBase == NULL) - { - return false; - } - const bool unlockSucceeded = m_pBase->Unlock(); - m_bLocked = m_bLocked && (unlockSucceeded == false); - return unlockSucceeded; - } - //---------------------------------------------------------------------------- - bool AMFLock::IsLocked() - { - return m_bLocked; - } - //---------------------------------------------------------------------------- - -#if defined(METRO_APP) - using namespace Platform; - using namespace Windows::Foundation; - using namespace Windows::UI::Xaml; - using namespace Windows::UI::Xaml::Controls; - using namespace Windows::UI::Xaml::Navigation; - class AMFThreadObj - { - Windows::Foundation::IAsyncAction^ m_AsyncAction; - AMFEvent m_StopEvent; - AMFThread* m_pOwner; - public: - AMFThreadObj(AMFThread* owner); - virtual ~AMFThreadObj(); - - virtual bool Start(); - virtual bool RequestStop(); - virtual bool WaitForStop(); - virtual bool StopRequested(); - - // this is executed in the thread and overloaded by implementor - virtual void Run() { m_pOwner->Run(); } - virtual bool Init(){ return m_pOwner->Init(); } - virtual bool Terminate(){ return m_pOwner->Terminate();} - }; - - - AMFThreadObj::AMFThreadObj(AMFThread* owner) - : m_StopEvent(true, true), m_pOwner(owner) - {} - - AMFThreadObj::~AMFThreadObj() - {} - - bool AMFThreadObj::Start() - { - auto workItemDelegate = [this](IAsyncAction ^ workItem) - { - if( !this->Init() ) - { - return; - } - - this->Run(); - this->Terminate(); - - this->m_AsyncAction = nullptr; - if( this->StopRequested() ) - { - this->m_StopEvent.SetEvent(); - } - - }; - - Windows::System::Threading::WorkItemPriority WorkPriority; - WorkPriority = Windows::System::Threading::WorkItemPriority::Normal; - - auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler(workItemDelegate); - m_AsyncAction = Windows::System::Threading::ThreadPool::RunAsync(workItemHandler, WorkPriority); - - return true; - } - - bool AMFThreadObj::RequestStop() - { - if( m_AsyncAction == nullptr ) - { - return true; - } - - m_StopEvent.ResetEvent(); - return true; - } - - bool AMFThreadObj::WaitForStop() - { - if( m_AsyncAction == nullptr ) - { - return true; - } - - return m_StopEvent.Lock(); - } - - bool AMFThreadObj::StopRequested() - { - return !m_StopEvent.Lock(0); - } - bool AMFThreadObj::IsRunning() - { - return m_AsyncAction != nullptr; - } - - void amf::ExitThread() - {} - - //#endif//#if defined(METRO_APP) - //#if defined(_WIN32) -#elif defined(_WIN32) // _WIN32 and METRO_APP defines are not mutually exclusive - class AMFThreadObj - { - AMFThread* m_pOwner; - uintptr_t m_pThread; - AMFEvent m_StopEvent; - AMFCriticalSection m_Lock; - public: - // this is called by owner - AMFThreadObj(AMFThread* owner); - virtual ~AMFThreadObj(); - - virtual bool Start(); - virtual bool RequestStop(); - virtual bool WaitForStop(); - virtual bool StopRequested(); - virtual bool IsRunning(); - - - protected: - static void AMF_CDECL_CALL AMFThreadProc(void* pThis); - - // this is executed in the thread and overloaded by implementor - virtual void Run() - { - m_pOwner->Run(); - } - virtual bool Init() - { - return m_pOwner->Init(); - } - virtual bool Terminate() - { - return m_pOwner->Terminate(); - } - }; - //---------------------------------------------------------------------------- - AMFThreadObj::AMFThreadObj(AMFThread* owner) : - m_pOwner(owner), - m_pThread(uintptr_t(-1)), - m_StopEvent(true, true) - {} - //---------------------------------------------------------------------------- - AMFThreadObj::~AMFThreadObj() - { - // RequestStop(); - // WaitForStop(); - } - //---------------------------------------------------------------------------- - void AMF_CDECL_CALL AMFThreadObj::AMFThreadProc(void* pThis) - { - AMFThreadObj* pT = (AMFThreadObj*)pThis; - if(!pT->Init()) - { - return; - } - pT->Run(); - pT->Terminate(); - - pT->m_pThread = uintptr_t(-1); - if(pT->StopRequested()) - { - pT->m_StopEvent.SetEvent(); // signal to stop that we just finished - } - } - //---------------------------------------------------------------------------- - bool AMFThreadObj::Start() - { - if(m_pThread != (uintptr_t)-1L) - { - return true; - } - AMFLock lock(&m_Lock); - m_pThread = _beginthread(AMFThreadProc, 0, (void* )this); - - return m_pThread != (uintptr_t)-1L; - } - - //---------------------------------------------------------------------------- - bool AMFThreadObj::RequestStop() - { - if(m_pThread == (uintptr_t)-1L) - { - return true; - } - - m_StopEvent.ResetEvent(); - return true; - } - //---------------------------------------------------------------------------- - bool AMFThreadObj::WaitForStop() - { - AMFLock lock(&m_Lock); - if(m_pThread == (uintptr_t)-1L) - { - return true; - } - bool stopped = m_StopEvent.Lock(); - - m_pThread = (uintptr_t)-1L; - return stopped; - } - //---------------------------------------------------------------------------- - bool AMFThreadObj::StopRequested() - { - return !m_StopEvent.Lock(0); - } - bool AMFThreadObj::IsRunning() - { - return m_pThread != (uintptr_t)-1L; - } - //---------------------------------------------------------------------------- - void ExitThread() - { - _endthread(); - } - -#endif //#if defined(_WIN32) -#if defined(__linux) || defined(__APPLE__) - class AMFThreadObj - { - public: - AMFThreadObj(AMFThread* owner); - virtual ~AMFThreadObj(); - - virtual bool Start(); - virtual bool RequestStop(); - virtual bool WaitForStop(); - virtual bool StopRequested(); - virtual bool IsRunning(); - - // this is executed in the thread and overloaded by implementor - virtual void Run() { m_pOwner->Run(); } - virtual bool Init(){ return m_pOwner->Init(); } - virtual bool Terminate(){ return m_pOwner->Terminate();} - - private: - AMFThread* m_pOwner; - pthread_t m_hThread; - bool m_bStopRequested; - bool m_bRunning; - bool m_bInternalRunning; //used to detect thread auto-exit case and make join in Start - AMFCriticalSection m_Lock; - - AMFThreadObj(const AMFThreadObj&); - AMFThreadObj& operator=(const AMFThreadObj&); - static void* AMF_CDECL_CALL AMFThreadProc(void* pThis); - - }; - - AMFThreadObj::AMFThreadObj(AMFThread* owner) - : m_pOwner(owner), - m_bStopRequested(false), - m_bRunning(false), - m_bInternalRunning(false) - { - } - - AMFThreadObj::~AMFThreadObj() - { - RequestStop(); - WaitForStop(); - } - - void* AMF_CDECL_CALL AMFThreadObj::AMFThreadProc(void* pThis) - { - AMFThreadObj* pT = (AMFThreadObj*)pThis; - if(!pT->Init()) - { - return 0; - } - - pT->Run(); - pT->Terminate(); - pT->m_bStopRequested = false; - pT->m_bInternalRunning = false; - return 0; - } - - bool AMFThreadObj::Start() - { - bool result = true; - if(m_bRunning == true && m_bInternalRunning == false) - { - pthread_join(m_hThread, 0); - m_bRunning = false; - m_bStopRequested = false; - } - - if (IsRunning() == false) - { - WaitForStop(); - - AMFLock lock(&m_Lock); - if (pthread_create(&m_hThread, 0, AMFThreadProc, (void*)this) == 0) - { - m_bRunning = true; - m_bInternalRunning = true; - } - else - { - result = false; - } - } - return result; - } - - bool AMFThreadObj::RequestStop() - { - AMFLock lock(&m_Lock); - if (IsRunning() == false) - { - return true; - } - - m_bStopRequested = true; - return true; - } - - bool AMFThreadObj::WaitForStop() - { - AMFLock lock(&m_Lock); - - if (IsRunning() == true) - { - pthread_join(m_hThread, 0); - m_bRunning = false; - } - - m_bStopRequested = false; - return true; - } - - bool AMFThreadObj::StopRequested() - { - return m_bStopRequested; - } - - bool AMFThreadObj::IsRunning() - { - return m_bRunning && m_bInternalRunning; - } - - void ExitThread() - { - pthread_exit(0); - } - -#endif //#if defined(__linux) - - AMFThread::AMFThread() : m_thread() - { - m_thread = new AMFThreadObj(this); - } - - AMFThread::~AMFThread() - { - delete m_thread; - } - - bool AMFThread::Start() - { - return m_thread->Start(); - } - - bool AMFThread::RequestStop() - { - return m_thread->RequestStop(); - } - - bool AMFThread::WaitForStop() - { - return m_thread->WaitForStop(); - } - - bool AMFThread::StopRequested() - { - return m_thread->StopRequested(); - } - bool AMFThread::IsRunning() const - { - return m_thread->IsRunning(); - } -} //namespace diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.h deleted file mode 100644 index 861e28d8..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Thread.h +++ /dev/null @@ -1,721 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Thread_h -#define AMF_Thread_h -#pragma once - -#include -#include -#include - -#include "../include/core/Platform.h" - -#ifndef _WIN32 -#include -#endif - -extern "C" -{ - // threads - #define AMF_INFINITE (0xFFFFFFFF) // Infinite ulTimeout - - // threads: atomic - amf_long AMF_CDECL_CALL amf_atomic_inc(amf_long* X); - amf_long AMF_CDECL_CALL amf_atomic_dec(amf_long* X); - - // threads: critical section - amf_handle AMF_CDECL_CALL amf_create_critical_section(); - bool AMF_CDECL_CALL amf_delete_critical_section(amf_handle cs); - bool AMF_CDECL_CALL amf_enter_critical_section(amf_handle cs); - bool AMF_CDECL_CALL amf_wait_critical_section(amf_handle cs, amf_ulong ulTimeout); - bool AMF_CDECL_CALL amf_leave_critical_section(amf_handle cs); - // threads: event - amf_handle AMF_CDECL_CALL amf_create_event(bool bInitiallyOwned, bool bManualReset, const wchar_t* pName); - bool AMF_CDECL_CALL amf_delete_event(amf_handle hevent); - bool AMF_CDECL_CALL amf_set_event(amf_handle hevent); - bool AMF_CDECL_CALL amf_reset_event(amf_handle hevent); - bool AMF_CDECL_CALL amf_wait_for_event(amf_handle hevent, amf_ulong ulTimeout); - bool AMF_CDECL_CALL amf_wait_for_event_timeout(amf_handle hevent, amf_ulong ulTimeout); - - // threads: mutex - amf_handle AMF_CDECL_CALL amf_create_mutex(bool bInitiallyOwned, const wchar_t* pName); -#if defined(_WIN32) - amf_handle AMF_CDECL_CALL amf_open_mutex(const wchar_t* pName); -#endif - bool AMF_CDECL_CALL amf_delete_mutex(amf_handle hmutex); - bool AMF_CDECL_CALL amf_wait_for_mutex(amf_handle hmutex, amf_ulong ulTimeout); - bool AMF_CDECL_CALL amf_release_mutex(amf_handle hmutex); - - // threads: semaphore - amf_handle AMF_CDECL_CALL amf_create_semaphore(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName); - bool AMF_CDECL_CALL amf_delete_semaphore(amf_handle hsemaphore); - bool AMF_CDECL_CALL amf_wait_for_semaphore(amf_handle hsemaphore, amf_ulong ulTimeout); - bool AMF_CDECL_CALL amf_release_semaphore(amf_handle hsemaphore, amf_long iCount, amf_long* iOldCount); - - // threads: delay - void AMF_CDECL_CALL amf_sleep(amf_ulong delay); - amf_pts AMF_CDECL_CALL amf_high_precision_clock(); // in 100 of nanosec - - void AMF_CDECL_CALL amf_increase_timer_precision(); - void AMF_CDECL_CALL amf_restore_timer_precision(); - - amf_handle AMF_CDECL_CALL amf_load_library(const wchar_t* filename); - amf_handle AMF_CDECL_CALL amf_load_library1(const wchar_t* filename, bool bGlobal); - - void* AMF_CDECL_CALL amf_get_proc_address(amf_handle module, const char* procName); - int AMF_CDECL_CALL amf_free_library(amf_handle module); - -#if defined(__APPLE__) - amf_uint64 AMF_STD_CALL get_current_thread_id(); -#else - amf_uint32 AMF_STD_CALL get_current_thread_id(); -#endif - -#if !defined(METRO_APP) - // virtual memory - void* AMF_CDECL_CALL amf_virtual_alloc(amf_size size); - void AMF_CDECL_CALL amf_virtual_free(void* ptr); -#else - #define amf_virtual_alloc amf_alloc - #define amf_virtual_free amf_free -#endif - - // cpu -#if defined(_WIN32) || (__linux__) - amf_int32 AMF_STD_CALL amf_get_cpu_cores(); -#endif - -} - -namespace amf -{ - //---------------------------------------------------------------- - class AMF_NO_VTABLE AMFSyncBase - { - public: - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE) = 0; - virtual bool Unlock() = 0; - }; - //---------------------------------------------------------------- - class AMFEvent : public AMFSyncBase - { - private: - amf_handle m_hSyncObject; - - AMFEvent(const AMFEvent&); - AMFEvent& operator=(const AMFEvent&); - - public: - AMFEvent(bool bInitiallyOwned = false, bool bManualReset = false, const wchar_t* pName = NULL); - virtual ~AMFEvent(); - - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE); - virtual bool LockTimeout(amf_ulong ulTimeout = AMF_INFINITE); - virtual bool Unlock(); - bool SetEvent(); - bool ResetEvent(); - amf_handle GetNative() { return m_hSyncObject; } - }; - //---------------------------------------------------------------- - class AMFMutex : public AMFSyncBase - { - private: - amf_handle m_hSyncObject; - - AMFMutex(const AMFMutex&); - AMFMutex& operator=(const AMFMutex&); - - public: - AMFMutex(bool bInitiallyOwned = false, const wchar_t* pName = NULL - #if defined(_WIN32) - , bool bOpenExistent = false - #endif - ); - virtual ~AMFMutex(); - - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE); - virtual bool Unlock(); - bool IsValid(); - }; - //---------------------------------------------------------------- - class AMFCriticalSection : public AMFSyncBase - { - private: - amf_handle m_Sect; - - AMFCriticalSection(const AMFCriticalSection&); - AMFCriticalSection& operator=(const AMFCriticalSection&); - - public: - AMFCriticalSection(); - virtual ~AMFCriticalSection(); - - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE); - virtual bool Unlock(); - }; - //---------------------------------------------------------------- - class AMFSemaphore : public AMFSyncBase - { - private: - amf_handle m_hSemaphore; - - AMFSemaphore(const AMFSemaphore&); - AMFSemaphore& operator=(const AMFSemaphore&); - - public: - AMFSemaphore(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName = NULL); - virtual ~AMFSemaphore(); - - virtual bool Create(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName = NULL); - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE); - virtual bool Unlock(); - }; - //---------------------------------------------------------------- - class AMFLock - { - private: - AMFSyncBase* m_pBase; - bool m_bLocked; - - AMFLock(const AMFLock&); - AMFLock& operator=(const AMFLock&); - - public: - AMFLock(AMFSyncBase* pBase, amf_ulong ulTimeout = AMF_INFINITE); - ~AMFLock(); - - bool Lock(amf_ulong ulTimeout = AMF_INFINITE); - bool Unlock(); - bool IsLocked(); - }; - //---------------------------------------------------------------- - class AMFReadWriteSync - { - private: - struct ReadWriteResources - { - // max threads reading concurrently - const int m_maxReadThreads; - AMFSemaphore m_readSemaphore; - AMFCriticalSection m_writeCriticalSection; - ReadWriteResources() : - m_maxReadThreads(10), - m_readSemaphore(m_maxReadThreads, m_maxReadThreads), - m_writeCriticalSection() - { } - }; - class ReadSync : public AMFSyncBase - { - private: - ReadSync(const ReadSync&); - ReadSync& operator=(const ReadSync&); - - ReadWriteResources& m_resources; - public: - ReadSync(ReadWriteResources& resources) : m_resources(resources) - { } - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE) - { - return m_resources.m_readSemaphore.Lock(ulTimeout); - } - virtual bool Unlock() - { - return m_resources.m_readSemaphore.Unlock(); - } - }; - class WriteSync : public AMFSyncBase - { - private: - WriteSync(const WriteSync&); - WriteSync& operator=(const WriteSync&); - - ReadWriteResources& m_resources; - public: - WriteSync(ReadWriteResources& resources) : m_resources(resources) - { } - /// waits passed timeout for other writers; wait readers for infinite - virtual bool Lock(amf_ulong ulTimeout = AMF_INFINITE) - { - if(!m_resources.m_writeCriticalSection.Lock(ulTimeout)) - { - return false; - } - for(int i = 0; i < m_resources.m_maxReadThreads; i++) - { - m_resources.m_readSemaphore.Lock(); - } - return true; - } - virtual bool Unlock() - { - // there is windows function to release N times by one call - could be optimize later - for(int i = 0; i < m_resources.m_maxReadThreads; i++) - { - m_resources.m_readSemaphore.Unlock(); - } - return m_resources.m_writeCriticalSection.Unlock(); - } - }; - private: - ReadWriteResources m_resources; - ReadSync m_readSync; - WriteSync m_writeSync; - public: - AMFReadWriteSync() : - m_resources(), - m_readSync(m_resources), - m_writeSync(m_resources) - { } - - AMFSyncBase* GetReadSync() - { - return &m_readSync; - } - AMFSyncBase* GetWriteSync() - { - return &m_writeSync; - } - }; - //---------------------------------------------------------------- - class AMFThreadObj; - class AMFThread - { - friend class AMFThreadObj; - public: - AMFThread(); - virtual ~AMFThread(); - - virtual bool Start(); - virtual bool RequestStop(); - virtual bool WaitForStop(); - virtual bool StopRequested(); - virtual bool IsRunning() const; - - protected: - // this is executed in the thread and overloaded by implementor - virtual void Run() = 0; - virtual bool Init() - { - return true; - } - virtual bool Terminate() - { - return true; - } - private: - AMFThreadObj* m_thread; - - AMFThread(const AMFThread&); - AMFThread& operator=(const AMFThread&); - }; - - void ExitThread(); - //---------------------------------------------------------------- - template - class AMFQueue - { - protected: - class ItemData - { - public: - T data; - amf_ulong ulID; - amf_long ulPriority; - ItemData() : data(), ulID(), ulPriority(){} - }; - typedef std::list< ItemData > QueueList; - - QueueList m_Queue; - AMFCriticalSection m_cSect; - AMFEvent m_SomethingInQueueEvent; - AMFSemaphore m_QueueSizeSem; - amf_int32 m_iQueueSize; - - bool InternalGet(amf_ulong& ulID, T& item) - { - AMFLock lock(&m_cSect); - if(!m_Queue.empty()) // something to get - { - ItemData& itemdata = m_Queue.front(); - ulID = itemdata.ulID; - item = itemdata.data; - m_Queue.pop_front(); - m_QueueSizeSem.Unlock(); - if(m_Queue.empty()) - { - m_SomethingInQueueEvent.ResetEvent(); - } - return true; - } - return false; - } - public: - AMFQueue(amf_int32 iQueueSize = 0) - : m_Queue(), - m_cSect(), - m_SomethingInQueueEvent(false, false), - m_QueueSizeSem(iQueueSize, iQueueSize > 0 ? iQueueSize + 1 : 0), - m_iQueueSize(iQueueSize) {} - virtual ~AMFQueue(){} - - virtual bool SetQueueSize(amf_int32 iQueueSize) - { - bool success = m_QueueSizeSem.Create(iQueueSize, iQueueSize > 0 ? iQueueSize + 1 : 0); - if(success) - { - m_iQueueSize = iQueueSize; - } - return success; - } - virtual amf_int32 GetQueueSize() - { - return m_iQueueSize; - } - virtual bool Add(amf_ulong ulID, const T& item, amf_long ulPriority = 0, amf_ulong ulTimeout = AMF_INFINITE) - { - if(m_QueueSizeSem.Lock(ulTimeout) == false) - { - return false; - } - { - AMFLock lock(&m_cSect); - - - ItemData itemdata; - itemdata.ulID = ulID; - itemdata.data = item; - itemdata.ulPriority = ulPriority; - - typename QueueList::iterator iter = m_Queue.end(); - - for(; iter != m_Queue.begin(); ) - { - iter--; - if(ulPriority <= (iter->ulPriority)) - { - iter++; - break; - } - } - m_Queue.insert(iter, itemdata); - m_SomethingInQueueEvent.SetEvent(); // this will set all waiting threads - some of them get data, some of them not - } - return true; - } - - virtual bool Get(amf_ulong& ulID, T& item, amf_ulong ulTimeout) - { - if(InternalGet(ulID, item)) // try right away - { - return true; - } - // wait for queue - if(m_SomethingInQueueEvent.Lock(ulTimeout)) - { - return InternalGet(ulID, item); - } - return false; - } - virtual void Clear() - { - bool bValue = true; - while(bValue) - { - amf_ulong ulID; - T item; - bValue = InternalGet(ulID, item); - } - } - virtual amf_size GetSize() - { - AMFLock lock(&m_cSect); - return m_Queue.size(); - } - }; - //---------------------------------------------------------------- - template - class AMFQueueThread : public AMFThread - { - private: - AMFQueueThread(const AMFQueueThread&); - AMFQueueThread& operator=(const AMFQueueThread&); - - protected: - AMFQueue* m_pInQueue; - AMFQueue* m_pOutQueue; - AMFMutex m_mutexInProcess; ///< This mutex shows other threads that the thread function allocates - ///< some objects on stack and it is unsafe state. To manipulate objects owned by descendant classes - ///< client must lock this mutex by calling BlockProcessing member function. When client finished its work - ///< corresponding UnblockProcessing member function call must be done. - - bool m_blockProcessingRequested; - AMFCriticalSection m_csBlockingRequest; - public: - AMFQueueThread(AMFQueue* pInQueue, - AMFQueue* pOutQueue) : m_pInQueue(pInQueue), m_pOutQueue(pOutQueue), m_mutexInProcess(), - m_blockProcessingRequested(false), m_csBlockingRequest() - {} - virtual bool Process(amf_ulong& ulID, inT& inData, outT& outData) = 0; - virtual void BlockProcessing() - { - AMFLock lock(&m_csBlockingRequest); - m_blockProcessingRequested = true; - m_mutexInProcess.Lock(); - } - virtual void UnblockProcessing() - { - AMFLock lock(&m_csBlockingRequest); - m_mutexInProcess.Unlock(); - m_blockProcessingRequested = false; - } - virtual bool IsPaused() - { - return false; - } - virtual void OnHaveOutput() {} - virtual void OnIdle() {} - - virtual void Run() - { - bool bStop = false; - while(!bStop) - { - { - AMFLock lock(&m_mutexInProcess); - inT inData; - amf_ulong ulID = 0; - bool callProcess = true; - if(m_pInQueue != NULL) - { - amf_ulong waitTimeout = 5; - bool validInput = m_pInQueue->Get(ulID, inData, waitTimeout); // Pulse to check Stop from time to time - if(StopRequested()) - { - bStop = true; - } - if(!validInput) - { - callProcess = false; - } - } - if(!bStop && callProcess) - { - outT outData; - bool validOutput = Process(ulID, inData, outData); - if(StopRequested()) - { - bStop = true; - } - if(!bStop && (m_pOutQueue != NULL) && validOutput) - { - m_pOutQueue->Add(ulID, outData); - OnHaveOutput(); - } - } - else - { - OnIdle(); - } - } - if(StopRequested()) - { - bStop = true; - } -#if defined(__linux) || defined(__APPLE__) - ///< HACK - ///< This amf_sleep(0) is required to emulate windows mutex behavior. - ///< In Windows release mutext causes some other waiting thread is receiving ownership of mutex. - ///< In Linux it is not true. - ///< Without sleep AMFLock destructor releases mutex but immediately on next cycle AMFLock constructor tries to lock - ///< the mutex and now system have two threads waiting for the mutex. - ///< Using some random logic system decides who will be unlocked. - ///< This thread may win during several seconds it looks like pipeline is hang. - ///< amf_sleep call causes waiting thread is becoming unlocked. - if(m_blockProcessingRequested) - { - amf_sleep(0); - } -#endif - } - } - }; - //---------------------------------------------------------------- - template - class AMFQueueThreadPipeline - { - private: - AMFQueueThreadPipeline(const AMFQueueThreadPipeline&); - AMFQueueThreadPipeline& operator=(const AMFQueueThreadPipeline&); - - public: - AMFQueue* m_pInQueue; - AMFQueue* m_pOutQueue; - std::vector<_Thread*> m_ThreadPool; - - AMFQueueThreadPipeline(AMFQueue* pInQueue, AMFQueue* pOutQueue) - : m_pInQueue(pInQueue), - m_pOutQueue(pOutQueue), - m_ThreadPool() - {} - virtual ~AMFQueueThreadPipeline() - { - Stop(); - } - void Start(int iNumberOfThreads, ThreadParam param) - { - if((long)m_ThreadPool.size() >= iNumberOfThreads) - { - Stop(); //temporary to remove stopped threads. need callback from thread to clean pool - //return; - } - size_t initialSize = m_ThreadPool.size(); - for(size_t i = initialSize; i < (size_t)iNumberOfThreads; i++) - { - _Thread* pThread = new _Thread(m_pInQueue, m_pOutQueue, param); - m_ThreadPool.push_back(pThread); - pThread->Start(); - } - } - void RequestStop() - { - long num = (long)m_ThreadPool.size(); - for(long i = 0; i < num; i++) - { - m_ThreadPool[i]->RequestStop(); - } - } - void BlockProcessing() - { - long num = (long)m_ThreadPool.size(); - for(long i = 0; i < num; i++) - { - m_ThreadPool[i]->BlockProcessing(); - } - } - void UnblockProcessing() - { - long num = (long)m_ThreadPool.size(); - for(long i = 0; i < num; i++) - { - m_ThreadPool[i]->UnblockProcessing(); - } - } - void WaitForStop() - { - long num = (long)m_ThreadPool.size(); - for(long i = 0; i < num; i++) - { - _Thread* pThread = m_ThreadPool[i]; - pThread->WaitForStop(); - delete pThread; - } - m_ThreadPool.clear(); - } - void Stop() - { - RequestStop(); - WaitForStop(); - } - }; - //---------------------------------------------------------------- - class AMFPreciseWaiter - { - public: - AMFPreciseWaiter() : m_WaitEvent(), m_bCancel(false) - {} - virtual ~AMFPreciseWaiter() - {} - amf_pts Wait(amf_pts waittime) - { - if (waittime < 0) - { - return 0; - } - m_bCancel = false; - amf_pts start = amf_high_precision_clock(); - amf_pts waited = 0; - int count = 0; - while(!m_bCancel) - { - count++; - if(!m_WaitEvent.LockTimeout(1)) - { - break; - } - waited = amf_high_precision_clock() - start; - if(waited >= waittime) - { - break; - } - } - return waited; - } - amf_pts WaitEx(amf_pts waittime) - { - m_bCancel = false; - amf_pts start = amf_high_precision_clock(); - amf_pts waited = 0; - int count = 0; - while (!m_bCancel && waited < waittime) - { - if (waittime - waited < 2 * AMF_SECOND / 1000)// last 2 ms burn CPU for precision - { - for (int i = 0; i < 1000; i++) - { - count++; -#ifdef _WIN32 - YieldProcessor(); -#endif - } - - } - else if (!m_WaitEvent.LockTimeout(1)) - { - break; - } - - waited = amf_high_precision_clock() - start; - } - return waited; - } - void Cancel() - { - m_bCancel = true; - } - protected: - AMFEvent m_WaitEvent; - bool m_bCancel; - }; - //---------------------------------------------------------------- -} // namespace amf -#endif // AMF_Thread_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.cpp deleted file mode 100644 index 03cd0150..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.cpp +++ /dev/null @@ -1,252 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "../include/core/Factory.h" -#include "Thread.h" -#include "TraceAdapter.h" - -#pragma warning(disable: 4251) -#pragma warning(disable: 4996) - -using namespace amf; - -#if defined(AMF_CORE_STATIC) || defined(AMF_RUNTIME) || defined(AMF_LITE) -extern "C" -{ - extern AMF_CORE_LINK AMF_RESULT AMF_CDECL_CALL AMFInit(amf_uint64 version, amf::AMFFactory **ppFactory); -} -#else - #include "AMFFactory.h" -#endif - -//------------------------------------------------------------------------------------------------ -static AMFTrace *s_pTrace = NULL; -//------------------------------------------------------------------------------------------------ -static AMFTrace *GetTrace() -{ - if (s_pTrace == NULL) - { -#if defined(AMF_CORE_STATIC) || defined(AMF_RUNTIME) || defined(AMF_LITE) - AMFFactory *pFactory = NULL; - AMFInit(AMF_FULL_VERSION, &pFactory); - pFactory->GetTrace(&s_pTrace); -#else - s_pTrace = g_AMFFactory.GetTrace(); - if (s_pTrace == nullptr) - { - g_AMFFactory.Init(); // last resort, should not happen - s_pTrace = g_AMFFactory.GetTrace(); - g_AMFFactory.Terminate(); - } -#endif - } - return s_pTrace; -} -//------------------------------------------------------------------------------------------------ -static AMFDebug *s_pDebug = NULL; -//------------------------------------------------------------------------------------------------ -static AMFDebug *GetDebug() -{ - if (s_pDebug == NULL) - { -#if defined(AMF_CORE_STATIC) || defined(AMF_RUNTIME) || defined(AMF_LITE) - AMFFactory *pFactory = NULL; - AMFInit(AMF_FULL_VERSION, &pFactory); - pFactory->GetDebug(&s_pDebug); -#else - s_pDebug = g_AMFFactory.GetDebug(); - if (s_pDebug == nullptr) - { - g_AMFFactory.Init(); // last resort, should not happen - s_pDebug = g_AMFFactory.GetDebug(); - g_AMFFactory.Terminate(); - } -#endif - } - return s_pDebug; -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFSetCustomDebugger(AMFDebug *pDebugger) -{ - s_pDebug = pDebugger; - return AMF_OK; -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFSetCustomTracer(AMFTrace *pTracer) -{ - s_pTrace = pTracer; - return AMF_OK; -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFTraceEnableAsync(bool enable) -{ - return GetTrace()->TraceEnableAsync(enable); -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFTraceFlush() -{ - return GetTrace()->TraceFlush(); -} -//------------------------------------------------------------------------------------------------ -void AMF_CDECL_CALL amf::AMFTraceW(const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope, - amf_int32 countArgs, const wchar_t* format, ...) // if countArgs <= 0 -> no args, formatting could be optimized then -{ - if(countArgs <= 0) - { - GetTrace()->Trace(src_path, line, level, scope, format, NULL); - } - else - { - va_list vl; - va_start(vl, format); - - GetTrace()->Trace(src_path, line, level, scope, format, &vl); - - va_end(vl); - } -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFTraceSetPath(const wchar_t* path) -{ - return GetTrace()->SetPath(path); -} -//------------------------------------------------------------------------------------------------ -AMF_RESULT AMF_CDECL_CALL amf::AMFTraceGetPath(wchar_t* path, amf_size* pSize) -{ - return GetTrace()->GetPath(path, pSize); -} -//------------------------------------------------------------------------------------------------ -bool AMF_CDECL_CALL amf::AMFTraceEnableWriter(const wchar_t* writerID, bool enable) -{ - return GetTrace()->EnableWriter(writerID, enable); -} -//------------------------------------------------------------------------------------------------ -bool AMF_CDECL_CALL amf::AMFTraceWriterEnabled(const wchar_t* writerID) -{ - return GetTrace()->WriterEnabled(writerID); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceSetGlobalLevel(amf_int32 level) -{ - return GetTrace()->SetGlobalLevel(level); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceGetGlobalLevel() -{ - return GetTrace()->GetGlobalLevel(); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceSetWriterLevel(const wchar_t* writerID, amf_int32 level) -{ - return GetTrace()->SetWriterLevel(writerID, level); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceGetWriterLevel(const wchar_t* writerID) -{ - return GetTrace()->GetWriterLevel(writerID); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceSetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope, amf_int32 level) -{ - return GetTrace()->SetWriterLevelForScope(writerID, scope, level); -} -//------------------------------------------------------------------------------------------------ -amf_int32 AMF_CDECL_CALL amf::AMFTraceGetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope) -{ - return GetTrace()->GetWriterLevelForScope(writerID, scope); -} -//------------------------------------------------------------------------------------------------ -void AMF_CDECL_CALL amf::AMFTraceRegisterWriter(const wchar_t* writerID, AMFTraceWriter* pWriter) -{ - GetTrace()->RegisterWriter(writerID, pWriter, true); -} - -void AMF_CDECL_CALL amf::AMFTraceUnregisterWriter(const wchar_t* writerID) -{ - GetTrace()->UnregisterWriter(writerID); -} - -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wexit-time-destructors" - #pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - -void AMF_CDECL_CALL amf::AMFTraceEnterScope() -{ - GetTrace()->Indent(1); -} - -amf_uint32 AMF_CDECL_CALL AMFTraceGetScopeDepth() -{ - return GetTrace()->GetIndentation(); -} - -void AMF_CDECL_CALL amf::AMFTraceExitScope() -{ - GetTrace()->Indent(-1); -} - -void AMF_CDECL_CALL amf::AMFAssertsEnable(bool enable) -{ - GetDebug()->AssertsEnable(enable); -} -bool AMF_CDECL_CALL amf::AMFAssertsEnabled() -{ - return GetDebug()->AssertsEnabled(); -} -amf_wstring AMF_CDECL_CALL amf::AMFFormatResult(AMF_RESULT result) -{ - return amf::amf_string_format(L"AMF_ERROR %d : %s: ", result, GetTrace()->GetResultText(result)); -} - -const wchar_t* AMF_STD_CALL amf::AMFGetResultText(AMF_RESULT res) -{ - return GetTrace()->GetResultText(res); -} -const wchar_t* AMF_STD_CALL amf::AMFSurfaceGetFormatName(const AMF_SURFACE_FORMAT eSurfaceFormat) -{ - return GetTrace()->SurfaceGetFormatName(eSurfaceFormat); -} -AMF_SURFACE_FORMAT AMF_STD_CALL amf::AMFSurfaceGetFormatByName(const wchar_t* pwName) -{ - return GetTrace()->SurfaceGetFormatByName(pwName); -} -const wchar_t* AMF_STD_CALL amf::AMFGetMemoryTypeName(const AMF_MEMORY_TYPE memoryType) -{ - return GetTrace()->GetMemoryTypeName(memoryType); -} - -AMF_MEMORY_TYPE AMF_STD_CALL amf::AMFGetMemoryTypeByName(const wchar_t* name) -{ - return GetTrace()->GetMemoryTypeByName(name); -} diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.h deleted file mode 100644 index ba7474e0..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/TraceAdapter.h +++ /dev/null @@ -1,808 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file TraceAdapter.h -/// @brief AMFTrace interface -///------------------------------------------------------------------------- -#ifndef AMF_TraceAdapter_h -#define AMF_TraceAdapter_h -#pragma once - -#include "../include/core/Debug.h" -#include "../include/core/Trace.h" -#include "../include/core/Result.h" -#include "public/common/AMFFactory.h" -#include "AMFSTL.h" - -#ifndef WIN32 -#include -#endif -#include - -//----------------------------------- -// Visual Studio memory leak report -#if defined(WIN32) && defined(_DEBUG) && defined(CRTDBG) - -#include - -#if !defined(METRO_APP) - -#ifdef _DEBUG -#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) -#define new DEBUG_NEW -#endif -#endif -#endif -//----------------------------------- - -#if defined(_DEBUG) && defined(__linux) -#include -#include -#endif - -namespace amf -{ -/** -******************************************************************************* -* AMFTraceEnableAsync -* -* @brief -* Enable or disable async mode -* -* There are 2 modes trace can work in: -* Synchronous - every Trace call immediately goes to writers: console, windows, file, ... -* Asynchronous - trace message go to thread local queues; separate thread passes them to writes -* Asynchronous mode offers no synchronization between working threads which are writing traces -* and high performance. -* Asynchronous mode is not enabled always as that dedicated thread (started in Media SDK module) cannot be -* terminated safely. See msdn ExitProcess description: it terminates all threads without notifications. -* ExitProcess is called after exit from main() -> before module static variables destroyed and before atexit -* notifiers are called -> no way to finish trace dedicated thread. -* -* Therefore here is direct enable of asynchronous mode. -* AMFTraceEnableAsync(true) increases internal asynchronous counter by 1; AMFTraceEnableAsync(false) decreases by 1 -* when counter becomes > 0 mode - switches to async; when becomes 0 - switches to sync -* -* Tracer must be switched to sync mode before quit application, otherwise async writing thread will be force terminated by OS (at lease Windows) -* See MSDN ExitProcess article for details. -******************************************************************************* -*/ -extern "C" -{ -AMF_RESULT AMF_CDECL_CALL AMFTraceEnableAsync(bool enable); - -/** -******************************************************************************* -* AMFDebugSetDebugger -* -* @brief -* it is used to set a local debugger, or set NULL to remove -* -******************************************************************************* -*/ -AMF_RESULT AMF_CDECL_CALL AMFSetCustomDebugger(AMFDebug *pDebugger); - -/** -******************************************************************************* -* AMFTraceSetTracer -* -* @brief -* it is used to set a local tracer, or set NULL to remove -* -******************************************************************************* -*/ -AMF_RESULT AMF_CDECL_CALL AMFSetCustomTracer(AMFTrace *pTrace); - -/** -******************************************************************************* -* AMFTraceFlush -* -* @brief -* Enforce trace writers flush -* -******************************************************************************* -*/ -AMF_RESULT AMF_CDECL_CALL AMFTraceFlush(); - -/** -******************************************************************************* -* EXPAND -* -* @brief -* Auxilary Macro used to evaluate __VA_ARGS__ from 1 macro argument into list of them -* -* It is needed for COUNT_ARGS macro -* -******************************************************************************* -*/ -#define EXPAND(x) x - -/** -******************************************************************************* -* GET_TENTH_ARG -* -* @brief -* Auxilary Macro for COUNT_ARGS macro -* -******************************************************************************* -*/ -#define GET_TENTH_ARG(a, b, c, d, e, f, g, h, i, j, name, ...) name - -/** -******************************************************************************* -* COUNT_ARGS -* -* @brief -* Macro returns number of arguments actually passed into it -* -* COUNT_ARGS macro works ok for 1..10 arguments -* It is needed to distinguish macro call with optional parameters and without them -******************************************************************************* -*/ -#define COUNT_ARGS(...) EXPAND(GET_TENTH_ARG(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)) - -/** -******************************************************************************* -* AMFTraceW -* -* @brief -* General trace function with all possible parameters -******************************************************************************* -*/ -void AMF_CDECL_CALL AMFTraceW(const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope, - amf_int32 countArgs, const wchar_t* format, ...); - -/** -******************************************************************************* -* AMFTrace -* -* @brief -* Most general macro for trace, incapsulates passing source file and line -******************************************************************************* -*/ -#define AMFTrace(level, scope, /*format, */...) amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, level, scope, COUNT_ARGS(__VA_ARGS__) - 1, __VA_ARGS__) - -/** -******************************************************************************* -* AMFTraceError -* -* @brief -* Shortened macro to trace exactly error. -* -* Similar macroses are: AMFTraceWarning, AMFTraceInfo, AMFTraceDebug -******************************************************************************* -*/ -#define AMFTraceError(scope, /*format, */...) amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, AMF_TRACE_ERROR, scope, COUNT_ARGS(__VA_ARGS__) - 1, __VA_ARGS__) -#define AMFTraceWarning(scope, /*format, */...) amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, AMF_TRACE_WARNING, scope, COUNT_ARGS(__VA_ARGS__) - 1, __VA_ARGS__) -#define AMFTraceInfo(scope, /*format, */...) amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, AMF_TRACE_INFO, scope, COUNT_ARGS(__VA_ARGS__) - 1, __VA_ARGS__) -#define AMFTraceDebug(scope, /*format, */...) amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, AMF_TRACE_DEBUG, scope, COUNT_ARGS(__VA_ARGS__) - 1, __VA_ARGS__) - -/** -******************************************************************************* -* AMFDebugHitEvent -* -* @brief -* Designed to determine how many are specific events take place -******************************************************************************* -*/ -void AMF_CDECL_CALL AMFDebugHitEvent(const wchar_t* scope, const wchar_t* eventName); -/** -******************************************************************************* -* AMFDebugGetEventsCount -* -* @brief -* Designed to acquire counter of events reported by call AMFDebugHitEvent -******************************************************************************* -*/ -amf_int64 AMF_CDECL_CALL AMFDebugGetEventsCount(const wchar_t* scope, const wchar_t* eventName); - -/** -******************************************************************************* -* AMFAssertsEnabled -* -* @brief -* Returns bool values indicating if asserts were enabled or not -******************************************************************************* -*/ -bool AMF_CDECL_CALL AMFAssertsEnabled(); - -/** -******************************************************************************* -* AMFTraceEnterScope -* -* @brief -* Increase trace indentation value by 1 -* -* Indentation value is thread specific -******************************************************************************* -*/ -void AMF_CDECL_CALL AMFTraceEnterScope(); -/** -******************************************************************************* -* AMFTraceExitScope -* -* @brief -* Decrease trace indentation value by 1 -* -* Indentation value is thread specific -******************************************************************************* -*/ -void AMF_CDECL_CALL AMFTraceExitScope(); - -/** -******************************************************************************* -* AMF_FACILITY -* -* @brief -* Default value for AMF_FACILITY, this NULL leads to generate facility from source file name -* -* This AMF_FACILITY could be overloaded locally with #define AMF_FACILITY L"LocalScope" -******************************************************************************* -*/ -static const wchar_t* AMF_FACILITY = NULL; -} //extern "C" - -/** -******************************************************************************* -* AMFDebugBreak -* -* @brief -* Macro for switching to debug of application -******************************************************************************* -*/ -#if defined(_DEBUG) -#if defined(_WIN32) -#define AMFDebugBreak {if(amf::AMFAssertsEnabled()) {__debugbreak();} \ -} //{ } -#elif defined(__linux) -// #define AMFDebugBreak ((void)0) -#define AMFDebugBreak {if(amf::AMFAssertsEnabled() && ptrace(PTRACE_TRACEME, 0, 1, 0) < 0) {raise(SIGTRAP);} \ -}//{ } -#elif defined(__APPLE__) -#define AMFDebugBreak {if(amf::AMFAssertsEnabled()) {assert(0);} \ -} -#endif -#else -#define AMFDebugBreak -#endif - -/** -******************************************************************************* -* __FormatMessage -* -* @brief -* Auxilary function to select from 2 messages and preformat message if any arguments are specified -******************************************************************************* -*/ -inline amf_wstring __FormatMessage(int /*argsCount*/, const wchar_t* expression) -{ - return amf_wstring(expression); // the only expression is provided - return this one -} - -inline amf_wstring __FormatMessage(int argsCount, const wchar_t* /*expression*/, const wchar_t* message, ...) -{ - // this version of __FormatMessage for case when descriptive message is provided with optional args - if(argsCount <= 0) - { - return amf_wstring(message); - } - else - { - va_list arglist; - va_start(arglist, message); - amf_wstring result = amf::amf_string_formatVA(message, arglist); - va_end(arglist); - return result; - } -} - -/** -******************************************************************************* -* AMF_FIRST_VALUE -* -* @brief -* Auxilary macro: extracts first argument from the list -******************************************************************************* -*/ -#define AMF_FIRST_VALUE(x, ...) x - -/** -******************************************************************************* -* AMF_BASE_RETURN -* -* @brief -* Base generic macro: checks expression for success, if failed: trace error, debug break and return an error -* -* return_result is a parameter to return to upper level, could be hard-coded or -* specified exp_res what means pass inner level error -******************************************************************************* -*/ -#define AMF_BASE_RETURN(exp, exp_type, check_func, format_prefix, level, scope, return_result/*(could be exp_res)*/, /* optional message args*/ ...) \ - { \ - exp_type exp_res = (exp_type)(exp); \ - if(!check_func(exp_res)) \ - { \ - amf_wstring message = format_prefix(exp_res) + amf::__FormatMessage(COUNT_ARGS(__VA_ARGS__) - 2, __VA_ARGS__); \ - EXPAND(amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, level, scope, 0, message.c_str()) ); \ - AMFDebugBreak; \ - return return_result; \ - } \ - } - -/** -******************************************************************************* -* AMF_BASE_ASSERT -* -* @brief -* Base generic macro: checks expression for success, if failed: trace error, debug break -******************************************************************************* -*/ -#define AMF_BASE_ASSERT(exp, exp_type, check_func, format_prefix, level, scope, return_result/*(could be exp_res)*/, /*optional message, optional message args*/ ...) \ - { \ - exp_type exp_res = (exp_type)(exp); \ - if(!check_func(exp_res)) \ - { \ - amf_wstring message = format_prefix(exp_res) + amf::__FormatMessage(COUNT_ARGS(__VA_ARGS__) - 2, __VA_ARGS__); \ - EXPAND(amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, level, scope, 0, message.c_str()) ); \ - AMFDebugBreak; \ - } \ - } - -/** -******************************************************************************* -* AMF_BASE_CALL -* -* @brief -* Macro supporting cascade call function returning AMF_RESULT from another -* -* return_result is a parameter to return to upper level, could be hard-coded or -* specified exp_res what means pass inner level error -******************************************************************************* -*/ -#define AMF_BASE_CALL(exp, exp_type, check_func, format_prefix, level, scope, return_result/*(could be exp_res)*/, /*optional message, optional message args*/ ...) \ - { \ - amf_wstring function_name = amf::__FormatMessage(COUNT_ARGS(__VA_ARGS__) - 2, __VA_ARGS__); \ - amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, AMF_TRACE_DEBUG, scope, 0, function_name.c_str()); \ - amf::AMFTraceEnterScope(); \ - exp_type exp_res = (exp_type)(exp); \ - amf::AMFTraceExitScope(); \ - if(!check_func(exp_res)) \ - { \ - amf_wstring message = format_prefix(exp_res) + function_name; \ - EXPAND(amf::AMFTraceW(AMF_UNICODE(__FILE__), __LINE__, level, scope, 0, message.c_str()) ); \ - AMFDebugBreak; \ - return return_result; \ - } \ - } - -/** -******************************************************************************* -* AMFCheckExpression -* -* @brief -* Checks if result succeeds -******************************************************************************* -*/ -inline bool AMFCheckExpression(int result) { return result != 0; } -/** -******************************************************************************* -* AMFFormatAssert -* -* @brief -* Returns default assertion message -******************************************************************************* -*/ -inline amf_wstring AMFFormatAssert(int result) { return result ? amf_wstring() : amf_wstring(L"Assertion failed:"); } - -/** -******************************************************************************* -* AMFOpenCLSucceeded -* -* @brief -* Checks cl_status for success -******************************************************************************* -*/ -inline bool AMFOpenCLSucceeded(int result) { return result == 0; } -/** -******************************************************************************* -* AMFFormatOpenCLError -* -* @brief -* Formats open CL error -******************************************************************************* -*/ -inline amf_wstring AMFFormatOpenCLError(int result) { return amf::amf_string_format(L"OpenCL failed, error = %d:", result); } -/** -******************************************************************************* -* AMFResultIsOK -* -* @brief -* Checks if AMF_RESULT is OK -******************************************************************************* -*/ -inline bool AMFResultIsOK(AMF_RESULT result) { return result == AMF_OK; } -/** -******************************************************************************* -* AMFSucceeded -* -* @brief -* Checks if AMF_RESULT is succeeded -******************************************************************************* -*/ -inline bool AMFSucceeded(AMF_RESULT result) { return result == AMF_OK || result == AMF_REPEAT; } -/** -******************************************************************************* -* AMFFormatResult -* -* @brief -* Formats AMF_RESULT into descriptive string -******************************************************************************* -*/ -amf_wstring AMF_CDECL_CALL AMFFormatResult(AMF_RESULT result); - -/** -******************************************************************************* -* AMFHResultSucceded -* -* @brief -* Checks if HRESULT succeeded -******************************************************************************* -*/ -inline bool AMFHResultSucceded(HRESULT result) { return SUCCEEDED(result); } -/** -******************************************************************************* -* AMFFormatHResult -* -* @brief -* Formats HRESULT into descriptive string -******************************************************************************* -*/ -inline amf_wstring AMFFormatHResult(HRESULT result) { return amf::amf_string_format(L"COM failed, HR = 0x%0X:", result); } - -/** -******************************************************************************* -* AMFVkResultSucceeded -* -* @brief -* Checks if VkResult succeeded -******************************************************************************* -*/ -inline bool AMFVkResultSucceeded(int result) { return result == 0; } - -/** -******************************************************************************* -* AMFFormatVkResult -* -* @brief -* Formats VkResult into descriptive string -******************************************************************************* -*/ -inline amf_wstring AMFFormatVkResult(int result) { return amf::amf_string_format(L"Vulkan failed, VkResult = %d:", result); } - -/** -******************************************************************************* -* AMF_CALL -* -* @brief -* Macro to call AMF_RESULT returning function from AMF_RESULT returning function -* -* It does: -* 1) Trace (level == debug) function name (or message if specified) -* 2) Indent trace -* 3) Call function -* 4) Unindent trace -* 5) Checks its result -* 6) If not OK trace error, switch to debugger (if asserts enabled) and return that error code to upper level -* -* Use cases: -* A) AMF_CALL(Init("Name")); // trace expression itself -* B) AMF_CALL(Init("Name"), L"Initialize resources"); // trace desciptive message -* C) AMF_CALL(Init(name), L"Initialize resources with %s", name); // trace descriptive message with aditional arguments from runtime -******************************************************************************* -*/ -#define AMF_CALL(exp, ... /*optional format, args*/) AMF_BASE_CALL(exp, AMF_RESULT, amf::AMFResultIsOK, amf::AMFFormatResult, AMF_TRACE_ERROR, AMF_FACILITY, exp_res, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* AMF_ASSERT_OK -* -* @brief -* Checks expression == AMF_OK, otherwise trace error and debug break -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define AMF_ASSERT_OK(exp, ... /*optional format, args*/) AMF_BASE_ASSERT(exp, AMF_RESULT, amf::AMFResultIsOK, amf::AMFFormatResult, AMF_TRACE_ERROR, AMF_FACILITY, AMF_FAIL, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* AMF_ASSERT -* -* @brief -* Checks expression != 0, otherwise trace error and debug break -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define AMF_ASSERT(exp, ...) AMF_BASE_ASSERT(exp, int, amf::AMFCheckExpression, amf::AMFFormatAssert, AMF_TRACE_ERROR, AMF_FACILITY, AMF_FAIL, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* AMF_RETURN_IF_FAILED -* -* @brief -* Checks expression != 0, otherwise trace error, debug break and return that error to upper level -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define AMF_RETURN_IF_FAILED(exp, ...) AMF_BASE_RETURN(exp, AMF_RESULT, amf::AMFResultIsOK, amf::AMFFormatResult, AMF_TRACE_ERROR, AMF_FACILITY, exp_res, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* ASSERT_RETURN_IF_CL_FAILED -* -* @brief -* Checks cl error is ok, otherwise trace error, debug break and return that error to upper level -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define ASSERT_RETURN_IF_CL_FAILED(exp, /*optional format, args,*/...) AMF_BASE_RETURN(exp, int, amf::AMFOpenCLSucceeded, amf::AMFFormatOpenCLError, AMF_TRACE_ERROR, AMF_FACILITY, AMF_OPENCL_FAILED, L###exp, ##__VA_ARGS__) -#define AMF_RETURN_IF_CL_FAILED(exp, /*optional format, args,*/...) AMF_BASE_RETURN(exp, int, amf::AMFOpenCLSucceeded, amf::AMFFormatOpenCLError, AMF_TRACE_ERROR, AMF_FACILITY, AMF_OPENCL_FAILED, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* ASSERT_RETURN_IF_HR_FAILED -* -* @brief -* Obsolete macro: Checks HRESULT if succeeded, otherwise trace error, debug break and return specified error to upper level -* -* Other macroses below are also obsolete -******************************************************************************* -*/ -#define ASSERT_RETURN_IF_HR_FAILED(exp, reterr, /*optional format, args,*/...) AMF_BASE_RETURN(exp, HRESULT, amf::AMFHResultSucceded, amf::AMFFormatHResult, AMF_TRACE_ERROR, AMF_FACILITY, reterr, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* ASSERT_RETURN_IF_VK_FAILED -* -* @brief -* Checks VkResult if succeeded, otherwise trace error, debug break and return specified error to upper level -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define ASSERT_RETURN_IF_VK_FAILED(exp, reterr, /*optional format, args,*/...) AMF_BASE_RETURN(exp, int, amf::AMFVkResultSucceeded, amf::AMFFormatVkResult, AMF_TRACE_ERROR, AMF_FACILITY, reterr, L###exp, ##__VA_ARGS__) - - -/** -******************************************************************************* -* AMF_RETURN_IF_FALSE -* -* @brief -* Checks expression != 0, otherwise trace error, debug break and return that error to upper level -* -* Could be used: A) with just expression B) with optinal descriptive message C) message + args for printf -******************************************************************************* -*/ -#define AMF_RETURN_IF_FALSE(exp, ret_value, /*optional message,*/ ...) AMF_BASE_RETURN(exp, int, amf::AMFCheckExpression, amf::AMFFormatAssert, AMF_TRACE_ERROR, AMF_FACILITY, ret_value, L###exp, ##__VA_ARGS__) - -/** -******************************************************************************* -* AMF_RETURN_IF_INVALID_POINTER -* -* @brief -* Checks ptr != NULL, otherwise trace error, debug break and return that error to upper level -* -******************************************************************************* -*/ -#define AMF_RETURN_IF_INVALID_POINTER(ptr, /*optional message,*/ ...) AMF_BASE_RETURN(ptr != NULL, int, amf::AMFCheckExpression, amf::AMFFormatAssert, AMF_TRACE_ERROR, AMF_FACILITY, AMF_INVALID_POINTER, L"invalid pointer : " L###ptr, ##__VA_ARGS__) - -/** -******************************************************************************* -* AMFTestEventObserver -* -* @brief -* Interface to subscribe on test events -******************************************************************************* -*/ - -extern "C" -{ - - /** - ******************************************************************************* - * AMFTraceSetPath - * - * @brief - * Set Trace path - * - * Returns AMF_OK if succeeded - ******************************************************************************* - */ - AMF_RESULT AMF_CDECL_CALL AMFTraceSetPath(const wchar_t* path); - - /** - ******************************************************************************* - * AMFTraceGetPath - * - * @brief - * Get Trace path - * - * Returns AMF_OK if succeeded - ******************************************************************************* - */ - AMF_RESULT AMF_CDECL_CALL AMFTraceGetPath( - wchar_t* path, ///< [out] buffer able to hold *pSize symbols; path is copied there, at least part fitting the buffer, always terminator is copied - amf_size* pSize ///< [in, out] size of buffer, returned needed size of buffer including zero terminator - ); - - /** - ******************************************************************************* - * AMFTraceEnableWriter - * - * @brief - * Disable trace to registered writer - * - * Returns previous state - ******************************************************************************* - */ - bool AMF_CDECL_CALL AMFTraceEnableWriter(const wchar_t* writerID, bool enable); - - /** - ******************************************************************************* - * AMFTraceWriterEnabled - * - * @brief - * Return flag if writer enabled - ******************************************************************************* - */ - bool AMF_CDECL_CALL AMFTraceWriterEnabled(const wchar_t* writerID); - - /** - ******************************************************************************* - * AMFTraceSetGlobalLevel - * - * @brief - * Sets trace level for writer and scope - * - * Returns previous setting - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceSetGlobalLevel(amf_int32 level); - - /** - ******************************************************************************* - * AMFTraceGetGlobalLevel - * - * @brief - * Returns global level - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceGetGlobalLevel(); - - /** - ******************************************************************************* - * AMFTraceSetWriterLevel - * - * @brief - * Sets trace level for writer - * - * Returns previous setting - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceSetWriterLevel(const wchar_t* writerID, amf_int32 level); - - /** - ******************************************************************************* - * AMFTraceGetWriterLevel - * - * @brief - * Gets trace level for writer - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceGetWriterLevel(const wchar_t* writerID); - - /** - ******************************************************************************* - * AMFTraceSetWriterLevelForScope - * - * @brief - * Sets trace level for writer and scope - * - * Returns previous setting - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceSetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope, amf_int32 level); - - /** - ******************************************************************************* - * AMFTraceGetWriterLevelForScope - * - * @brief - * Gets trace level for writer and scope - ******************************************************************************* - */ - amf_int32 AMF_CDECL_CALL AMFTraceGetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope); - - /** - ******************************************************************************* - * AMFTraceRegisterWriter - * - * @brief - * Register custom trace writer - * - ******************************************************************************* - */ - void AMF_CDECL_CALL AMFTraceRegisterWriter(const wchar_t* writerID, AMFTraceWriter* pWriter); - - /** - ******************************************************************************* - * AMFTraceUnregisterWriter - * - * @brief - * Register custom trace writer - * - ******************************************************************************* - */ - void AMF_CDECL_CALL AMFTraceUnregisterWriter(const wchar_t* writerID); - /* - ******************************************************************************* - * AMFAssertsEnable - * - * @brief - * Enable asserts in checks - * - ******************************************************************************* - */ - void AMF_CDECL_CALL AMFAssertsEnable(bool enable); - - /** - ******************************************************************************* - * AMFAssertsEnabled - * - * @brief - * Returns true if asserts in checks enabled - * - ******************************************************************************* - */ - bool AMF_CDECL_CALL AMFAssertsEnabled(); - - const wchar_t* AMF_STD_CALL AMFGetResultText(AMF_RESULT res); - const wchar_t* AMF_STD_CALL AMFSurfaceGetFormatName(const AMF_SURFACE_FORMAT eSurfaceFormat); - AMF_SURFACE_FORMAT AMF_STD_CALL AMFSurfaceGetFormatByName(const wchar_t* pwName); - const wchar_t* AMF_STD_CALL AMFGetMemoryTypeName(const AMF_MEMORY_TYPE memoryType); - AMF_MEMORY_TYPE AMF_STD_CALL AMFGetMemoryTypeByName(const wchar_t* name); -} //extern "C" -} // namespace amf -#endif // AMF_TraceAdapter_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.cpp deleted file mode 100644 index 7fdecf42..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "VirtualMicrophoneAudioInput.h" -#include "public/common/TraceAdapter.h" -#if defined(_WIN32) -//------------------------------------------------------------------------------------------------- -#define AMF_FACILITY L"VirtualMicrophoneAudioInput" - -//------------------------------------------------------------------------------------------------- -VirtualMicrophoneAudioInput::VirtualMicrophoneAudioInput(): - m_pAudioManager (nullptr), - m_pVirtualAudioInput (nullptr) -#ifdef WIN32 - , m_bCoInitializeSucceeded(false) -#endif -{ -} -//------------------------------------------------------------------------------------------------- -VirtualMicrophoneAudioInput::~VirtualMicrophoneAudioInput() -{ -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::Init() -{ - AMF_RESULT res = AMF_FAIL; - -#ifdef WIN32 - HRESULT hr = CoInitialize(nullptr); - m_bCoInitializeSucceeded = SUCCEEDED(hr); - - AMFCreateVirtualAudioManager_Fn pAudioFun = (AMFCreateVirtualAudioManager_Fn)amf_get_proc_address(g_AMFFactory.GetAMFDLLHandle(), AMF_CREATE_VIRTUAL_AUDIO_MANAGER_FUNCTION_NAME); - AMF_RETURN_IF_FALSE(pAudioFun != nullptr, AMF_FAIL, L"AMFCreateVirtualAudioManager() is not availalbe in AMF DLL"); - res = pAudioFun(AMF_FULL_VERSION, nullptr, &m_pAudioManager); - AMF_RETURN_IF_FAILED(res, L"AMFCreateVirtualAudioManager() failed"); -#endif - - if (res == AMF_OK) - { - res = CreateVirtualAudioInput(); - } - if (res != AMF_OK) - { - Terminate(); - } - - - return res; -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::CreateVirtualAudioInput() -{ - AMF_RESULT res = AMF_OK; - res = m_pAudioManager->CreateInput(&m_pVirtualAudioInput); - AMF_RETURN_IF_FAILED(res, L"CreateInput() failed"); - - return AMF_OK; -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::DestroyVirtualAudioInput() -{ - AMF_RESULT res = AMF_OK; - if (nullptr != m_pVirtualAudioInput) - { - m_pVirtualAudioInput.Release(); - } - AMF_RETURN_IF_FAILED(res, L"CreateInput() failed"); - - return AMF_OK; -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::Terminate() -{ - DestroyVirtualAudioInput(); - - if (nullptr != m_pAudioManager) - { - m_pAudioManager.Release(); - } - -#ifdef WIN32 - if (m_bCoInitializeSucceeded) - { - ::CoUninitialize(); - m_bCoInitializeSucceeded = false; - } -#endif - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::EnableInput() -{ - AMF_RESULT res = AMF_OK; - res = m_pVirtualAudioInput->SetStatus(amf::AMF_VAS_CONNECTED); - AMF_RETURN_IF_FAILED(res, L"SetStatus(amf::AMF_VAS_CONNECTED) failed"); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::CheckStatus() -{ - amf::AMF_VIRTUAL_AUDIO_STATUS status = m_pVirtualAudioInput->GetStatus(); - switch (status) - { - case amf::AMF_VAS_UNKNOWN: - AMFTraceInfo(AMF_FACILITY, L"Virtual Audio Input status: UNKNOWN"); - break; - case amf::AMF_VAS_CONNECTED: - AMFTraceInfo(AMF_FACILITY, L"Virtual Audio Input status: CONNECTED"); - break; - case amf::AMF_VAS_DISCONNECTED: - AMFTraceInfo(AMF_FACILITY, L"Virtual Audio Input status: DISCONNECTED"); - break; - } - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::CheckFormat() -{ - AMF_RESULT res = AMF_OK; - amf::AMFVirtualAudioFormat format = {}; - res = m_pVirtualAudioInput->GetFormat(&format); - AMF_RETURN_IF_FAILED(res, L"GetFormat() failed"); - - AMFTraceInfo(AMF_FACILITY, L"Virtual Audio Input format: SampleRate=%d channels=%d sampleSize=%d", format.sampleRate, format.channelCount, format.sampleSize); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::ChangeInputParameters(amf_int64 sampleRate, amf_int64 channelCount, amf_int64 audioFormat) -{ - amf_int32 bytesInSample = 2; - switch (audioFormat) - { - case AMFAF_U8: bytesInSample = 1; break; - case AMFAF_S16: bytesInSample = 2; break; - case AMFAF_S32: bytesInSample = 4; break; - case AMFAF_FLT: bytesInSample = 4; break; - case AMFAF_DBL: bytesInSample = 8; break; - case AMFAF_U8P: bytesInSample = 1; break; - case AMFAF_S16P: bytesInSample = 2; break; - case AMFAF_S32P: bytesInSample = 4; break; - case AMFAF_FLTP: bytesInSample = 4; break; - case AMFAF_DBLP: bytesInSample = 8; break; - } - - amf::AMFVirtualAudioFormat audioformat = { - static_cast(sampleRate & 0xFFFFFFFF), - static_cast(channelCount & 0xFFFFFFFF), - bytesInSample }; - - return ChangeInputParameters(&audioformat); -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::ChangeInputParameters(amf::AMFVirtualAudioFormat* format) -{ - AMF_RESULT res = AMF_OK; - res = m_pVirtualAudioInput->SetFormat(format); - AMF_RETURN_IF_FAILED(res, L"SetFormat() failed"); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::VerifyInputParameters(amf::AMFVirtualAudioFormat* formatVer) -{ - AMF_RESULT res = AMF_OK; - amf::AMFVirtualAudioFormat format = {}; - res = m_pVirtualAudioInput->GetFormat(&format); - AMF_RETURN_IF_FAILED(res, L"GetFormat() failed"); - // AMF_RETURN_IF_FALSE(format.sampleRate == formatVer->sampleRate && format.channelCount == formatVer->channelCount && format.sampleSize == formatVer->sampleSize, AMF_FAIL, L"Formats dont match" ); - if (format.sampleRate == formatVer->sampleRate && format.channelCount == formatVer->channelCount && format.sampleSize == formatVer->sampleSize) - { - return AMF_OK; - } - AMFTraceError(AMF_FACILITY, L"Formats dont match"); - return AMF_FAIL; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::DisableInput() -{ - AMF_RESULT res = AMF_OK; - res = m_pVirtualAudioInput->SetStatus(amf::AMF_VAS_DISCONNECTED); - AMF_RETURN_IF_FAILED(res, L"SetStatus(amf::AMF_VAS_DISCONNECTED) failed"); - return AMF_OK; -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::SubmitInput(amf::AMFAudioBufferPtr pAudioBuffer) -{ - return SubmitData(pAudioBuffer->GetNative(), pAudioBuffer->GetSize()); -} -//------------------------------------------------------------------------------------------------- -AMF_RESULT VirtualMicrophoneAudioInput::SubmitData(const void* data, amf_size sizeInBytes) -{ - AMF_RESULT res = AMF_OK; - if (nullptr != m_pVirtualAudioInput) - { - return m_pVirtualAudioInput->SubmitData(data, sizeInBytes); - } - return res; -} -#endif // #if defined(_WIN32) \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.h deleted file mode 100644 index f59abbe0..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VirtualMicrophoneAudioInput.h +++ /dev/null @@ -1,87 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#if defined(_WIN32) -#include -#if defined(WIN32) -#include -#endif - -#include - -#include "public/include/core/Debug.h" -#include "public/common/TraceAdapter.h" -#include "public/common/AMFFactory.h" -#include "public/common/AMFMath.h" -#include "public/common/Thread.h" -#include "protected/include/components/VirtualAudio.h" -#include "public/common/ByteArray.h" - -using namespace amf; - -class VirtualMicrophoneAudioInput -{ -public: - VirtualMicrophoneAudioInput(); - ~VirtualMicrophoneAudioInput(); - - AMF_RESULT Init(); - AMF_RESULT Terminate(); - - AMF_RESULT EnableInput(); - AMF_RESULT CheckStatus(); - AMF_RESULT CheckFormat(); - AMF_RESULT ChangeInputParameters(amf_int64 sampleRate, - amf_int64 channelCount, - amf_int64 audioFormat); - AMF_RESULT ChangeInputParameters(amf::AMFVirtualAudioFormat* format); - AMF_RESULT VerifyInputParameters(amf::AMFVirtualAudioFormat* format); - AMF_RESULT DisableInput(); - AMF_RESULT SubmitInput(amf::AMFAudioBufferPtr pAudioBuffer); - AMF_RESULT SubmitData(const void* data, amf_size sizeInBytes); - -protected: - amf::AMFVirtualAudioManagerPtr m_pAudioManager; - amf::AMFVirtualAudioInputPtr m_pVirtualAudioInput; - - AMF_RESULT CreateVirtualAudioInput(); - AMF_RESULT DestroyVirtualAudioInput(); - -#ifdef WIN32 - bool m_bCoInitializeSucceeded; -#endif -}; - -typedef std::shared_ptr VirtualMicrophoneAudioInputPtr; -#endif diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.cpp deleted file mode 100644 index ec618a07..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.cpp +++ /dev/null @@ -1,451 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file VulkanImportTable.cpp -/// @brief Vulkan import table -///------------------------------------------------------------------------- -#include "VulkanImportTable.h" -#include "public/common/TraceAdapter.h" -#include "Thread.h" - -using namespace amf; - -//------------------------------------------------------------------------------------------------- - -// -#define GET_DLL_ENTRYPOINT(h, w) w = reinterpret_cast(amf_get_proc_address(h, #w)); if(w==nullptr) \ - { AMFTraceError(L"VulkanImportTable", L"Failed to aquire entrypoint %S", #w); return AMF_FAIL; }; -#define GET_INSTANCE_ENTRYPOINT(i, w) w = reinterpret_cast(vkGetInstanceProcAddr(i, #w)); if(w==nullptr) \ - { AMFTraceError(L"VulkanImportTable", L"Failed to aquire entrypoint %S", #w); return AMF_FAIL; }; -#define GET_INSTANCE_ENTRYPOINT_NORETURN(i, w) w = reinterpret_cast(vkGetInstanceProcAddr(i, #w)); -#define GET_DEVICE_ENTRYPOINT(i, w) w = reinterpret_cast(vkGetDeviceProcAddr(i, #w)); if(w==nullptr) \ - { AMFTraceError(L"VulkanImportTable", L"Failed to aquire entrypoint %S", #w); return AMF_FAIL; }; -#define GET_DEVICE_ENTRYPOINT_NORETURN(i, w) w = reinterpret_cast(vkGetDeviceProcAddr(i, #w)); if(w==nullptr) \ - { AMFTraceDebug(L"VulkanImportTable", L"Failed to aquire entrypoint %S", #w); }; - -VulkanImportTable::VulkanImportTable() : - m_hVulkanDll(nullptr), - vkCreateInstance(nullptr), - vkDestroyInstance(nullptr), - vkEnumeratePhysicalDevices(nullptr), - vkGetPhysicalDeviceFeatures(nullptr), - vkGetPhysicalDeviceFormatProperties(nullptr), - vkGetPhysicalDeviceImageFormatProperties(nullptr), - vkGetPhysicalDeviceProperties(nullptr), - vkGetPhysicalDeviceExternalSemaphoreProperties(nullptr), - vkGetPhysicalDeviceProperties2KHR(nullptr), - vkGetPhysicalDeviceQueueFamilyProperties(nullptr), - vkGetPhysicalDeviceQueueFamilyProperties2(nullptr), - vkGetPhysicalDeviceMemoryProperties(nullptr), - vkGetInstanceProcAddr(nullptr), - vkGetDeviceProcAddr(nullptr), - vkCreateDevice(nullptr), - vkDestroyDevice(nullptr), - vkEnumerateInstanceExtensionProperties(nullptr), - vkEnumerateDeviceExtensionProperties(nullptr), - vkEnumerateInstanceLayerProperties(nullptr), - vkEnumerateDeviceLayerProperties(nullptr), - vkGetDeviceQueue(nullptr), - vkQueueSubmit(nullptr), - vkQueueWaitIdle(nullptr), - vkDeviceWaitIdle(nullptr), - vkAllocateMemory(nullptr), - vkFreeMemory(nullptr), - vkMapMemory(nullptr), - vkUnmapMemory(nullptr), - vkFlushMappedMemoryRanges(nullptr), - vkInvalidateMappedMemoryRanges(nullptr), - vkGetDeviceMemoryCommitment(nullptr), - vkBindBufferMemory(nullptr), - vkBindImageMemory(nullptr), - vkGetBufferMemoryRequirements(nullptr), - vkGetImageMemoryRequirements(nullptr), - vkGetImageSparseMemoryRequirements(nullptr), - vkGetPhysicalDeviceSparseImageFormatProperties(nullptr), - vkQueueBindSparse(nullptr), - vkCreateFence(nullptr), - vkDestroyFence(nullptr), - vkResetFences(nullptr), - vkGetFenceStatus(nullptr), - vkWaitForFences(nullptr), - vkCreateSemaphore(nullptr), - vkDestroySemaphore(nullptr), - vkCreateEvent(nullptr), - vkDestroyEvent(nullptr), - vkGetEventStatus(nullptr), - vkSetEvent(nullptr), - vkResetEvent(nullptr), - vkCreateQueryPool(nullptr), - vkDestroyQueryPool(nullptr), - vkGetQueryPoolResults(nullptr), - vkCreateBuffer(nullptr), - vkDestroyBuffer(nullptr), - vkCreateBufferView(nullptr), - vkDestroyBufferView(nullptr), - vkCreateImage(nullptr), - vkDestroyImage(nullptr), - vkGetImageSubresourceLayout(nullptr), - vkCreateImageView(nullptr), - vkDestroyImageView(nullptr), - vkCreateShaderModule(nullptr), - vkDestroyShaderModule(nullptr), - vkCreatePipelineCache(nullptr), - vkDestroyPipelineCache(nullptr), - vkGetPipelineCacheData(nullptr), - vkMergePipelineCaches(nullptr), - vkCreateGraphicsPipelines(nullptr), - vkCreateComputePipelines(nullptr), - vkDestroyPipeline(nullptr), - vkCreatePipelineLayout(nullptr), - vkDestroyPipelineLayout(nullptr), - vkCreateSampler(nullptr), - vkDestroySampler(nullptr), - vkCreateDescriptorSetLayout(nullptr), - vkDestroyDescriptorSetLayout(nullptr), - vkCreateDescriptorPool(nullptr), - vkDestroyDescriptorPool(nullptr), - vkResetDescriptorPool(nullptr), - vkAllocateDescriptorSets(nullptr), - vkFreeDescriptorSets(nullptr), - vkUpdateDescriptorSets(nullptr), - vkCreateFramebuffer(nullptr), - vkDestroyFramebuffer(nullptr), - vkCreateRenderPass(nullptr), - vkDestroyRenderPass(nullptr), - vkGetRenderAreaGranularity(nullptr), - vkCreateCommandPool(nullptr), - vkDestroyCommandPool(nullptr), - vkResetCommandPool(nullptr), - vkAllocateCommandBuffers(nullptr), - vkFreeCommandBuffers(nullptr), - vkBeginCommandBuffer(nullptr), - vkEndCommandBuffer(nullptr), - vkResetCommandBuffer(nullptr), - vkCmdBindPipeline(nullptr), - vkCmdSetViewport(nullptr), - vkCmdSetScissor(nullptr), - vkCmdSetLineWidth(nullptr), - vkCmdSetDepthBias(nullptr), - vkCmdSetBlendConstants(nullptr), - vkCmdSetDepthBounds(nullptr), - vkCmdSetStencilCompareMask(nullptr), - vkCmdSetStencilWriteMask(nullptr), - vkCmdSetStencilReference(nullptr), - vkCmdBindDescriptorSets(nullptr), - vkCmdBindIndexBuffer(nullptr), - vkCmdBindVertexBuffers(nullptr), - vkCmdDraw(nullptr), - vkCmdDrawIndexed(nullptr), - vkCmdDrawIndirect(nullptr), - vkCmdDrawIndexedIndirect(nullptr), - vkCmdDispatch(nullptr), - vkCmdDispatchIndirect(nullptr), - vkCmdCopyBuffer(nullptr), - vkCmdCopyImage(nullptr), - vkCmdBlitImage(nullptr), - vkCmdCopyBufferToImage(nullptr), - vkCmdCopyImageToBuffer(nullptr), - vkCmdUpdateBuffer(nullptr), - vkCmdFillBuffer(nullptr), - vkCmdClearColorImage(nullptr), - vkCmdClearDepthStencilImage(nullptr), - vkCmdClearAttachments(nullptr), - vkCmdResolveImage(nullptr), - vkCmdSetEvent(nullptr), - vkCmdResetEvent(nullptr), - vkCmdWaitEvents(nullptr), - vkCmdPipelineBarrier(nullptr), - vkCmdBeginQuery(nullptr), - vkCmdEndQuery(nullptr), - vkCmdResetQueryPool(nullptr), - vkCmdWriteTimestamp(nullptr), - vkCmdCopyQueryPoolResults(nullptr), - vkCmdPushConstants(nullptr), - vkCmdBeginRenderPass(nullptr), - vkCmdNextSubpass(nullptr), - vkCmdEndRenderPass(nullptr), - vkCmdExecuteCommands(nullptr), - vkGetPhysicalDeviceFeatures2(nullptr), - vkDestroySurfaceKHR(nullptr), - vkGetPhysicalDeviceSurfaceSupportKHR(nullptr), - vkGetPhysicalDeviceSurfaceCapabilitiesKHR(nullptr), - vkGetPhysicalDeviceSurfaceFormatsKHR(nullptr), - vkGetPhysicalDeviceSurfacePresentModesKHR(nullptr), - vkCreateSwapchainKHR(nullptr), - vkDestroySwapchainKHR(nullptr), - vkGetSwapchainImagesKHR(nullptr), - vkAcquireNextImageKHR(nullptr), - vkQueuePresentKHR(nullptr), -#if defined(__linux) - vkGetMemoryFdKHR(nullptr), - vkImportSemaphoreFdKHR(nullptr), - vkGetSemaphoreFdKHR(nullptr), -#endif -#if defined(VK_USE_PLATFORM_WIN32_KHR) - vkCreateWin32SurfaceKHR(nullptr), -#endif -#if defined(VK_USE_PLATFORM_XLIB_KHR) - vkCreateXlibSurfaceKHR(nullptr), -#endif -#if defined(VK_USE_PLATFORM_ANDROID_KHR) - vkCreateAndroidSurfaceKHR(nullptr), -#endif - vkGetMemoryHostPointerPropertiesEXT(nullptr), - vkCreateDebugReportCallbackEXT(nullptr), - vkDebugReportMessageEXT(nullptr), - vkDestroyDebugReportCallbackEXT(nullptr) -{ -} - -VulkanImportTable::~VulkanImportTable() -{ - if (m_hVulkanDll != nullptr) - { - amf_free_library(m_hVulkanDll); - } - m_hVulkanDll = nullptr; -} - -AMF_RESULT VulkanImportTable::LoadFunctionsTable() -{ - if (m_hVulkanDll != nullptr) - { - return AMF_OK; - } -#if defined(_WIN32) - m_hVulkanDll = amf_load_library(L"vulkan-1.dll"); -#elif defined(__ANDROID__) - m_hVulkanDll = amf_load_library1(L"libvulkan.so", true); -#elif defined(__linux__) - m_hVulkanDll = amf_load_library1(L"libvulkan.so.1", true); -#endif - - if (m_hVulkanDll == nullptr) - { - AMFTraceError(L"VulkanImportTable", L"amf_load_library() failed to load vulkan dll!"); - return AMF_FAIL; - } - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateInstance); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateInstance); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyInstance); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEnumeratePhysicalDevices); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceFeatures); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceFormatProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceImageFormatProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceExternalSemaphoreProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceQueueFamilyProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceQueueFamilyProperties2); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceMemoryProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetInstanceProcAddr); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetDeviceProcAddr); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateDevice); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyDevice); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEnumerateInstanceExtensionProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEnumerateDeviceExtensionProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEnumerateInstanceLayerProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEnumerateDeviceLayerProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetDeviceQueue); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkQueueSubmit); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkQueueWaitIdle); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDeviceWaitIdle); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkAllocateMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkFreeMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkMapMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkUnmapMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkFlushMappedMemoryRanges); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkInvalidateMappedMemoryRanges); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetDeviceMemoryCommitment); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkBindBufferMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkBindImageMemory); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetBufferMemoryRequirements); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetImageMemoryRequirements); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetImageSparseMemoryRequirements); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceSparseImageFormatProperties); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkQueueBindSparse); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateFence); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyFence); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkResetFences); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetFenceStatus); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkWaitForFences); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateSemaphore); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroySemaphore); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetEventStatus); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkSetEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkResetEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateQueryPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyQueryPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetQueryPoolResults); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateBufferView); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyBufferView); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetImageSubresourceLayout); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateImageView); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyImageView); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateShaderModule); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyShaderModule); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreatePipelineCache); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyPipelineCache); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPipelineCacheData); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkMergePipelineCaches); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateGraphicsPipelines); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateComputePipelines); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyPipeline); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreatePipelineLayout); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyPipelineLayout); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateSampler); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroySampler); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateDescriptorSetLayout); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyDescriptorSetLayout); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateDescriptorPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyDescriptorPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkResetDescriptorPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkAllocateDescriptorSets); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkFreeDescriptorSets); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkUpdateDescriptorSets); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateFramebuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyFramebuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateRenderPass); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyRenderPass); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetRenderAreaGranularity); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateCommandPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroyCommandPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkResetCommandPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkAllocateCommandBuffers); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkFreeCommandBuffers); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkBeginCommandBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkEndCommandBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkResetCommandBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBindPipeline); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetViewport); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetScissor); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetLineWidth); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetDepthBias); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetBlendConstants); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetDepthBounds); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetStencilCompareMask); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetStencilWriteMask); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetStencilReference); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBindDescriptorSets); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBindIndexBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBindVertexBuffers); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDraw); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDrawIndexed); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDrawIndirect); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDrawIndexedIndirect); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDispatch); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdDispatchIndirect); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdCopyBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdCopyImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBlitImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdCopyBufferToImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdCopyImageToBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdUpdateBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdFillBuffer); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdClearColorImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdClearDepthStencilImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdClearAttachments); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdResolveImage); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdSetEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdResetEvent); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdWaitEvents); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdPipelineBarrier); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBeginQuery); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdEndQuery); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdResetQueryPool); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdWriteTimestamp); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdCopyQueryPoolResults); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdPushConstants); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdBeginRenderPass); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdNextSubpass); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdEndRenderPass); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCmdExecuteCommands); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceFeatures2); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceSurfaceSupportKHR); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceSurfaceCapabilitiesKHR); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceSurfaceFormatsKHR); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetPhysicalDeviceSurfacePresentModesKHR); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkDestroySurfaceKHR); - -#if defined(VK_USE_PLATFORM_XLIB_KHR) - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateXlibSurfaceKHR); -#endif -#if defined(VK_USE_PLATFORM_ANDROID_KHR) - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateAndroidSurfaceKHR); - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkGetAndroidHardwareBufferPropertiesANDROID); -#endif - return AMF_OK; -} - -AMF_RESULT VulkanImportTable::LoadInstanceFunctionsTableExt(VkInstance instance, bool bDebug) -{ - GET_INSTANCE_ENTRYPOINT(instance, vkGetPhysicalDeviceProperties2KHR); - - if(bDebug) - { - GET_INSTANCE_ENTRYPOINT(instance, vkCreateDebugReportCallbackEXT); - GET_INSTANCE_ENTRYPOINT(instance, vkDebugReportMessageEXT); - GET_INSTANCE_ENTRYPOINT(instance, vkDestroyDebugReportCallbackEXT); - } - return AMF_OK; -} - -//------------------------------------------------------------------------------------------------- -AMF_RESULT VulkanImportTable::LoadDeviceFunctionsTableExt(VkDevice device) -{ - GET_DEVICE_ENTRYPOINT(device, vkCreateSwapchainKHR); - GET_DEVICE_ENTRYPOINT(device, vkDestroySwapchainKHR); - GET_DEVICE_ENTRYPOINT(device, vkGetSwapchainImagesKHR); - GET_DEVICE_ENTRYPOINT(device, vkAcquireNextImageKHR); - GET_DEVICE_ENTRYPOINT(device, vkQueuePresentKHR); -#if defined(VK_USE_PLATFORM_WIN32_KHR) - GET_DLL_ENTRYPOINT(m_hVulkanDll, vkCreateWin32SurfaceKHR); -#endif - -#if defined(__linux) - GET_DEVICE_ENTRYPOINT(device, vkGetMemoryFdKHR); - GET_DEVICE_ENTRYPOINT(device, vkImportSemaphoreFdKHR); - GET_DEVICE_ENTRYPOINT(device, vkGetSemaphoreFdKHR); -#endif - GET_DEVICE_ENTRYPOINT_NORETURN(device, vkGetMemoryHostPointerPropertiesEXT); //< requires VK_EXT_external_memory_host - - return AMF_OK; -} - -#undef GET_DEVICE_ENTRYPOINT -#undef GET_INSTANCE_ENTRYPOINT -#undef GET_INSTANCE_ENTRYPOINT_NORETURN diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.h deleted file mode 100644 index eb4da96a..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/VulkanImportTable.h +++ /dev/null @@ -1,246 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -///------------------------------------------------------------------------- -/// @file VulkanImportTable.h -/// @brief Vulkan import table -///------------------------------------------------------------------------- -#pragma once - -#include "../include/core/Result.h" - -#define VK_NO_PROTOTYPES -#ifdef _WIN32 - #define VK_USE_PLATFORM_WIN32_KHR -#elif defined(__ANDROID__) - #define VK_USE_PLATFORM_ANDROID_KHR -#elif defined(__linux) - #if !defined(AMF_DISABLE_VK_USE_PLATFORM_XLIB_KHR) - #define VK_USE_PLATFORM_XLIB_KHR - #endif -#endif - -#include "public/include/core/VulkanAMF.h" -#if defined(VK_USE_PLATFORM_ANDROID_KHR) - #include "vulkan/vulkan_android.h" -#endif - - -//#define ENABLE_VALIDATION - -struct VulkanImportTable -{ - VulkanImportTable(); - ~VulkanImportTable(); - - AMF_RESULT LoadFunctionsTable(); - AMF_RESULT LoadInstanceFunctionsTableExt(VkInstance instance, bool bDebug); - AMF_RESULT LoadDeviceFunctionsTableExt(VkDevice device); - // core Vulkan - - PFN_vkCreateInstance vkCreateInstance; - PFN_vkDestroyInstance vkDestroyInstance; - PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; - PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; - PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; - PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; - PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; - PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2; - PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; - PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; - PFN_vkCreateDevice vkCreateDevice; - PFN_vkDestroyDevice vkDestroyDevice; - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; - PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; - PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; - PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; - PFN_vkGetDeviceQueue vkGetDeviceQueue; - PFN_vkQueueSubmit vkQueueSubmit; - PFN_vkQueueWaitIdle vkQueueWaitIdle; - PFN_vkDeviceWaitIdle vkDeviceWaitIdle; - PFN_vkAllocateMemory vkAllocateMemory; - PFN_vkFreeMemory vkFreeMemory; - PFN_vkMapMemory vkMapMemory; - PFN_vkUnmapMemory vkUnmapMemory; - PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; - PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; - PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; - PFN_vkBindBufferMemory vkBindBufferMemory; - PFN_vkBindImageMemory vkBindImageMemory; - PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; - PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; - PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties; - PFN_vkQueueBindSparse vkQueueBindSparse; - PFN_vkCreateFence vkCreateFence; - PFN_vkDestroyFence vkDestroyFence; - PFN_vkResetFences vkResetFences; - PFN_vkGetFenceStatus vkGetFenceStatus; - PFN_vkWaitForFences vkWaitForFences; - PFN_vkCreateSemaphore vkCreateSemaphore; - PFN_vkDestroySemaphore vkDestroySemaphore; - PFN_vkCreateEvent vkCreateEvent; - PFN_vkDestroyEvent vkDestroyEvent; - PFN_vkGetEventStatus vkGetEventStatus; - PFN_vkSetEvent vkSetEvent; - PFN_vkResetEvent vkResetEvent; - PFN_vkCreateQueryPool vkCreateQueryPool; - PFN_vkDestroyQueryPool vkDestroyQueryPool; - PFN_vkGetQueryPoolResults vkGetQueryPoolResults; - PFN_vkCreateBuffer vkCreateBuffer; - PFN_vkDestroyBuffer vkDestroyBuffer; - PFN_vkCreateBufferView vkCreateBufferView; - PFN_vkDestroyBufferView vkDestroyBufferView; - PFN_vkCreateImage vkCreateImage; - PFN_vkDestroyImage vkDestroyImage; - PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; - PFN_vkCreateImageView vkCreateImageView; - PFN_vkDestroyImageView vkDestroyImageView; - PFN_vkCreateShaderModule vkCreateShaderModule; - PFN_vkDestroyShaderModule vkDestroyShaderModule; - PFN_vkCreatePipelineCache vkCreatePipelineCache; - PFN_vkDestroyPipelineCache vkDestroyPipelineCache; - PFN_vkGetPipelineCacheData vkGetPipelineCacheData; - PFN_vkMergePipelineCaches vkMergePipelineCaches; - PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines; - PFN_vkCreateComputePipelines vkCreateComputePipelines; - PFN_vkDestroyPipeline vkDestroyPipeline; - PFN_vkCreatePipelineLayout vkCreatePipelineLayout; - PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; - PFN_vkCreateSampler vkCreateSampler; - PFN_vkDestroySampler vkDestroySampler; - PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; - PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; - PFN_vkCreateDescriptorPool vkCreateDescriptorPool; - PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; - PFN_vkResetDescriptorPool vkResetDescriptorPool; - PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; - PFN_vkFreeDescriptorSets vkFreeDescriptorSets; - PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; - PFN_vkCreateFramebuffer vkCreateFramebuffer; - PFN_vkDestroyFramebuffer vkDestroyFramebuffer; - PFN_vkCreateRenderPass vkCreateRenderPass; - PFN_vkDestroyRenderPass vkDestroyRenderPass; - PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity; - PFN_vkCreateCommandPool vkCreateCommandPool; - PFN_vkDestroyCommandPool vkDestroyCommandPool; - PFN_vkResetCommandPool vkResetCommandPool; - PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; - PFN_vkFreeCommandBuffers vkFreeCommandBuffers; - PFN_vkBeginCommandBuffer vkBeginCommandBuffer; - PFN_vkEndCommandBuffer vkEndCommandBuffer; - PFN_vkResetCommandBuffer vkResetCommandBuffer; - PFN_vkCmdBindPipeline vkCmdBindPipeline; - PFN_vkCmdSetViewport vkCmdSetViewport; - PFN_vkCmdSetScissor vkCmdSetScissor; - PFN_vkCmdSetLineWidth vkCmdSetLineWidth; - PFN_vkCmdSetDepthBias vkCmdSetDepthBias; - PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants; - PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds; - PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask; - PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask; - PFN_vkCmdSetStencilReference vkCmdSetStencilReference; - PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; - PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; - PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; - PFN_vkCmdDraw vkCmdDraw; - PFN_vkCmdDrawIndexed vkCmdDrawIndexed; - PFN_vkCmdDrawIndirect vkCmdDrawIndirect; - PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect; - PFN_vkCmdDispatch vkCmdDispatch; - PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; - PFN_vkCmdCopyBuffer vkCmdCopyBuffer; - PFN_vkCmdCopyImage vkCmdCopyImage; - PFN_vkCmdBlitImage vkCmdBlitImage; - PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; - PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; - PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; - PFN_vkCmdFillBuffer vkCmdFillBuffer; - PFN_vkCmdClearColorImage vkCmdClearColorImage; - PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage; - PFN_vkCmdClearAttachments vkCmdClearAttachments; - PFN_vkCmdResolveImage vkCmdResolveImage; - PFN_vkCmdSetEvent vkCmdSetEvent; - PFN_vkCmdResetEvent vkCmdResetEvent; - PFN_vkCmdWaitEvents vkCmdWaitEvents; - PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; - PFN_vkCmdBeginQuery vkCmdBeginQuery; - PFN_vkCmdEndQuery vkCmdEndQuery; - PFN_vkCmdResetQueryPool vkCmdResetQueryPool; - PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; - PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; - PFN_vkCmdPushConstants vkCmdPushConstants; - PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; - PFN_vkCmdNextSubpass vkCmdNextSubpass; - PFN_vkCmdEndRenderPass vkCmdEndRenderPass; - PFN_vkCmdExecuteCommands vkCmdExecuteCommands; - PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; - - // public extensions - PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; - - PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; - PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; - PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; - PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; - PFN_vkQueuePresentKHR vkQueuePresentKHR; -#ifdef __linux - PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR; - PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR; - PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR; -#endif - - -#if defined(VK_USE_PLATFORM_WIN32_KHR) - PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR; -#endif -#if defined(VK_USE_PLATFORM_XLIB_KHR) - PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR; -#endif -#if defined(VK_USE_PLATFORM_ANDROID_KHR) - PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; - PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; -#endif - PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; - - PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; - PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT; - PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; - amf_handle m_hVulkanDll; -}; diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/ThreadWindows.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/ThreadWindows.cpp deleted file mode 100644 index ccc6f7b2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/ThreadWindows.cpp +++ /dev/null @@ -1,462 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - - -#include "../Thread.h" - -#ifdef _WIN32 - -#include -#include -#include -//---------------------------------------------------------------------------------------- -// threading -//---------------------------------------------------------------------------------------- -amf_long AMF_CDECL_CALL amf_atomic_inc(amf_long* X) -{ - return InterlockedIncrement((long*)X); -} -//---------------------------------------------------------------------------------------- -amf_long AMF_CDECL_CALL amf_atomic_dec(amf_long* X) -{ - return InterlockedDecrement((long*)X); -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_create_critical_section() -{ - CRITICAL_SECTION* cs = new CRITICAL_SECTION; -#if defined(METRO_APP) - ::InitializeCriticalSectionEx(cs, 0, CRITICAL_SECTION_NO_DEBUG_INFO); -#else - ::InitializeCriticalSection(cs); -#endif - return (amf_handle)cs; // in Win32 - no errors -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_delete_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - ::DeleteCriticalSection((CRITICAL_SECTION*)cs); - delete (CRITICAL_SECTION*)cs; - return true; // in Win32 - no errors -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_enter_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - ::EnterCriticalSection((CRITICAL_SECTION*)cs); - return true; // in Win32 - no errors -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_critical_section(amf_handle cs, amf_ulong ulTimeout) -{ - if(cs == NULL) - { - return false; - } - while (true) - { - const BOOL success = ::TryEnterCriticalSection((CRITICAL_SECTION*)cs); - if (success == TRUE) - { - return true; // in Win32 - no errors - } - if (ulTimeout == 0) - { - return false; - } - - amf_sleep(1); - ulTimeout--; - } - - return false; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_leave_critical_section(amf_handle cs) -{ - if(cs == NULL) - { - return false; - } - ::LeaveCriticalSection((CRITICAL_SECTION*)cs); - return true; // in Win32 - no errors -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_create_event(bool bInitiallyOwned, bool bManualReset, const wchar_t* pName) -{ -#if defined(METRO_APP) - DWORD flags = ((bManualReset) ? CREATE_EVENT_MANUAL_RESET : 0) | - ((bInitiallyOwned) ? CREATE_EVENT_INITIAL_SET : 0); - - return ::CreateEventEx(NULL, pName, flags, STANDARD_RIGHTS_ALL | EVENT_MODIFY_STATE); - -#else - return ::CreateEventW(NULL, bManualReset == true, bInitiallyOwned == true, pName); - -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_delete_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - return ::CloseHandle(hevent) != FALSE; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_set_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - return ::SetEvent(hevent) != FALSE; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_reset_event(amf_handle hevent) -{ - if(hevent == NULL) - { - return false; - } - return ::ResetEvent(hevent) != FALSE; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_for_event(amf_handle hevent, amf_ulong ulTimeout) -{ - if(hevent == NULL) - { - return false; - } -#if defined(METRO_APP) - return ::WaitForSingleObjectEx(hevent, ulTimeout, FALSE) == WAIT_OBJECT_0; - -#else - return ::WaitForSingleObject(hevent, ulTimeout) == WAIT_OBJECT_0; - -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_for_event_timeout(amf_handle hevent, amf_ulong ulTimeout) -{ - if(hevent == NULL) - { - return false; - } - DWORD ret; -#if defined(METRO_APP) - ret = ::WaitForSingleObjectEx(hevent, ulTimeout, FALSE); -#else - ret = ::WaitForSingleObject(hevent, ulTimeout); -#endif - return ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT; -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_create_mutex(bool bInitiallyOwned, const wchar_t* pName) -{ -#if defined(METRO_APP) - DWORD flags = (bInitiallyOwned) ? CREATE_MUTEX_INITIAL_OWNER : 0; - return ::CreateMutexEx(NULL, pName, flags, STANDARD_RIGHTS_ALL); - -#else - return ::CreateMutexW(NULL, bInitiallyOwned == true, pName); - -#endif -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_open_mutex(const wchar_t* pName) -{ - return ::OpenMutexW(MUTEX_ALL_ACCESS, FALSE, pName); -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_delete_mutex(amf_handle hmutex) -{ - if(hmutex == NULL) - { - return false; - } - return ::CloseHandle(hmutex) != FALSE; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_for_mutex(amf_handle hmutex, amf_ulong ulTimeout) -{ - if(hmutex == NULL) - { - return false; - } -#if defined(METRO_APP) - return ::WaitForSingleObjectEx(hmutex, ulTimeout, FALSE) == WAIT_OBJECT_0; - -#else - return ::WaitForSingleObject(hmutex, ulTimeout) == WAIT_OBJECT_0; - -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_release_mutex(amf_handle hmutex) -{ - if(hmutex == NULL) - { - return false; - } - return ::ReleaseMutex(hmutex) != FALSE; -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_create_semaphore(amf_long iInitCount, amf_long iMaxCount, const wchar_t* pName) -{ - if(iMaxCount == NULL || iInitCount > iMaxCount) - { - return NULL; - } -#if defined(METRO_APP) - return ::CreateSemaphoreEx(NULL, iInitCount, iMaxCount, pName, 0, STANDARD_RIGHTS_ALL | SEMAPHORE_MODIFY_STATE); - -#else - return ::CreateSemaphoreW(NULL, iInitCount, iMaxCount, pName); - -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_delete_semaphore(amf_handle hsemaphore) -{ - if(hsemaphore == NULL) - { - return false; - } - return ::CloseHandle(hsemaphore) != FALSE; -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_wait_for_semaphore(amf_handle hsemaphore, amf_ulong timeout) -{ - if(hsemaphore == NULL) - { - return true; - } -#if defined(METRO_APP) - return ::WaitForSingleObjectEx(hsemaphore, timeout, false) == WAIT_OBJECT_0; - -#else - return ::WaitForSingleObject(hsemaphore, timeout) == WAIT_OBJECT_0; - -#endif -} -//---------------------------------------------------------------------------------------- -bool AMF_CDECL_CALL amf_release_semaphore(amf_handle hsemaphore, amf_long iCount, amf_long* iOldCount) -{ - if(hsemaphore == NULL) - { - return false; - } - return ::ReleaseSemaphore(hsemaphore, iCount, iOldCount) != FALSE; -} -//------------------------------------------------------------------------------ -void AMF_CDECL_CALL amf_sleep(amf_ulong delay) -{ -#if defined(METRO_APP) - Concurrency::wait(delay); -#else - Sleep(delay); -#endif -} -//---------------------------------------------------------------------------------------- -amf_pts AMF_CDECL_CALL amf_high_precision_clock() -{ - static int state = 0; - static LARGE_INTEGER Frequency; - static LARGE_INTEGER StartCount; - static amf_pts offset = 0; - - if(state == 0) - { - if(QueryPerformanceFrequency(&Frequency)) - { - state = 1; - QueryPerformanceCounter(&StartCount); - } - else - { - state = 2; - } - } - if(state == 1) - { - LARGE_INTEGER PerformanceCount; - if(QueryPerformanceCounter(&PerformanceCount)) - { - amf_pts elapsed = static_cast((PerformanceCount.QuadPart - StartCount.QuadPart) * 10000000LL / Frequency.QuadPart); - - // periodically reset StartCount in order to avoid overflow - if (elapsed > (3600LL * AMF_SECOND)) - { - offset += elapsed; - StartCount = PerformanceCount; - - return offset; - } - else - { - return offset + elapsed; - } - } - } -#if defined(METRO_APP) - return GetTickCount64() * 10; - -#else - return GetTickCount() * 10; - -#endif -} -//------------------------------------------------------------------------------------------------- -#pragma comment (lib, "Winmm.lib") -static amf_uint32 timerPrecision = 1; - -void AMF_CDECL_CALL amf_increase_timer_precision() -{ -#if !defined(METRO_APP) - while (timeBeginPeriod(timerPrecision) == TIMERR_NOCANDO) - { - ++timerPrecision; - } -/* - typedef NTSTATUS (CALLBACK * NTSETTIMERRESOLUTION)(IN ULONG DesiredTime,IN BOOLEAN SetResolution,OUT PULONG ActualTime); - typedef NTSTATUS (CALLBACK * NTQUERYTIMERRESOLUTION)(OUT PULONG MaximumTime,OUT PULONG MinimumTime,OUT PULONG CurrentTime); - - HINSTANCE hNtDll = LoadLibrary(L"NTDLL.dll"); - if(hNtDll != NULL) - { - ULONG MinimumResolution=0; - ULONG MaximumResolution=0; - ULONG ActualResolution=0; - - NTQUERYTIMERRESOLUTION NtQueryTimerResolution = (NTQUERYTIMERRESOLUTION)GetProcAddress(hNtDll, "NtQueryTimerResolution"); - NTSETTIMERRESOLUTION NtSetTimerResolution = (NTSETTIMERRESOLUTION)GetProcAddress(hNtDll, "NtSetTimerResolution"); - - if(NtQueryTimerResolution != NULL && NtSetTimerResolution != NULL) - { - NtQueryTimerResolution (&MinimumResolution, &MaximumResolution, &ActualResolution); - if(MaximumResolution != 0) - { - NtSetTimerResolution (MaximumResolution, TRUE, &ActualResolution); - NtQueryTimerResolution (&MinimumResolution, &MaximumResolution, &ActualResolution); - - // if call NtQueryTimerResolution() again it will return the same values but precision is actually increased - } - } - FreeLibrary(hNtDll); - } -*/ -#endif -} -void AMF_CDECL_CALL amf_restore_timer_precision() -{ -#if !defined(METRO_APP) - timeEndPeriod(timerPrecision); -#endif -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_load_library1(const wchar_t* filename, bool /*bGlobal*/) -{ - return amf_load_library(filename); -} -//---------------------------------------------------------------------------------------- -amf_handle AMF_CDECL_CALL amf_load_library(const wchar_t* filename) -{ -#if defined(METRO_APP) - return LoadPackagedLibrary(filename, 0); -#else - return ::LoadLibraryExW(filename, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32 | LOAD_LIBRARY_SEARCH_USER_DIRS); -#endif -} -//---------------------------------------------------------------------------------------- -void* AMF_CDECL_CALL amf_get_proc_address(amf_handle module, const char* procName) -{ - return (void*)::GetProcAddress((HMODULE)module, procName); -} -//---------------------------------------------------------------------------------------- -int AMF_CDECL_CALL amf_free_library(amf_handle module) -{ - return ::FreeLibrary((HMODULE)module)==TRUE; -} -#if !defined(METRO_APP) -//---------------------------------------------------------------------------------------- -// memory -//---------------------------------------------------------------------------------------- -void* AMF_CDECL_CALL amf_virtual_alloc(size_t size) -{ - return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); -} -//---------------------------------------------------------------------------------------- -void AMF_CDECL_CALL amf_virtual_free(void* ptr) -{ - VirtualFree(ptr, NULL, MEM_RELEASE); -} -#endif //#if !defined(METRO_APP) -//---------------------------------------------------------------------------------------- -// cpu -//---------------------------------------------------------------------------------------- -amf_int32 AMF_STD_CALL amf_get_cpu_cores() -{ - //query the number of CPU HW cores - DWORD len = 0; - GetLogicalProcessorInformation(NULL, &len); - - amf_uint32 count = len / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); - std::unique_ptr pBuffer(new SYSTEM_LOGICAL_PROCESSOR_INFORMATION[count]); - if (pBuffer) - { - GetLogicalProcessorInformation(pBuffer.get(), &len); - count = len / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); - amf_int32 iCores = 0; - for (amf_uint32 idx = 0; idx < count; idx++) - { - if (pBuffer[idx].Relationship == RelationProcessorCore) - { - iCores++; - } - } - return iCores; - } - - return 1; -} -//---------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------- -#endif // _WIN32 \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.cpp b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.cpp deleted file mode 100644 index 83c576d2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "UtilsWindows.h" -#include - -#ifdef _WIN32 - -#define AMF_FACILITY L"UtilWindows" - -amf_bool OSIsVersionOrGreater(DWORD major, DWORD minor, DWORD build) -{ - // This function is to replace "IsWindowsVersionOrGreater" since - // it seems to be broken since windows 8 - - HMODULE hModule = GetModuleHandleW(L"ntdll"); - - if (hModule == nullptr) - { - AMFTraceError(AMF_FACILITY, L"OSIsVersionOrGreater() - Could not get ntdll handle"); - return false; - } - - NTSTATUS(WINAPI * RtlGetVersion)(LPOSVERSIONINFOEXW); - *(FARPROC*)&RtlGetVersion = GetProcAddress(hModule, "RtlGetVersion"); - - if (RtlGetVersion == nullptr) - { - AMFTraceError(AMF_FACILITY, L"OSIsVersionOrGreater() - Could not get RtlGetVersion procedure handle from ntdll"); - return false; - } - - OSVERSIONINFOEXW osVersionInfo = {}; - NTSTATUS status = RtlGetVersion(&osVersionInfo); - - if (status != 0) - { - AMFTraceError(AMF_FACILITY, L"OSIsVersionOrGreater() - RtlGetVersion failed"); - return false; - } - - const DWORD versions[] = { osVersionInfo.dwMajorVersion, osVersionInfo.dwMinorVersion, osVersionInfo.dwBuildNumber }; - const DWORD checkVersions[] = { major, minor, build }; - constexpr amf_uint count = amf_countof(versions); - - for (amf_uint i = 0; i < count; ++i) - { - if (versions[i] == checkVersions[i]) - { - continue; - } - - return versions[i] > checkVersions[i]; - } - - return versions[count - 1] == checkVersions[count - 1]; -} - -AMF_RESULT GetDisplayInfo(amf_handle hwnd, DisplayInfo& displayInfo) -{ - AMF_RETURN_IF_FALSE(hwnd != nullptr, AMF_INVALID_ARG, L"GetDisplayInfoFromWindow() - hwnd is NULL"); - displayInfo = {}; - - // Get display information (specifically name) - displayInfo.hMonitor = MonitorFromWindow((HWND)hwnd, MONITOR_DEFAULTTONEAREST); - AMF_RETURN_IF_FALSE(displayInfo.hMonitor != nullptr, AMF_FAIL, L"GetDisplayInfoFromWindow() - MonitorFromWindow() returned NULL"); - - MONITORINFOEX monitorInfo = {}; - monitorInfo.cbSize = sizeof(monitorInfo); - BOOL ret = GetMonitorInfoW(displayInfo.hMonitor, &monitorInfo); - AMF_RETURN_IF_FALSE(ret != 0, AMF_FAIL, L"GetDisplayInfoFromWindow() - GetMonitorInfoW() failed, code=%d", ret); - - // Save the windowed DEVMODE - DEVMODEW devMode = {}; - devMode.dmSize = sizeof(devMode); - ret = EnumDisplaySettingsW(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &devMode); - AMF_RETURN_IF_FALSE(ret != 0, AMF_FAIL, L"GetDisplayInfoFromWindow() - EnumDisplaySettingsW() failed to get Window Mode DEVMODE, code=%d", ret); - - displayInfo.deviceName = monitorInfo.szDevice; - displayInfo.primary = (monitorInfo.dwFlags & MONITORINFOF_PRIMARY) == MONITORINFOF_PRIMARY; - displayInfo.workRect = AMFConstructRect(monitorInfo.rcWork.left, monitorInfo.rcWork.top, monitorInfo.rcWork.right, monitorInfo.rcWork.bottom); - displayInfo.monitorRect = AMFConstructRect(monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top, monitorInfo.rcMonitor.right, monitorInfo.rcMonitor.bottom); - displayInfo.deviceRect = AMFConstructRect(devMode.dmPosition.x, devMode.dmPosition.y, devMode.dmPosition.x + devMode.dmPelsWidth, devMode.dmPosition.y + devMode.dmPelsHeight); - displayInfo.frequency = AMFConstructRate(devMode.dmDisplayFrequency, 1); - displayInfo.bitsPerPixel = devMode.dmBitsPerPel; - - return AMF_OK; -} - -#endif // _WIN32 \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.h deleted file mode 100644 index 9bea5741..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/common/Windows/UtilsWindows.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifdef _WIN32 - -#include "public/include/core/Platform.h" -#include "public/include/core/Result.h" -#include "../AMFSTL.h" - -amf_bool OSIsVersionOrGreater(DWORD major, DWORD minor, DWORD build); - -struct DisplayInfo -{ - HMONITOR hMonitor; - amf_wstring deviceName; - amf_bool primary; - AMFRect monitorRect; - AMFRect workRect; - AMFRect deviceRect; - AMFRate frequency; - amf_uint bitsPerPixel; -}; - -AMF_RESULT GetDisplayInfo(amf_handle hwnd, DisplayInfo& displayInfo); - -#endif // _WIN32 \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AMFXInput.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AMFXInput.h deleted file mode 100644 index 133e637d..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AMFXInput.h +++ /dev/null @@ -1,139 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#ifndef AMF_XInput_h -#define AMF_XInput_h - -#pragma once - -#include "../../../public/include/core/Interface.h" - -// XInput injection API: -// - XBox - like controller emulation -// - event injection -// - vibration notifications - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFXInput interface - //---------------------------------------------------------------------------------------------- - - typedef enum AMF_CONTROLLER_TYPE - { - AMF_CONTROLLER_XBOX360 = 1, - } AMF_CONTROLLER_TYPE; - - - typedef struct AMFXInputCreationDesc - { - AMF_CONTROLLER_TYPE eType; - amf_uint32 reserved[100]; - } AMFXInputCreationDesc; - - //---------------------------------------------------------------------------------------------- - // Constants for gamepad buttons - match Xinput.h - //---------------------------------------------------------------------------------------------- - #define AMF_XINPUT_GAMEPAD_DPAD_UP 0x0001 - #define AMF_XINPUT_GAMEPAD_DPAD_DOWN 0x0002 - #define AMF_XINPUT_GAMEPAD_DPAD_LEFT 0x0004 - #define AMF_XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 - #define AMF_XINPUT_GAMEPAD_START 0x0010 - #define AMF_XINPUT_GAMEPAD_BACK 0x0020 - #define AMF_XINPUT_GAMEPAD_LEFT_THUMB 0x0040 - #define AMF_XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 - #define AMF_XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 - #define AMF_XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 - #define AMF_XINPUT_GAMEPAD_A 0x1000 - #define AMF_XINPUT_GAMEPAD_B 0x2000 - #define AMF_XINPUT_GAMEPAD_X 0x4000 - #define AMF_XINPUT_GAMEPAD_Y 0x8000 - //---------------------------------------------------------------------------------------------- - typedef struct AMFXInputState - { - amf_uint32 uiButtonStates; // bit-wize flags AMF_XINPUT_GAMEPAD_<> - the same as XINPUT_GAMEPAD_<> from Windows SDK XInput.h - amf_float fLeftTrigger; // 0.0f , 1.0f - amf_float fRightTrigger; // 0.0f , 1.0f - amf_float fThumbLX; // -1.0f , 1.0f - amf_float fThumbLY; // -1.0f , 1.0f - amf_float fThumbRX; // -1.0f , 1.0f - amf_float fThumbRY; // -1.0f , 1.0f - } AMFXInputState; - //---------------------------------------------------------------------------------------------- - typedef struct AMFXInputHaptic - { - amf_float fLeftMotor; // 0.0f , 1.0f - motor level - amf_float fRightMotor; // 0.0f , 1.0f - motor level - } AMFXInputHaptic; - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - class AMF_NO_VTABLE AMFXInputCallback - { - public: - virtual void AMF_STD_CALL OnHaptic(amf_int32 id, const AMFXInputHaptic* pHaptic) = 0; - }; - //---------------------------------------------------------------------------------------------- - class AMF_NO_VTABLE AMFXInputController : public AMFInterface - { - public: - AMF_DECLARE_IID(0xbcaaaf0e, 0x6766, 0x46ac, 0xb1, 0xf1, 0x31, 0x5d, 0xca, 0x71, 0xe3, 0x4d) - - virtual amf_int32 AMF_STD_CALL GetControllerID() const = 0; - virtual AMF_RESULT AMF_STD_CALL SetCallback(AMFXInputCallback *pCallback) = 0; - - virtual AMF_RESULT AMF_STD_CALL SetState(const AMFXInputState *pState) = 0; - virtual AMF_RESULT AMF_STD_CALL GetState(AMFXInputState *pState) const = 0; - virtual AMF_RESULT AMF_STD_CALL Terminate() = 0; - }; - typedef amf::AMFInterfacePtr_T AMFXInputControllerPtr; -#endif - //---------------------------------------------------------------------------------------------- -#endif -#if defined(__cplusplus) -} - -#define AMF_XINPUT_CREATE_CONTROLLER_FUNCTION_NAME "AMFXInputCreateController" - -#if defined(__cplusplus) -extern "C" -{ - typedef AMF_RESULT(AMF_CDECL_CALL *AMFXInputCreateController_Fn)(amf_uint64 version, amf::AMFXInputCreationDesc* params, amf::AMFXInputController **ppController); -} -#else - typedef AMF_RESULT(AMF_CDECL_CALL *AMFXInputCreateController_Fn)(amf_uint64 version, AMFXInputCreationDesc* params, AMFXInputController **ppController); -#endif - - -#endif // AMF_XInput_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Ambisonic2SRenderer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Ambisonic2SRenderer.h deleted file mode 100644 index 63ac7977..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Ambisonic2SRenderer.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// interface declaration; Ambisonic to Stereo Renderer -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_Ambisonic2SRenderer_h -#define AMF_Ambisonic2SRenderer_h -#pragma once - -#include "public/include/components/Component.h" - -#define AMFAmbisonic2SRendererHW L"AMFAmbisonic2SRenderer" - -enum AMF_AMBISONIC2SRENDERER_MODE_ENUM -{ - AMF_AMBISONIC2SRENDERER_MODE_SIMPLE = 0, - AMF_AMBISONIC2SRENDERER_MODE_HRTF_AMD0 = 1, - AMF_AMBISONIC2SRENDERER_MODE_HRTF_MIT1 = 2, -}; - - -// static properties -#define AMF_AMBISONIC2SRENDERER_IN_AUDIO_SAMPLE_RATE L"InSampleRate" // amf_int64 (default = 0) -#define AMF_AMBISONIC2SRENDERER_IN_AUDIO_CHANNELS L"InChannels" // amf_int64 (only = 4) -#define AMF_AMBISONIC2SRENDERER_IN_AUDIO_SAMPLE_FORMAT L"InSampleFormat" // amf_int64(AMF_AUDIO_FORMAT) (default = AMFAF_FLTP) - -#define AMF_AMBISONIC2SRENDERER_OUT_AUDIO_CHANNELS L"OutChannels" // amf_int64 (only = 2 - stereo) -#define AMF_AMBISONIC2SRENDERER_OUT_AUDIO_SAMPLE_FORMAT L"OutSampleFormat" // amf_int64(AMF_AUDIO_FORMAT) (only = AMFAF_FLTP) -#define AMF_AMBISONIC2SRENDERER_OUT_AUDIO_CHANNEL_LAYOUT L"OutChannelLayout" // amf_int64 (only = 3 - defalut stereo L R) - -#define AMF_AMBISONIC2SRENDERER_MODE L"StereoMode" //TODO: AMF_AMBISONIC2SRENDERER_MODE_ENUM(default=AMF_AMBISONIC2SRENDERER_MODE_HRTF) - - -// dynamic properties -#define AMF_AMBISONIC2SRENDERER_W L"w" //amf_int64 (default=0) -#define AMF_AMBISONIC2SRENDERER_X L"x" //amf_int64 (default=1) -#define AMF_AMBISONIC2SRENDERER_Y L"y" //amf_int64 (default=2) -#define AMF_AMBISONIC2SRENDERER_Z L"z" //amf_int64 (default=3) - -#define AMF_AMBISONIC2SRENDERER_THETA L"Theta" //double (default=0.0) -#define AMF_AMBISONIC2SRENDERER_PHI L"Phi" //double (default=0.0) -#define AMF_AMBISONIC2SRENDERER_RHO L"Rho" //double (default=0.0) - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentAmbisonic(amf::AMFContext* pContext, void* reserved, amf::AMFComponent** ppComponent); -} -#endif //#ifndef AMF_Ambisonic2SRenderer_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AudioCapture.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AudioCapture.h deleted file mode 100644 index af5b4287..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/AudioCapture.h +++ /dev/null @@ -1,86 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// Audio session interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_AudioCapture_h -#define AMF_AudioCapture_h - -#pragma once - -#include "Component.h" - -// Set to capture from either a microphone or desktop -#define AUDIOCAPTURE_SOURCE L"AudioCaptureSource" // amf_bool true for microphone, false for desktop; - -// In the case of capturing a microphone, the AUDIOCAPTURE_DEVICE_ACTIVE property -// can be set to -1 so that the active input devices are looked up. If the initialization -// is successful then the AUDIOCAPTURE_DEVICE_NAME and AUDIOCAPTURE_DEVICE_COUNT -// properties will be set. -#define AUDIOCAPTURE_DEVICE_ACTIVE L"AudioCaptureDeviceActive" // amf_int64 -#define AUDIOCAPTURE_DEVICE_COUNT L"AudioCaptureDeviceCount" // amf_int64 -#define AUDIOCAPTURE_DEVICE_NAME L"AudioCaptureDeviceName" // String - -// Codec used for audio capture -#define AUDIOCAPTURE_CODEC L"AudioCaptureCodec" // amf_int64, AV_CODEC_ID_PCM_F32LE -// Sample rate used for audio capture -#define AUDIOCAPTURE_SAMPLERATE L"AudioCaptureSampleRate" // amf_int64, 44100 in samples -// Sample count used for audio capture -#define AUDIOCAPTURE_SAMPLES L"AudioCaptureSampleCount" // amf_int64, 1024 -// Bitrate used for audio capture -#define AUDIOCAPTURE_BITRATE L"AudioCaptureBitRate" // amf_int64, in bits -// Channel count used for audio capture -#define AUDIOCAPTURE_CHANNELS L"AudioCaptureChannelCount" // amf_int64, 2 -// Channel layout used for audio capture -#define AUDIOCAPTURE_CHANNEL_LAYOUT L"AudioCaptureChannelLayout" // amf_int64, AMF_AUDIO_CHANNEL_LAYOUT -// Format used for audio capture -#define AUDIOCAPTURE_FORMAT L"AudioCaptureFormat" // amf_int64, AMFAF_U8 -// Block alignment -#define AUDIOCAPTURE_BLOCKALIGN L"AudioCaptureBlockAlign" // amf_int64, bytes -// Audio frame size -#define AUDIOCAPTURE_FRAMESIZE L"AudioCaptureFrameSize" // amf_int64, bytes -// Audio low latency state -#define AUDIOCAPTURE_LOWLATENCY L"AudioCaptureLowLatency" // amf_int64; - -// Optional interface that provides current time -#define AUDIOCAPTURE_CURRENT_TIME_INTERFACE L"CurrentTimeInterface" // interface to current time object - -extern "C" -{ - // Component that allows the recording of inputs such as microphones or the audio that is being - // rendered. The direction that is captured is controlled by the AUDIOCAPTURE_CAPTURE property - // - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentAudioCapture(amf::AMFContext* pContext, amf::AMFComponent** ppComponent); -} - -#endif // #ifndef AMF_AudioCapture_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Capture.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Capture.h deleted file mode 100644 index 78fb12fc..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Capture.h +++ /dev/null @@ -1,198 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// Capture interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef __Capture_h__ -#define __Capture_h__ -#pragma once - -#include "../../../public/include/components/Component.h" - -typedef enum AMF_CAPTURE_DEVICE_TYPE_ENUM -{ - AMF_CAPTURE_DEVICE_UNKNOWN = 0, - AMF_CAPTURE_DEVICE_MEDIAFOUNDATION = 1, - AMF_CAPTURE_DEVICE_WASAPI = 2, - AMF_CAPTURE_DEVICE_SDI = 3, - AMF_CAPTURE_DEVICE_SCREEN_DUPLICATION = 4, -} AMF_CAPTURE_DEVICE_TYPE_ENUM; - -// device properties -#define AMF_CAPTURE_DEVICE_TYPE L"DeviceType" // amf_int64( AMF_CAPTURE_DEVICE_TYPE_ENUM ) -#define AMF_CAPTURE_DEVICE_NAME L"DeviceName" // wchar_t* : name of the device - - - -#if defined(__cplusplus) -namespace amf -{ -#endif - - //---------------------------------------------------------------------------------------------- - // AMFCaptureDevice interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFCaptureDevice : public AMFComponentEx - { - public: - AMF_DECLARE_IID (0x5bfd1b17, 0x9f2a, 0x43c4, 0x9c, 0xdd, 0x2c, 0x3, 0x88, 0x43, 0xb5, 0xf3) - - virtual AMF_RESULT AMF_STD_CALL Start() = 0; - virtual AMF_RESULT AMF_STD_CALL Stop() = 0; - - // TODO add callback interface for disconnected / lost / changed device notification - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFCaptureDevicePtr; - //---------------------------------------------------------------------------------------------- -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFCaptureDevice, 0x5bfd1b17, 0x9f2a, 0x43c4, 0x9c, 0xdd, 0x2c, 0x3, 0x88, 0x43, 0xb5, 0xf3) - - typedef struct AMFCaptureDeviceVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFCaptureDevice* pThis); - amf_long (AMF_STD_CALL *Release)(AMFCaptureDevice* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFCaptureDevice* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFCaptureDevice* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFCaptureDevice* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFCaptureDevice* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFCaptureDevice* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFCaptureDevice* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFCaptureDevice* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFCaptureDevice* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFCaptureDevice* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFCaptureDevice* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFCaptureDevice* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFCaptureDevice* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - // AMFComponent interface - - AMF_RESULT (AMF_STD_CALL *Init)(AMFCaptureDevice* pThis, AMF_SURFACE_FORMAT format,amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *ReInit)(AMFCaptureDevice* pThis, amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *Drain)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *Flush)(AMFCaptureDevice* pThis); - - AMF_RESULT (AMF_STD_CALL *SubmitInput)(AMFCaptureDevice* pThis, AMFData* pData); - AMF_RESULT (AMF_STD_CALL *QueryOutput)(AMFCaptureDevice* pThis, AMFData** ppData); - AMFContext* (AMF_STD_CALL *GetContext)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *SetOutputDataAllocatorCB)(AMFCaptureDevice* pThis, AMFDataAllocatorCB* callback); - - AMF_RESULT (AMF_STD_CALL *GetCaps)(AMFCaptureDevice* pThis, AMFCaps** ppCaps); - AMF_RESULT (AMF_STD_CALL *Optimize)(AMFCaptureDevice* pThis, AMFComponentOptimizationCallback* pCallback); - - // AMFComponentEx interface - - amf_int32 (AMF_STD_CALL *GetInputCount)(AMFCaptureDevice* pThis); - amf_int32 (AMF_STD_CALL *GetOutputCount)(AMFCaptureDevice* pThis); - - AMF_RESULT (AMF_STD_CALL *GetInput)(AMFCaptureDevice* pThis, amf_int32 index, AMFInput** ppInput); - AMF_RESULT (AMF_STD_CALL *GetOutput)(AMFCaptureDevice* pThis, amf_int32 index, AMFOutput** ppOutput); - - // AMFCaptureDevice interface - - AMF_RESULT (AMF_STD_CALL *Start)(AMFCaptureDevice* pThis); - AMF_RESULT (AMF_STD_CALL *Stop)(AMFCaptureDevice* pThis); - - } AMFCaptureVtbl; - - struct AMFCapture - { - const AMFCaptureVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFCaptureManager interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFCaptureManager : public AMFInterface - { - public: - AMF_DECLARE_IID ( 0xf64d2f0d, 0xad16, 0x4ce7, 0x80, 0x5f, 0xa1, 0xe7, 0x3b, 0x0, 0xf4, 0x28) - - virtual AMF_RESULT AMF_STD_CALL Update() = 0; - virtual amf_int32 AMF_STD_CALL GetDeviceCount() = 0; - virtual AMF_RESULT AMF_STD_CALL GetDevice(amf_int32 index,AMFCaptureDevice **pDevice) = 0; - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFCaptureManagerPtr; - //---------------------------------------------------------------------------------------------- -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFCaptureManager, 0xf64d2f0d, 0xad16, 0x4ce7, 0x80, 0x5f, 0xa1, 0xe7, 0x3b, 0x0, 0xf4, 0x28) - - typedef struct AMFCaptureManagerVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFCaptureManager* pThis); - amf_long (AMF_STD_CALL *Release)(AMFCaptureManager* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFCaptureManager* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - - // AMFCaptureManager interface - AMF_RESULT (AMF_STD_CALL *Update)((AMFCaptureManager* pThis); - amf_int32 (AMF_STD_CALL *GetDeviceCount)(AMFCaptureManager* pThis); - AMF_RESULT (AMF_STD_CALL *GetDevice)(AMFCaptureManager* pThis, amf_int32 index,AMFCaptureDevice **pDevice); - - } AMFCaptureManagerVtbl; - - struct AMFCaptureManager - { - const AMFCaptureManagerVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) -} // namespace -#endif - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL AMFCreateCaptureManager(amf::AMFContext* pContext, amf::AMFCaptureManager** ppManager); -} - -#endif // __Capture_h__ \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ChromaKey.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ChromaKey.h deleted file mode 100644 index 82b3516f..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ChromaKey.h +++ /dev/null @@ -1,76 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -/** - *************************************************************************************************** - * @file ChromaKey.h - * @brief AMFChromaKey interface declaration - *************************************************************************************************** - */ -#ifndef __AMFChromaKey_h__ -#define __AMFChromaKey_h__ -#pragma once - -#include "public/include/components/Component.h" - -#define AMFChromaKey L"AMFChromaKey" - -// static properties -#define AMF_CHROMAKEY_COLOR L"ChromaKeyColor" // amf_uint64 (default=0x992A1E), YUV Green key Color -#define AMF_CHROMAKEY_COLOR_EX L"ChromaKeyColorEX" // amf_uint64 (default=0), YUV Green key Color, secondary -#define AMF_CHROMAKEY_RANGE_MIN L"ChromaKeyRangeMin" // amf_uint64 (default=20) color tolerance low, 0~255 -#define AMF_CHROMAKEY_RANGE_MAX L"ChromaKeyRangeMax" // amf_uint64 (default=22) color tolerance high, 0~255 -#define AMF_CHROMAKEY_RANGE_EXT L"ChromaKeyRangeExt" // amf_uint64 (default=40) color tolerance extended, 0~255 -#define AMF_CHROMAKEY_SPILL_MODE L"ChromaKeySpillMode" // amf_uint64 (default=0) spill suppression mode -#define AMF_CHROMAKEY_RANGE_SPILL L"ChromaKeyRangeSpill" // amf_uint64 (default=5) spill suppression threshold -#define AMF_CHROMAKEY_LUMA_LOW L"ChromaKeyLumaLow" // amf_uint64 (default=16) minimum luma value for processing -#define AMF_CHROMAKEY_INPUT_COUNT L"InputCount" // amf_uint64 (default=2) number of inputs -#define AMF_CHROMAKEY_COLOR_POS L"KeyColorPos" // amf_uint64 (default=0) key color position from the surface -#define AMF_CHROMAKEY_OUT_FORMAT L"ChromaKeyOutFormat" // amf_uint64 (default=RGBA) output format -#define AMF_CHROMAKEY_MEMORY_TYPE L"ChromaKeyMemoryType" // amf_uint64 (default=DX11) mmeory type -#define AMF_CHROMAKEY_COLOR_ADJ L"ChromaKeyColorAdj" // amf_uint64 (default=0) endble color adjustment -#define AMF_CHROMAKEY_COLOR_ADJ_THRE L"ChromaKeyColorAdjThre" // amf_uint64 (default=0) color adjustment threshold -#define AMF_CHROMAKEY_COLOR_ADJ_THRE2 L"ChromaKeyColorAdjThre2" // amf_uint64 (default=0) color adjustment threshold -#define AMF_CHROMAKEY_BYPASS L"ChromaKeyBypass" // amf_uint64 (default=0) disable chromakey -#define AMF_CHROMAKEY_EDGE L"ChromaKeyEdge" // amf_uint64 (default=0) endble edge detection -#define AMF_CHROMAKEY_BOKEH L"ChromaKeyBokeh" // amf_uint64 (default=0) endble background bokeh -#define AMF_CHROMAKEY_BOKEH_RADIUS L"ChromaKeyBokehRadius" // amf_uint64 (default=7) background bokeh radius -#define AMF_CHROMAKEY_DEBUG L"ChromaKeyDebug" // amf_uint64 (default=0) endble debug mode - -#define AMF_CHROMAKEY_POSX L"ChromaKeyPosX" // amf_uint64 (default=0) positionX -#define AMF_CHROMAKEY_POSY L"ChromaKeyPosY" // amf_uint64 (default=0) positionY - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentChromaKey(amf::AMFContext* pContext, amf::AMFComponentEx** ppComponent); -} -#endif //#ifndef __AMFChromaKey_h__ diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ColorSpace.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ColorSpace.h deleted file mode 100644 index 8d6afdae..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ColorSpace.h +++ /dev/null @@ -1,140 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// Color Spacedeclaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_ColorSpace_h -#define AMF_ColorSpace_h -#pragma once - -#include "../core/Platform.h" - -// YUV <--> RGB conversion matrix with range -typedef enum AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM -{ - AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN =-1, - AMF_VIDEO_CONVERTER_COLOR_PROFILE_601 = 0, // studio range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_709 = 1, // studio range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_2020 = 2, // studio range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_JPEG = 3, // full range 601 -// AMF_VIDEO_CONVERTER_COLOR_PROFILE_G22_BT709 = AMF_VIDEO_CONVERTER_COLOR_PROFILE_709, -// AMF_VIDEO_CONVERTER_COLOR_PROFILE_G10_SCRGB = 4, -// AMF_VIDEO_CONVERTER_COLOR_PROFILE_G10_BT709 = 5, -// AMF_VIDEO_CONVERTER_COLOR_PROFILE_G10_BT2020 = AMF_VIDEO_CONVERTER_COLOR_PROFILE_2020, -// AMF_VIDEO_CONVERTER_COLOR_PROFILE_G2084_BT2020 = 6, - AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601 = AMF_VIDEO_CONVERTER_COLOR_PROFILE_JPEG, // full range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709 = 7, // full range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_2020 = 8, // full range - AMF_VIDEO_CONVERTER_COLOR_PROFILE_COUNT -} AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM; - -typedef enum AMF_COLOR_PRIMARIES_ENUM // as in VUI color_primaries AVC and HEVC -{ - AMF_COLOR_PRIMARIES_UNDEFINED = 0, - AMF_COLOR_PRIMARIES_BT709 = 1, - AMF_COLOR_PRIMARIES_UNSPECIFIED = 2, - AMF_COLOR_PRIMARIES_RESERVED = 3, - AMF_COLOR_PRIMARIES_BT470M = 4, - AMF_COLOR_PRIMARIES_BT470BG = 5, - AMF_COLOR_PRIMARIES_SMPTE170M = 6, - AMF_COLOR_PRIMARIES_SMPTE240M = 7, - AMF_COLOR_PRIMARIES_FILM = 8, - AMF_COLOR_PRIMARIES_BT2020 = 9, - AMF_COLOR_PRIMARIES_SMPTE428 = 10, - AMF_COLOR_PRIMARIES_SMPTE431 = 11, - AMF_COLOR_PRIMARIES_SMPTE432 = 12, - AMF_COLOR_PRIMARIES_JEDEC_P22 = 22, - AMF_COLOR_PRIMARIES_CCCS = 1000, // Common Composition Color Space or scRGB -} AMF_COLOR_PRIMARIES_ENUM; - -typedef enum AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM // as in VUI transfer_characteristic AVC and HEVC -{ - AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED = 0, - AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709 = 1, //BT709 - AMF_COLOR_TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2, - AMF_COLOR_TRANSFER_CHARACTERISTIC_RESERVED = 3, - AMF_COLOR_TRANSFER_CHARACTERISTIC_GAMMA22 = 4, //BT470_M - AMF_COLOR_TRANSFER_CHARACTERISTIC_GAMMA28 = 5, //BT470 - AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE170M = 6, //BT601 - AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE240M = 7, //SMPTE 240M - AMF_COLOR_TRANSFER_CHARACTERISTIC_LINEAR = 8, - AMF_COLOR_TRANSFER_CHARACTERISTIC_LOG = 9, //LOG10 - AMF_COLOR_TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,//LOG10 SQRT - AMF_COLOR_TRANSFER_CHARACTERISTIC_IEC61966_2_4 = 11, - AMF_COLOR_TRANSFER_CHARACTERISTIC_BT1361_ECG = 12, - AMF_COLOR_TRANSFER_CHARACTERISTIC_IEC61966_2_1 = 13, - AMF_COLOR_TRANSFER_CHARACTERISTIC_BT2020_10 = 14, //BT709 - AMF_COLOR_TRANSFER_CHARACTERISTIC_BT2020_12 = 15, //BT709 - AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084 = 16, //PQ - AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE428 = 17, - AMF_COLOR_TRANSFER_CHARACTERISTIC_ARIB_STD_B67 = 18, //HLG -} AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM; - -typedef enum AMF_COLOR_BIT_DEPTH_ENUM -{ - AMF_COLOR_BIT_DEPTH_UNDEFINED = 0, - AMF_COLOR_BIT_DEPTH_8 = 8, - AMF_COLOR_BIT_DEPTH_10 = 10, -} AMF_COLOR_BIT_DEPTH_ENUM; - -typedef struct AMFHDRMetadata -{ - amf_uint16 redPrimary[2]; // normalized to 50000 - amf_uint16 greenPrimary[2]; // normalized to 50000 - amf_uint16 bluePrimary[2]; // normalized to 50000 - amf_uint16 whitePoint[2]; // normalized to 50000 - amf_uint32 maxMasteringLuminance; // normalized to 10000 - amf_uint32 minMasteringLuminance; // normalized to 10000 - amf_uint16 maxContentLightLevel; // nit value - amf_uint16 maxFrameAverageLightLevel; // nit value -} AMFHDRMetadata; - - -typedef enum AMF_COLOR_RANGE_ENUM -{ - AMF_COLOR_RANGE_UNDEFINED = 0, - AMF_COLOR_RANGE_STUDIO = 1, - AMF_COLOR_RANGE_FULL = 2, -} AMF_COLOR_RANGE_ENUM; - - -// these properties can be set on input or outout surface -// IDs are the same as in decoder properties -// can be used to dynamically pass color data between components: -// Decoder, Capture, Encoder. Presenter etc. -#define AMF_VIDEO_COLOR_TRANSFER_CHARACTERISTIC L"ColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 Section 7.2 See ColorSpace.h for enum -#define AMF_VIDEO_COLOR_PRIMARIES L"ColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 Section 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_COLOR_RANGE L"ColorRange" // amf_int64(AMF_COLOR_RANGE_ENUM) default = AMF_COLOR_RANGE_UNDEFINED -#define AMF_VIDEO_COLOR_HDR_METADATA L"HdrMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -#endif //#ifndef AMF_ColorSpace_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Component.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Component.h deleted file mode 100644 index 5293b8f4..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/Component.h +++ /dev/null @@ -1,444 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** - *************************************************************************************************** - * @file Component.h - * @brief AMFComponent interface declaration - *************************************************************************************************** - */ -#ifndef AMF_Component_h -#define AMF_Component_h -#pragma once - -#include "../core/Data.h" -#include "../core/PropertyStorageEx.h" -#include "../core/Surface.h" -#include "../core/Context.h" -#include "ComponentCaps.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFDataAllocatorCB interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFDataAllocatorCB : public AMFInterface - { - public: - AMF_DECLARE_IID(0x4bf46198, 0x8b7b, 0x49d0, 0xaa, 0x72, 0x48, 0xd4, 0x7, 0xce, 0x24, 0xc5 ) - - virtual AMF_RESULT AMF_STD_CALL AllocBuffer(AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer) = 0; - virtual AMF_RESULT AMF_STD_CALL AllocSurface(AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, - amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, AMFSurface** ppSurface) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFDataAllocatorCBPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFDataAllocatorCB, 0x4bf46198, 0x8b7b, 0x49d0, 0xaa, 0x72, 0x48, 0xd4, 0x7, 0xce, 0x24, 0xc5 ) - typedef struct AMFDataAllocatorCB AMFDataAllocatorCB; - - typedef struct AMFDataAllocatorCBVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFDataAllocatorCB* pThis); - amf_long (AMF_STD_CALL *Release)(AMFDataAllocatorCB* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFDataAllocatorCB* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - // AMFDataAllocatorCB interface - AMF_RESULT (AMF_STD_CALL *AllocBuffer)(AMFDataAllocatorCB* pThis, AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurface)(AMFDataAllocatorCB* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, - amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, AMFSurface** ppSurface); - } AMFDataAllocatorCBVtbl; - - struct AMFDataAllocatorCB - { - const AMFDataAllocatorCBVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComponentOptimizationCallback - { - public: - virtual AMF_RESULT AMF_STD_CALL OnComponentOptimizationProgress(amf_uint percent) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFComponentOptimizationCallback AMFComponentOptimizationCallback; - typedef struct AMFComponentOptimizationCallbackVtbl - { - // AMFDataAllocatorCB interface - AMF_RESULT (AMF_STD_CALL *OnComponentOptimizationProgress)(AMFComponentOptimizationCallback* pThis, amf_uint percent); - } AMFComponentOptimizationCallbackVtbl; - - struct AMFComponentOptimizationCallback - { - const AMFComponentOptimizationCallbackVtbl *pVtbl; - }; - -#endif //#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMFComponent interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComponent : public AMFPropertyStorageEx - { - public: - AMF_DECLARE_IID(0x8b51e5e4, 0x455d, 0x4034, 0xa7, 0x46, 0xde, 0x1b, 0xed, 0xc3, 0xc4, 0x6) - - virtual AMF_RESULT AMF_STD_CALL Init(AMF_SURFACE_FORMAT format,amf_int32 width,amf_int32 height) = 0; - virtual AMF_RESULT AMF_STD_CALL ReInit(amf_int32 width,amf_int32 height) = 0; - virtual AMF_RESULT AMF_STD_CALL Terminate() = 0; - virtual AMF_RESULT AMF_STD_CALL Drain() = 0; - virtual AMF_RESULT AMF_STD_CALL Flush() = 0; - - virtual AMF_RESULT AMF_STD_CALL SubmitInput(AMFData* pData) = 0; - virtual AMF_RESULT AMF_STD_CALL QueryOutput(AMFData** ppData) = 0; - virtual AMFContext* AMF_STD_CALL GetContext() = 0; - virtual AMF_RESULT AMF_STD_CALL SetOutputDataAllocatorCB(AMFDataAllocatorCB* callback) = 0; - - virtual AMF_RESULT AMF_STD_CALL GetCaps(AMFCaps** ppCaps) = 0; - virtual AMF_RESULT AMF_STD_CALL Optimize(AMFComponentOptimizationCallback* pCallback) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComponentPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComponent, 0x8b51e5e4, 0x455d, 0x4034, 0xa7, 0x46, 0xde, 0x1b, 0xed, 0xc3, 0xc4, 0x6) - typedef struct AMFComponent AMFComponent; - - typedef struct AMFComponentVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComponent* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComponent* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComponent* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFComponent* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFComponent* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFComponent* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFComponent* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFComponent* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFComponent* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFComponent* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFComponent* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFComponent* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFComponent* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFComponent* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - // AMFComponent interface - - AMF_RESULT (AMF_STD_CALL *Init)(AMFComponent* pThis, AMF_SURFACE_FORMAT format,amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *ReInit)(AMFComponent* pThis, amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *Drain)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *Flush)(AMFComponent* pThis); - - AMF_RESULT (AMF_STD_CALL *SubmitInput)(AMFComponent* pThis, AMFData* pData); - AMF_RESULT (AMF_STD_CALL *QueryOutput)(AMFComponent* pThis, AMFData** ppData); - AMFContext* (AMF_STD_CALL *GetContext)(AMFComponent* pThis); - AMF_RESULT (AMF_STD_CALL *SetOutputDataAllocatorCB)(AMFComponent* pThis, AMFDataAllocatorCB* callback); - - AMF_RESULT (AMF_STD_CALL *GetCaps)(AMFComponent* pThis, AMFCaps** ppCaps); - AMF_RESULT (AMF_STD_CALL *Optimize)(AMFComponent* pThis, AMFComponentOptimizationCallback* pCallback); - } AMFComponentVtbl; - - struct AMFComponent - { - const AMFComponentVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMFInput interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFInput : public AMFPropertyStorageEx - { - public: - AMF_DECLARE_IID(0x1181eee7, 0x95f2, 0x434a, 0x9b, 0x96, 0xea, 0x55, 0xa, 0xa7, 0x84, 0x89) - - virtual AMF_RESULT AMF_STD_CALL SubmitInput(AMFData* pData) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFInputPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFInput, 0x1181eee7, 0x95f2, 0x434a, 0x9b, 0x96, 0xea, 0x55, 0xa, 0xa7, 0x84, 0x89) - typedef struct AMFInput AMFInput; - - typedef struct AMFInputVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFInput* pThis); - amf_long (AMF_STD_CALL *Release)(AMFInput* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFInput* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFInput* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFInput* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFInput* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFInput* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFInput* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFInput* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFInput* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFInput* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFInput* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFInput* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFInput* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFInput* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFInput* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFInput* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - // AMFInput interface - AMF_RESULT (AMF_STD_CALL *SubmitInput)(AMFInput* pThis, AMFData* pData); - - } AMFInputVtbl; - - struct AMFInput - { - const AMFInputVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFOutput interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFOutput : public AMFPropertyStorageEx - { - public: - AMF_DECLARE_IID(0x86a8a037, 0x912c, 0x4698, 0xb0, 0x46, 0x7, 0x5a, 0x1f, 0xac, 0x6b, 0x97) - - virtual AMF_RESULT AMF_STD_CALL QueryOutput(AMFData** ppData) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFOutputPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFOutput, 0x86a8a037, 0x912c, 0x4698, 0xb0, 0x46, 0x7, 0x5a, 0x1f, 0xac, 0x6b, 0x97) - typedef struct AMFOutput AMFOutput; - - typedef struct AMFOutputVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFOutput* pThis); - amf_long (AMF_STD_CALL *Release)(AMFOutput* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFOutput* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFOutput* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFOutput* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFOutput* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFOutput* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFOutput* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFOutput* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFOutput* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFOutput* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFOutput* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFOutput* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFOutput* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFOutput* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFOutput* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFOutput* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - // AMFOutput interface - AMF_RESULT (AMF_STD_CALL *QueryOutput)(AMFOutput* pThis, AMFData** ppData); - - } AMFOutputVtbl; - - struct AMFOutput - { - const AMFOutputVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMFComponent interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComponentEx : public AMFComponent - { - public: - AMF_DECLARE_IID(0xfda792af, 0x8712, 0x44df, 0x8e, 0xa0, 0xdf, 0xfa, 0xad, 0x2c, 0x80, 0x93) - - virtual amf_int32 AMF_STD_CALL GetInputCount() = 0; - virtual amf_int32 AMF_STD_CALL GetOutputCount() = 0; - - virtual AMF_RESULT AMF_STD_CALL GetInput(amf_int32 index, AMFInput** ppInput) = 0; - virtual AMF_RESULT AMF_STD_CALL GetOutput(amf_int32 index, AMFOutput** ppOutput) = 0; - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComponentExPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComponentEx, 0xfda792af, 0x8712, 0x44df, 0x8e, 0xa0, 0xdf, 0xfa, 0xad, 0x2c, 0x80, 0x93) - typedef struct AMFComponentEx AMFComponentEx; - - typedef struct AMFComponentExVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComponentEx* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComponentEx* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComponentEx* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFComponentEx* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFComponentEx* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFComponentEx* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFComponentEx* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFComponentEx* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFComponentEx* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFComponentEx* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFComponentEx* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFComponentEx* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFComponentEx* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFComponentEx* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - // AMFComponent interface - - AMF_RESULT (AMF_STD_CALL *Init)(AMFComponentEx* pThis, AMF_SURFACE_FORMAT format,amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *ReInit)(AMFComponentEx* pThis, amf_int32 width,amf_int32 height); - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *Drain)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *Flush)(AMFComponentEx* pThis); - - AMF_RESULT (AMF_STD_CALL *SubmitInput)(AMFComponentEx* pThis, AMFData* pData); - AMF_RESULT (AMF_STD_CALL *QueryOutput)(AMFComponentEx* pThis, AMFData** ppData); - AMFContext* (AMF_STD_CALL *GetContext)(AMFComponentEx* pThis); - AMF_RESULT (AMF_STD_CALL *SetOutputDataAllocatorCB)(AMFComponentEx* pThis, AMFDataAllocatorCB* callback); - - AMF_RESULT (AMF_STD_CALL *GetCaps)(AMFComponentEx* pThis, AMFCaps** ppCaps); - AMF_RESULT (AMF_STD_CALL *Optimize)(AMFComponentEx* pThis, AMFComponentOptimizationCallback* pCallback); - - // AMFComponentEx interface - - amf_int32 (AMF_STD_CALL *GetInputCount)(AMFComponentEx* pThis); - amf_int32 (AMF_STD_CALL *GetOutputCount)(AMFComponentEx* pThis); - - AMF_RESULT (AMF_STD_CALL *GetInput)(AMFComponentEx* pThis, amf_int32 index, AMFInput** ppInput); - AMF_RESULT (AMF_STD_CALL *GetOutput)(AMFComponentEx* pThis, amf_int32 index, AMFOutput** ppOutput); - - - } AMFComponentExVtbl; - - struct AMFComponentEx - { - const AMFComponentExVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - -#if defined(__cplusplus) -} // namespace -#endif - -typedef enum AMF_STREAM_TYPE_ENUM -{ - AMF_STREAM_UNKNOWN = 0, - AMF_STREAM_VIDEO = 1, - AMF_STREAM_AUDIO = 2, - AMF_STREAM_DATA = 3, -} AMF_STREAM_TYPE_ENUM; - -typedef enum AMF_STREAM_CODEC_ID_ENUM // matched codecs from VideoDecoxcderUVD.h -{ - AMF_STREAM_CODEC_ID_UNKNOWN = 0, - AMF_STREAM_CODEC_ID_MPEG2 = 1, // AMFVideoDecoderUVD_MPEG2 - AMF_STREAM_CODEC_ID_MPEG4 = 2, // AMFVideoDecoderUVD_MPEG4 - AMF_STREAM_CODEC_ID_WMV3 = 3, // AMFVideoDecoderUVD_WMV3 - AMF_STREAM_CODEC_ID_VC1 = 4, // AMFVideoDecoderUVD_VC1 - AMF_STREAM_CODEC_ID_H264_AVC = 5, // AMFVideoDecoderUVD_H264_AVC - AMF_STREAM_CODEC_ID_H264_MVC = 6, // AMFVideoDecoderUVD_H264_MVC - AMF_STREAM_CODEC_ID_H264_SVC = 7, // AMFVideoDecoderUVD_H264_SVC - AMF_STREAM_CODEC_ID_MJPEG = 8, // AMFVideoDecoderUVD_MJPEG - AMF_STREAM_CODEC_ID_H265_HEVC = 9, // AMFVideoDecoderHW_H265_HEVC - AMF_STREAM_CODEC_ID_H265_MAIN10 = 10, // AMFVideoDecoderHW_H265_MAIN10 - AMF_STREAM_CODEC_ID_VP9 = 11, // AMFVideoDecoderHW_VP9 - AMF_STREAM_CODEC_ID_VP9_10BIT = 12, // AMFVideoDecoderHW_VP9_10BIT - AMF_STREAM_CODEC_ID_AV1 = 13, // AMFVideoDecoderHW_AV1 - AMF_STREAM_CODEC_ID_AV1_12BIT = 14, // AMFVideoDecoderHW_AV1_12BIT -} AMF_STREAM_CODEC_ID_ENUM; - -// common stream properties -#define AMF_STREAM_TYPE L"StreamType" // amf_int64( AMF_STREAM_TYPE_ENUM ) -#define AMF_STREAM_ENABLED L"Enabled" // bool( default = false ) -#define AMF_STREAM_CODEC_ID L"CodecID" // amf_int64(Video: AMF_STREAM_CODEC_ID_ENUM, Audio: AVCodecID) (default = 0 - uncompressed) -#define AMF_STREAM_BIT_RATE L"BitRate" // amf_int64 (default = codec->bit_rate) -#define AMF_STREAM_EXTRA_DATA L"ExtraData" // interface to AMFBuffer - as is from FFMPEG - -// video stream properties -#define AMF_STREAM_VIDEO_MEMORY_TYPE L"VideoMemoryType" // amf_int64(AMF_MEMORY_TYPE); default = AMF_MEMORY_DX11 -#define AMF_STREAM_VIDEO_FORMAT L"VideoFormat" // amf_int64(AMF_SURFACE_FORMAT); default = AMF_SURFACE_NV12 (used if AMF_STREAM_CODEC_ID == 0) -#define AMF_STREAM_VIDEO_FRAME_RATE L"VideoFrameRate" // AMFRate; default = (30,1) - video frame rate -#define AMF_STREAM_VIDEO_FRAME_SIZE L"VideoFrameSize" // AMFSize; default = (1920,1080) - video frame rate -#define AMF_STREAM_VIDEO_SURFACE_POOL L"VideoSurfacePool" // amf_int64; default = 5, number of allocated output surfaces -//TODO support interlaced frames - -// audio stream properties -#define AMF_STREAM_AUDIO_FORMAT L"AudioFormat" // amf_int64(AMF_AUDIO_FORMAT); default = AMFAF_S16 -#define AMF_STREAM_AUDIO_SAMPLE_RATE L"AudioSampleRate" // amf_int64; default = 48000 -#define AMF_STREAM_AUDIO_CHANNELS L"AudioChannels" // amf_int64; default = 2 -#define AMF_STREAM_AUDIO_CHANNEL_LAYOUT L"AudioChannelLayout" // amf_int64 (default = codec->channel_layout) -#define AMF_STREAM_AUDIO_BLOCK_ALIGN L"AudioBlockAlign" // amf_int64 (default = codec->block_align) -#define AMF_STREAM_AUDIO_FRAME_SIZE L"AudioFrameSize" // amf_int64 (default = codec->frame_size) - - -#endif //#ifndef AMF_Component_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ComponentCaps.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ComponentCaps.h deleted file mode 100644 index 48197670..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ComponentCaps.h +++ /dev/null @@ -1,172 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_ComponentCaps_h -#define AMF_ComponentCaps_h - -#pragma once - -#include "../core/Interface.h" -#include "../core/PropertyStorage.h" -#include "../core/Surface.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - typedef enum AMF_ACCELERATION_TYPE - { - AMF_ACCEL_NOT_SUPPORTED = -1, - AMF_ACCEL_HARDWARE, - AMF_ACCEL_GPU, - AMF_ACCEL_SOFTWARE - } AMF_ACCELERATION_TYPE; - //---------------------------------------------------------------------------------------------- - // AMFIOCaps interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFIOCaps : public AMFInterface - { - public: - // Get supported resolution ranges in pixels/lines: - virtual void AMF_STD_CALL GetWidthRange(amf_int32* minWidth, amf_int32* maxWidth) const = 0; - virtual void AMF_STD_CALL GetHeightRange(amf_int32* minHeight, amf_int32* maxHeight) const = 0; - - // Get memory alignment in lines: Vertical aligmnent should be multiples of this number - virtual amf_int32 AMF_STD_CALL GetVertAlign() const = 0; - - // Enumerate supported surface pixel formats - virtual amf_int32 AMF_STD_CALL GetNumOfFormats() const = 0; - virtual AMF_RESULT AMF_STD_CALL GetFormatAt(amf_int32 index, AMF_SURFACE_FORMAT* format, amf_bool* native) const = 0; - - // Enumerate supported memory types - virtual amf_int32 AMF_STD_CALL GetNumOfMemoryTypes() const = 0; - virtual AMF_RESULT AMF_STD_CALL GetMemoryTypeAt(amf_int32 index, AMF_MEMORY_TYPE* memType, amf_bool* native) const = 0; - - virtual amf_bool AMF_STD_CALL IsInterlacedSupported() const = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFIOCapsPtr; -#else // #if defined(__cplusplus) - typedef struct AMFIOCaps AMFIOCaps; - - typedef struct AMFIOCapsVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFIOCaps* pThis); - amf_long (AMF_STD_CALL *Release)(AMFIOCaps* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFIOCaps* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFIOCaps interface - // Get supported resolution ranges in pixels/lines: - void (AMF_STD_CALL *GetWidthRange)(AMFIOCaps* pThis, amf_int32* minWidth, amf_int32* maxWidth); - void (AMF_STD_CALL *GetHeightRange)(AMFIOCaps* pThis, amf_int32* minHeight, amf_int32* maxHeight); - - // Get memory alignment in lines: Vertical aligmnent should be multiples of this number - amf_int32 (AMF_STD_CALL *GetVertAlign)(AMFIOCaps* pThis); - - // Enumerate supported surface pixel formats - amf_int32 (AMF_STD_CALL *GetNumOfFormats)(AMFIOCaps* pThis); - AMF_RESULT (AMF_STD_CALL *GetFormatAt)(AMFIOCaps* pThis, amf_int32 index, AMF_SURFACE_FORMAT* format, amf_bool* native); - - // Enumerate supported memory types - amf_int32 (AMF_STD_CALL *GetNumOfMemoryTypes)(AMFIOCaps* pThis); - AMF_RESULT (AMF_STD_CALL *GetMemoryTypeAt)(AMFIOCaps* pThis, amf_int32 index, AMF_MEMORY_TYPE* memType, amf_bool* native); - - amf_bool (AMF_STD_CALL *IsInterlacedSupported)(AMFIOCaps* pThis); - } AMFIOCapsVtbl; - - struct AMFIOCaps - { - const AMFIOCapsVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFCaps interface - base interface for every h/w module supported by Capability Manager - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFCaps : public AMFPropertyStorage - { - public: - virtual AMF_ACCELERATION_TYPE AMF_STD_CALL GetAccelerationType() const = 0; - virtual AMF_RESULT AMF_STD_CALL GetInputCaps(AMFIOCaps** input) = 0; - virtual AMF_RESULT AMF_STD_CALL GetOutputCaps(AMFIOCaps** output) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFCapsPtr; -#else // #if defined(__cplusplus) - typedef struct AMFCaps AMFCaps; - - typedef struct AMFCapsVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFCaps* pThis); - amf_long (AMF_STD_CALL *Release)(AMFCaps* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFCaps* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFCaps* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFCaps* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFCaps* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFCaps* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFCaps* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFCaps* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFCaps* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFCaps* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFCaps* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFCaps* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFCaps interface - - AMF_ACCELERATION_TYPE (AMF_STD_CALL *GetAccelerationType)(AMFCaps* pThis); - AMF_RESULT (AMF_STD_CALL *GetInputCaps)(AMFCaps* pThis, AMFIOCaps** input); - AMF_RESULT (AMF_STD_CALL *GetOutputCaps)(AMFCaps* pThis, AMFIOCaps** output); - } AMFCapsVtbl; - - struct AMFCaps - { - const AMFCapsVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) -} -#endif - -#endif //#ifndef AMF_ComponentCaps_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/CursorCapture.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/CursorCapture.h deleted file mode 100644 index e21c1690..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/CursorCapture.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// Cursor capture interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_CursorCapture_h -#define AMF_CursorCapture_h -#pragma once - -namespace amf -{ - class AMFCursorCapture : public AMFInterface - { - public: - AMF_DECLARE_IID(0x166efa1a, 0x19b8, 0x42f2, 0x86, 0x0f, 0x56, 0x69, 0xca, 0x7a, 0x85, 0x4c) - virtual AMF_RESULT AMF_STD_CALL AcquireCursor(amf::AMFSurface** pSurface) = 0; - virtual AMF_RESULT AMF_STD_CALL Reset() = 0; - }; - - typedef AMFInterfacePtr_T AMFCursorCapturePtr; -} - -#endif // #ifndef AMF_CursorCapture_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/DisplayCapture.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/DisplayCapture.h deleted file mode 100644 index 21aa18af..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/DisplayCapture.h +++ /dev/null @@ -1,83 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// Desktop duplication interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_DisplayCapture_h -#define AMF_DisplayCapture_h -#pragma once - -#include "Component.h" - -extern "C" -{ - // To create capture component with Desktop Duplication API use this function - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentDisplayCapture(amf::AMFContext* pContext, void* reserved, amf::AMFComponent** ppComponent); -} - -// To create AMD Direct Capture component use this component ID with AMFFactory::CreateComponent() -#define AMFDisplayCapture L"AMFDisplayCapture" - -// Static properties -// -typedef enum AMF_DISPLAYCAPTURE_MODE_ENUM -{ - AMF_DISPLAYCAPTURE_MODE_KEEP_FRAMERATE = 0, // capture component maintains the frame rate and returns current visible surface - AMF_DISPLAYCAPTURE_MODE_WAIT_FOR_PRESENT = 1, // capture component waits for flip (present) event - AMF_DISPLAYCAPTURE_MODE_GET_CURRENT_SURFACE = 2, // returns current visible surface immediately -} AMF_DISPLAYCAPTURE_MODE_ENUM; - - -#define AMF_DISPLAYCAPTURE_MONITOR_INDEX L"MonitorIndex" // amf_int64, default = 0, Index of the display monitor; is determined by using EnumAdapters() in DXGI. -#define AMF_DISPLAYCAPTURE_MODE L"CaptureMode" // amf_int64(AMF_DISPLAYCAPTURE_MODE_ENUM), default = AMF_DISPLAYCAPTURE_MODE_FRAMERATE, controls wait logic -#define AMF_DISPLAYCAPTURE_FRAMERATE L"FrameRate" // AMFRate, default = (0, 1) Capture framerate, if 0 - capture rate will be driven by flip event from fullscreen app or DWM -#define AMF_DISPLAYCAPTURE_CURRENT_TIME_INTERFACE L"CurrentTimeInterface" // AMFInterface(AMFCurrentTime) Optional interface object for providing timestamps. -#define AMF_DISPLAYCAPTURE_FORMAT L"CurrentFormat" // amf_int64(AMF_SURFACE_FORMAT) Capture format - read-only -#define AMF_DISPLAYCAPTURE_RESOLUTION L"Resolution" // AMFSize - screen resolution - read-only -#define AMF_DISPLAYCAPTURE_DUPLICATEOUTPUT L"DuplicateOutput" // amf_bool, default = false, output AMF surface is a copy of captured -#define AMF_DISPLAYCAPTURE_DESKTOP_RECT L"DesktopRect" // AMFRect - rect of the capture desktop - read-only -#define AMF_DISPLAYCAPTURE_ENABLE_DIRTY_RECTS L"EnableDirtyRects" // amf_bool, default = false, enable dirty rectangles attached to output as AMF_DISPLAYCAPTURE_DIRTY_RECTS -#define AMF_DISPLAYCAPTURE_DRAW_DIRTY_RECTS L"DrawDirtyRects" // amf_bool, default = false, copies capture output and draws dirty rectangles with red - for debugging only -#define AMF_DISPLAYCAPTURE_ROTATION L"Rotation" // amf_int64(AMF_ROTATION_ENUM); default = AMF_ROTATION_NONE, monitor rotation state - -// Properties that can be set on output AMFSurface -#define AMF_DISPLAYCAPTURE_DIRTY_RECTS L"DirtyRects" // AMFInterface*(AMFBuffer*) - array of AMFRect(s) -#define AMF_DISPLAYCAPTURE_FRAME_INDEX L"FrameIndex" // amf_int64; default = 0, index of presented frame since capture started -#define AMF_DISPLAYCAPTURE_FRAME_FLIP_TIMESTAMP L"FlipTimesamp" // amf_int64; default = 0, flip timestmap of presented frame -#define AMF_DISPLAY_CAPTURE_DCC L"DisplayCaptureDCC" // bool, default false, DCC is enabled on the surface when set to true - -// see Surface.h -//#define AMF_SURFACE_ROTATION L"Rotation" // amf_int64(AMF_ROTATION_ENUM); default = AMF_ROTATION_NONE, can be set on surfaces - the same value as AMF_DISPLAYCAPTURE_ROTATION - -#endif // #ifndef AMF_DisplayCapture_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioConverter.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioConverter.h deleted file mode 100644 index 5ce79cab..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioConverter.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// AMFFAudioConverterFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_AudioConverterFFMPEG_h -#define AMF_AudioConverterFFMPEG_h - -#pragma once - - -#define FFMPEG_AUDIO_CONVERTER L"AudioConverterFFMPEG" - - -#define AUDIO_CONVERTER_IN_AUDIO_BIT_RATE L"In_BitRate" // amf_int64 (default = 128000) -#define AUDIO_CONVERTER_IN_AUDIO_SAMPLE_RATE L"In_SampleRate" // amf_int64 (default = 0) -#define AUDIO_CONVERTER_IN_AUDIO_CHANNELS L"In_Channels" // amf_int64 (default = 2) -#define AUDIO_CONVERTER_IN_AUDIO_SAMPLE_FORMAT L"In_SampleFormat" // amf_int64 (default = AMFAF_UNKNOWN) (AMF_AUDIO_FORMAT) -#define AUDIO_CONVERTER_IN_AUDIO_CHANNEL_LAYOUT L"In_ChannelLayout" // amf_int64 (default = 0) -#define AUDIO_CONVERTER_IN_AUDIO_BLOCK_ALIGN L"In_BlockAlign" // amf_int64 (default = 0) - -#define AUDIO_CONVERTER_OUT_AUDIO_BIT_RATE L"Out_BitRate" // amf_int64 (default = 128000) -#define AUDIO_CONVERTER_OUT_AUDIO_SAMPLE_RATE L"Out_SampleRate" // amf_int64 (default = 0) -#define AUDIO_CONVERTER_OUT_AUDIO_CHANNELS L"Out_Channels" // amf_int64 (default = 2) -#define AUDIO_CONVERTER_OUT_AUDIO_SAMPLE_FORMAT L"Out_SampleFormat" // amf_int64 (default = AMFAF_UNKNOWN) (AMF_AUDIO_FORMAT) -#define AUDIO_CONVERTER_OUT_AUDIO_CHANNEL_LAYOUT L"Out_ChannelLayout" // amf_int64 (default = 0) -#define AUDIO_CONVERTER_OUT_AUDIO_BLOCK_ALIGN L"Out_BlockAlign" // amf_int64 (default = 0) - - - -#endif //#ifndef AMF_AudioConverterFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioDecoder.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioDecoder.h deleted file mode 100644 index e0c324c6..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioDecoder.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// AudioDecoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_AudioDecoderFFMPEG_h -#define AMF_AudioDecoderFFMPEG_h - -#pragma once - - -#define FFMPEG_AUDIO_DECODER L"AudioDecoderFFMPEG" - - -#define AUDIO_DECODER_ENABLE_DEBUGGING L"EnableDebug" // bool (default = false) - trace some debug information if set to true -#define AUDIO_DECODER_ENABLE_DECODING L"EnableDecoding" // bool (default = true) - if false, component will not decode anything - -#define AUDIO_DECODER_IN_AUDIO_CODEC_ID L"In_CodecID" // amf_int64 (default = AV_CODEC_ID_NONE) - FFMPEG codec ID -#define AUDIO_DECODER_IN_AUDIO_BIT_RATE L"In_BitRate" // amf_int64 (default = 128000) -#define AUDIO_DECODER_IN_AUDIO_EXTRA_DATA L"In_ExtraData" // interface to AMFBuffer -#define AUDIO_DECODER_IN_AUDIO_SAMPLE_RATE L"In_SampleRate" // amf_int64 (default = 0) -#define AUDIO_DECODER_IN_AUDIO_CHANNELS L"In_Channels" // amf_int64 (default = 2) -#define AUDIO_DECODER_IN_AUDIO_SAMPLE_FORMAT L"In_SampleFormat" // amf_int64 (default = AMFAF_UNKNOWN) (AMF_AUDIO_FORMAT) -#define AUDIO_DECODER_IN_AUDIO_CHANNEL_LAYOUT L"In_ChannelLayout" // amf_int64 (default = 0) -#define AUDIO_DECODER_IN_AUDIO_BLOCK_ALIGN L"In_BlockAlign" // amf_int64 (default = 0) -#define AUDIO_DECODER_IN_AUDIO_FRAME_SIZE L"In_FrameSize" // amf_int64 (default = 0) -#define AUDIO_DECODER_IN_AUDIO_SEEK_POSITION L"In_SeekPosition" // amf_int64 (default = 0) - -#define AUDIO_DECODER_OUT_AUDIO_BIT_RATE L"Out_BitRate" // amf_int64 (default = 128000) -#define AUDIO_DECODER_OUT_AUDIO_SAMPLE_RATE L"Out_SampleRate" // amf_int64 (default = 0) -#define AUDIO_DECODER_OUT_AUDIO_CHANNELS L"Out_Channels" // amf_int64 (default = 2) -#define AUDIO_DECODER_OUT_AUDIO_SAMPLE_FORMAT L"Out_SampleFormat" // amf_int64 (default = AMFAF_UNKNOWN) (AMF_AUDIO_FORMAT) -#define AUDIO_DECODER_OUT_AUDIO_CHANNEL_LAYOUT L"Out_ChannelLayout" // amf_int64 (default = 0) -#define AUDIO_DECODER_OUT_AUDIO_BLOCK_ALIGN L"Out_BlockAlign" // amf_int64 (default = 0) - - - -#endif //#ifndef AMF_AudioDecoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioEncoder.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioEncoder.h deleted file mode 100644 index 872080b1..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGAudioEncoder.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// AudioEncoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_AudioEncoderFFMPEG_h -#define AMF_AudioEncoderFFMPEG_h - -#pragma once - - -#define FFMPEG_AUDIO_ENCODER L"AudioEncoderFFMPEG" - - -#define AUDIO_ENCODER_ENABLE_DEBUGGING L"EnableDebug" // bool (default = false) - trace some debug information if set to true -#define AUDIO_ENCODER_ENABLE_ENCODING L"EnableEncoding" // bool (default = true) - if false, component will not encode anything -#define AUDIO_ENCODER_AUDIO_CODEC_ID L"CodecID" // amf_int64 (default = AV_CODEC_ID_NONE) - FFMPEG codec ID - -#define AUDIO_ENCODER_IN_AUDIO_SAMPLE_RATE L"In_SampleRate" // amf_int64 (default = 44100) -#define AUDIO_ENCODER_IN_AUDIO_CHANNELS L"In_Channels" // amf_int64 (default = 2) -#define AUDIO_ENCODER_IN_AUDIO_SAMPLE_FORMAT L"In_SampleFormat" // amf_int64 (default = AMFAF_S16) (AMF_AUDIO_FORMAT) -#define AUDIO_ENCODER_IN_AUDIO_CHANNEL_LAYOUT L"In_ChannelLayout" // amf_int64 (default = 3) -#define AUDIO_ENCODER_IN_AUDIO_BLOCK_ALIGN L"In_BlockAlign" // amf_int64 (default = 0) - -#define AUDIO_ENCODER_OUT_AUDIO_BIT_RATE L"Out_BitRate" // amf_int64 (default = 128000) -#define AUDIO_ENCODER_OUT_AUDIO_EXTRA_DATA L"Out_ExtraData" // interface to AMFBuffer -#define AUDIO_ENCODER_OUT_AUDIO_SAMPLE_RATE L"Out_SampleRate" // amf_int64 (default = 44100) -#define AUDIO_ENCODER_OUT_AUDIO_CHANNELS L"Out_Channels" // amf_int64 (default = 2) -#define AUDIO_ENCODER_OUT_AUDIO_SAMPLE_FORMAT L"Out_SampleFormat" // amf_int64 (default = AMFAF_S16) (AMF_AUDIO_FORMAT) -#define AUDIO_ENCODER_OUT_AUDIO_CHANNEL_LAYOUT L"Out_ChannelLayout" // amf_int64 (default = 0) -#define AUDIO_ENCODER_OUT_AUDIO_BLOCK_ALIGN L"Out_BlockAlign" // amf_int64 (default = 0) -#define AUDIO_ENCODER_OUT_AUDIO_FRAME_SIZE L"Out_FrameSize" // amf_int64 (default = 0) - - - -#endif //#ifndef AMF_AudioEncoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGComponents.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGComponents.h deleted file mode 100644 index a3fbaff2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGComponents.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// FFMPEG components definitions -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_ComponentsFFMPEG_h -#define AMF_ComponentsFFMPEG_h - -#pragma once - - -#if defined(_WIN32) - #if defined(_M_AMD64) - #define FFMPEG_DLL_NAME L"amf-component-ffmpeg64.dll" - #else - #define FFMPEG_DLL_NAME L"amf-component-ffmpeg32.dll" - #endif -#elif defined(__linux) - #define FFMPEG_DLL_NAME L"amf-component-ffmpeg.so" -#endif - - -#endif //#ifndef AMF_ComponentsFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderAV1.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderAV1.h deleted file mode 100644 index 0e5e3f06..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderAV1.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// HEVCEncoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_AV1EncoderFFMPEG_h -#define AMF_AV1EncoderFFMPEG_h - -#pragma once - -#define FFMPEG_ENCODER_AV1 L"AV1EncoderFFMPEG" - - -#endif //#ifndef AMF_HEVCEncoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderH264.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderH264.h deleted file mode 100644 index ef5e7462..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderH264.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; H264/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// H264EncoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_H264EncoderFFMPEG_h -#define AMF_H264EncoderFFMPEG_h - -#pragma once - -#define FFMPEG_ENCODER_H264 L"H264EncoderFFMPEG" - - -#endif //#ifndef AMF_H264EncoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderHEVC.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderHEVC.h deleted file mode 100644 index a5fec4f2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGEncoderHEVC.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// HEVCEncoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_HEVCEncoderFFMPEG_h -#define AMF_HEVCEncoderFFMPEG_h - -#pragma once - -#define FFMPEG_ENCODER_HEVC L"HEVCEncoderFFMPEG" - - -#endif //#ifndef AMF_HEVCEncoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileDemuxer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileDemuxer.h deleted file mode 100644 index 60fd2934..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileDemuxer.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// DemuxerFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_FileDemuxerFFMPEG_h -#define AMF_FileDemuxerFFMPEG_h - -#pragma once - -#define FFMPEG_DEMUXER L"DemuxerFFMPEG" - - -// component properties -#define FFMPEG_DEMUXER_PATH L"Path" // string - the file to open -#define FFMPEG_DEMUXER_URL L"Url" // string - the stream url to open -#define FFMPEG_DEMUXER_START_FRAME L"StartFrame" // amf_int64 (default = 0) -#define FFMPEG_DEMUXER_FRAME_COUNT L"FramesNumber" // amf_int64 (default = 0) -#define FFMPEG_DEMUXER_DURATION L"Duration" // amf_int64 (default = 0) -#define FFMPEG_DEMUXER_CHECK_MVC L"CheckMVC" // bool (default = true) -//#define FFMPEG_DEMUXER_SYNC_AV L"SyncAV" // bool (default = false) -#define FFMPEG_DEMUXER_INDIVIDUAL_STREAM_MODE L"StreamMode" // bool (default = true) -#define FFMPEG_DEMUXER_LISTEN L"Listen" // bool (default = false) - -// for common, video and audio properties see Component.h - - -// video stream properties -#define FFMPEG_DEMUXER_VIDEO_PIXEL_ASPECT_RATIO L"PixelAspectRatio" // double (default = calculated) -#define FFMPEG_DEMUXER_VIDEO_CODEC L"FFmpegCodec" // enum (from source) - - -// buffer properties -#define FFMPEG_DEMUXER_BUFFER_TYPE L"BufferType" // amf_int64 ( AMF_STREAM_TYPE_ENUM ) -#define FFMPEG_DEMUXER_BUFFER_STREAM_INDEX L"BufferStreamIndexType" // amf_int64 ( stream index ) -#endif //#ifndef AMF_FileDemuxerFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileMuxer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileMuxer.h deleted file mode 100644 index a4467609..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGFileMuxer.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// MuxerFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_FileMuxerFFMPEG_h -#define AMF_FileMuxerFFMPEG_h - -#pragma once - -#define FFMPEG_MUXER L"MuxerFFMPEG" - - -// component properties -#define FFMPEG_MUXER_PATH L"Path" // string - the file to open -#define FFMPEG_MUXER_URL L"Url" // string - the stream url to open -#define FFMPEG_MUXER_LISTEN L"Listen" // bool (default = false) -#define FFMPEG_MUXER_ENABLE_VIDEO L"EnableVideo" // bool (default = true) -#define FFMPEG_MUXER_ENABLE_AUDIO L"EnableAudio" // bool (default = false) -#define FFMPEG_MUXER_CURRENT_TIME_INTERFACE L"CurrentTimeInterface" -#define FFMPEG_MUXER_VIDEO_ROTATION L"VideoRotation" // amf_int64 (0, 90, 180, 270, default = 0) -#define FFMPEG_MUXER_USAGE_IS_TRIM L"UsageIsTrim" // bool (default = false) - -#endif //#ifndef AMF_FileMuxerFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGVideoDecoder.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGVideoDecoder.h deleted file mode 100644 index c844145d..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FFMPEGVideoDecoder.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// VideoDecoderFFMPEG interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_VideoDecoderFFMPEG_h -#define AMF_VideoDecoderFFMPEG_h - -#pragma once - -#define FFMPEG_VIDEO_DECODER L"VideoDecoderFFMPEG" - -#define VIDEO_DECODER_ENABLE_DECODING L"EnableDecoding" // bool (default = true) - if false, component will not decode anything -#define VIDEO_DECODER_CODEC_ID L"CodecID" // amf_int64 (AMF_STREAM_CODEC_ID_ENUM) codec ID -#define VIDEO_DECODER_EXTRA_DATA L"ExtraData" // interface to AMFBuffer -#define VIDEO_DECODER_RESOLUTION L"Resolution" // AMFSize -#define VIDEO_DECODER_BITRATE L"BitRate" // amf_int64 (default = 0) -#define VIDEO_DECODER_FRAMERATE L"FrameRate" // AMFRate -#define VIDEO_DECODER_SEEK_POSITION L"SeekPosition" // amf_int64 (default = 0) - -#define VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC L"ColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 - -#endif //#ifndef AMF_VideoDecoderFFMPEG_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FRC.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FRC.h deleted file mode 100644 index dd74ac21..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/FRC.h +++ /dev/null @@ -1,90 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMFFRC_h -#define AMFFRC_h - -#pragma once - -#define AMFFRC L"AMFFRC" - -// Select rendering API for FRC -enum AMF_FRC_ENGINE -{ - FRC_ENGINE_OFF = 0, - FRC_ENGINE_DX12 = 1, - FRC_ENGINE_OPENCL = 2, - FRC_ENGINE_DX11 = 3, -}; - -// Select present mode for FRC -enum AMF_FRC_MODE_TYPE -{ - FRC_OFF = 0, - FRC_ON = 1, - FRC_ONLY_INTERPOLATED = 2, - FRC_x2_PRESENT = 3, - TOTAL_FRC_MODES -}; - -enum AMF_FRC_SNAPSHOT_MODE_TYPE { - FRC_SNAPSHOT_OFF = 0, - FRC_SNAPSHOT_LOAD = 1, - FRC_SNAPSHOT_STORE = 2, - FRC_SNAPSHOT_REGRESSION_TEST= 3, - FRC_SNAPSHOT_STORE_NO_PADDING= 4, - TOTAL_FRC_SNAPSHOT_MODES -}; - -enum AMF_FRC_PROFILE_TYPE { - FRC_PROFILE_LOW = 0, - FRC_PROFILE_HIGH = 1, - FRC_PROFILE_SUPER = 2, - TOTAL_FRC_PROFILES -}; - -enum AMF_FRC_MV_SEARCH_MODE_TYPE { - FRC_MV_SEARCH_NATIVE = 0, - FRC_MV_SEARCH_PERFORMANCE = 1, - TOTAL_FRC_MV_SEARCH_MODES -}; - -#define AMF_FRC_ENGINE_TYPE L"FRCEngineType" // amf_int64(AMF_FRC_ENGINE); default = DX12; determines how the object is initialized and what kernels to use -#define AMF_FRC_OUTPUT_SIZE L"FRCSOutputSize" // AMFSize - output scaling width/height -#define AMF_FRC_MODE L"FRCMode" // amf_int64(AMF_FRC_MODE_TYPE); default = FRC_ONLY_INTERPOLATED; FRC mode -#define AMF_FRC_ENABLE_FALLBACK L"FRCEnableFallback" // bool; default = true; FRC enable fallback mode -#define AMF_FRC_INDICATOR L"FRCIndicator" // bool; default : false; draw indicator in the corner -#define AMF_FRC_PROFILE L"FRCProfile" // amf_int64(AMF_FRC_PROFILE_TYPE); default=FRC_PROFILE_HIGH; FRC profile -#define AMF_FRC_MV_SEARCH_MODE L"FRCMVSEARCHMODE" // amf_int64(AMF_FRC_MV_SEARCH_MODE_TYPE); defaut = FRC_MV_SEARCH_NATIVE; FRC MV search mode -#define AMF_FRC_USE_FUTURE_FRAME L"FRCUseFutureFrame" // bool; default = true; Enable dependency on future frame, improves quality for the cost of latency - -#endif //#ifndef AMFFRC_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/HQScaler.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/HQScaler.h deleted file mode 100644 index 251723e0..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/HQScaler.h +++ /dev/null @@ -1,69 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMFHQScaler_h -#define AMFHQScaler_h - -#pragma once - -#define AMFHQScaler L"AMFHQScaler" - - -// various types of algorithms supported by the high-quality scaler -enum AMF_HQ_SCALER_ALGORITHM_ENUM -{ - AMF_HQ_SCALER_ALGORITHM_BILINEAR = 0, - AMF_HQ_SCALER_ALGORITHM_BICUBIC = 1, - AMF_HQ_SCALER_ALGORITHM_FSR = 2, // deprecated - AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 = 2, - AMF_HQ_SCALER_ALGORITHM_POINT = 3, - AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 = 4, - -}; - - -// PA object properties -#define AMF_HQ_SCALER_ALGORITHM L"HQScalerAlgorithm" // amf_int64(AMF_HQ_SCALER_ALGORITHM_ENUM) (Bi-linear, Bi-cubic, RCAS, Auto)" - determines which scaling algorithm will be used - // auto will chose best option between algorithms available -#define AMF_HQ_SCALER_ENGINE_TYPE L"HQScalerEngineType" // AMF_MEMORY_TYPE (DX11, DX12, OPENCL, VULKAN default : DX11)" - determines how the object is initialized and what kernels to use - -#define AMF_HQ_SCALER_OUTPUT_SIZE L"HQSOutputSize" // AMFSize - output scaling width/hieight - -#define AMF_HQ_SCALER_KEEP_ASPECT_RATIO L"KeepAspectRatio" // bool (default=false) Keep aspect ratio if scaling. -#define AMF_HQ_SCALER_FILL L"Fill" // bool (default=false) fill area out of ROI. -#define AMF_HQ_SCALER_FILL_COLOR L"FillColor" // AMFColor -#define AMF_HQ_SCALER_FROM_SRGB L"FromSRGB" // bool (default=true) Convert to SRGB. - -#define AMF_HQ_SCALER_SHARPNESS L"HQScalerSharpness" // Float in the range of [0.0, 2.0] -#define AMF_HQ_SCALER_FRAME_RATE L"HQScalerFrameRate" // Frame rate (off, 15, 30, 60) - -#endif //#ifndef AMFHQScaler_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/MediaSource.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/MediaSource.h deleted file mode 100644 index 1afdb674..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/MediaSource.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_MediaSource_h -#define AMF_MediaSource_h - -#pragma once - -#include "public/include/core/Interface.h" - -namespace amf -{ - enum AMF_SEEK_TYPE - { - AMF_SEEK_PREV = 0, // nearest packet before pts - AMF_SEEK_NEXT = 1, // nearest packet after pts - AMF_SEEK_PREV_KEYFRAME = 2, // nearest keyframe packet before pts - AMF_SEEK_NEXT_KEYFRAME = 3, // nearest keyframe packet after pts - }; - - //---------------------------------------------------------------------------------------------- - // media source interface. - //---------------------------------------------------------------------------------------------- - class AMFMediaSource : public AMFInterface - { - public: - AMF_DECLARE_IID(0xb367695a, 0xdbd0, 0x4430, 0x95, 0x3b, 0xbc, 0x7d, 0xbd, 0x2a, 0xa7, 0x66) - - // interface - virtual AMF_RESULT AMF_STD_CALL Seek(amf_pts pos, AMF_SEEK_TYPE seekType, amf_int32 whichStream) = 0; - virtual amf_pts AMF_STD_CALL GetPosition() = 0; - virtual amf_pts AMF_STD_CALL GetDuration() = 0; - - virtual void AMF_STD_CALL SetMinPosition(amf_pts pts) = 0; - virtual amf_pts AMF_STD_CALL GetMinPosition() = 0; - virtual void AMF_STD_CALL SetMaxPosition(amf_pts pts) = 0; - virtual amf_pts AMF_STD_CALL GetMaxPosition() = 0; - - virtual amf_uint64 AMF_STD_CALL GetFrameFromPts(amf_pts pts) = 0; - virtual amf_pts AMF_STD_CALL GetPtsFromFrame(amf_uint64 frame) = 0; - - virtual bool AMF_STD_CALL SupportFramesAccess() = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFMediaSourcePtr; -} //namespace amf - -#endif //#ifndef AMF_MediaSource_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreAnalysis.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreAnalysis.h deleted file mode 100644 index ce13117e..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreAnalysis.h +++ /dev/null @@ -1,133 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMFPreAnalysis_h -#define AMFPreAnalysis_h - -#pragma once - -#define AMFPreAnalysis L"AMFPreAnalysis" - - - -enum AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY_ENUM -{ - AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY_LOW = 0, - AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY_MEDIUM = 1, - AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY_HIGH = 2 -}; - - -enum AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY_ENUM -{ - AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY_LOW = 0, - AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY_MEDIUM = 1, - AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY_HIGH = 2 -}; - - -enum AMF_PA_ACTIVITY_TYPE_ENUM -{ - AMF_PA_ACTIVITY_Y = 0, - AMF_PA_ACTIVITY_YUV = 1 -}; - - -enum AMF_PA_CAQ_STRENGTH_ENUM -{ - AMF_PA_CAQ_STRENGTH_LOW = 0, - AMF_PA_CAQ_STRENGTH_MEDIUM = 1, - AMF_PA_CAQ_STRENGTH_HIGH = 2 -}; - -// Perceptual adaptive quantization mode -enum AMF_PA_PAQ_MODE_ENUM -{ - AMF_PA_PAQ_MODE_NONE = 0, - AMF_PA_PAQ_MODE_CAQ = 1 -}; - -// Temporal adaptive quantization mode -enum AMF_PA_TAQ_MODE_ENUM -{ - AMF_PA_TAQ_MODE_NONE = 0, - AMF_PA_TAQ_MODE_1 = 1, - AMF_PA_TAQ_MODE_2 = 2 -}; - -enum AMF_PA_HIGH_MOTION_QUALITY_BOOST_MODE_ENUM -{ - AMF_PA_HIGH_MOTION_QUALITY_BOOST_MODE_NONE = 0, //default - AMF_PA_HIGH_MOTION_QUALITY_BOOST_MODE_AUTO = 1 -}; - - -// PA object properties -#define AMF_PA_ENGINE_TYPE L"PAEngineType" // AMF_MEMORY_TYPE (Host, DX11, OpenCL, Vulkan, DX12, Auto default : UNKNOWN (Auto))" - determines how the object is initialized and what kernels to use - // by default it is Auto (DX11, OpenCL and Vulkan are currently available) - -#define AMF_PA_SCENE_CHANGE_DETECTION_ENABLE L"PASceneChangeDetectionEnable" // bool (default : True) - Enable Scene Change Detection GPU algorithm -#define AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY L"PASceneChangeDetectionSensitivity" // AMF_PA_SCENE_CHANGE_DETECTION_SENSITIVITY_ENUM (default : Medium) - Scene Change Detection Sensitivity -#define AMF_PA_STATIC_SCENE_DETECTION_ENABLE L"PAStaticSceneDetectionEnable" // bool (default : False) - Enable Skip Detection GPU algorithm -#define AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY L"PAStaticSceneDetectionSensitivity" // AMF_PA_STATIC_SCENE_DETECTION_SENSITIVITY_ENUM (default : High) - Allowable absolute difference between pixels (sample counts) -#define AMF_PA_FRAME_SAD_ENABLE L"PAFrameSadEnable" // bool (default : True) - Enable Frame SAD algorithm -#define AMF_PA_ACTIVITY_TYPE L"PAActivityType" // AMF_PA_ACTIVITY_TYPE_ENUM (default : Calculate on Y) - Block activity calculation mode -#define AMF_PA_LTR_ENABLE L"PALongTermReferenceEnable" // bool (default : False) - Enable Automatic Long Term Reference frame management -#define AMF_PA_LOOKAHEAD_BUFFER_DEPTH L"PALookAheadBufferDepth" // amf_uint64 (default : 0) Values: [0, MAX_LOOKAHEAD_DEPTH] - PA lookahead buffer size -#define AMF_PA_PAQ_MODE L"PAPerceptualAQMode" // AMF_PA_PAQ_MODE_ENUM (default : AMF_PA_PAQ_MODE_NONE) - Perceptual AQ mode -#define AMF_PA_TAQ_MODE L"PATemporalAQMode" // AMF_PA_TAQ_MODE_ENUM (default: AMF_PA_TAQ_MODE_NONE) - Temporal AQ mode -#define AMF_PA_HIGH_MOTION_QUALITY_BOOST_MODE L"PAHighMotionQualityBoostMode" // AMF_PA_HIGH_MOTION_QUALITY_BOOST_MODE_ENUM (default: None) - High motion quality boost mode - -/////////////////////////////////////////// -// the following properties are available -// only through the Encoder - trying to -// access/set them when PA is standalone -// will fail - - -#define AMF_PA_INITIAL_QP_AFTER_SCENE_CHANGE L"PAInitialQPAfterSceneChange" // amf_uint64 (default : 0) Values: [0, 51] - Base QP to be used immediately after scene change. If this value is not set, PA will choose a proper QP value -#define AMF_PA_MAX_QP_BEFORE_FORCE_SKIP L"PAMaxQPBeforeForceSkip" // amf_uint64 (default : 35) Values: [0, 51] - When a static scene is detected, a skip frame is inserted only if the previous encoded frame average QP <= this value - - -#define AMF_PA_CAQ_STRENGTH L"PACAQStrength" // AMF_PA_CAQ_STRENGTH_ENUM (default : Medium) - Content Adaptive Quantization (CAQ) strength - - - - -////////////////////////////////////////////////// -// properties set by PA on output buffer interface in standalone mode -#define AMF_PA_ACTIVITY_MAP L"PAActivityMap" // AMFInterface* -> AMFSurface*; Values: int32 - When PA is standalone, there will be a 2D Activity map generated for each frame -#define AMF_PA_SCENE_CHANGE_DETECT L"PASceneChangeDetect" // bool - True/False - available if AMF_PA_SCENE_CHANGE_DETECTION_ENABLE was set to True when PA is standalone -#define AMF_PA_STATIC_SCENE_DETECT L"PAStaticSceneDetect" // bool - True/False - available if AMF_PA_STATIC_SCENE_DETECTION_ENABLE was set to True when PA is standalone - - -#endif //#ifndef AMFPreAnalysis_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreProcessing.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreProcessing.h deleted file mode 100644 index ab59d826..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/PreProcessing.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMFPreProcessing_h -#define AMFPreProcessing_h - -#pragma once - -#define AMFPreProcessing L"AMFPreProcessing" - - -// Pre-processing object properties -#define AMF_PP_ENGINE_TYPE L"PPEngineType" // AMF_MEMORY_TYPE (Host, DX11, OPENCL, Auto default : OPENCL) - determines how the object is initialized and what kernels to use - // by default it is OpenCL (Host, DX11 and OpenCL are currently available) -// add a property that will determine the output format -// by default we output in the same format as input -// but in some cases we might need to change the output -// format to be different than input -#define AMF_PP_OUTPUT_MEMORY_TYPE L"PPOutputFormat" // AMF_MEMORY_TYPE (Host, DX11, OPENCL default : Unknown) - determines format of frame going out - - -#define AMF_PP_ADAPTIVE_FILTER_STRENGTH L"PPAdaptiveFilterStrength" // int (default : 4) - strength: 0 - 10: the higher the value, the stronger the filtering -#define AMF_PP_ADAPTIVE_FILTER_SENSITIVITY L"PPAdaptiveFilterSensitivity" // int (default : 4) - sensitivity: 0 - 10: the lower the value, the more sensitive to edge (preserve more details) - -// Encoder parameters used for adaptive filtering -#define AMF_PP_TARGET_BITRATE L"PPTargetBitrate" // int64 (default: 2000000) - target bit rate -#define AMF_PP_FRAME_RATE L"PPFrameRate" // AMFRate (default: 30, 1) - frame rate -#define AMF_PP_ADAPTIVE_FILTER_ENABLE L"PPAdaptiveFilterEnable" // bool (default: false) - turn on/off adaptive filtering - -#endif //#ifndef AMFPreProcessing_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/SupportedCodecs.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/SupportedCodecs.h deleted file mode 100644 index efdd9705..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/SupportedCodecs.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// An interface available on some components to provide information on supported input and output codecs -//------------------------------------------------------------------------------------------------- -#ifndef AMF_SupportedCodecs_h -#define AMF_SupportedCodecs_h - -#pragma once - -#include "public/include/core/Interface.h" - -//properties on the returned AMFPropertyStorage -#define SUPPORTEDCODEC_ID L"CodecId" //amf_int64 -#define SUPPORTEDCODEC_SAMPLERATE L"SampleRate" //amf_int32 - -namespace amf -{ - class AMFSupportedCodecs : public AMFInterface - { - public: - AMF_DECLARE_IID(0xc1003a83, 0x7934, 0x408a, 0x95, 0x5b, 0xc4, 0xdd, 0x85, 0x9d, 0xf5, 0x61) - - //call with increasing values until it returns AMF_OUT_OF_RANGE - virtual AMF_RESULT AMF_STD_CALL GetInputCodecAt(amf_size index, AMFPropertyStorage** codec) const = 0; - virtual AMF_RESULT AMF_STD_CALL GetOutputCodecAt(amf_size index, AMFPropertyStorage** codec) const = 0; - }; - typedef AMFInterfacePtr_T AMFSupportedCodecsPtr; -} - -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VQEnhancer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VQEnhancer.h deleted file mode 100644 index 6d3468ab..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VQEnhancer.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMFVQEnhancer_h -#define AMFVQEnhancer_h - -#pragma once - -#define VE_FCR_DEFAULT_ATTENUATION 0.1 - -#define AMFVQEnhancer L"AMFVQEnhancer" - -#define AMF_VIDEO_ENHANCER_ENGINE_TYPE L"AMF_VIDEI_ENHANCER_ENGINE_TYPE" // AMF_MEMORY_TYPE (DX11, DX12, OPENCL, VULKAN default : DX11)" - determines how the object is initialized and what kernels to use -#define AMF_VIDEO_ENHANCER_OUTPUT_SIZE L"AMF_VIDEO_ENHANCER_OUTPUT_SIZE" // AMFSize -#define AMF_VE_FCR_ATTENUATION L"AMF_VE_FCR_ATTENUATION" // Float in the range of [0.02, 0.4], default : 0.1 -#define AMF_VE_FCR_RADIUS L"AMF_VE_FCR_RADIUS" // int in the range of [1, 4] -#define AMF_VE_FCR_SPLIT_VIEW L"AMF_VE_FCR_SPLIT_VIEW" // FCR View split window - -#endif //#ifndef AMFVQEnhancer_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoCapture.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoCapture.h deleted file mode 100644 index db0f6c0b..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoCapture.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// ZCamLive interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_VideoCapture_h -#define AMF_VideoCapture_h - -#pragma once - -#define VIDEOCAP_DEVICE_COUNT L"VideoCapDeviceCount" // amf_int64, (default=2), number of video capture devices -#define VIDEOCAP_DEVICE_NAME L"VideoCapDeviceName" // WString, (default=""), name of the video capture device -#define VIDEOCAP_DEVICE_ACTIVE L"VideoCapDeviceActive" // WString, (default=""), name of the selected video capture device - -#define VIDEOCAP_CODEC L"CodecID" // WString (default = "AMFVideoDecoderUVD_H264_AVC"), UVD codec ID -#define VIDEOCAP_FRAMESIZE L"FrameSize" // AMFSize, (default=AMFConstructSize(1920, 1080)), frame size in pixels - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentVideoCapture(amf::AMFContext* pContext, amf::AMFComponentEx** ppComponent); -} -#endif // AMF_VideoCapture_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoConverter.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoConverter.h deleted file mode 100644 index ed8559a2..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoConverter.h +++ /dev/null @@ -1,121 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// AMFFVideoConverter interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_VideoConverter_h -#define AMF_VideoConverter_h -#pragma once - -#include "Component.h" -#include "ColorSpace.h" - -#define AMFVideoConverter L"AMFVideoConverter" - -enum AMF_VIDEO_CONVERTER_SCALE_ENUM -{ - AMF_VIDEO_CONVERTER_SCALE_INVALID = -1, - AMF_VIDEO_CONVERTER_SCALE_BILINEAR = 0, - AMF_VIDEO_CONVERTER_SCALE_BICUBIC = 1 -}; - -enum AMF_VIDEO_CONVERTER_TONEMAPPING_ENUM -{ - AMF_VIDEO_CONVERTER_TONEMAPPING_COPY = 0, - AMF_VIDEO_CONVERTER_TONEMAPPING_AMD = 1, - AMF_VIDEO_CONVERTER_TONEMAPPING_LINEAR = 2, - AMF_VIDEO_CONVERTER_TONEMAPPING_GAMMA = 3, - AMF_VIDEO_CONVERTER_TONEMAPPING_REINHARD = 4, - AMF_VIDEO_CONVERTER_TONEMAPPING_2390 = 5, -}; - - - -#define AMF_VIDEO_CONVERTER_OUTPUT_FORMAT L"OutputFormat" // Values : AMF_SURFACE_NV12 or AMF_SURFACE_BGRA or AMF_SURFACE_YUV420P -#define AMF_VIDEO_CONVERTER_MEMORY_TYPE L"MemoryType" // Values : AMF_MEMORY_DX11 or AMF_MEMORY_DX9 or AMF_MEMORY_UNKNOWN (get from input type) -#define AMF_VIDEO_CONVERTER_COMPUTE_DEVICE L"ComputeDevice" // Values : AMF_MEMORY_COMPUTE_FOR_DX9 enumeration - -#define AMF_VIDEO_CONVERTER_OUTPUT_SIZE L"OutputSize" // AMFSize (default=0,0) width in pixels. default means no scaling -#define AMF_VIDEO_CONVERTER_OUTPUT_RECT L"OutputRect" // AMFRect (default=0, 0, 0, 0) rectangle in pixels. default means no rect -#define AMF_VIDEO_CONVERTER_SCALE L"ScaleType" // amf_int64(AMF_VIDEO_CONVERTER_SCALE_ENUM); default = AMF_VIDEO_CONVERTER_SCALE_BILINEAR -#define AMF_VIDEO_CONVERTER_FORCE_OUTPUT_SURFACE_SIZE L"ForceOutputSurfaceSize" // bool (default=false) Force output size from output surface - -#define AMF_VIDEO_CONVERTER_KEEP_ASPECT_RATIO L"KeepAspectRatio" // bool (default=false) Keep aspect ratio if scaling. -#define AMF_VIDEO_CONVERTER_FILL L"Fill" // bool (default=false) fill area out of ROI. -#define AMF_VIDEO_CONVERTER_FILL_COLOR L"FillColor" // AMFColor - -//------------------------------------------------------------------------------------------------- -// SDR color conversion -//------------------------------------------------------------------------------------------------- -#define AMF_VIDEO_CONVERTER_COLOR_PROFILE L"ColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO -#define AMF_VIDEO_CONVERTER_LINEAR_RGB L"LinearRGB" // bool (default=false) Convert to/from linear RGB instead of sRGB using AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC or by default AMF_VIDEO_CONVERTER_TRANSFER_CHARACTERISTIC - -//------------------------------------------------------------------------------------------------- -// HDR color conversion -//------------------------------------------------------------------------------------------------- -// AMF_VIDEO_CONVERTER_COLOR_PROFILE is used to define color space conversion - -// HDR data - can be set on converter or respectively on input and output surfaces (output surface via custom allocator) -// if present, HDR_METADATA primary color overwrites COLOR_PRIMARIES - -// these properties can be set on converter component to configure input and output -// these properties overwrite properties set on surface - see below -#define AMF_VIDEO_CONVERTER_INPUT_TRANSFER_CHARACTERISTIC L"InputTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 See ColorSpace.h for enum -#define AMF_VIDEO_CONVERTER_INPUT_COLOR_PRIMARIES L"InputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_CONVERTER_INPUT_COLOR_RANGE L"InputColorRange" // amf_int64(AMF_COLOR_RANGE_ENUM) default = AMF_COLOR_RANGE_UNDEFINED -#define AMF_VIDEO_CONVERTER_INPUT_HDR_METADATA L"InputHdrMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL -#define AMF_VIDEO_CONVERTER_INPUT_TONEMAPPING L"InputTonemapping" // amf_int64(AMF_VIDEO_CONVERTER_TONEMAPPING_ENUM) default = AMF_VIDEO_CONVERTER_TONEMAPPING_LINEAR - -#define AMF_VIDEO_CONVERTER_OUTPUT_TRANSFER_CHARACTERISTIC L"OutputTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 See ColorSpace.h for enum -#define AMF_VIDEO_CONVERTER_OUTPUT_COLOR_PRIMARIES L"OutputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_CONVERTER_OUTPUT_COLOR_RANGE L"OutputColorRange" // amf_int64(AMF_COLOR_RANGE_ENUM) default = AMF_COLOR_RANGE_UNDEFINED -#define AMF_VIDEO_CONVERTER_OUTPUT_HDR_METADATA L"OutputHdrMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL -#define AMF_VIDEO_CONVERTER_OUTPUT_TONEMAPPING L"OutputTonemapping" // amf_int64(AMF_VIDEO_CONVERTER_TONEMAPPING_ENUM) default = AMF_VIDEO_CONVERTER_TONEMAPPING_AMD - -// these properties can be set on input or outout surface See ColorSpace.h -// the same as decoder properties set on input surface - see below -//#define AMF_VIDEO_COLOR_TRANSFER_CHARACTERISTIC L"ColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 See ColorSpace.h for enum -//#define AMF_VIDEO_COLOR_PRIMARIES L"ColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 7.1 See ColorSpace.h for enum -//#define AMF_VIDEO_COLOR_RANGE L"ColorRange" // amf_int64(AMF_COLOR_RANGE_ENUM) default = AMF_COLOR_RANGE_UNDEFINED -//#define AMF_VIDEO_COLOR_HDR_METADATA L"HdrMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -// If decoder properties can be set on input see VideoDecoder.h -// AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC -// AMF_VIDEO_DECODER_COLOR_PRIMARIES -// AMF_VIDEO_DECODER_COLOR_RANGE -// AMF_VIDEO_DECODER_HDR_METADATA - -#define AMF_VIDEO_CONVERTER_USE_DECODER_HDR_METADATA L"UseDecoderHDRMetadata" // bool (default=true) enables use of decoder / surface input color properties above - - -#endif //#ifndef AMF_VideoConverter_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoDecoderUVD.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoDecoderUVD.h deleted file mode 100644 index b9cebfd5..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoDecoderUVD.h +++ /dev/null @@ -1,135 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// VideoDecoderUVD interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_VideoDecoderUVD_h -#define AMF_VideoDecoderUVD_h -#pragma once - -#include "Component.h" -#include "ColorSpace.h" - -#define AMFVideoDecoderUVD_MPEG2 L"AMFVideoDecoderUVD_MPEG2" -#define AMFVideoDecoderUVD_MPEG4 L"AMFVideoDecoderUVD_MPEG4" -#define AMFVideoDecoderUVD_WMV3 L"AMFVideoDecoderUVD_WMV3" -#define AMFVideoDecoderUVD_VC1 L"AMFVideoDecoderUVD_VC1" -#define AMFVideoDecoderUVD_H264_AVC L"AMFVideoDecoderUVD_H264_AVC" -#define AMFVideoDecoderUVD_H264_MVC L"AMFVideoDecoderUVD_H264_MVC" -#define AMFVideoDecoderUVD_H264_SVC L"AMFVideoDecoderUVD_H264_SVC" -#define AMFVideoDecoderUVD_MJPEG L"AMFVideoDecoderUVD_MJPEG" -#define AMFVideoDecoderHW_H265_HEVC L"AMFVideoDecoderHW_H265_HEVC" -#define AMFVideoDecoderHW_H265_MAIN10 L"AMFVideoDecoderHW_H265_MAIN10" // deprecated, AMFVideoDecoderHW_H265_HEVC can be used -#define AMFVideoDecoderHW_VP9 L"AMFVideoDecoderHW_VP9" -#define AMFVideoDecoderHW_VP9_10BIT L"AMFVideoDecoderHW_VP9_10BIT" // deprecated, AMFVideoDecoderHW_VP9 can be used -#define AMFVideoDecoderHW_AV1 L"AMFVideoDecoderHW_AV1" -#define AMFVideoDecoderHW_AV1_12BIT L"AMFVideoDecoderHW_AV1_12BIT" // deprecated, AMFVideoDecoderHW_AV1 can be used - -enum AMF_VIDEO_DECODER_MODE_ENUM -{ - AMF_VIDEO_DECODER_MODE_REGULAR = 0, // DPB delay is based on number of reference frames + 1 (from SPS) - AMF_VIDEO_DECODER_MODE_COMPLIANT, // DPB delay is based on profile - up to 16 - AMF_VIDEO_DECODER_MODE_LOW_LATENCY, // DPB delay is 0. Expect stream with no reordering in P-Frames or B-Frames. B-frames can be present as long as they do not introduce any frame re-ordering -}; -enum AMF_TIMESTAMP_MODE_ENUM -{ - AMF_TS_PRESENTATION = 0, // default. decoder will preserve timestamps from input to output - AMF_TS_SORT, // decoder will resort PTS list - AMF_TS_DECODE // timestamps reflect decode order - decoder will reuse them -}; - -#define AMF_VIDEO_DECODER_SURFACE_COPY L"SurfaceCopy" // amf_bool; default = false; return output surfaces as a copy -#define AMF_VIDEO_DECODER_EXTRADATA L"ExtraData" // AMFInterface* -> AMFBuffer* - AVCC - size length + SPS/PPS; or as Annex B. Optional if stream is Annex B -#define AMF_VIDEO_DECODER_FRAME_RATE L"FrameRate" // amf_double; default = 0.0, optional property to restore duration in the output if needed -#define AMF_TIMESTAMP_MODE L"TimestampMode" // amf_int64(AMF_TIMESTAMP_MODE_ENUM) - default AMF_TS_PRESENTATION - how input timestamps are treated - -// dynamic/adaptive resolution change -#define AMF_VIDEO_DECODER_ADAPTIVE_RESOLUTION_CHANGE L"AdaptiveResolutionChange" // amf_bool; default = false; reuse allocated surfaces if new resolution is smaller -#define AMF_VIDEO_DECODER_ALLOC_SIZE L"AllocSize" // AMFSize; default (1920,1088); size of allocated surface if AdaptiveResolutionChange is true -#define AMF_VIDEO_DECODER_CURRENT_SIZE L"CurrentSize" // AMFSize; default = (0,0); current size of the video - -// reference frame management -#define AMF_VIDEO_DECODER_REORDER_MODE L"ReorderMode" // amf_int64(AMF_VIDEO_DECODER_MODE_ENUM); default = AMF_VIDEO_DECODER_MODE_REGULAR; defines number of surfaces in DPB list. -#define AMF_VIDEO_DECODER_SURFACE_POOL_SIZE L"SurfacePoolSize" // amf_int64; number of surfaces in the decode pool = DPB list size + number of surfaces for presentation -#define AMF_VIDEO_DECODER_DPB_SIZE L"DPBSize" // amf_int64; minimum number of surfaces for reordering - -#define AMF_VIDEO_DECODER_DEFAULT_SURFACES_FOR_TRANSIT 5 // if AMF_VIDEO_DECODER_SURFACE_POOL_SIZE is 0 , AMF_VIDEO_DECODER_SURFACE_POOL_SIZE=AMF_VIDEO_DECODER_DEFAULT_SURFACES_FOR_TRANSIT+AMF_VIDEO_DECODER_DPB_SIZE - -// Decoder capabilities - exposed in AMFCaps interface -#define AMF_VIDEO_DECODER_CAP_NUM_OF_STREAMS L"NumOfStreams" // amf_int64; maximum number of decode streams supported - - -// metadata information: can be set on output surface - -// Properties could be set on surface based on HDR SEI or VUI header -#define AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC L"ColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 -#define AMF_VIDEO_DECODER_COLOR_PRIMARIES L"ColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 7.1 -#define AMF_VIDEO_DECODER_HDR_METADATA L"HdrMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -/////// AMF_VIDEO_DECODER_FULL_RANGE_COLOR deprecated, use AMF_VIDEO_DECODER_COLOR_RANGE -#define AMF_VIDEO_DECODER_FULL_RANGE_COLOR L"FullRangeColor" // bool; default = false; false = studio range, true = full range -/////// -#define AMF_VIDEO_DECODER_COLOR_RANGE L"ColorRange" // amf_int64(AMF_COLOR_RANGE_ENUM) default = AMF_COLOR_RANGE_UNDEFINED - -// can be set on output surface if YUV outout or on component to overwrite VUI -#define AMF_VIDEO_DECODER_COLOR_PROFILE L"ColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO - -// properties to be set on decoder if internal converter is used -#define AMF_VIDEO_DECODER_OUTPUT_TRANSFER_CHARACTERISTIC L"OutColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_DECODER_OUTPUT_COLOR_PRIMARIES L"OutputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_DECODER_OUTPUT_HDR_METADATA L"OutHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -#define AMF_VIDEO_DECODER_LOW_LATENCY L"LowLatencyDecode" // amf_bool; default = false; true = low latency decode, false = regular decode - -#if defined(__ANDROID__) -#define AMF_VIDEO_DECODER_NATIVEWINDOW L"AndroidNativeWindow" // amf_int64; default = 0; pointer to native window -#endif //__ANDROID__ - - -#if defined(__APPLE__) -#define AMF_VIDEO_DECODER_NATIVEWINDOW L"AppleNativeWindow" // amf_int64; default = 0; pointer to native window -#endif //__APPLE__ - -#define AMF_VIDEO_DECODER_ENABLE_SMART_ACCESS_VIDEO L"EnableDecoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature -#define AMF_VIDEO_DECODER_SKIP_TRANSFER_SMART_ACCESS_VIDEO L"SkipTransferSmartAccessVideo" // amf_bool; default = false; true = keeps output on GPU where it ran -#define AMF_VIDEO_DECODER_OUTPUT_FORMAT L"OutputDecodeFormat" // amf_int64 (AMF_SURFACE_FORMAT) detected output format - -#define AMF_VIDEO_DECODER_CAP_SUPPORT_SMART_ACCESS_VIDEO L"SupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video - -#define AMF_VIDEO_DECODER_SURFACE_CPU L"SurfaceCpu" // amf_bool. default = false, true = hint to decoder that output will be consumed on cpu - -#define AMF_VIDEO_DECODER_INSTANCE_INDEX L"DecoderInstance" // amf_int64; selected HW instance idx -#define AMF_VIDEO_DECODER_CAP_NUM_OF_HW_INSTANCES L"NumOfHwDecoderInstances" // amf_int64 number of HW decoder instances - - -#endif //#ifndef AMF_VideoDecoderUVD_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderAV1.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderAV1.h deleted file mode 100644 index 351f6421..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderAV1.h +++ /dev/null @@ -1,366 +0,0 @@ -// -// Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// VideoEncoderHW_AV1 interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_VideoEncoderAV1_h -#define AMF_VideoEncoderAV1_h -#pragma once - -#include "Component.h" -#include "ColorSpace.h" -#include "PreAnalysis.h" - -#define AMFVideoEncoder_AV1 L"AMFVideoEncoderHW_AV1" - -enum AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_NONE = 0, // No encoding latency requirement. Encoder will balance encoding time and power consumption. - AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_POWER_SAVING_REAL_TIME = 1, // Try the best to finish encoding a frame within 1/framerate sec. This mode may cause more power consumption - AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_REAL_TIME = 2, // Try the best to finish encoding a frame within 1/(2 x framerate) sec. This mode will cause more power consumption than POWER_SAVING_REAL_TIME - AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_LOWEST_LATENCY = 3 // Encoding as fast as possible. This mode causes highest power consumption. -}; - -enum AMF_VIDEO_ENCODER_AV1_USAGE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING = 0, - AMF_VIDEO_ENCODER_AV1_USAGE_ULTRA_LOW_LATENCY = 2, - AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY = 1, - AMF_VIDEO_ENCODER_AV1_USAGE_WEBCAM = 3, - AMF_VIDEO_ENCODER_AV1_USAGE_HIGH_QUALITY = 4, - AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY_HIGH_QUALITY = 5 -}; - -enum AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM -{ - AMF_VIDEO_ENCODER_AV1_LEVEL_2_0 = 0, - AMF_VIDEO_ENCODER_AV1_LEVEL_2_1 = 1, - AMF_VIDEO_ENCODER_AV1_LEVEL_2_2 = 2, - AMF_VIDEO_ENCODER_AV1_LEVEL_2_3 = 3, - AMF_VIDEO_ENCODER_AV1_LEVEL_3_0 = 4, - AMF_VIDEO_ENCODER_AV1_LEVEL_3_1 = 5, - AMF_VIDEO_ENCODER_AV1_LEVEL_3_2 = 6, - AMF_VIDEO_ENCODER_AV1_LEVEL_3_3 = 7, - AMF_VIDEO_ENCODER_AV1_LEVEL_4_0 = 8, - AMF_VIDEO_ENCODER_AV1_LEVEL_4_1 = 9, - AMF_VIDEO_ENCODER_AV1_LEVEL_4_2 = 10, - AMF_VIDEO_ENCODER_AV1_LEVEL_4_3 = 11, - AMF_VIDEO_ENCODER_AV1_LEVEL_5_0 = 12, - AMF_VIDEO_ENCODER_AV1_LEVEL_5_1 = 13, - AMF_VIDEO_ENCODER_AV1_LEVEL_5_2 = 14, - AMF_VIDEO_ENCODER_AV1_LEVEL_5_3 = 15, - AMF_VIDEO_ENCODER_AV1_LEVEL_6_0 = 16, - AMF_VIDEO_ENCODER_AV1_LEVEL_6_1 = 17, - AMF_VIDEO_ENCODER_AV1_LEVEL_6_2 = 18, - AMF_VIDEO_ENCODER_AV1_LEVEL_6_3 = 19, - AMF_VIDEO_ENCODER_AV1_LEVEL_7_0 = 20, - AMF_VIDEO_ENCODER_AV1_LEVEL_7_1 = 21, - AMF_VIDEO_ENCODER_AV1_LEVEL_7_2 = 22, - AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 = 23 -}; - -enum AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_ENUM -{ - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN = -1, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP = 0, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR = 1, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR = 2, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR = 3, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_QUALITY_VBR = 4, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_HIGH_QUALITY_VBR = 5, - AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR = 6 -}; - -enum AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY = 1, - AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082 = 2, - AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS = 3 -}; - -enum AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_NONE = 0, - AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_KEY = 1, - AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_INTRA_ONLY = 2, - AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_SWITCH = 3, - AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_SHOW_EXISTING = 4 -}; - -enum AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_KEY = 0, - AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_INTRA_ONLY = 1, - AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_INTER = 2, - AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_SWITCH = 3, - AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_SHOW_EXISTING = 4 -}; - -enum AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_ENUM -{ - AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY = 0, - AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_QUALITY = 30, - AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_BALANCED = 70, - AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED = 100 -}; - -enum AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE = 0, - AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_GOP_ALIGNED = 1, - AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED = 2, - AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_SUPPRESSED = 3 -}; - -enum AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_NONE = 0, - AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_FIXED_INTERVAL = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_CDEF_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_CDEF_DISABLE = 0, - AMF_VIDEO_ENCODER_AV1_CDEF_ENABLE_DEFAULT = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_DISABLE = 0, - AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENABLE_DEFAULT = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_AQ_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_AQ_MODE_NONE = 0, - AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ = 1 // Content adaptive quantization mode -}; - -enum AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__DISABLED = 0, - AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__GOP_ALIGNED = 1, - AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__CONTINUOUS = 2 -}; -enum AMF_VIDEO_ENCODER_AV1_LTR_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_LTR_MODE_RESET_UNUSED = 0, - AMF_VIDEO_ENCODER_AV1_LTR_MODE_KEEP_UNUSED = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE_FRAME = 0, - AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE_TILE = 1 -}; - -enum AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_FRAME = 0, - AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_TILE = 1, - AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_TILE_LAST = 2 -}; -// *** Static properties - can be set only before Init() *** - -// Encoder Engine Settings -#define AMF_VIDEO_ENCODER_AV1_ENCODER_INSTANCE_INDEX L"Av1EncoderInstanceIndex" // amf_int64; default = 0; selected HW instance idx. The number of instances is queried by using AMF_VIDEO_ENCODER_AV1_CAP_NUM_OF_HW_INSTANCES -#define AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE L"Av1EncodingLatencyMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_ENUM); default = depends on USAGE; The encoding latency mode. -#define AMF_VIDEO_ENCODER_AV1_QUERY_TIMEOUT L"Av1QueryTimeout" // amf_int64; default = 0 (no wait); timeout for QueryOutput call in ms. - -// Usage Settings -#define AMF_VIDEO_ENCODER_AV1_USAGE L"Av1Usage" // amf_int64(AMF_VIDEO_ENCODER_AV1_USAGE_ENUM); default = N/A; Encoder usage. fully configures parameter set. - -// Session Configuration -#define AMF_VIDEO_ENCODER_AV1_FRAMESIZE L"Av1FrameSize" // AMFSize; default = 0,0; Frame size -#define AMF_VIDEO_ENCODER_AV1_COLOR_BIT_DEPTH L"Av1ColorBitDepth" // amf_int64(AMF_COLOR_BIT_DEPTH_ENUM); default = AMF_COLOR_BIT_DEPTH_8 -#define AMF_VIDEO_ENCODER_AV1_PROFILE L"Av1Profile" // amf_int64(AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM) ; default = depends on USAGE; the codec profile of the coded bitstream -#define AMF_VIDEO_ENCODER_AV1_LEVEL L"Av1Level" // amf_int64 (AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM); default = depends on USAGE; the codec level of the coded bitstream -#define AMF_VIDEO_ENCODER_AV1_TILES_PER_FRAME L"Av1NumTilesPerFrame" // amf_int64; default = 1; Number of tiles Per Frame. This is treated as suggestion. The actual number of tiles might be different due to compliance or encoder limitation. -#define AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET L"Av1QualityPreset" // amf_int64(AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_ENUM); default = depends on USAGE; Quality Preset - -// Codec Configuration -#define AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS L"Av1ScreenContentTools" // bool; default = true; If true, allow enabling screen content tools by AMF_VIDEO_ENCODER_AV1_PALETTE_MODE and AMF_VIDEO_ENCODER_AV1_FORCE_INTEGER_MV; if false, all screen content tools are disabled. -#define AMF_VIDEO_ENCODER_AV1_ORDER_HINT L"Av1OrderHint" // bool; default = depends on USAGE; If true, code order hint; if false, don't code order hint -#define AMF_VIDEO_ENCODER_AV1_FRAME_ID L"Av1FrameId" // bool; default = depends on USAGE; If true, code frame id; if false, don't code frame id -#define AMF_VIDEO_ENCODER_AV1_TILE_GROUP_OBU L"Av1TileGroupObu" // bool; default = depends on USAGE; If true, code FrameHeaderObu + TileGroupObu and each TileGroupObu contains one tile; if false, code FrameObu. -#define AMF_VIDEO_ENCODER_AV1_CDEF_MODE L"Av1CdefMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_CDEF_MODE_ENUM); default = depends on USAGE; Cdef mode -#define AMF_VIDEO_ENCODER_AV1_ERROR_RESILIENT_MODE L"Av1ErrorResilientMode" // bool; default = depends on USAGE; If true, enable error resilient mode; if false, disable error resilient mode - -// Rate Control and Quality Enhancement -#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD L"Av1RateControlMethod" // amf_int64(AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_ENUM); default = depends on USAGE; Rate Control Method -#define AMF_VIDEO_ENCODER_AV1_QVBR_QUALITY_LEVEL L"Av1QvbrQualityLevel" // amf_int64; default = 23; QVBR quality level; range = 1-51 -#define AMF_VIDEO_ENCODER_AV1_INITIAL_VBV_BUFFER_FULLNESS L"Av1InitialVBVBufferFullness" // amf_int64; default = depends on USAGE; Initial VBV Buffer Fullness 0=0% 64=100% - -// Alignment Mode Configuration -#define AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE L"Av1AlignmentMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM); default = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY; Alignment Mode. - -#define AMF_VIDEO_ENCODER_AV1_PRE_ANALYSIS_ENABLE L"Av1EnablePreAnalysis" // bool; default = depends on USAGE; If true, enables the pre-analysis module. Refer to AMF Video PreAnalysis API reference for more details. If false, disable the pre-analysis module. -#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_PREENCODE L"Av1RateControlPreEncode" // bool; default = depends on USAGE; If true, enables pre-encode assist in rate control; if false, disables pre-encode assist in rate control. -#define AMF_VIDEO_ENCODER_AV1_HIGH_MOTION_QUALITY_BOOST L"Av1HighMotionQualityBoost" // bool; default = depends on USAGE; If true, enable high motion quality boost mode; if false, disable high motion quality boost mode. -#define AMF_VIDEO_ENCODER_AV1_AQ_MODE L"Av1AQMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_AQ_MODE_ENUM); default = depends on USAGE; AQ mode - -// Picture Management Configuration -#define AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS L"Av1MaxNumOfTemporalLayers" // amf_int64; default = depends on USAGE; Max number of temporal layers might be enabled. The maximum value can be queried from AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS -#define AMF_VIDEO_ENCODER_AV1_MAX_LTR_FRAMES L"Av1MaxNumLTRFrames" // amf_int64; default = depends on USAGE; Max number of LTR frames. The maximum value can be queried from AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES -#define AMF_VIDEO_ENCODER_AV1_LTR_MODE L"Av1LTRMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_LTR_MODE_ENUM); default = AMF_VIDEO_ENCODER_AV1_LTR_MODE_RESET_UNUSED; remove/keep unused LTRs (not specified in property AMF_VIDEO_ENCODER_AV1_FORCE_LTR_REFERENCE_BITFIELD) -#define AMF_VIDEO_ENCODER_AV1_MAX_NUM_REFRAMES L"Av1MaxNumRefFrames" // amf_int64; default = 1; Maximum number of reference frames - -// color conversion -#define AMF_VIDEO_ENCODER_AV1_INPUT_HDR_METADATA L"Av1InHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -// Miscellaneous -#define AMF_VIDEO_ENCODER_AV1_EXTRA_DATA L"Av1ExtraData" // AMFInterface* - > AMFBuffer*; buffer to retrieve coded sequence header -#define AMF_VIDEO_ENCODER_AV1_ENABLE_SMART_ACCESS_VIDEO L"Av1EnableEncoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature -#define AMF_VIDEO_ENCODER_AV1_INPUT_QUEUE_SIZE L"Av1InputQueueSize" // amf_int64; default 16; Set amf input queue size - -// Tile Output -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE L"AV1OutputMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE_ENUM); default = AMF_VIDEO_ENCODER_AV1_OUTPUT_MODE_FRAME - defines encoder output mode - -// *** Dynamic properties - can be set anytime *** - -// Codec Configuration -#define AMF_VIDEO_ENCODER_AV1_PALETTE_MODE L"Av1PaletteMode" // bool; default = true; If true, enable palette mode; if false, disable palette mode. Valid only when AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS is true. -#define AMF_VIDEO_ENCODER_AV1_FORCE_INTEGER_MV L"Av1ForceIntegerMv" // bool; default = false; If true, enable force integer MV; if false, disable force integer MV. Valid only when AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS is true. -#define AMF_VIDEO_ENCODER_AV1_CDF_UPDATE L"Av1CdfUpdate" // bool; default = depends on USAGE; If true, enable CDF update; if false, disable CDF update. -#define AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE L"Av1CdfFrameEndUpdateMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENUM); default = depends on USAGE; CDF frame end update mode - - -// Rate Control and Quality Enhancement -#define AMF_VIDEO_ENCODER_AV1_VBV_BUFFER_SIZE L"Av1VBVBufferSize" // amf_int64; default = depends on USAGE; VBV Buffer Size in bits -#define AMF_VIDEO_ENCODER_AV1_FRAMERATE L"Av1FrameRate" // AMFRate; default = depends on usage; Frame Rate -#define AMF_VIDEO_ENCODER_AV1_ENFORCE_HRD L"Av1EnforceHRD" // bool; default = depends on USAGE; If true, enforce HRD; if false, HRD is not enforced. -#define AMF_VIDEO_ENCODER_AV1_FILLER_DATA L"Av1FillerData" // bool; default = depends on USAGE; If true, code filler data when needed; if false, don't code filler data. -#define AMF_VIDEO_ENCODER_AV1_TARGET_BITRATE L"Av1TargetBitrate" // amf_int64; default = depends on USAGE; Target bit rate in bits -#define AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE L"Av1PeakBitrate" // amf_int64; default = depends on USAGE; Peak bit rate in bits - -#define AMF_VIDEO_ENCODER_AV1_MAX_COMPRESSED_FRAME_SIZE L"Av1MaxCompressedFrameSize" // amf_int64; default = 0; Max compressed frame Size in bits. 0 - no limit -#define AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA L"Av1MinQIndex_Intra" // amf_int64; default = depends on USAGE; Min QIndex for intra frames; range = 1-255 -#define AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA L"Av1MaxQIndex_Intra" // amf_int64; default = depends on USAGE; Max QIndex for intra frames; range = 1-255 -#define AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER L"Av1MinQIndex_Inter" // amf_int64; default = depends on USAGE; Min QIndex for inter frames; range = 1-255 -#define AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER L"Av1MaxQIndex_Inter" // amf_int64; default = depends on USAGE; Max QIndex for inter frames; range = 1-255 - -#define AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTRA L"Av1QIndex_Intra" // amf_int64; default = depends on USAGE; intra-frame QIndex; range = 1-255 -#define AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTER L"Av1QIndex_Inter" // amf_int64; default = depends on USAGE; inter-frame QIndex; range = 1-255 - -#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_SKIP_FRAME L"Av1RateControlSkipFrameEnable" // bool; default = depends on USAGE; If true, rate control may code skip frame when needed; if false, rate control will not code skip frame. - - -// Picture Management Configuration -#define AMF_VIDEO_ENCODER_AV1_GOP_SIZE L"Av1GOPSize" // amf_int64; default = depends on USAGE; GOP Size (distance between automatically inserted key frames). If 0, key frame will be inserted at first frame only. Note that GOP may be interrupted by AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE. -#define AMF_VIDEO_ENCODER_AV1_INTRA_PERIOD L"Av1IntraPeriod" // amf_int64; default = 0; Intra period in frames. -#define AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE L"Av1HeaderInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_ENUM); default = depends on USAGE; sequence header insertion mode -#define AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE L"Av1SwitchFrameInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_ENUM); default = depends on USAGE; switch frame insertin mode -#define AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INTERVAL L"Av1SwitchFrameInterval" // amf_int64; default = depends on USAGE; the interval between two inserted switch frames. Valid only when AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE is AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_FIXED_INTERVAL. -#define AMF_VIDEO_ENCODER_AV1_NUM_TEMPORAL_LAYERS L"Av1NumTemporalLayers" // amf_int64; default = depends on USAGE; Number of temporal layers. Can be changed at any time but the change is only applied when encoding next base layer frame. - -#define AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE L"Av1IntraRefreshMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE_ENUM); default AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__DISABLED -#define AMF_VIDEO_ENCODER_AV1_INTRAREFRESH_STRIPES L"Av1IntraRefreshNumOfStripes" // amf_int64; default = N/A; Valid only when intra refresh is enabled. - -// color conversion -#define AMF_VIDEO_ENCODER_AV1_INPUT_COLOR_PROFILE L"Av1InputColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_AV1_INPUT_TRANSFER_CHARACTERISTIC L"Av1InputColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 section 7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_AV1_INPUT_COLOR_PRIMARIES L"Av1InputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum - -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE L"Av1OutputColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC L"Av1OutputColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 ?7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES L"Av1OutputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum - - -// Frame encode parameters -#define AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE L"Av1ForceFrameType" // amf_int64(AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_ENUM); default = AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_NONE; generate particular frame type -#define AMF_VIDEO_ENCODER_AV1_FORCE_INSERT_SEQUENCE_HEADER L"Av1ForceInsertSequenceHeader" // bool; default = false; If true, force insert sequence header with current frame; -#define AMF_VIDEO_ENCODER_AV1_MARK_CURRENT_WITH_LTR_INDEX L"Av1MarkCurrentWithLTRIndex" // amf_int64; default = N/A; Mark current frame with LTR index -#define AMF_VIDEO_ENCODER_AV1_FORCE_LTR_REFERENCE_BITFIELD L"Av1ForceLTRReferenceBitfield" // amf_int64; default = 0; force LTR bit-field -#define AMF_VIDEO_ENCODER_AV1_ROI_DATA L"Av1ROIData" // 2D AMFSurface, surface format: AMF_SURFACE_GRAY32; Importance value for each 64x64 block ranges from `0` (least important) to `10` (most important), stored in 32bit unsigned format -#define AMF_VIDEO_ENCODER_AV1_PSNR_FEEDBACK L"Av1PSNRFeedback" // amf_bool; default = false; Signal encoder to calculate PSNR score -#define AMF_VIDEO_ENCODER_AV1_SSIM_FEEDBACK L"Av1SSIMFeedback" // amf_bool; default = false; Signal encoder to calculate SSIM score -#define AMF_VIDEO_ENCODER_AV1_STATISTICS_FEEDBACK L"Av1StatisticsFeedback" // amf_bool; default = false; Signal encoder to collect and feedback encoder statistics -#define AMF_VIDEO_ENCODER_AV1_BLOCK_Q_INDEX_FEEDBACK L"Av1BlockQIndexFeedback" // amf_bool; default = false; Signal encoder to collect and feedback block level QIndex values - -// Encode output parameters -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE L"Av1OutputFrameType" // amf_int64(AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_ENUM); default = N/A -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_MARKED_LTR_INDEX L"Av1MarkedLTRIndex" // amf_int64; default = N/A; Marked LTR index -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_REFERENCED_LTR_INDEX_BITFIELD L"Av1ReferencedLTRIndexBitfield" // amf_int64; default = N/A; referenced LTR bit-field -#define AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE L"AV1OutputBufferType" // amf_int64(AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_ENUM); encoder output buffer type -#define AMF_VIDEO_ENCODER_AV1_RECONSTRUCTED_PICTURE L"Av1ReconstructedPicture" // AMFInterface(AMFSurface); returns reconstructed picture as an AMFSurface attached to the output buffer as property AMF_VIDEO_ENCODER_RECONSTRUCTED_PICTURE of AMFInterface type -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PSNR_Y L"Av1PSNRY" // double; PSNR Y -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PSNR_U L"Av1PSNRU" // double; PSNR U -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PSNR_V L"Av1PSNRV" // double; PSNR V -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PSNR_ALL L"Av1PSNRALL" // double; PSNR All -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SSIM_Y L"Av1SSIMY" // double; SSIM Y -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SSIM_U L"Av1SSIMU" // double; SSIM U -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SSIM_V L"Av1SSIMV" // double; SSIM V -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SSIM_ALL L"Av1SSIMALL" // double; SSIM ALL -// Encoder statistics feedback -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_FRAME_Q_INDEX L"Av1StatisticsFeedbackFrameQIndex" // amf_int64; Rate control base frame/initial QIndex -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_AVERAGE_Q_INDEX L"Av1StatisticsFeedbackAvgQIndex" // amf_int64; Average QIndex of all encoded SBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped SBs. -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_MAX_Q_INDEX L"Av1StatisticsFeedbackMaxQIndex" // amf_int64; Max QIndex among all encoded SBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped SBs. -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_MIN_Q_INDEX L"Av1StatisticsFeedbackMinQIndex" // amf_int64; Min QIndex among all encoded SBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped SBs. -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PIX_NUM_INTRA L"Av1StatisticsFeedbackPixNumIntra" // amf_int64; Number of the intra encoded pixels -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PIX_NUM_INTER L"Av1StatisticsFeedbackPixNumInter" // amf_int64; Number of the inter encoded pixels -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_PIX_NUM_SKIP L"Av1StatisticsFeedbackPixNumSkip" // amf_int64; Number of the skip mode pixels -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_BITCOUNT_RESIDUAL L"Av1StatisticsFeedbackBitcountResidual" // amf_int64; The bit count that corresponds to residual data -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_BITCOUNT_MOTION L"Av1StatisticsFeedbackBitcountMotion" // amf_int64; The bit count that corresponds to motion vectors -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_BITCOUNT_INTER L"Av1StatisticsFeedbackBitcountInter" // amf_int64; The bit count that are assigned to inter SBs -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_BITCOUNT_INTRA L"Av1StatisticsFeedbackBitcountIntra" // amf_int64; The bit count that are assigned to intra SBs -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_BITCOUNT_ALL_MINUS_HEADER L"Av1StatisticsFeedbackBitcountAllMinusHeader" // amf_int64; The bit count of the bitstream excluding header -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_MV_X L"Av1StatisticsFeedbackMvX" // amf_int64; Accumulated absolute values of horizontal MV's -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_MV_Y L"Av1StatisticsFeedbackMvY" // amf_int64; Accumulated absolute values of vertical MV's -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_RD_COST_FINAL L"Av1StatisticsFeedbackRdCostFinal" // amf_int64; Frame level final RD cost for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_RD_COST_INTRA L"Av1StatisticsFeedbackRdCostIntra" // amf_int64; Frame level intra RD cost for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_RD_COST_INTER L"Av1StatisticsFeedbackRdCostInter" // amf_int64; Frame level inter RD cost for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SAD_FINAL L"Av1StatisticsFeedbackSadFinal" // amf_int64; Frame level final SAD for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SAD_INTRA L"Av1StatisticsFeedbackSadIntra" // amf_int64; Frame level intra SAD for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SAD_INTER L"Av1StatisticsFeedbackSadInter" // amf_int64; Frame level inter SAD for full encoding -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_SSE L"Av1StatisticsFeedbackSSE" // amf_int64; Frame level SSE (only calculated for AV1) -#define AMF_VIDEO_ENCODER_AV1_STATISTIC_VARIANCE L"Av1StatisticsFeedbackVariance" // amf_int64; Frame level variance for full encoding - - // Encoder block level feedback -#define AMF_VIDEO_ENCODER_AV1_BLOCK_Q_INDEX_MAP L"Av1BlockQIndexMap" // AMFInterface(AMFSurface); AMFSurface of format AMF_SURFACE_GRAY32 containing block level QIndex values - -// AV1 Encoder capabilities - exposed in AMFCaps interface -#define AMF_VIDEO_ENCODER_AV1_CAP_NUM_OF_HW_INSTANCES L"Av1CapNumOfHwInstances" // amf_int64; default = N/A; number of HW encoder instances -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_THROUGHPUT L"Av1CapMaxThroughput" // amf_int64; default = N/A; MAX throughput for AV1 encoder in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_AV1_CAP_REQUESTED_THROUGHPUT L"Av1CapRequestedThroughput" // amf_int64; default = N/A; Currently total requested throughput for AV1 encode in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_AV1_CAP_COLOR_CONVERSION L"Av1CapColorConversion" // amf_int64(AMF_ACCELERATION_TYPE); default = N/A; type of supported color conversion. -#define AMF_VIDEO_ENCODER_AV1_CAP_PRE_ANALYSIS L"Av1PreAnalysis" // amf_bool - pre analysis module is available. -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_BITRATE L"Av1MaxBitrate" // amf_int64; default = N/A; Maximum bit rate in bits -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_PROFILE L"Av1MaxProfile" // amf_int64(AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM); default = N/A; max value of code profile -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_LEVEL L"Av1MaxLevel" // amf_int64(AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM); default = N/A; max value of codec level -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS L"Av1CapMaxNumTemporalLayers" // amf_int64; default = N/A; The cap of maximum number of temporal layers -#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES L"Av1CapMaxNumLTRFrames" // amf_int64; default = N/A; The cap of maximum number of LTR frames. This value is calculated based on current value of AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS. -#define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_TILE_OUTPUT L"AV1SupportTileOutput" // amf_bool; if tile output is supported - -#define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_SMART_ACCESS_VIDEO L"Av1EncoderSupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video -#define AMF_VIDEO_ENCODER_AV1_CAP_WIDTH_ALIGNMENT_FACTOR L"Av1WidthAlignmentFactor" // amf_int64; default = 1; The encoder capability for width alignment -#define AMF_VIDEO_ENCODER_AV1_CAP_HEIGHT_ALIGNMENT_FACTOR L"Av1HeightAlignmentFactor" // amf_int64; default = 1; The encoder capability for height alignment - -#define AMF_VIDEO_ENCODER_AV1_MULTI_HW_INSTANCE_ENCODE L"Av1MultiHwInstanceEncode" // amf_bool; flag to enable AV1 multi VCN encode. - -#endif //#ifndef AMF_VideoEncoderAV1_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderHEVC.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderHEVC.h deleted file mode 100644 index 5097bb27..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderHEVC.h +++ /dev/null @@ -1,330 +0,0 @@ -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// VideoEncoderHW_HEVC interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_VideoEncoderHEVC_h -#define AMF_VideoEncoderHEVC_h -#pragma once - -#include "Component.h" -#include "ColorSpace.h" -#include "PreAnalysis.h" - -#define AMFVideoEncoder_HEVC L"AMFVideoEncoderHW_HEVC" - -enum AMF_VIDEO_ENCODER_HEVC_USAGE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_USAGE_TRANSCONDING = 0, // kept for backwards compatability - AMF_VIDEO_ENCODER_HEVC_USAGE_TRANSCODING = 0, // fixed typo - AMF_VIDEO_ENCODER_HEVC_USAGE_ULTRA_LOW_LATENCY, - AMF_VIDEO_ENCODER_HEVC_USAGE_LOW_LATENCY, - AMF_VIDEO_ENCODER_HEVC_USAGE_WEBCAM, - AMF_VIDEO_ENCODER_HEVC_USAGE_HIGH_QUALITY, - AMF_VIDEO_ENCODER_HEVC_USAGE_LOW_LATENCY_HIGH_QUALITY -}; - -enum AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN = 1, - AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN_10 = 2 -}; - -enum AMF_VIDEO_ENCODER_HEVC_TIER_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_TIER_MAIN = 0, - AMF_VIDEO_ENCODER_HEVC_TIER_HIGH = 1 -}; - -enum AMF_VIDEO_ENCODER_LEVEL_ENUM -{ - AMF_LEVEL_1 = 30, - AMF_LEVEL_2 = 60, - AMF_LEVEL_2_1 = 63, - AMF_LEVEL_3 = 90, - AMF_LEVEL_3_1 = 93, - AMF_LEVEL_4 = 120, - AMF_LEVEL_4_1 = 123, - AMF_LEVEL_5 = 150, - AMF_LEVEL_5_1 = 153, - AMF_LEVEL_5_2 = 156, - AMF_LEVEL_6 = 180, - AMF_LEVEL_6_1 = 183, - AMF_LEVEL_6_2 = 186 -}; - -enum AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_UNKNOWN = -1, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CONSTANT_QP = 0, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CBR, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_QUALITY_VBR, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_HIGH_QUALITY_VBR, - AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR -}; - -enum AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_NONE = 0, - AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_SKIP, - AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_IDR, - AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_I, - AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_P -}; - -enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_IDR, - AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_I, - AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_P -}; - -enum AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_QUALITY = 0, - AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_BALANCED = 5, - AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_SPEED = 10 -}; - -enum AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_NONE = 0, - AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_GOP_ALIGNED, - AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_IDR_ALIGNED, - AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_SUPPRESSED -}; - -enum AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_OFF = 0, - AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ON -}; - -enum AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE -{ - AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_STUDIO = 0, - AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_FULL = 1 -}; - -enum AMF_VIDEO_ENCODER_HEVC_LTR_MODE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_LTR_MODE_RESET_UNUSED = 0, - AMF_VIDEO_ENCODER_HEVC_LTR_MODE_KEEP_UNUSED -}; - -enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_FRAME = 0, - AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_SLICE = 1 -}; - -enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_FRAME = 0, - AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_SLICE = 1, - AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_SLICE_LAST = 2 -}; - -// Static properties - can be set before Init() -#define AMF_VIDEO_ENCODER_HEVC_INSTANCE_INDEX L"HevcEncoderInstance" // amf_int64; selected instance idx -#define AMF_VIDEO_ENCODER_HEVC_FRAMESIZE L"HevcFrameSize" // AMFSize; default = 0,0; Frame size - -#define AMF_VIDEO_ENCODER_HEVC_USAGE L"HevcUsage" // amf_int64(AMF_VIDEO_ENCODER_HEVC_USAGE_ENUM); default = N/A; Encoder usage type. fully configures parameter set. -#define AMF_VIDEO_ENCODER_HEVC_PROFILE L"HevcProfile" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM) ; default = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; -#define AMF_VIDEO_ENCODER_HEVC_TIER L"HevcTier" // amf_int64(AMF_VIDEO_ENCODER_HEVC_TIER_ENUM) ; default = AMF_VIDEO_ENCODER_HEVC_TIER_MAIN; -#define AMF_VIDEO_ENCODER_HEVC_PROFILE_LEVEL L"HevcProfileLevel" // amf_int64 (AMF_VIDEO_ENCODER_LEVEL_ENUM, default depends on HW capabilities); -#define AMF_VIDEO_ENCODER_HEVC_MAX_LTR_FRAMES L"HevcMaxOfLTRFrames" // amf_int64; default = 0; Max number of LTR frames -#define AMF_VIDEO_ENCODER_HEVC_LTR_MODE L"HevcLTRMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_LTR_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_LTR_MODE_RESET_UNUSED; remove/keep unused LTRs (not specified in property AMF_VIDEO_ENCODER_HEVC_FORCE_LTR_REFERENCE_BITFIELD) -#define AMF_VIDEO_ENCODER_HEVC_MAX_NUM_REFRAMES L"HevcMaxNumRefFrames" // amf_int64; default = 1; Maximum number of reference frames -#define AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET L"HevcQualityPreset" // amf_int64(AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_ENUM); default = depends on USAGE; Quality Preset -#define AMF_VIDEO_ENCODER_HEVC_EXTRADATA L"HevcExtraData" // AMFInterface* - > AMFBuffer*; SPS/PPS buffer - read-only -#define AMF_VIDEO_ENCODER_HEVC_ASPECT_RATIO L"HevcAspectRatio" // AMFRatio; default = 1, 1 -#define AMF_VIDEO_ENCODER_HEVC_LOWLATENCY_MODE L"LowLatencyInternal" // bool; default = false, enables low latency mode -#define AMF_VIDEO_ENCODER_HEVC_PRE_ANALYSIS_ENABLE L"HevcEnablePreAnalysis" // bool; default = false; enables the pre-analysis module. Currently only works in AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR mode. Refer to AMF Video PreAnalysis API reference for more details. -#define AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE L"HevcNominalRange" // amf_int64(AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE); default = amf_int64(AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_STUDIO); property is bool but amf_int64 also works for backward compatibility. -#define AMF_VIDEO_ENCODER_HEVC_MAX_NUM_TEMPORAL_LAYERS L"HevcMaxNumOfTemporalLayers" // amf_int64; default = 1; Max number of temporal layers. - -// Picture control properties -#define AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR L"HevcGOPSPerIDR" // amf_int64; default = 1; The frequency to insert IDR as start of a GOP. 0 means no IDR will be inserted. -#define AMF_VIDEO_ENCODER_HEVC_GOP_SIZE L"HevcGOPSize" // amf_int64; default = 60; GOP Size, in frames -#define AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE L"HevcDeBlockingFilter" // bool; default = depends on USAGE; De-blocking Filter -#define AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME L"HevcSlicesPerFrame" // amf_int64; default = 1; Number of slices Per Frame -#define AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE L"HevcHeaderInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_ENUM); default = NONE -#define AMF_VIDEO_ENCODER_HEVC_INTRA_REFRESH_NUM_CTBS_PER_SLOT L"HevcIntraRefreshCTBsNumberPerSlot" // amf_int64; default = depends on USAGE; Intra Refresh CTBs Number Per Slot in 64x64 CTB - -// Rate control properties -#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD L"HevcRateControlMethod" // amf_int64(AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_ENUM); default = depends on USAGE; Rate Control Method -#define AMF_VIDEO_ENCODER_HEVC_QVBR_QUALITY_LEVEL L"HevcQvbrQualityLevel" // amf_int64; default = 23; QVBR quality level; range = 1-51 -#define AMF_VIDEO_ENCODER_HEVC_VBV_BUFFER_SIZE L"HevcVBVBufferSize" // amf_int64; default = depends on USAGE; VBV Buffer Size in bits -#define AMF_VIDEO_ENCODER_HEVC_INITIAL_VBV_BUFFER_FULLNESS L"HevcInitialVBVBufferFullness" // amf_int64; default = 64; Initial VBV Buffer Fullness 0=0% 64=100% -#define AMF_VIDEO_ENCODER_HEVC_ENABLE_VBAQ L"HevcEnableVBAQ" // // bool; default = depends on USAGE; Enable auto VBAQ -#define AMF_VIDEO_ENCODER_HEVC_HIGH_MOTION_QUALITY_BOOST_ENABLE L"HevcHighMotionQualityBoostEnable"// bool; default = depends on USAGE; Enable High motion quality boost mode - -#define AMF_VIDEO_ENCODER_HEVC_PREENCODE_ENABLE L"HevcRateControlPreAnalysisEnable" // bool; default = depends on USAGE; enables pre-encode assisted rate control -#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_PREANALYSIS_ENABLE L"HevcRateControlPreAnalysisEnable" // bool; default = depends on USAGE; enables pre-encode assisted rate control. Deprecated, please use AMF_VIDEO_ENCODER_HEVC_PREENCODE_ENABLE instead. -#ifdef _MSC_VER - #ifndef __clang__ - #pragma deprecated("AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_PREANALYSIS_ENABLE") - #endif -#endif - -// Motion estimation -#define AMF_VIDEO_ENCODER_HEVC_MOTION_HALF_PIXEL L"HevcHalfPixel" // bool; default= true; Half Pixel -#define AMF_VIDEO_ENCODER_HEVC_MOTION_QUARTERPIXEL L"HevcQuarterPixel" // bool; default= true; Quarter Pixel - -// color conversion -#define AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH L"HevcColorBitDepth" // amf_int64(AMF_COLOR_BIT_DEPTH_ENUM); default = AMF_COLOR_BIT_DEPTH_8 - -#define AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PROFILE L"HevcInColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_HEVC_INPUT_TRANSFER_CHARACTERISTIC L"HevcInColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 section 7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PRIMARIES L"HevcInColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum - -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE L"HevcOutColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC L"HevcOutColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 ?7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES L"HevcOutColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum - -// Slice output -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE L"HevcOutputMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_FRAME - defines encoder output mode - -// Dynamic properties - can be set at any time - -// Rate control properties -#define AMF_VIDEO_ENCODER_HEVC_FRAMERATE L"HevcFrameRate" // AMFRate; default = depends on usage; Frame Rate - -#define AMF_VIDEO_ENCODER_HEVC_ENFORCE_HRD L"HevcEnforceHRD" // bool; default = depends on USAGE; Enforce HRD -#define AMF_VIDEO_ENCODER_HEVC_FILLER_DATA_ENABLE L"HevcFillerDataEnable" // bool; default = depends on USAGE; Enforce HRD -#define AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE L"HevcTargetBitrate" // amf_int64; default = depends on USAGE; Target bit rate in bits -#define AMF_VIDEO_ENCODER_HEVC_PEAK_BITRATE L"HevcPeakBitrate" // amf_int64; default = depends on USAGE; Peak bit rate in bits - -#define AMF_VIDEO_ENCODER_HEVC_MAX_AU_SIZE L"HevcMaxAUSize" // amf_int64; default = 60; Max AU Size in bits - -#define AMF_VIDEO_ENCODER_HEVC_MIN_QP_I L"HevcMinQP_I" // amf_int64; default = depends on USAGE; Min QP; range = -#define AMF_VIDEO_ENCODER_HEVC_MAX_QP_I L"HevcMaxQP_I" // amf_int64; default = depends on USAGE; Max QP; range = -#define AMF_VIDEO_ENCODER_HEVC_MIN_QP_P L"HevcMinQP_P" // amf_int64; default = depends on USAGE; Min QP; range = -#define AMF_VIDEO_ENCODER_HEVC_MAX_QP_P L"HevcMaxQP_P" // amf_int64; default = depends on USAGE; Max QP; range = - -#define AMF_VIDEO_ENCODER_HEVC_QP_I L"HevcQP_I" // amf_int64; default = 26; P-frame QP; range = 0-51 -#define AMF_VIDEO_ENCODER_HEVC_QP_P L"HevcQP_P" // amf_int64; default = 26; P-frame QP; range = 0-51 - -#define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_SKIP_FRAME_ENABLE L"HevcRateControlSkipFrameEnable" // bool; default = depends on USAGE; Rate Control Based Frame Skip - -// color conversion -#define AMF_VIDEO_ENCODER_HEVC_INPUT_HDR_METADATA L"HevcInHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL -//#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_HDR_METADATA L"HevcOutHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -// SVC -#define AMF_VIDEO_ENCODER_HEVC_NUM_TEMPORAL_LAYERS L"HevcNumOfTemporalLayers" // amf_int64; default = 1; Number of temporal layers. Can be changed at any time but the change is only applied when encoding next base layer frame. - -// DPB management -#define AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE L"HevcPicTransferMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_OFF - whether to exchange reference/reconstructed pic between encoder and application - -// misc -#define AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT L"HevcQueryTimeout" // amf_int64; default = 0 (no wait); timeout for QueryOutput call in ms. -#define AMF_VIDEO_ENCODER_HEVC_MEMORY_TYPE L"HevcEncoderMemoryType" // amf_int64(AMF_MEMORY_TYPE) , default is AMF_MEMORY_UNKNOWN, Values : AMF_MEMORY_DX11, AMF_MEMORY_DX9, AMF_MEMORY_UNKNOWN (auto) -#define AMF_VIDEO_ENCODER_HEVC_ENABLE_SMART_ACCESS_VIDEO L"HevcEnableEncoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature -#define AMF_VIDEO_ENCODER_HEVC_INPUT_QUEUE_SIZE L"HevcInputQueueSize" // amf_int64; default 16; Set amf input queue size - -// Per-submission properties - can be set on input surface interface -#define AMF_VIDEO_ENCODER_HEVC_END_OF_SEQUENCE L"HevcEndOfSequence" // bool; default = false; generate end of sequence -#define AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE L"HevcForcePictureType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_NONE; generate particular picture type -#define AMF_VIDEO_ENCODER_HEVC_INSERT_AUD L"HevcInsertAUD" // bool; default = false; insert AUD -#define AMF_VIDEO_ENCODER_HEVC_INSERT_HEADER L"HevcInsertHeader" // bool; default = false; insert header(SPS, PPS, VPS) - -#define AMF_VIDEO_ENCODER_HEVC_MARK_CURRENT_WITH_LTR_INDEX L"HevcMarkCurrentWithLTRIndex" // amf_int64; default = N/A; Mark current frame with LTR index -#define AMF_VIDEO_ENCODER_HEVC_FORCE_LTR_REFERENCE_BITFIELD L"HevcForceLTRReferenceBitfield"// amf_int64; default = 0; force LTR bit-field -#define AMF_VIDEO_ENCODER_HEVC_ROI_DATA L"HevcROIData" // 2D AMFSurface, surface format: AMF_SURFACE_GRAY32; Importance value for each 64x64 block ranges from `0` (least important) to `10` (most important), stored in 32bit unsigned format. -#define AMF_VIDEO_ENCODER_HEVC_REFERENCE_PICTURE L"HevcReferencePicture" // AMFInterface(AMFSurface); surface used for frame injection -#define AMF_VIDEO_ENCODER_HEVC_PSNR_FEEDBACK L"HevcPSNRFeedback" // amf_bool; default = false; Signal encoder to calculate PSNR score -#define AMF_VIDEO_ENCODER_HEVC_SSIM_FEEDBACK L"HevcSSIMFeedback" // amf_bool; default = false; Signal encoder to calculate SSIM score -#define AMF_VIDEO_ENCODER_HEVC_STATISTICS_FEEDBACK L"HevcStatisticsFeedback" // amf_bool; default = false; Signal encoder to collect and feedback encoder statistics -#define AMF_VIDEO_ENCODER_HEVC_BLOCK_QP_FEEDBACK L"HevcBlockQpFeedback" // amf_bool; default = false; Signal encoder to collect and feedback block level QP values - -// Properties set by encoder on output buffer interface -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE L"HevcOutputDataType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_ENUM); default = N/A -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_MARKED_LTR_INDEX L"HevcMarkedLTRIndex" // amf_int64; default = -1; Marked LTR index -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_REFERENCED_LTR_INDEX_BITFIELD L"HevcReferencedLTRIndexBitfield"// amf_int64; default = 0; referenced LTR bit-field -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_TEMPORAL_LAYER L"HevcOutputTemporalLayer" // amf_int64; Temporal layer -#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE L"HevcOutputBufferType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_ENUM); encoder output buffer type -#define AMF_VIDEO_ENCODER_HEVC_RECONSTRUCTED_PICTURE L"HevcReconstructedPicture" // AMFInterface(AMFSurface); returns reconstructed picture as an AMFSurface attached to the output buffer as property AMF_VIDEO_ENCODER_RECONSTRUCTED_PICTURE of AMFInterface type -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_Y L"PSNRY" // double; PSNR Y -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_U L"PSNRU" // double; PSNR U -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_V L"PSNRV" // double; PSNR V -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_ALL L"PSNRALL" // double; PSNR All -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_Y L"SSIMY" // double; SSIM Y -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_U L"SSIMU" // double; SSIM U -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_V L"SSIMV" // double; SSIM V -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_ALL L"SSIMALL" // double; SSIM ALL - - // Encoder statistics feedback -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_FRAME_QP L"HevcStatisticsFeedbackFrameQP" // amf_int64; Rate control base frame/initial QP -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_AVERAGE_QP L"HevcStatisticsFeedbackAvgQP" // amf_int64; Average QP of all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MAX_QP L"HevcStatisticsFeedbackMaxQP" // amf_int64; Max QP among all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MIN_QP L"HevcStatisticsFeedbackMinQP" // amf_int64; Min QP among all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_INTRA L"HevcStatisticsFeedbackPixNumIntra" // amf_int64; Number of the intra encoded pixels -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_INTER L"HevcStatisticsFeedbackPixNumInter" // amf_int64; Number of the inter encoded pixels -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_SKIP L"HevcStatisticsFeedbackPixNumSkip" // amf_int64; Number of the skip mode pixels -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_RESIDUAL L"HevcStatisticsFeedbackBitcountResidual" // amf_int64; The bit count that corresponds to residual data -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_MOTION L"HevcStatisticsFeedbackBitcountMotion" // amf_int64; The bit count that corresponds to motion vectors -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_INTER L"HevcStatisticsFeedbackBitcountInter" // amf_int64; The bit count that are assigned to inter CTBs -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_INTRA L"HevcStatisticsFeedbackBitcountIntra" // amf_int64; The bit count that are assigned to intra CTBs -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_ALL_MINUS_HEADER L"HevcStatisticsFeedbackBitcountAllMinusHeader" // amf_int64; The bit count of the bitstream excluding header -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MV_X L"HevcStatisticsFeedbackMvX" // amf_int64; Accumulated absolute values of horizontal MV's -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MV_Y L"HevcStatisticsFeedbackMvY" // amf_int64; Accumulated absolute values of vertical MV's -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_FINAL L"HevcStatisticsFeedbackRdCostFinal" // amf_int64; Frame level final RD cost for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_INTRA L"HevcStatisticsFeedbackRdCostIntra" // amf_int64; Frame level intra RD cost for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_INTER L"HevcStatisticsFeedbackRdCostInter" // amf_int64; Frame level inter RD cost for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_FINAL L"HevcStatisticsFeedbackSadFinal" // amf_int64; Frame level final SAD for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_INTRA L"HevcStatisticsFeedbackSadIntra" // amf_int64; Frame level intra SAD for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_INTER L"HevcStatisticsFeedbackSadInter" // amf_int64; Frame level inter SAD for full encoding -#define AMF_VIDEO_ENCODER_HEVC_STATISTIC_VARIANCE L"HevcStatisticsFeedbackVariance" // amf_int64; Frame level variance for full encoding - - // Encoder block level feedback -#define AMF_VIDEO_ENCODER_HEVC_BLOCK_QP_MAP L"HevcBlockQpMap" // AMFInterface(AMFSurface); AMFSurface of format AMF_SURFACE_GRAY32 containing block level QP values - -// HEVC Encoder capabilities - exposed in AMFCaps interface -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_BITRATE L"HevcMaxBitrate" // amf_int64; Maximum bit rate in bits -#define AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_STREAMS L"HevcNumOfStreams" // amf_int64; maximum number of encode streams supported -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_PROFILE L"HevcMaxProfile" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM) -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_TIER L"HevcMaxTier" // amf_int64(AMF_VIDEO_ENCODER_HEVC_TIER_ENUM) maximum profile tier -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_LEVEL L"HevcMaxLevel" // amf_int64 maximum profile level -#define AMF_VIDEO_ENCODER_HEVC_CAP_MIN_REFERENCE_FRAMES L"HevcMinReferenceFrames" // amf_int64 minimum number of reference frames -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_REFERENCE_FRAMES L"HevcMaxReferenceFrames" // amf_int64 maximum number of reference frames -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_TEMPORAL_LAYERS L"HevcMaxTemporalLayers" // amf_int64 maximum number of temporal layers -#define AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_HW_INSTANCES L"HevcNumOfHwInstances" // amf_int64 number of HW encoder instances -#define AMF_VIDEO_ENCODER_HEVC_CAP_COLOR_CONVERSION L"HevcColorConversion" // amf_int64(AMF_ACCELERATION_TYPE) - type of supported color conversion. default AMF_ACCEL_GPU -#define AMF_VIDEO_ENCODER_HEVC_CAP_PRE_ANALYSIS L"HevcPreAnalysis" // amf_bool - pre analysis module is available. -#define AMF_VIDEO_ENCODER_HEVC_CAP_ROI L"HevcROIMap" // amf_bool - ROI map support is available. -#define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_THROUGHPUT L"HevcMaxThroughput" // amf_int64 - MAX throughput for HEVC encoder in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_HEVC_CAP_REQUESTED_THROUGHPUT L"HevcRequestedThroughput" // amf_int64 - Currently total requested throughput for HEVC encode in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_HEVC_CAP_QUERY_TIMEOUT_SUPPORT L"HevcQueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutput call -#define AMF_VIDEO_ENCODER_CAPS_HEVC_QUERY_TIMEOUT_SUPPORT L"HevcQueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutput call (Deprecated, please use AMF_VIDEO_ENCODER_HEVC_CAP_QUERY_TIMEOUT_SUPPORT instead) -#define AMF_VIDEO_ENCODER_HEVC_CAP_SUPPORT_SLICE_OUTPUT L"HevcSupportSliceOutput" // amf_bool - if slice output is supported - -#define AMF_VIDEO_ENCODER_HEVC_CAP_SUPPORT_SMART_ACCESS_VIDEO L"HevcEncoderSupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video - -#define AMF_VIDEO_ENCODER_HEVC_MULTI_HW_INSTANCE_ENCODE L"HevcMultiHwInstanceEncode" // amf_bool; flag to enable multi VCN encode. - -#endif //#ifndef AMF_VideoEncoderHEVC_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderVCE.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderVCE.h deleted file mode 100644 index a86fba51..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoEncoderVCE.h +++ /dev/null @@ -1,375 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// AMFVideoEncoderHW_AVC interface declaration -//------------------------------------------------------------------------------------------------- - -#ifndef AMF_VideoEncoderVCE_h -#define AMF_VideoEncoderVCE_h -#pragma once - -#include "Component.h" -#include "ColorSpace.h" -#include "PreAnalysis.h" - -#define AMFVideoEncoderVCE_AVC L"AMFVideoEncoderVCE_AVC" -#define AMFVideoEncoderVCE_SVC L"AMFVideoEncoderVCE_SVC" - -enum AMF_VIDEO_ENCODER_USAGE_ENUM -{ - AMF_VIDEO_ENCODER_USAGE_TRANSCONDING = 0, // kept for backwards compatability - AMF_VIDEO_ENCODER_USAGE_TRANSCODING = 0, // fixed typo - AMF_VIDEO_ENCODER_USAGE_ULTRA_LOW_LATENCY, - AMF_VIDEO_ENCODER_USAGE_LOW_LATENCY, - AMF_VIDEO_ENCODER_USAGE_WEBCAM, - AMF_VIDEO_ENCODER_USAGE_HIGH_QUALITY, - AMF_VIDEO_ENCODER_USAGE_LOW_LATENCY_HIGH_QUALITY -}; - -enum AMF_VIDEO_ENCODER_PROFILE_ENUM -{ - AMF_VIDEO_ENCODER_PROFILE_UNKNOWN = 0, - AMF_VIDEO_ENCODER_PROFILE_BASELINE = 66, - AMF_VIDEO_ENCODER_PROFILE_MAIN = 77, - AMF_VIDEO_ENCODER_PROFILE_HIGH = 100, - AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE = 256, - AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH = 257 -}; - -enum AMF_VIDEO_ENCODER_H264_LEVEL_ENUM -{ - AMF_H264_LEVEL__1 = 10, - AMF_H264_LEVEL__1_1 = 11, - AMF_H264_LEVEL__1_2 = 12, - AMF_H264_LEVEL__1_3 = 13, - AMF_H264_LEVEL__2 = 20, - AMF_H264_LEVEL__2_1 = 21, - AMF_H264_LEVEL__2_2 = 22, - AMF_H264_LEVEL__3 = 30, - AMF_H264_LEVEL__3_1 = 31, - AMF_H264_LEVEL__3_2 = 32, - AMF_H264_LEVEL__4 = 40, - AMF_H264_LEVEL__4_1 = 41, - AMF_H264_LEVEL__4_2 = 42, - AMF_H264_LEVEL__5 = 50, - AMF_H264_LEVEL__5_1 = 51, - AMF_H264_LEVEL__5_2 = 52, - AMF_H264_LEVEL__6 = 60, - AMF_H264_LEVEL__6_1 = 61, - AMF_H264_LEVEL__6_2 = 62 -}; - -enum AMF_VIDEO_ENCODER_SCANTYPE_ENUM -{ - AMF_VIDEO_ENCODER_SCANTYPE_PROGRESSIVE = 0, - AMF_VIDEO_ENCODER_SCANTYPE_INTERLACED -}; - -enum AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_ENUM -{ - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_UNKNOWN = -1, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CONSTANT_QP = 0, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CBR, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_QUALITY_VBR, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_HIGH_QUALITY_VBR, - AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR -}; - -enum AMF_VIDEO_ENCODER_QUALITY_PRESET_ENUM -{ - AMF_VIDEO_ENCODER_QUALITY_PRESET_BALANCED = 0, - AMF_VIDEO_ENCODER_QUALITY_PRESET_SPEED, - AMF_VIDEO_ENCODER_QUALITY_PRESET_QUALITY -}; - -enum AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_ENUM -{ - AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_NONE = 0, - AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_FRAME, - AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_TOP_FIELD, - AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_BOTTOM_FIELD -}; - -enum AMF_VIDEO_ENCODER_PICTURE_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_PICTURE_TYPE_NONE = 0, - AMF_VIDEO_ENCODER_PICTURE_TYPE_SKIP, - AMF_VIDEO_ENCODER_PICTURE_TYPE_IDR, - AMF_VIDEO_ENCODER_PICTURE_TYPE_I, - AMF_VIDEO_ENCODER_PICTURE_TYPE_P, - AMF_VIDEO_ENCODER_PICTURE_TYPE_B -}; - -enum AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_IDR, - AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_I, - AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_P, - AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_B -}; - -enum AMF_VIDEO_ENCODER_PREENCODE_MODE_ENUM -{ - AMF_VIDEO_ENCODER_PREENCODE_DISABLED = 0, - AMF_VIDEO_ENCODER_PREENCODE_ENABLED = 1, -}; - -enum AMF_VIDEO_ENCODER_CODING_ENUM -{ - AMF_VIDEO_ENCODER_UNDEFINED = 0, // BASELINE = CALV; MAIN, HIGH = CABAC - AMF_VIDEO_ENCODER_CABAC, - AMF_VIDEO_ENCODER_CALV, - -}; - -enum AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE_ENUM -{ - AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE_OFF = 0, - AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE_ON -}; - -enum AMF_VIDEO_ENCODER_LTR_MODE_ENUM -{ - AMF_VIDEO_ENCODER_LTR_MODE_RESET_UNUSED = 0, - AMF_VIDEO_ENCODER_LTR_MODE_KEEP_UNUSED -}; - -enum AMF_VIDEO_ENCODER_OUTPUT_MODE_ENUM -{ - AMF_VIDEO_ENCODER_OUTPUT_MODE_FRAME = 0, - AMF_VIDEO_ENCODER_OUTPUT_MODE_SLICE = 1 -}; - -enum AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE_ENUM -{ - AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE_FRAME = 0, - AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE_SLICE = 1, - AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE_SLICE_LAST = 2 -}; - -// Static properties - can be set before Init() -#define AMF_VIDEO_ENCODER_INSTANCE_INDEX L"EncoderInstance" // amf_int64; selected HW instance idx -#define AMF_VIDEO_ENCODER_FRAMESIZE L"FrameSize" // AMFSize; default = 0,0; Frame size - -#define AMF_VIDEO_ENCODER_EXTRADATA L"ExtraData" // AMFInterface* - > AMFBuffer*; SPS/PPS buffer in Annex B format - read-only -#define AMF_VIDEO_ENCODER_USAGE L"Usage" // amf_int64(AMF_VIDEO_ENCODER_USAGE_ENUM); default = N/A; Encoder usage type. fully configures parameter set. -#define AMF_VIDEO_ENCODER_PROFILE L"Profile" // amf_int64(AMF_VIDEO_ENCODER_PROFILE_ENUM) ; default = AMF_VIDEO_ENCODER_PROFILE_MAIN; H264 profile -#define AMF_VIDEO_ENCODER_PROFILE_LEVEL L"ProfileLevel" // amf_int64(AMF_VIDEO_ENCODER_H264_LEVEL_ENUM); default = AMF_H264_LEVEL__4_2; H264 level -#define AMF_VIDEO_ENCODER_MAX_LTR_FRAMES L"MaxOfLTRFrames" // amf_int64; default = 0; Max number of LTR frames -#define AMF_VIDEO_ENCODER_LTR_MODE L"LTRMode" // amf_int64(AMF_VIDEO_ENCODER_LTR_MODE_ENUM); default = AMF_VIDEO_ENCODER_LTR_MODE_RESET_UNUSED; remove/keep unused LTRs (not specified in property AMF_VIDEO_ENCODER_FORCE_LTR_REFERENCE_BITFIELD) -#define AMF_VIDEO_ENCODER_SCANTYPE L"ScanType" // amf_int64(AMF_VIDEO_ENCODER_SCANTYPE_ENUM); default = AMF_VIDEO_ENCODER_SCANTYPE_PROGRESSIVE; indicates input stream type -#define AMF_VIDEO_ENCODER_MAX_NUM_REFRAMES L"MaxNumRefFrames" // amf_int64; Maximum number of reference frames -#define AMF_VIDEO_ENCODER_MAX_CONSECUTIVE_BPICTURES L"MaxConsecutiveBPictures" // amf_int64; Maximum number of consecutive B Pictures -#define AMF_VIDEO_ENCODER_ADAPTIVE_MINIGOP L"AdaptiveMiniGOP" // bool; default = false; Disable/Enable Adaptive MiniGOP -#define AMF_VIDEO_ENCODER_ASPECT_RATIO L"AspectRatio" // AMFRatio; default = 1, 1 -#define AMF_VIDEO_ENCODER_FULL_RANGE_COLOR L"FullRangeColor" // bool; default = false; inidicates that YUV input is (0,255) -#define AMF_VIDEO_ENCODER_LOWLATENCY_MODE L"LowLatencyInternal" // bool; default = false, enables low latency mode and POC mode 2 in the encoder -#define AMF_VIDEO_ENCODER_PRE_ANALYSIS_ENABLE L"EnablePreAnalysis" // bool; default = false; enables the pre-analysis module. Currently only works in AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR mode. Refer to AMF Video PreAnalysis API reference for more details. -#define AMF_VIDEO_ENCODER_PREENCODE_ENABLE L"RateControlPreanalysisEnable" // amf_int64(AMF_VIDEO_ENCODER_PREENCODE_MODE_ENUM); default = AMF_VIDEO_ENCODER_PREENCODE_DISABLED; enables pre-encode assisted rate control -#define AMF_VIDEO_ENCODER_RATE_CONTROL_PREANALYSIS_ENABLE L"RateControlPreanalysisEnable" // amf_int64(AMF_VIDEO_ENCODER_PREENCODE_MODE_ENUM); default = AMF_VIDEO_ENCODER_PREENCODE_DISABLED; enables pre-encode assisted rate control. Deprecated, please use AMF_VIDEO_ENCODER_PREENCODE_ENABLE instead. -#define AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD L"RateControlMethod" // amf_int64(AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_ENUM); default = depends on USAGE; Rate Control Method -#define AMF_VIDEO_ENCODER_QVBR_QUALITY_LEVEL L"QvbrQualityLevel" // amf_int64; default = 23; QVBR quality level; range = 1-51 -#define AMF_VIDEO_ENCODER_MAX_NUM_TEMPORAL_LAYERS L"MaxNumOfTemporalLayers" // amf_int64; default = 1; Max number of temporal layers. -#if !defined(__GNUC__) && !defined(__clang__) - #pragma deprecated("AMF_VIDEO_ENCODER_RATE_CONTROL_PREANALYSIS_ENABLE") -#endif - - - // Quality preset property -#define AMF_VIDEO_ENCODER_QUALITY_PRESET L"QualityPreset" // amf_int64(AMF_VIDEO_ENCODER_QUALITY_PRESET_ENUM); default = depends on USAGE; Quality Preset - - // color conversion -#define AMF_VIDEO_ENCODER_COLOR_BIT_DEPTH L"ColorBitDepth" // amf_int64(AMF_COLOR_BIT_DEPTH_ENUM); default = AMF_COLOR_BIT_DEPTH_8 - -#define AMF_VIDEO_ENCODER_INPUT_COLOR_PROFILE L"InColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_INPUT_TRANSFER_CHARACTERISTIC L"InColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 ?7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_INPUT_COLOR_PRIMARIES L"InColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 Section 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_ENCODER_INPUT_HDR_METADATA L"InHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -#define AMF_VIDEO_ENCODER_OUTPUT_COLOR_PROFILE L"OutColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size -#define AMF_VIDEO_ENCODER_OUTPUT_TRANSFER_CHARACTERISTIC L"OutColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 Section 7.2 See VideoDecoderUVD.h for enum -#define AMF_VIDEO_ENCODER_OUTPUT_COLOR_PRIMARIES L"OutColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 Section 7.1 See ColorSpace.h for enum -#define AMF_VIDEO_ENCODER_OUTPUT_HDR_METADATA L"OutHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL - -// Slice output -#define AMF_VIDEO_ENCODER_OUTPUT_MODE L"OutputMode" // amf_int64(AMF_VIDEO_ENCODER_OUTPUT_MODE_ENUM); default = AMF_VIDEO_ENCODER_OUTPUT_MODE_FRAME - defines encoder output mode - - -// Dynamic properties - can be set at any time - // Rate control properties -#define AMF_VIDEO_ENCODER_FRAMERATE L"FrameRate" // AMFRate; default = depends on usage; Frame Rate -#define AMF_VIDEO_ENCODER_B_PIC_DELTA_QP L"BPicturesDeltaQP" // amf_int64; default = depends on USAGE; B-picture Delta -#define AMF_VIDEO_ENCODER_REF_B_PIC_DELTA_QP L"ReferenceBPicturesDeltaQP"// amf_int64; default = depends on USAGE; Reference B-picture Delta - -#define AMF_VIDEO_ENCODER_ENFORCE_HRD L"EnforceHRD" // bool; default = depends on USAGE; Enforce HRD -#define AMF_VIDEO_ENCODER_FILLER_DATA_ENABLE L"FillerDataEnable" // bool; default = false; Filler Data Enable -#define AMF_VIDEO_ENCODER_ENABLE_VBAQ L"EnableVBAQ" // bool; default = depends on USAGE; Enable VBAQ -#define AMF_VIDEO_ENCODER_HIGH_MOTION_QUALITY_BOOST_ENABLE L"HighMotionQualityBoostEnable"// bool; default = depends on USAGE; Enable High motion quality boost mode - - -#define AMF_VIDEO_ENCODER_VBV_BUFFER_SIZE L"VBVBufferSize" // amf_int64; default = depends on USAGE; VBV Buffer Size in bits -#define AMF_VIDEO_ENCODER_INITIAL_VBV_BUFFER_FULLNESS L"InitialVBVBufferFullness" // amf_int64; default = 64; Initial VBV Buffer Fullness 0=0% 64=100% - -#define AMF_VIDEO_ENCODER_MAX_AU_SIZE L"MaxAUSize" // amf_int64; default = 0; Max AU Size in bits - -#define AMF_VIDEO_ENCODER_MIN_QP L"MinQP" // amf_int64; default = depends on USAGE; Min QP; range = 0-51 -#define AMF_VIDEO_ENCODER_MAX_QP L"MaxQP" // amf_int64; default = depends on USAGE; Max QP; range = 0-51 -#define AMF_VIDEO_ENCODER_QP_I L"QPI" // amf_int64; default = 22; I-frame QP; range = 0-51 -#define AMF_VIDEO_ENCODER_QP_P L"QPP" // amf_int64; default = 22; P-frame QP; range = 0-51 -#define AMF_VIDEO_ENCODER_QP_B L"QPB" // amf_int64; default = 22; B-frame QP; range = 0-51 -#define AMF_VIDEO_ENCODER_TARGET_BITRATE L"TargetBitrate" // amf_int64; default = depends on USAGE; Target bit rate in bits -#define AMF_VIDEO_ENCODER_PEAK_BITRATE L"PeakBitrate" // amf_int64; default = depends on USAGE; Peak bit rate in bits -#define AMF_VIDEO_ENCODER_RATE_CONTROL_SKIP_FRAME_ENABLE L"RateControlSkipFrameEnable" // bool; default = depends on USAGE; Rate Control Based Frame Skip - - // Picture control properties -#define AMF_VIDEO_ENCODER_HEADER_INSERTION_SPACING L"HeaderInsertionSpacing" // amf_int64; default = depends on USAGE; Header Insertion Spacing; range 0-1000 -#define AMF_VIDEO_ENCODER_B_PIC_PATTERN L"BPicturesPattern" // amf_int64; default = 0; B-picture Pattern (number of B-Frames) -#define AMF_VIDEO_ENCODER_DE_BLOCKING_FILTER L"DeBlockingFilter" // bool; default = depends on USAGE; De-blocking Filter -#define AMF_VIDEO_ENCODER_B_REFERENCE_ENABLE L"BReferenceEnable" // bool; default = true; Enable Refrence to B-frames -#define AMF_VIDEO_ENCODER_IDR_PERIOD L"IDRPeriod" // amf_int64; default = depends on USAGE; IDR Period in frames -#define AMF_VIDEO_ENCODER_INTRA_PERIOD L"IntraPeriod" // amf_int64; default = 0; Intra period in frames -#define AMF_VIDEO_ENCODER_INTRA_REFRESH_NUM_MBS_PER_SLOT L"IntraRefreshMBsNumberPerSlot" // amf_int64; default = depends on USAGE; Intra Refresh MBs Number Per Slot in Macroblocks -#define AMF_VIDEO_ENCODER_SLICES_PER_FRAME L"SlicesPerFrame" // amf_int64; default = 1; Number of slices Per Frame -#define AMF_VIDEO_ENCODER_CABAC_ENABLE L"CABACEnable" // amf_int64(AMF_VIDEO_ENCODER_CODING_ENUM) default = AMF_VIDEO_ENCODER_UNDEFINED - - // Motion estimation -#define AMF_VIDEO_ENCODER_MOTION_HALF_PIXEL L"HalfPixel" // bool; default= true; Half Pixel -#define AMF_VIDEO_ENCODER_MOTION_QUARTERPIXEL L"QuarterPixel" // bool; default= true; Quarter Pixel - - // SVC -#define AMF_VIDEO_ENCODER_NUM_TEMPORAL_ENHANCMENT_LAYERS L"NumOfTemporalEnhancmentLayers" // amf_int64; default = 1; range = 1-MaxTemporalLayers; Number of temporal Layers (SVC) - - - // DPB management -#define AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE L"PicTransferMode" // amf_int64(AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE_ENUM); default = AMF_VIDEO_ENCODER_PICTURE_TRANSFER_MODE_OFF - whether to exchange reference/reconstructed pic between encoder and application - // misc -#define AMF_VIDEO_ENCODER_QUERY_TIMEOUT L"QueryTimeout" // amf_int64; default = 0 (no wait); timeout for QueryOutput call in ms. -#define AMF_VIDEO_ENCODER_MEMORY_TYPE L"EncoderMemoryType" // amf_int64(AMF_MEMORY_TYPE) , default is AMF_MEMORY_UNKNOWN, Values : AMF_MEMORY_DX11, AMF_MEMORY_DX9, AMF_MEMORY_VULKAN or AMF_MEMORY_UNKNOWN (auto) -#define AMF_VIDEO_ENCODER_ENABLE_SMART_ACCESS_VIDEO L"EnableEncoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature -#define AMF_VIDEO_ENCODER_INPUT_QUEUE_SIZE L"InputQueueSize" // amf_int64; default 16; Set amf input queue size - -// Per-submission properties - can be set on input surface interface -#define AMF_VIDEO_ENCODER_END_OF_SEQUENCE L"EndOfSequence" // bool; default = false; generate end of sequence -#define AMF_VIDEO_ENCODER_END_OF_STREAM L"EndOfStream" // bool; default = false; generate end of stream -#define AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE L"ForcePictureType" // amf_int64(AMF_VIDEO_ENCODER_PICTURE_TYPE_ENUM); default = AMF_VIDEO_ENCODER_PICTURE_TYPE_NONE; generate particular picture type -#define AMF_VIDEO_ENCODER_INSERT_AUD L"InsertAUD" // bool; default = false; insert AUD -#define AMF_VIDEO_ENCODER_INSERT_SPS L"InsertSPS" // bool; default = false; insert SPS -#define AMF_VIDEO_ENCODER_INSERT_PPS L"InsertPPS" // bool; default = false; insert PPS -#define AMF_VIDEO_ENCODER_PICTURE_STRUCTURE L"PictureStructure" // amf_int64(AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_ENUM); default = AMF_VIDEO_ENCODER_PICTURE_STRUCTURE_FRAME; indicate picture type -#define AMF_VIDEO_ENCODER_MARK_CURRENT_WITH_LTR_INDEX L"MarkCurrentWithLTRIndex" // //amf_int64; default = N/A; Mark current frame with LTR index -#define AMF_VIDEO_ENCODER_FORCE_LTR_REFERENCE_BITFIELD L"ForceLTRReferenceBitfield"// amf_int64; default = 0; force LTR bit-field -#define AMF_VIDEO_ENCODER_ROI_DATA L"ROIData" // 2D AMFSurface, surface format: AMF_SURFACE_GRAY32; Importance value for each 16x16 macro block ranges from `0` (least important) to `10` (most important), stored in 32bit unsigned format. -#define AMF_VIDEO_ENCODER_REFERENCE_PICTURE L"ReferencePicture" // AMFInterface(AMFSurface); surface used for frame injection -#define AMF_VIDEO_ENCODER_PSNR_FEEDBACK L"PSNRFeedback" // amf_bool; default = false; Signal encoder to calculate PSNR score -#define AMF_VIDEO_ENCODER_SSIM_FEEDBACK L"SSIMFeedback" // amf_bool; default = false; Signal encoder to calculate SSIM score -#define AMF_VIDEO_ENCODER_STATISTICS_FEEDBACK L"StatisticsFeedback" // amf_bool; default = false; Signal encoder to collect and feedback statistics -#define AMF_VIDEO_ENCODER_BLOCK_QP_FEEDBACK L"BlockQpFeedback" // amf_bool; default = false; Signal encoder to collect and feedback block level QP values - - -// properties set by encoder on output buffer interface -#define AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE L"OutputDataType" // amf_int64(AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_ENUM); default = N/A -#define AMF_VIDEO_ENCODER_OUTPUT_MARKED_LTR_INDEX L"MarkedLTRIndex" //amf_int64; default = -1; Marked LTR index -#define AMF_VIDEO_ENCODER_OUTPUT_REFERENCED_LTR_INDEX_BITFIELD L"ReferencedLTRIndexBitfield" // amf_int64; default = 0; referenced LTR bit-field -#define AMF_VIDEO_ENCODER_OUTPUT_TEMPORAL_LAYER L"OutputTemporalLayer" // amf_int64; Temporal layer -#define AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE L"OutputBufferType" // amf_int64(AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE_ENUM); encoder output buffer type -#define AMF_VIDEO_ENCODER_PRESENTATION_TIME_STAMP L"PresentationTimeStamp" // amf_int64; Presentation time stamp (PTS) -#define AMF_VIDEO_ENCODER_RECONSTRUCTED_PICTURE L"ReconstructedPicture" // AMFInterface(AMFSurface); returns reconstructed picture as an AMFSurface attached to the output buffer as property AMF_VIDEO_ENCODER_RECONSTRUCTED_PICTURE of AMFInterface type -#define AMF_VIDEO_ENCODER_STATISTIC_PSNR_Y L"PSNRY" // double; PSNR Y -#define AMF_VIDEO_ENCODER_STATISTIC_PSNR_U L"PSNRU" // double; PSNR U -#define AMF_VIDEO_ENCODER_STATISTIC_PSNR_V L"PSNRV" // double; PSNR V -#define AMF_VIDEO_ENCODER_STATISTIC_PSNR_ALL L"PSNRALL" // double; PSNR All -#define AMF_VIDEO_ENCODER_STATISTIC_SSIM_Y L"SSIMY" // double; SSIM Y -#define AMF_VIDEO_ENCODER_STATISTIC_SSIM_U L"SSIMU" // double; SSIM U -#define AMF_VIDEO_ENCODER_STATISTIC_SSIM_V L"SSIMV" // double; SSIM V -#define AMF_VIDEO_ENCODER_STATISTIC_SSIM_ALL L"SSIMALL" // double; SSIM ALL - - // Encoder statistics feedback -#define AMF_VIDEO_ENCODER_STATISTIC_FRAME_QP L"StatisticsFeedbackFrameQP" // amf_int64; Rate control base frame/initial QP -#define AMF_VIDEO_ENCODER_STATISTIC_AVERAGE_QP L"StatisticsFeedbackAvgQP" // amf_int64; Average calculated QP of all encoded MBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped MBs. -#define AMF_VIDEO_ENCODER_STATISTIC_MAX_QP L"StatisticsFeedbackMaxQP" // amf_int64; Max calculated QP among all encoded MBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped MBs. -#define AMF_VIDEO_ENCODER_STATISTIC_MIN_QP L"StatisticsFeedbackMinQP" // amf_int64; Min calculated QP among all encoded MBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped MBs. -#define AMF_VIDEO_ENCODER_STATISTIC_PIX_NUM_INTRA L"StatisticsFeedbackPixNumIntra" // amf_int64; Number of the intra encoded pixels -#define AMF_VIDEO_ENCODER_STATISTIC_PIX_NUM_INTER L"StatisticsFeedbackPixNumInter" // amf_int64; Number of the inter encoded pixels -#define AMF_VIDEO_ENCODER_STATISTIC_PIX_NUM_SKIP L"StatisticsFeedbackPixNumSkip" // amf_int64; Number of the skip mode pixels -#define AMF_VIDEO_ENCODER_STATISTIC_BITCOUNT_RESIDUAL L"StatisticsFeedbackBitcountResidual" // amf_int64; The bit count that corresponds to residual data -#define AMF_VIDEO_ENCODER_STATISTIC_BITCOUNT_MOTION L"StatisticsFeedbackBitcountMotion" // amf_int64; The bit count that corresponds to motion vectors -#define AMF_VIDEO_ENCODER_STATISTIC_BITCOUNT_INTER L"StatisticsFeedbackBitcountInter" // amf_int64; The bit count that are assigned to inter MBs -#define AMF_VIDEO_ENCODER_STATISTIC_BITCOUNT_INTRA L"StatisticsFeedbackBitcountIntra" // amf_int64; The bit count that are assigned to intra MBs -#define AMF_VIDEO_ENCODER_STATISTIC_BITCOUNT_ALL_MINUS_HEADER L"StatisticsFeedbackBitcountAllMinusHeader" // amf_int64; The bit count of the bitstream excluding header -#define AMF_VIDEO_ENCODER_STATISTIC_MV_X L"StatisticsFeedbackMvX" // amf_int64; Accumulated absolute values of horizontal MV's -#define AMF_VIDEO_ENCODER_STATISTIC_MV_Y L"StatisticsFeedbackMvY" // amf_int64; Accumulated absolute values of vertical MV's -#define AMF_VIDEO_ENCODER_STATISTIC_RD_COST_FINAL L"StatisticsFeedbackRdCostFinal" // amf_int64; Frame level final RD cost for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_RD_COST_INTRA L"StatisticsFeedbackRdCostIntra" // amf_int64; Frame level intra RD cost for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_RD_COST_INTER L"StatisticsFeedbackRdCostInter" // amf_int64; Frame level inter RD cost for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_SATD_FINAL L"StatisticsFeedbackSatdFinal" // amf_int64; Frame level final SATD for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_SATD_INTRA L"StatisticsFeedbackSatdIntra" // amf_int64; Frame level intra SATD for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_SATD_INTER L"StatisticsFeedbackSatdInter" // amf_int64; Frame level inter SATD for full encoding -#define AMF_VIDEO_ENCODER_STATISTIC_VARIANCE L"StatisticsFeedbackVariance" // amf_int64; Frame level variance for full encoding - - // Encoder block level feedback -#define AMF_VIDEO_ENCODER_BLOCK_QP_MAP L"BlockQpMap" // AMFInterface(AMFSurface); AMFSurface of format AMF_SURFACE_GRAY32 containing block level QP values - -#define AMF_VIDEO_ENCODER_HDCP_COUNTER L"HDCPCounter" // const void* - -// Properties for multi-instance cloud gaming -#define AMF_VIDEO_ENCODER_MAX_INSTANCES L"EncoderMaxInstances" // deprecated. amf_int64; default = 1; max number of encoder instances -#define AMF_VIDEO_ENCODER_MULTI_INSTANCE_MODE L"MultiInstanceMode" // deprecated. bool; default = false; -#define AMF_VIDEO_ENCODER_CURRENT_QUEUE L"MultiInstanceCurrentQueue"// deprecated. amf_int64; default = 0; - - -// VCE Encoder capabilities - exposed in AMFCaps interface -#define AMF_VIDEO_ENCODER_CAP_MAX_BITRATE L"MaxBitrate" // amf_int64; Maximum bit rate in bits -#define AMF_VIDEO_ENCODER_CAP_NUM_OF_STREAMS L"NumOfStreams" // amf_int64; maximum number of encode streams supported -#define AMF_VIDEO_ENCODER_CAP_MAX_PROFILE L"MaxProfile" // AMF_VIDEO_ENCODER_PROFILE_ENUM -#define AMF_VIDEO_ENCODER_CAP_MAX_LEVEL L"MaxLevel" // amf_int64 maximum profile level -#define AMF_VIDEO_ENCODER_CAP_BFRAMES L"BFrames" // bool is B-Frames supported -#define AMF_VIDEO_ENCODER_CAP_MIN_REFERENCE_FRAMES L"MinReferenceFrames" // amf_int64 minimum number of reference frames -#define AMF_VIDEO_ENCODER_CAP_MAX_REFERENCE_FRAMES L"MaxReferenceFrames" // amf_int64 maximum number of reference frames -#define AMF_VIDEO_ENCODER_CAP_MAX_TEMPORAL_LAYERS L"MaxTemporalLayers" // amf_int64 maximum number of temporal layers -#define AMF_VIDEO_ENCODER_CAP_FIXED_SLICE_MODE L"FixedSliceMode" // bool is fixed slice mode supported -#define AMF_VIDEO_ENCODER_CAP_NUM_OF_HW_INSTANCES L"NumOfHwInstances" // amf_int64 number of HW encoder instances -#define AMF_VIDEO_ENCODER_CAP_COLOR_CONVERSION L"ColorConversion" // amf_int64(AMF_ACCELERATION_TYPE) - type of supported color conversion. default AMF_ACCEL_GPU -#define AMF_VIDEO_ENCODER_CAP_PRE_ANALYSIS L"PreAnalysis" // amf_bool - pre analysis module is available. -#define AMF_VIDEO_ENCODER_CAP_ROI L"ROIMap" // amf_bool - ROI map support is available. -#define AMF_VIDEO_ENCODER_CAP_MAX_THROUGHPUT L"MaxThroughput" // amf_int64 - MAX throughput for H264 encoder in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_CAP_REQUESTED_THROUGHPUT L"RequestedThroughput" // amf_int64 - Currently total requested throughput for H264 encoder in MB (16 x 16 pixel) -#define AMF_VIDEO_ENCODER_CAPS_QUERY_TIMEOUT_SUPPORT L"QueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutput call (Deprecated, please use AMF_VIDEO_ENCODER_CAP_QUERY_TIMEOUT_SUPPORT ) -#define AMF_VIDEO_ENCODER_CAP_QUERY_TIMEOUT_SUPPORT L"QueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutput call - -#define AMF_VIDEO_ENCODER_CAP_SUPPORT_SLICE_OUTPUT L"SupportSliceOutput" // amf_bool - if slice output is supported - -#define AMF_VIDEO_ENCODER_CAP_SUPPORT_SMART_ACCESS_VIDEO L"EncoderSupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video - -#endif //#ifndef AMF_VideoEncoderVCE_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoStitch.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoStitch.h deleted file mode 100644 index 0ae2af52..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/VideoStitch.h +++ /dev/null @@ -1,124 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** - *************************************************************************************************** - * @file VideoStitch.h - * @brief AMFVideoStitch interface declaration - *************************************************************************************************** - */ -#ifndef AMF_VideoStitch_h -#define AMF_VideoStitch_h -#pragma once - -#include "public/include/components/Component.h" - -#define AMFVideoStitch L"AMFVideoStitch" //Component name - -// static properties -#define AMF_VIDEO_STITCH_OUTPUT_FORMAT L"OutputFormat" // Values, AMF_SURFACE_BGRA or AMF_SURFACE_RGBA -#define AMF_VIDEO_STITCH_MEMORY_TYPE L"MemoryType" // Values, only AMF_MEMORY_DX11 is supported for now. -#define AMF_VIDEO_STITCH_OUTPUT_SIZE L"OutputSize" // AMFSize, (width, height) in pixels. default= (0,0), will be the same size as input. -#define AMF_VIDEO_STITCH_INPUTCOUNT L"InputCount" // amf_uint64, number of camera inputs. - -// individual camera direction and location -#define AMF_VIDEO_CAMERA_ANGLE_PITCH L"CameraPitch" // double, in radians, default = 0, camera pitch orientation -#define AMF_VIDEO_CAMERA_ANGLE_YAW L"CameraYaw" // double, in radians, default = 0, camera yaw orientation -#define AMF_VIDEO_CAMERA_ANGLE_ROLL L"CameraRoll" // double, in radians, default = 0, camera roll orientation - -#define AMF_VIDEO_CAMERA_OFFSET_X L"CameraOffsetX" // double, in pixels, default = 0, X offset of camera center of the lens from the center of the rig. -#define AMF_VIDEO_CAMERA_OFFSET_Y L"CameraOffsetY" // double, in pixels, default = 0, Y offset of camera center of the lens from the center of the rig. -#define AMF_VIDEO_CAMERA_OFFSET_Z L"CameraOffsetZ" // double, in pixels, default = 0, Z offset of camera center of the lens from the center of the rig. -#define AMF_VIDEO_CAMERA_HFOV L"CameraHFOV" // double, in radians, default = PI, - horizontal field of view -#define AMF_VIDEO_CAMERA_SCALE L"CameraScale" // double, default = 1, scale coeff - -// lens correction parameters -#define AMF_VIDEO_STITCH_LENS_CORR_K1 L"LensK1" // double, default = 0. -#define AMF_VIDEO_STITCH_LENS_CORR_K2 L"LensK2" // double, default = 0. -#define AMF_VIDEO_STITCH_LENS_CORR_K3 L"LensK3" // double, default = 0. -#define AMF_VIDEO_STITCH_LENS_CORR_OFFX L"LensOffX" // double, default = 0. -#define AMF_VIDEO_STITCH_LENS_CORR_OFFY L"LensOffY" // double, default = 0. -#define AMF_VIDEO_STITCH_CROP L"Crop" //AMFRect, in pixels default = (0,0,0,0). - -#define AMF_VIDEO_STITCH_LENS_MODE L"LensMode" // Values, AMF_VIDEO_STITCH_LENS_CORR_MODE_ENUM, (default = AMF_VIDEO_STITCH_LENS_CORR_MODE_RADIAL) - -#define AMF_VIDEO_STITCH_OUTPUT_MODE L"OutputMode" // AMF_VIDEO_STITCH_OUTPUT_MODE_ENUM (default=AMF_VIDEO_STITCH_OUTPUT_MODE_PREVIEW) -#define AMF_VIDEO_STITCH_COMBINED_SOURCE L"CombinedSource" // bool, (default=false) video sources are combined in one stream - -#define AMF_VIDEO_STITCH_COMPUTE_DEVICE L"ComputeDevice" // amf_int64(AMF_MEMORY_TYPE) Values, AMF_MEMORY_DX11, AMF_MEMORY_COMPUTE_FOR_DX11, AMF_MEMORY_OPENCL - -//for debug -#define AMF_VIDEO_STITCH_WIRE_RENDER L"Wire" // bool (default=false) reder wireframe - -//view angle -#define AMF_VIDEO_STITCH_VIEW_ROTATE_X L"AngleX" // double, in radians, default = 0 - delta from current position / automatilcally reset to 0 inside SetProperty() call -#define AMF_VIDEO_STITCH_VIEW_ROTATE_Y L"AngleY" // double, in radians, default = 0 - delta from current position / automatilcally reset to 0 inside SetProperty() call -#define AMF_VIDEO_STITCH_VIEW_ROTATE_Z L"AngleZ" // double, in radians, default = 0 - delta from current position / automatilcally reset to 0 inside SetProperty() call - -#define AMF_VIDEO_STITCH_COLOR_BALANCE L"ColorBalance" // bool (default=true) enables color balance - -//lens mode -enum AMF_VIDEO_STITCH_LENS_ENUM -{ - AMF_VIDEO_STITCH_LENS_RECTILINEAR = 0, //rect linear lens - AMF_VIDEO_STITCH_LENS_FISHEYE_FULLFRAME = 1, //fisheye full frame - AMF_VIDEO_STITCH_LENS_FISHEYE_CIRCULAR = 2, //fisheye, circular -}; - -//Output Mode -enum AMF_VIDEO_STITCH_OUTPUT_MODE_ENUM -{ - AMF_VIDEO_STITCH_OUTPUT_MODE_PREVIEW = 0, //preview mode - AMF_VIDEO_STITCH_OUTPUT_MODE_EQUIRECTANGULAR = 1, //equirectangular mode - AMF_VIDEO_STITCH_OUTPUT_MODE_CUBEMAP = 2, //cubemap mode - AMF_VIDEO_STITCH_OUTPUT_MODE_LAST = AMF_VIDEO_STITCH_OUTPUT_MODE_CUBEMAP, -}; - -//audio mode -enum AMF_VIDEO_STITCH_AUDIO_MODE_ENUM -{ - AMF_VIDEO_STITCH_AUDIO_MODE_NONE = 0, //no audio - AMF_VIDEO_STITCH_AUDIO_MODE_VIDEO = 1, //using audio from video stream - AMF_VIDEO_STITCH_AUDIO_MODE_FILE = 2, //using audio from file - AMF_VIDEO_STITCH_AUDIO_MODE_CAPTURE = 3, //using audio from capture device - AMF_VIDEO_STITCH_AUDIO_MODE_INVALID = -1, //invalid -}; - - -#if defined(_M_AMD64) - #define STITCH_DLL_NAME L"amf-stitch-64.dll" -#else - #define STITCH_DLL_NAME L"amf-stitch-32.dll" -#endif - -#endif //#ifndef AMF_VideoStitch_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ZCamLiveStream.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ZCamLiveStream.h deleted file mode 100644 index 7f4a6bbe..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/components/ZCamLiveStream.h +++ /dev/null @@ -1,83 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -//------------------------------------------------------------------------------------------------- -// ZCamLive interface declaration -//------------------------------------------------------------------------------------------------- -#ifndef AMF_ZCamLiveStream_h -#define AMF_ZCamLiveStream_h - -#pragma once -#define ZCAMLIVE_STREAMCOUNT L"StreamCount" // amf_int64 (default = 4), number of streams -#define ZCAMLIVE_VIDEO_FRAMESIZE L"FrameSize" // AMFSize (default = AMFConstructSize(2704, 1520)), frame size -#define ZCAMLIVE_VIDEO_FRAMERATE L"FrameRate" // AMFRate (default = 30.0), video frame rate -#define ZCAMLIVE_VIDEO_BIT_RATE L"BitRate" // amf_int64 (default = 3000000), video bitrate -#define ZCAMLIVE_STREAM_ACTIVE_CAMERA L"ActiveCamera" // amf_int64 (default = -1, all the cameras), the index of the camera to capture -#define ZCAMLIVE_STREAM_FRAMECOUNT L"FrameCount" // amf_int64 (default = 0), number of frames captured -#define ZCAMLIVE_CODEC_ID L"CodecID" // WString (default = "AMFVideoDecoderUVD_H264_AVC"), UVD codec ID -#define ZCAMLIVE_VIDEO_MODE L"VideoMode" // Enum (default = 0, 2K7P30), ZCam mode -#define ZCAMLIVE_AUDIO_MODE L"AudioMode" // Enum (default = 0, Silent) - Audio mode -#define ZCAMLIVE_LOWLATENCY L"LowLatency" // amf_int64 (default = 1, LowLatency), low latency flag -#define ZCAMLIVE_IP_0 L"ZCamIP_00" // WString, IP address of the #1 stream, default "10.98.32.1" -#define ZCAMLIVE_IP_1 L"ZCamIP_01" // WString, IP address of the #2 stream, default "10.98.32.2" -#define ZCAMLIVE_IP_2 L"ZCamIP_02" // WString, IP address of the #3 stream, default "10.98.32.3" -#define ZCAMLIVE_IP_3 L"ZCamIP_03" // WString, IP address of the #4 stream, default "10.98.32.4" - -//Camera live capture Mode -enum CAMLIVE_MODE_ENUM -{ - CAMLIVE_MODE_ZCAM_1080P24 = 0, //1920x1080, 24FPS - CAMLIVE_MODE_ZCAM_1080P30, //1920x1080, 30FPS - CAMLIVE_MODE_ZCAM_1080P60, //1920x1080, 60FPS - CAMLIVE_MODE_ZCAM_2K7P24, //2704x1520, 24FPS - CAMLIVE_MODE_ZCAM_2K7P30, //2704x1520, 24FPS - CAMLIVE_MODE_ZCAM_2K7P60, //2704x1520, 24FPS - CAMLIVE_MODE_ZCAM_2544P24, //3392x2544, 24FPS - CAMLIVE_MODE_ZCAM_2544P30, //3392x2544, 24FPS - CAMLIVE_MODE_ZCAM_2544P60, //3392x2544, 24FPS - CAMLIVE_MODE_THETAS, //Ricoh TheataS - CAMLIVE_MODE_THETAV, //Ricoh TheataV - CAMLIVE_MODE_INVALID = -1, -}; - -enum CAM_AUDIO_MODE_ENUM -{ - CAM_AUDIO_MODE_NONE = 0, //None - CAM_AUDIO_MODE_SILENT, //Silent audio - CAM_AUDIO_MODE_CAMERA //Capture from camera, not supported yet -}; - -extern "C" -{ - AMF_RESULT AMF_CDECL_CALL AMFCreateComponentZCamLiveStream(amf::AMFContext* pContext, amf::AMFComponentEx** ppComponent); -} -#endif // AMF_ZCamLiveStream_h \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/AudioBuffer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/AudioBuffer.h deleted file mode 100644 index 7382fc0c..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/AudioBuffer.h +++ /dev/null @@ -1,241 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_AudioBuffer_h -#define AMF_AudioBuffer_h -#pragma once - -#include "Data.h" -#if defined(_MSC_VER) - #pragma warning( push ) - #pragma warning(disable : 4263) - #pragma warning(disable : 4264) -#endif -#if defined(__cplusplus) -namespace amf -{ -#endif - typedef enum AMF_AUDIO_FORMAT - { - AMFAF_UNKNOWN =-1, - AMFAF_U8 = 0, // amf_uint8 - AMFAF_S16 = 1, // amf_int16 - AMFAF_S32 = 2, // amf_int32 - AMFAF_FLT = 3, // amf_float - AMFAF_DBL = 4, // amf_double - - AMFAF_U8P = 5, // amf_uint8 - AMFAF_S16P = 6, // amf_int16 - AMFAF_S32P = 7, // amf_int32 - AMFAF_FLTP = 8, // amf_float - AMFAF_DBLP = 9, // amf_double - AMFAF_FIRST = AMFAF_U8, - AMFAF_LAST = AMFAF_DBLP, - } AMF_AUDIO_FORMAT; - - typedef enum AMF_AUDIO_CHANNEL_LAYOUT - { - AMFACL_SPEAKER_FRONT_LEFT = 0x1, - AMFACL_SPEAKER_FRONT_RIGHT = 0x2, - AMFACL_SPEAKER_FRONT_CENTER = 0x4, - AMFACL_SPEAKER_LOW_FREQUENCY = 0x8, - AMFACL_SPEAKER_BACK_LEFT = 0x10, - AMFACL_SPEAKER_BACK_RIGHT = 0x20, - AMFACL_SPEAKER_FRONT_LEFT_OF_CENTER = 0x40, - AMFACL_SPEAKER_FRONT_RIGHT_OF_CENTER = 0x80, - AMFACL_SPEAKER_BACK_CENTER = 0x100, - AMFACL_SPEAKER_SIDE_LEFT = 0x200, - AMFACL_SPEAKER_SIDE_RIGHT = 0x400, - AMFACL_SPEAKER_TOP_CENTER = 0x800, - AMFACL_SPEAKER_TOP_FRONT_LEFT = 0x1000, - AMFACL_SPEAKER_TOP_FRONT_CENTER = 0x2000, - AMFACL_SPEAKER_TOP_FRONT_RIGHT = 0x4000, - AMFACL_SPEAKER_TOP_BACK_LEFT = 0x8000, - AMFACL_SPEAKER_TOP_BACK_CENTER = 0x10000, - AMFACL_SPEAKER_TOP_BACK_RIGHT = 0x20000 - } AMF_AUDIO_CHANNEL_LAYOUT; - - // get the most common layout for a given number of speakers - inline int GetDefaultChannelLayout(int channels) - { - switch (channels) - { - case 1: - return (AMFACL_SPEAKER_FRONT_CENTER); - case 2: - return (AMFACL_SPEAKER_FRONT_LEFT | AMFACL_SPEAKER_FRONT_RIGHT); - case 4: - return (AMFACL_SPEAKER_FRONT_LEFT | AMFACL_SPEAKER_FRONT_RIGHT | AMFACL_SPEAKER_BACK_LEFT | AMFACL_SPEAKER_BACK_RIGHT); - case 6: - return (AMFACL_SPEAKER_FRONT_LEFT | AMFACL_SPEAKER_FRONT_RIGHT | AMFACL_SPEAKER_FRONT_CENTER | AMFACL_SPEAKER_LOW_FREQUENCY | AMFACL_SPEAKER_BACK_LEFT | AMFACL_SPEAKER_BACK_RIGHT); - case 8: - return (AMFACL_SPEAKER_FRONT_LEFT | AMFACL_SPEAKER_FRONT_RIGHT | AMFACL_SPEAKER_FRONT_CENTER | AMFACL_SPEAKER_LOW_FREQUENCY | AMFACL_SPEAKER_BACK_LEFT | AMFACL_SPEAKER_BACK_RIGHT | AMFACL_SPEAKER_FRONT_LEFT_OF_CENTER | AMFACL_SPEAKER_FRONT_RIGHT_OF_CENTER); - } - - return AMFACL_SPEAKER_FRONT_LEFT | AMFACL_SPEAKER_FRONT_RIGHT; - } - - //---------------------------------------------------------------------------------------------- - // AMFAudioBufferObserver interface - callback - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMFAudioBuffer; - class AMF_NO_VTABLE AMFAudioBufferObserver - { - public: - virtual void AMF_STD_CALL OnBufferDataRelease(AMFAudioBuffer* pBuffer) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFAudioBuffer AMFAudioBuffer; - typedef struct AMFAudioBufferObserver AMFAudioBufferObserver; - typedef struct AMFAudioBufferObserverVtbl - { - void (AMF_STD_CALL *OnBufferDataRelease)(AMFAudioBufferObserver* pThis, AMFAudioBuffer* pBuffer); - } AMFAudioBufferObserverVtbl; - - struct AMFAudioBufferObserver - { - const AMFAudioBufferObserverVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AudioBuffer interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFAudioBuffer : public AMFData - { - public: - AMF_DECLARE_IID(0x2212ff8, 0x6107, 0x430b, 0xb6, 0x3c, 0xc7, 0xe5, 0x40, 0xe5, 0xf8, 0xeb) - - virtual amf_int32 AMF_STD_CALL GetSampleCount() = 0; - virtual amf_int32 AMF_STD_CALL GetSampleRate() = 0; - virtual amf_int32 AMF_STD_CALL GetChannelCount() = 0; - virtual AMF_AUDIO_FORMAT AMF_STD_CALL GetSampleFormat() = 0; - virtual amf_int32 AMF_STD_CALL GetSampleSize() = 0; - virtual amf_uint32 AMF_STD_CALL GetChannelLayout() = 0; - virtual void* AMF_STD_CALL GetNative() = 0; - virtual amf_size AMF_STD_CALL GetSize() = 0; - - // Observer management -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Woverloaded-virtual" -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverloaded-virtual" -#endif - virtual void AMF_STD_CALL AddObserver(AMFAudioBufferObserver* pObserver) = 0; - virtual void AMF_STD_CALL RemoveObserver(AMFAudioBufferObserver* pObserver) = 0; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFAudioBufferPtr; - //---------------------------------------------------------------------------------------------- -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFAudioBuffer, 0x2212ff8, 0x6107, 0x430b, 0xb6, 0x3c, 0xc7, 0xe5, 0x40, 0xe5, 0xf8, 0xeb) - - typedef struct AMFAudioBufferVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFAudioBuffer* pThis); - amf_long (AMF_STD_CALL *Release)(AMFAudioBuffer* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFAudioBuffer* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFAudioBuffer* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFAudioBuffer* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFAudioBuffer* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFAudioBuffer* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFAudioBuffer* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFAudioBuffer* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFAudioBuffer* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFAudioBuffer* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFAudioBuffer* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFAudioBuffer* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFData interface - - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryType)(AMFAudioBuffer* pThis); - - AMF_RESULT (AMF_STD_CALL *Duplicate)(AMFAudioBuffer* pThis, AMF_MEMORY_TYPE type, AMFData** ppData); - AMF_RESULT (AMF_STD_CALL *Convert)(AMFAudioBuffer* pThis, AMF_MEMORY_TYPE type); // optimal interop if possilble. Copy through host memory if needed - AMF_RESULT (AMF_STD_CALL *Interop)(AMFAudioBuffer* pThis, AMF_MEMORY_TYPE type); // only optimal interop if possilble. No copy through host memory for GPU objects - - AMF_DATA_TYPE (AMF_STD_CALL *GetDataType)(AMFAudioBuffer* pThis); - - amf_bool (AMF_STD_CALL *IsReusable)(AMFAudioBuffer* pThis); - - void (AMF_STD_CALL *SetPts)(AMFAudioBuffer* pThis, amf_pts pts); - amf_pts (AMF_STD_CALL *GetPts)(AMFAudioBuffer* pThis); - void (AMF_STD_CALL *SetDuration)(AMFAudioBuffer* pThis, amf_pts duration); - amf_pts (AMF_STD_CALL *GetDuration)(AMFAudioBuffer* pThis); - - // AMFAudioBuffer interface - - amf_int32 (AMF_STD_CALL *GetSampleCount)(AMFAudioBuffer* pThis); - amf_int32 (AMF_STD_CALL *GetSampleRate)(AMFAudioBuffer* pThis); - amf_int32 (AMF_STD_CALL *GetChannelCount)(AMFAudioBuffer* pThis); - AMF_AUDIO_FORMAT (AMF_STD_CALL *GetSampleFormat)(AMFAudioBuffer* pThis); - amf_int32 (AMF_STD_CALL *GetSampleSize)(AMFAudioBuffer* pThis); - amf_uint32 (AMF_STD_CALL *GetChannelLayout)(AMFAudioBuffer* pThis); - void* (AMF_STD_CALL *GetNative)(AMFAudioBuffer* pThis); - amf_size (AMF_STD_CALL *GetSize)(AMFAudioBuffer* pThis); - - // Observer management - void (AMF_STD_CALL *AddObserver_AudioBuffer)(AMFAudioBuffer* pThis, AMFAudioBufferObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver_AudioBuffer)(AMFAudioBuffer* pThis, AMFAudioBufferObserver* pObserver); - - } AMFAudioBufferVtbl; - - struct AMFAudioBuffer - { - const AMFAudioBufferVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) -} // namespace -#endif -#if defined(_MSC_VER) - #pragma warning( pop ) -#endif -#endif //#ifndef AMF_AudioBuffer_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Buffer.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Buffer.h deleted file mode 100644 index 608c0a1d..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Buffer.h +++ /dev/null @@ -1,197 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Buffer_h -#define AMF_Buffer_h -#pragma once - -#include "Data.h" - -#if defined(_MSC_VER) - #pragma warning( push ) - #pragma warning(disable : 4263) - #pragma warning(disable : 4264) -#endif -#if defined(__cplusplus) -namespace amf -{ -#endif - - //---------------------------------------------------------------------------------------------- - // AMF_BUFFER_USAGE translates to D3D11_BIND_FLAG or VkBufferUsageFlagBits - // bit mask - //---------------------------------------------------------------------------------------------- - typedef enum AMF_BUFFER_USAGE_BITS - { // D3D11 D3D12 Vulkan - AMF_BUFFER_USAGE_DEFAULT = 0x80000000, // D3D11_USAGE_STAGING, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT - AMF_BUFFER_USAGE_NONE = 0x00000000, // 0 , D3D12_RESOURCE_FLAG_NONE, 0 - AMF_BUFFER_USAGE_CONSTANT = 0x00000001, // D3D11_BIND_CONSTANT_BUFFER, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT - AMF_BUFFER_USAGE_SHADER_RESOURCE = 0x00000002, // D3D11_BIND_SHADER_RESOURCE, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT - AMF_BUFFER_USAGE_UNORDERED_ACCESS = 0x00000004, // D3D11_BIND_UNORDERED_ACCESS, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT - AMF_BUFFER_USAGE_TRANSFER_SRC = 0x00000008, // VK_BUFFER_USAGE_TRANSFER_SRC_BIT - AMF_BUFFER_USAGE_TRANSFER_DST = 0x00000010, // VK_BUFFER_USAGE_TRANSFER_DST_BIT - AMF_BUFFER_USAGE_NOSYNC = 0x00000020, // no fence (AMFFenceGUID) created no semaphore (AMFVulkanSync::hSemaphore) created - AMF_BUFFER_USAGE_DECODER_SRC = 0x00000040, // VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR - } AMF_BUFFER_USAGE_BITS; - typedef amf_flags AMF_BUFFER_USAGE; - //---------------------------------------------------------------------------------------------- - - - //---------------------------------------------------------------------------------------------- - // AMFBufferObserver interface - callback - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMFBuffer; - class AMF_NO_VTABLE AMFBufferObserver - { - public: - virtual void AMF_STD_CALL OnBufferDataRelease(AMFBuffer* pBuffer) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFBuffer AMFBuffer; - typedef struct AMFBufferObserver AMFBufferObserver; - - typedef struct AMFBufferObserverVtbl - { - void (AMF_STD_CALL *OnBufferDataRelease)(AMFBufferObserver* pThis, AMFBuffer* pBuffer); - } AMFBufferObserverVtbl; - - struct AMFBufferObserver - { - const AMFBufferObserverVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFBuffer interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFBuffer : public AMFData - { - public: - AMF_DECLARE_IID(0xb04b7248, 0xb6f0, 0x4321, 0xb6, 0x91, 0xba, 0xa4, 0x74, 0xf, 0x9f, 0xcb) - - virtual AMF_RESULT AMF_STD_CALL SetSize(amf_size newSize) = 0; - virtual amf_size AMF_STD_CALL GetSize() = 0; - virtual void* AMF_STD_CALL GetNative() = 0; - - // Observer management -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Woverloaded-virtual" -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverloaded-virtual" -#endif - - virtual void AMF_STD_CALL AddObserver(AMFBufferObserver* pObserver) = 0; - virtual void AMF_STD_CALL RemoveObserver(AMFBufferObserver* pObserver) = 0; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFBufferPtr; - //---------------------------------------------------------------------------------------------- - -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFBuffer, 0xb04b7248, 0xb6f0, 0x4321, 0xb6, 0x91, 0xba, 0xa4, 0x74, 0xf, 0x9f, 0xcb) - - typedef struct AMFBufferVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFBuffer* pThis); - amf_long (AMF_STD_CALL *Release)(AMFBuffer* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFBuffer* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFBuffer* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFBuffer* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFBuffer* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFBuffer* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFBuffer* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFBuffer* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFBuffer* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFBuffer* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFBuffer* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFBuffer* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFData interface - - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryType)(AMFBuffer* pThis); - - AMF_RESULT (AMF_STD_CALL *Duplicate)(AMFBuffer* pThis, AMF_MEMORY_TYPE type, AMFData** ppData); - AMF_RESULT (AMF_STD_CALL *Convert)(AMFBuffer* pThis, AMF_MEMORY_TYPE type); // optimal interop if possilble. Copy through host memory if needed - AMF_RESULT (AMF_STD_CALL *Interop)(AMFBuffer* pThis, AMF_MEMORY_TYPE type); // only optimal interop if possilble. No copy through host memory for GPU objects - - AMF_DATA_TYPE (AMF_STD_CALL *GetDataType)(AMFBuffer* pThis); - - amf_bool (AMF_STD_CALL *IsReusable)(AMFBuffer* pThis); - - void (AMF_STD_CALL *SetPts)(AMFBuffer* pThis, amf_pts pts); - amf_pts (AMF_STD_CALL *GetPts)(AMFBuffer* pThis); - void (AMF_STD_CALL *SetDuration)(AMFBuffer* pThis, amf_pts duration); - amf_pts (AMF_STD_CALL *GetDuration)(AMFBuffer* pThis); - - // AMFBuffer interface - - AMF_RESULT (AMF_STD_CALL *SetSize)(AMFBuffer* pThis, amf_size newSize); - amf_size (AMF_STD_CALL *GetSize)(AMFBuffer* pThis); - void* (AMF_STD_CALL *GetNative)(AMFBuffer* pThis); - - // Observer management - void (AMF_STD_CALL *AddObserver_Buffer)(AMFBuffer* pThis, AMFBufferObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver_Buffer)(AMFBuffer* pThis, AMFBufferObserver* pObserver); - - } AMFBufferVtbl; - - struct AMFBuffer - { - const AMFBufferVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) -} // namespace -#endif -#if defined(_MSC_VER) - #pragma warning( pop ) -#endif -#endif //#ifndef AMF_Buffer_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Compute.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Compute.h deleted file mode 100644 index bc34749f..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Compute.h +++ /dev/null @@ -1,302 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** - *************************************************************************************************** - * @file Compute.h - * @brief AMFCompute interface declaration - *************************************************************************************************** - */ -#ifndef AMF_Compute_h -#define AMF_Compute_h -#pragma once - -#include "Buffer.h" -#include "Surface.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - typedef amf_uint64 AMF_KERNEL_ID; - - //---------------------------------------------------------------------------------------------- - // enumerations for plane conversion - //---------------------------------------------------------------------------------------------- - typedef enum AMF_CHANNEL_ORDER - { - AMF_CHANNEL_ORDER_INVALID = 0, - AMF_CHANNEL_ORDER_R = 1, - AMF_CHANNEL_ORDER_RG = 2, - AMF_CHANNEL_ORDER_BGRA = 3, - AMF_CHANNEL_ORDER_RGBA = 4, - AMF_CHANNEL_ORDER_ARGB = 5, - AMF_CHANNEL_ORDER_YUY2 = 6, - } AMF_CHANNEL_ORDER; - //---------------------------------------------------------------------------------------------- - typedef enum AMF_CHANNEL_TYPE - { - AMF_CHANNEL_INVALID = 0, - AMF_CHANNEL_UNSIGNED_INT8 = 1, - AMF_CHANNEL_UNSIGNED_INT32 = 2, - AMF_CHANNEL_UNORM_INT8 = 3, - AMF_CHANNEL_UNORM_INT16 = 4, - AMF_CHANNEL_SNORM_INT16 = 5, - AMF_CHANNEL_FLOAT = 6, - AMF_CHANNEL_FLOAT16 = 7, - AMF_CHANNEL_UNSIGNED_INT16 = 8, - AMF_CHANNEL_UNORM_INT_101010 = 9, -} AMF_CHANNEL_TYPE; - //---------------------------------------------------------------------------------------------- -#define AMF_STRUCTURED_BUFFER_FORMAT L"StructuredBufferFormat" // amf_int64(AMF_CHANNEL_TYPE), default - AMF_CHANNEL_UNSIGNED_INT32; to be set on AMFBuffer objects -#if defined(_WIN32) - AMF_WEAK GUID AMFStructuredBufferFormatGUID = { 0x90c5d674, 0xe90, 0x4181, {0xbd, 0xef, 0x26, 0x13, 0xc1, 0xdf, 0xa3, 0xbd} }; // UINT(DXGI_FORMAT), default - DXGI_FORMAT_R32_UINT; to be set on ID3D11Buffer or ID3D11Texture2D objects when used natively -#endif - //---------------------------------------------------------------------------------------------- - // enumeration argument type - //---------------------------------------------------------------------------------------------- - typedef enum AMF_ARGUMENT_ACCESS_TYPE - { - AMF_ARGUMENT_ACCESS_READ = 0, - AMF_ARGUMENT_ACCESS_WRITE = 1, - AMF_ARGUMENT_ACCESS_READWRITE = 2, - AMF_ARGUMENT_ACCESS_READWRITE_MASK = 0xFFFF, - //Sampler parameters - AMF_ARGUMENT_SAMPLER_LINEAR = 0x10000000, - AMF_ARGUMENT_SAMPLER_NORM_COORD = 0x20000000, - AMF_ARGUMENT_SAMPLER_POINT = 0x40000000, - AMF_ARGUMENT_SAMPLER_MASK = 0xFFFF0000, - } AMF_ARGUMENT_ACCESS_TYPE; - //---------------------------------------------------------------------------------------------- - // AMFComputeKernel interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComputeKernel : public AMFInterface - { - public: - AMF_DECLARE_IID(0x94815701, 0x6c84, 0x4ba6, 0xa9, 0xfe, 0xe9, 0xad, 0x40, 0xf8, 0x8, 0x8) - - virtual void* AMF_STD_CALL GetNative() = 0; - virtual const wchar_t* AMF_STD_CALL GetIDName() = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgPlaneNative(amf_size index, void* pPlane, AMF_ARGUMENT_ACCESS_TYPE eAccess) = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgBufferNative(amf_size index, void* pBuffer, AMF_ARGUMENT_ACCESS_TYPE eAccess) = 0; - - virtual AMF_RESULT AMF_STD_CALL SetArgPlane(amf_size index, AMFPlane* pPlane, AMF_ARGUMENT_ACCESS_TYPE eAccess) = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgBuffer(amf_size index, AMFBuffer* pBuffer, AMF_ARGUMENT_ACCESS_TYPE eAccess) = 0; - - virtual AMF_RESULT AMF_STD_CALL SetArgInt32(amf_size index, amf_int32 data) = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgInt64(amf_size index, amf_int64 data) = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgFloat(amf_size index, amf_float data) = 0; - virtual AMF_RESULT AMF_STD_CALL SetArgBlob(amf_size index, amf_size dataSize, const void* pData) = 0; - - virtual AMF_RESULT AMF_STD_CALL GetCompileWorkgroupSize(amf_size workgroupSize[3]) = 0; - - virtual AMF_RESULT AMF_STD_CALL Enqueue(amf_size dimension, amf_size globalOffset[3], amf_size globalSize[3], amf_size localSize[3]) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComputeKernelPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComputeKernel, 0x94815701, 0x6c84, 0x4ba6, 0xa9, 0xfe, 0xe9, 0xad, 0x40, 0xf8, 0x8, 0x8) - typedef struct AMFComputeKernel AMFComputeKernel; - - typedef struct AMFComputeKernelVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComputeKernel* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComputeKernel* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComputeKernel* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFComputeKernel interface - - } AMFComputeKernelVtbl; - - struct AMFComputeKernel - { - const AMFComputeKernelVtbl *pVtbl; - }; - -#endif //#if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFComputeSyncPoint interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComputeSyncPoint : public AMFInterface - { - public: - AMF_DECLARE_IID(0x66f33fe6, 0xaae, 0x4e65, 0xba, 0x3, 0xea, 0x8b, 0xa3, 0x60, 0x11, 0x2) - - virtual amf_bool AMF_STD_CALL IsCompleted() = 0; - virtual void AMF_STD_CALL Wait() = 0; - }; - typedef AMFInterfacePtr_T AMFComputeSyncPointPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComputeSyncPoint, 0x66f33fe6, 0xaae, 0x4e65, 0xba, 0x3, 0xea, 0x8b, 0xa3, 0x60, 0x11, 0x2) - typedef struct AMFComputeSyncPoint AMFComputeSyncPoint; - - typedef struct AMFComputeSyncPointVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComputeSyncPoint* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComputeSyncPoint* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComputeSyncPoint* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFComputeSyncPoint interface - amf_bool (AMF_STD_CALL *IsCompleted)(AMFComputeSyncPoint* pThis); - void (AMF_STD_CALL *Wait)(AMFComputeSyncPoint* pThis); - - } AMFComputeSyncPointVtbl; - - struct AMFComputeSyncPoint - { - const AMFComputeSyncPointVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFCompute interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFCompute : public AMFInterface - { - public: - AMF_DECLARE_IID(0x3846233a, 0x3f43, 0x443f, 0x8a, 0x45, 0x75, 0x22, 0x11, 0xa9, 0xfb, 0xd5) - - virtual AMF_MEMORY_TYPE AMF_STD_CALL GetMemoryType() = 0; - - virtual void* AMF_STD_CALL GetNativeContext() = 0; - virtual void* AMF_STD_CALL GetNativeDeviceID() = 0; - virtual void* AMF_STD_CALL GetNativeCommandQueue() = 0; - - virtual AMF_RESULT AMF_STD_CALL GetKernel(AMF_KERNEL_ID kernelID, AMFComputeKernel** kernel) = 0; - - virtual AMF_RESULT AMF_STD_CALL PutSyncPoint(AMFComputeSyncPoint** ppSyncPoint) = 0; - virtual AMF_RESULT AMF_STD_CALL FinishQueue() = 0; - virtual AMF_RESULT AMF_STD_CALL FlushQueue() = 0; - - virtual AMF_RESULT AMF_STD_CALL FillPlane(AMFPlane *pPlane, const amf_size origin[3], const amf_size region[3], const void* pColor) = 0; - virtual AMF_RESULT AMF_STD_CALL FillBuffer(AMFBuffer* pBuffer, amf_size dstOffset, amf_size dstSize, const void* pSourcePattern, amf_size patternSize) = 0; - virtual AMF_RESULT AMF_STD_CALL ConvertPlaneToBuffer(AMFPlane *pSrcPlane, AMFBuffer** ppDstBuffer) = 0; - - virtual AMF_RESULT AMF_STD_CALL CopyBuffer(AMFBuffer* pSrcBuffer, amf_size srcOffset, amf_size size, AMFBuffer* pDstBuffer, amf_size dstOffset) = 0; - virtual AMF_RESULT AMF_STD_CALL CopyPlane(AMFPlane *pSrcPlane, const amf_size srcOrigin[3], const amf_size region[3], AMFPlane *pDstPlane, const amf_size dstOrigin[3]) = 0; - - virtual AMF_RESULT AMF_STD_CALL CopyBufferToHost(AMFBuffer* pSrcBuffer, amf_size srcOffset, amf_size size, void* pDest, amf_bool blocking) = 0; - virtual AMF_RESULT AMF_STD_CALL CopyBufferFromHost(const void* pSource, amf_size size, AMFBuffer* pDstBuffer, amf_size dstOffsetInBytes, amf_bool blocking) = 0; - - virtual AMF_RESULT AMF_STD_CALL CopyPlaneToHost(AMFPlane *pSrcPlane, const amf_size origin[3], const amf_size region[3], void* pDest, amf_size dstPitch, amf_bool blocking) = 0; - virtual AMF_RESULT AMF_STD_CALL CopyPlaneFromHost(void* pSource, const amf_size origin[3], const amf_size region[3], amf_size srcPitch, AMFPlane *pDstPlane, amf_bool blocking) = 0; - - virtual AMF_RESULT AMF_STD_CALL ConvertPlaneToPlane(AMFPlane* pSrcPlane, AMFPlane** ppDstPlane, AMF_CHANNEL_ORDER order, AMF_CHANNEL_TYPE type) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComputePtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFCompute, 0x3846233a, 0x3f43, 0x443f, 0x8a, 0x45, 0x75, 0x22, 0x11, 0xa9, 0xfb, 0xd5) - typedef struct AMFCompute AMFCompute; - - typedef struct AMFComputeVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFCompute* pThis); - amf_long (AMF_STD_CALL *Release)(AMFCompute* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFCompute* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFCompute interface - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryType)(AMFCompute* pThis); - void* (AMF_STD_CALL *GetNativeContext)(AMFCompute* pThis); - void* (AMF_STD_CALL *GetNativeDeviceID)(AMFCompute* pThis); - void* (AMF_STD_CALL *GetNativeCommandQueue)(AMFCompute* pThis); - AMF_RESULT (AMF_STD_CALL *GetKernel)(AMFCompute* pThis, AMF_KERNEL_ID kernelID, AMFComputeKernel** kernel); - AMF_RESULT (AMF_STD_CALL *PutSyncPoint)(AMFCompute* pThis, AMFComputeSyncPoint** ppSyncPoint); - AMF_RESULT (AMF_STD_CALL *FinishQueue)(AMFCompute* pThis); - AMF_RESULT (AMF_STD_CALL *FlushQueue)(AMFCompute* pThis); - AMF_RESULT (AMF_STD_CALL *FillPlane)(AMFCompute* pThis, AMFPlane *pPlane, const amf_size origin[3], const amf_size region[3], const void* pColor); - AMF_RESULT (AMF_STD_CALL *FillBuffer)(AMFCompute* pThis, AMFBuffer* pBuffer, amf_size dstOffset, amf_size dstSize, const void* pSourcePattern, amf_size patternSize); - AMF_RESULT (AMF_STD_CALL *ConvertPlaneToBuffer)(AMFCompute* pThis, AMFPlane *pSrcPlane, AMFBuffer** ppDstBuffer); - AMF_RESULT (AMF_STD_CALL *CopyBuffer)(AMFCompute* pThis, AMFBuffer* pSrcBuffer, amf_size srcOffset, amf_size size, AMFBuffer* pDstBuffer, amf_size dstOffset); - AMF_RESULT (AMF_STD_CALL *CopyPlane)(AMFCompute* pThis, AMFPlane *pSrcPlane, const amf_size srcOrigin[3], const amf_size region[3], AMFPlane *pDstPlane, const amf_size dstOrigin[3]); - AMF_RESULT (AMF_STD_CALL *CopyBufferToHost)(AMFCompute* pThis, AMFBuffer* pSrcBuffer, amf_size srcOffset, amf_size size, void* pDest, amf_bool blocking); - AMF_RESULT (AMF_STD_CALL *CopyBufferFromHost)(AMFCompute* pThis, const void* pSource, amf_size size, AMFBuffer* pDstBuffer, amf_size dstOffsetInBytes, amf_bool blocking); - AMF_RESULT (AMF_STD_CALL *CopyPlaneToHost)(AMFCompute* pThis, AMFPlane *pSrcPlane, const amf_size origin[3], const amf_size region[3], void* pDest, amf_size dstPitch, amf_bool blocking); - AMF_RESULT (AMF_STD_CALL *CopyPlaneFromHost)(AMFCompute* pThis, void* pSource, const amf_size origin[3], const amf_size region[3], amf_size srcPitch, AMFPlane *pDstPlane, amf_bool blocking); - AMF_RESULT (AMF_STD_CALL *ConvertPlaneToPlane)(AMFCompute* pThis, AMFPlane* pSrcPlane, AMFPlane** ppDstPlane, AMF_CHANNEL_ORDER order, AMF_CHANNEL_TYPE type); - } AMFComputeVtbl; - - struct AMFCompute - { - const AMFComputeVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFPrograms interface - singleton - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFPrograms - { - public: - virtual AMF_RESULT AMF_STD_CALL RegisterKernelSourceFile(AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, const wchar_t* filepath, const char* options) = 0; - virtual AMF_RESULT AMF_STD_CALL RegisterKernelSource(AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options) = 0; - virtual AMF_RESULT AMF_STD_CALL RegisterKernelBinary(AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options) = 0; - virtual AMF_RESULT AMF_STD_CALL RegisterKernelSource1(AMF_MEMORY_TYPE eMemoryType, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options) = 0; - virtual AMF_RESULT AMF_STD_CALL RegisterKernelBinary1(AMF_MEMORY_TYPE eMemoryType, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFPrograms AMFPrograms; - typedef struct AMFProgramsVtbl - { - AMF_RESULT (AMF_STD_CALL *RegisterKernelSourceFile)(AMFPrograms* pThis, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, const wchar_t* filepath, const char* options); - AMF_RESULT (AMF_STD_CALL *RegisterKernelSource)(AMFPrograms* pThis, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options); - AMF_RESULT (AMF_STD_CALL *RegisterKernelBinary)(AMFPrograms* pThis, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options); - AMF_RESULT (AMF_STD_CALL *RegisterKernelSource1)(AMFPrograms* pThis, AMF_MEMORY_TYPE eMemoryType, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options); - AMF_RESULT (AMF_STD_CALL *RegisterKernelBinary1)(AMFPrograms* pThis, AMF_MEMORY_TYPE eMemoryType, AMF_KERNEL_ID* pKernelID, const wchar_t* kernelid_name, const char* kernelName, amf_size dataSize, const amf_uint8* data, const char* options); - } AMFProgramsVtbl; - - struct AMFPrograms - { - const AMFProgramsVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - -#if defined(__cplusplus) -} // namespace amf -#endif - -#endif // AMF_Compute_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/ComputeFactory.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/ComputeFactory.h deleted file mode 100644 index e335ee31..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/ComputeFactory.h +++ /dev/null @@ -1,147 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_ComputeFactory_h -#define AMF_ComputeFactory_h -#pragma once - -#include "Compute.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif -// compute device audio capabilities accessed via GetProperties() from AMFComputeDevice -#define AMF_DEVICE_NAME L"DeviceName" // char*, string, device name -#define AMF_DRIVER_VERSION_NAME L"DriverVersion" // char*, string, driver version -#define AMF_AUDIO_CONVOLUTION_MAX_STREAMS L"ConvolutionMaxStreams" // amf_int64, maximum number of audio streams supported in realtime -#define AMF_AUDIO_CONVOLUTION_LENGTH L"ConvolutionLength" // amf_int64, length of convolution in samples -#define AMF_AUDIO_CONVOLUTION_BUFFER_SIZE L"ConvolutionBufferSize" // amf_int64, buffer size in samples -#define AMF_AUDIO_CONVOLUTION_SAMPLE_RATE L"ConvolutionSampleRate" // amf_int64, sample rate - -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComputeDevice : public AMFPropertyStorage - { - public: - AMF_DECLARE_IID(0xb79d7cf6, 0x2c5c, 0x4deb, 0xb8, 0x96, 0xa2, 0x9e, 0xbe, 0xa6, 0xe3, 0x97) - - virtual void* AMF_STD_CALL GetNativePlatform() = 0; - virtual void* AMF_STD_CALL GetNativeDeviceID() = 0; - virtual void* AMF_STD_CALL GetNativeContext() = 0; - - virtual AMF_RESULT AMF_STD_CALL CreateCompute(void *reserved, AMFCompute **ppCompute) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateComputeEx(void* pCommandQueue, AMFCompute **ppCompute) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComputeDevicePtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComputeDevice, 0xb79d7cf6, 0x2c5c, 0x4deb, 0xb8, 0x96, 0xa2, 0x9e, 0xbe, 0xa6, 0xe3, 0x97) - typedef struct AMFComputeDevice AMFComputeDevice; - - typedef struct AMFComputeDeviceVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComputeDevice* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComputeDevice* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComputeDevice* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFComputeDevice* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFComputeDevice* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFComputeDevice* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFComputeDevice* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFComputeDevice* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFComputeDevice* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFComputeDevice* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFComputeDevice* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFComputeDevice* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFComputeDevice* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFComputeDevice interface - void* (AMF_STD_CALL *GetNativePlatform)(AMFComputeDevice* pThis); - void* (AMF_STD_CALL *GetNativeDeviceID)(AMFComputeDevice* pThis); - void* (AMF_STD_CALL *GetNativeContext)(AMFComputeDevice* pThis); - - AMF_RESULT (AMF_STD_CALL *CreateCompute)(AMFComputeDevice* pThis, void *reserved, AMFCompute **ppCompute); - AMF_RESULT (AMF_STD_CALL *CreateComputeEx)(AMFComputeDevice* pThis, void* pCommandQueue, AMFCompute **ppCompute); - - } AMFComputeDeviceVtbl; - - struct AMFComputeDevice - { - const AMFComputeDeviceVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFComputeFactory : public AMFInterface - { - public: - AMF_DECLARE_IID(0xe3c24bd7, 0x2d83, 0x416c, 0x8c, 0x4e, 0xfd, 0x13, 0xca, 0x86, 0xf4, 0xd0) - - virtual amf_int32 AMF_STD_CALL GetDeviceCount() = 0; - virtual AMF_RESULT AMF_STD_CALL GetDeviceAt(amf_int32 index, AMFComputeDevice **ppDevice) = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFComputeFactoryPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFComputeFactory, 0xe3c24bd7, 0x2d83, 0x416c, 0x8c, 0x4e, 0xfd, 0x13, 0xca, 0x86, 0xf4, 0xd0) - typedef struct AMFComputeFactory AMFComputeFactory; - - typedef struct AMFComputeFactoryVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFComputeFactory* pThis); - amf_long (AMF_STD_CALL *Release)(AMFComputeFactory* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFComputeFactory* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFComputeFactory interface - amf_int32 (AMF_STD_CALL *GetDeviceCount)(AMFComputeFactory* pThis); - AMF_RESULT (AMF_STD_CALL *GetDeviceAt)(AMFComputeFactory* pThis, amf_int32 index, AMFComputeDevice **ppDevice); - } AMFComputeFactoryVtbl; - - struct AMFComputeFactory - { - const AMFComputeFactoryVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) -} // namespace amf -#endif - -#endif // AMF_ComputeFactory_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Context.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Context.h deleted file mode 100644 index 3555f080..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Context.h +++ /dev/null @@ -1,786 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Context_h -#define AMF_Context_h -#pragma once - -#include "Buffer.h" -#include "AudioBuffer.h" -#include "Surface.h" -#include "Compute.h" -#include "ComputeFactory.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFContext interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFContext : public AMFPropertyStorage - { - public: - AMF_DECLARE_IID(0xa76a13f0, 0xd80e, 0x4fcc, 0xb5, 0x8, 0x65, 0xd0, 0xb5, 0x2e, 0xd9, 0xee) - - // Cleanup - virtual AMF_RESULT AMF_STD_CALL Terminate() = 0; - - // DX9 - virtual AMF_RESULT AMF_STD_CALL InitDX9(void* pDX9Device) = 0; - virtual void* AMF_STD_CALL GetDX9Device(AMF_DX_VERSION dxVersionRequired = AMF_DX9) = 0; - virtual AMF_RESULT AMF_STD_CALL LockDX9() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockDX9() = 0; - class AMFDX9Locker; - - // DX11 - virtual AMF_RESULT AMF_STD_CALL InitDX11(void* pDX11Device, AMF_DX_VERSION dxVersionRequired = AMF_DX11_0) = 0; - virtual void* AMF_STD_CALL GetDX11Device(AMF_DX_VERSION dxVersionRequired = AMF_DX11_0) = 0; - virtual AMF_RESULT AMF_STD_CALL LockDX11() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockDX11() = 0; - class AMFDX11Locker; - - // OpenCL - virtual AMF_RESULT AMF_STD_CALL InitOpenCL(void* pCommandQueue = NULL) = 0; - virtual void* AMF_STD_CALL GetOpenCLContext() = 0; - virtual void* AMF_STD_CALL GetOpenCLCommandQueue() = 0; - virtual void* AMF_STD_CALL GetOpenCLDeviceID() = 0; - virtual AMF_RESULT AMF_STD_CALL GetOpenCLComputeFactory(AMFComputeFactory **ppFactory) = 0; // advanced compute - multiple queries - virtual AMF_RESULT AMF_STD_CALL InitOpenCLEx(AMFComputeDevice *pDevice) = 0; - virtual AMF_RESULT AMF_STD_CALL LockOpenCL() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockOpenCL() = 0; - class AMFOpenCLLocker; - - // OpenGL - virtual AMF_RESULT AMF_STD_CALL InitOpenGL(amf_handle hOpenGLContext, amf_handle hWindow, amf_handle hDC) = 0; - virtual amf_handle AMF_STD_CALL GetOpenGLContext() = 0; - virtual amf_handle AMF_STD_CALL GetOpenGLDrawable() = 0; - virtual AMF_RESULT AMF_STD_CALL LockOpenGL() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockOpenGL() = 0; - class AMFOpenGLLocker; - - // XV - Linux - virtual AMF_RESULT AMF_STD_CALL InitXV(void* pXVDevice) = 0; - virtual void* AMF_STD_CALL GetXVDevice() = 0; - virtual AMF_RESULT AMF_STD_CALL LockXV() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockXV() = 0; - class AMFXVLocker; - - // Gralloc - Android - virtual AMF_RESULT AMF_STD_CALL InitGralloc(void* pGrallocDevice) = 0; - virtual void* AMF_STD_CALL GetGrallocDevice() = 0; - virtual AMF_RESULT AMF_STD_CALL LockGralloc() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockGralloc() = 0; - class AMFGrallocLocker; - - // Allocation - virtual AMF_RESULT AMF_STD_CALL AllocBuffer(AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer) = 0; - virtual AMF_RESULT AMF_STD_CALL AllocSurface(AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMFSurface** ppSurface) = 0; - virtual AMF_RESULT AMF_STD_CALL AllocAudioBuffer(AMF_MEMORY_TYPE type, AMF_AUDIO_FORMAT format, amf_int32 samples, amf_int32 sampleRate, amf_int32 channels, - AMFAudioBuffer** ppAudioBuffer) = 0; - - // Wrap existing objects - virtual AMF_RESULT AMF_STD_CALL CreateBufferFromHostNative(void* pHostBuffer, amf_size size, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromHostNative(AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, void* pData, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromDX9Native(void* pDX9Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromDX11Native(void* pDX11Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromOpenGLNative(AMF_SURFACE_FORMAT format, amf_handle hGLTextureID, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromGrallocNative(amf_handle hGrallocSurface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromOpenCLNative(AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, void** pClPlanes, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateBufferFromOpenCLNative(void* pCLBuffer, amf_size size, AMFBuffer** ppBuffer) = 0; - - // Access to AMFCompute interface - AMF_MEMORY_OPENCL, AMF_MEMORY_COMPUTE_FOR_DX9, AMF_MEMORY_COMPUTE_FOR_DX11 are currently supported - virtual AMF_RESULT AMF_STD_CALL GetCompute(AMF_MEMORY_TYPE eMemType, AMFCompute** ppCompute) = 0; - }; - - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFContextPtr; - - //---------------------------------------------------------------------------------------------- - // AMFContext1 interface - //---------------------------------------------------------------------------------------------- - - class AMF_NO_VTABLE AMFContext1 : public AMFContext - { - public: - AMF_DECLARE_IID(0xd9e9f868, 0x6220, 0x44c6, 0xa2, 0x2f, 0x7c, 0xd6, 0xda, 0xc6, 0x86, 0x46) - - virtual AMF_RESULT AMF_STD_CALL CreateBufferFromDX11Native(void* pHostBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver) = 0; - - virtual AMF_RESULT AMF_STD_CALL AllocBufferEx(AMF_MEMORY_TYPE type, amf_size size, AMF_BUFFER_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFBuffer** ppBuffer) = 0; - virtual AMF_RESULT AMF_STD_CALL AllocSurfaceEx(AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMF_SURFACE_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFSurface** ppSurface) = 0; - - // Vulkan - Windows, Linux - virtual AMF_RESULT AMF_STD_CALL InitVulkan(void* pVulkanDevice) = 0; - virtual void* AMF_STD_CALL GetVulkanDevice() = 0; - virtual AMF_RESULT AMF_STD_CALL LockVulkan() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockVulkan() = 0; - - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromVulkanNative(void* pVulkanImage, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateBufferFromVulkanNative(void* pVulkanBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL GetVulkanDeviceExtensions(amf_size *pCount, const char **ppExtensions) = 0; - - - class AMFVulkanLocker; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFContext1Ptr; - - class AMF_NO_VTABLE AMFContext2 : public AMFContext1 - { - public: - AMF_DECLARE_IID(0x726241d3, 0xbd46, 0x4e90, 0x99, 0x68, 0x93, 0xe0, 0x7e, 0xa2, 0x98, 0x4d) - - // DX12 - virtual AMF_RESULT AMF_STD_CALL InitDX12(void* pDX11Device, AMF_DX_VERSION dxVersionRequired = AMF_DX12) = 0; - virtual void* AMF_STD_CALL GetDX12Device(AMF_DX_VERSION dxVersionRequired = AMF_DX12) = 0; - virtual AMF_RESULT AMF_STD_CALL LockDX12() = 0; - virtual AMF_RESULT AMF_STD_CALL UnlockDX12() = 0; - virtual AMF_RESULT AMF_STD_CALL CreateSurfaceFromDX12Native(void* pResourceTexture, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateBufferFromDX12Native(void* pResourceBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver) = 0; - - class AMFDX12Locker; - }; - typedef AMFInterfacePtr_T AMFContext2Ptr; -#else - typedef struct AMFContext AMFContext; - AMF_DECLARE_IID(AMFContext, 0xa76a13f0, 0xd80e, 0x4fcc, 0xb5, 0x8, 0x65, 0xd0, 0xb5, 0x2e, 0xd9, 0xee) - - typedef struct AMFContextVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFContext* pThis); - amf_long (AMF_STD_CALL *Release)(AMFContext* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFContext* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFInterface AMFPropertyStorage - - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFContext* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFContext* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFContext* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFContext* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFContext* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFContext* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFContext* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFContext* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFContext interface - - // Cleanup - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFContext* pThis); - - // DX9 - AMF_RESULT (AMF_STD_CALL *InitDX9)(AMFContext* pThis, void* pDX9Device); - void* (AMF_STD_CALL *GetDX9Device)(AMFContext* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX9)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX9)(AMFContext* pThis); - // DX11 - AMF_RESULT (AMF_STD_CALL *InitDX11)(AMFContext* pThis, void* pDX11Device, AMF_DX_VERSION dxVersionRequired); - void* (AMF_STD_CALL *GetDX11Device)(AMFContext* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX11)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX11)(AMFContext* pThis); - - // OpenCL - AMF_RESULT (AMF_STD_CALL *InitOpenCL)(AMFContext* pThis, void* pCommandQueue); - void* (AMF_STD_CALL *GetOpenCLContext)(AMFContext* pThis); - void* (AMF_STD_CALL *GetOpenCLCommandQueue)(AMFContext* pThis); - void* (AMF_STD_CALL *GetOpenCLDeviceID)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *GetOpenCLComputeFactory)(AMFContext* pThis, AMFComputeFactory **ppFactory); // advanced compute - multiple queries - AMF_RESULT (AMF_STD_CALL *InitOpenCLEx)(AMFContext* pThis, AMFComputeDevice *pDevice); - AMF_RESULT (AMF_STD_CALL *LockOpenCL)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenCL)(AMFContext* pThis); - - // OpenGL - AMF_RESULT (AMF_STD_CALL *InitOpenGL)(AMFContext* pThis, amf_handle hOpenGLContext, amf_handle hWindow, amf_handle hDC); - amf_handle (AMF_STD_CALL *GetOpenGLContext)(AMFContext* pThis); - amf_handle (AMF_STD_CALL *GetOpenGLDrawable)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *LockOpenGL)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenGL)(AMFContext* pThis); - // XV - Linux - AMF_RESULT (AMF_STD_CALL *InitXV)(AMFContext* pThis, void* pXVDevice); - void* (AMF_STD_CALL *GetXVDevice)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *LockXV)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockXV)(AMFContext* pThis); - - // Gralloc - Android - AMF_RESULT (AMF_STD_CALL *InitGralloc)(AMFContext* pThis, void* pGrallocDevice); - void* (AMF_STD_CALL *GetGrallocDevice)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *LockGralloc)(AMFContext* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockGralloc)(AMFContext* pThis); - // Allocation - AMF_RESULT (AMF_STD_CALL *AllocBuffer)(AMFContext* pThis, AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurface)(AMFContext* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMFSurface** ppSurface); - AMF_RESULT (AMF_STD_CALL *AllocAudioBuffer)(AMFContext* pThis, AMF_MEMORY_TYPE type, AMF_AUDIO_FORMAT format, amf_int32 samples, amf_int32 sampleRate, amf_int32 channels, - AMFAudioBuffer** ppAudioBuffer); - - // Wrap existing objects - AMF_RESULT (AMF_STD_CALL *CreateBufferFromHostNative)(AMFContext* pThis, void* pHostBuffer, amf_size size, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromHostNative)(AMFContext* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, void* pData, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX9Native)(AMFContext* pThis, void* pDX9Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX11Native)(AMFContext* pThis, void* pDX11Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenGLNative)(AMFContext* pThis, AMF_SURFACE_FORMAT format, amf_handle hGLTextureID, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromGrallocNative)(AMFContext* pThis, amf_handle hGrallocSurface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenCLNative)(AMFContext* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, void** pClPlanes, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromOpenCLNative)(AMFContext* pThis, void* pCLBuffer, amf_size size, AMFBuffer** ppBuffer); - - // Access to AMFCompute interface - AMF_MEMORY_OPENCL, AMF_MEMORY_COMPUTE_FOR_DX9, AMF_MEMORY_COMPUTE_FOR_DX11 are currently supported - AMF_RESULT (AMF_STD_CALL *GetCompute)(AMFContext* pThis, AMF_MEMORY_TYPE eMemType, AMFCompute** ppCompute); - - } AMFContextVtbl; - - struct AMFContext - { - const AMFContextVtbl *pVtbl; - }; - - - typedef struct AMFContext1 AMFContext1; - AMF_DECLARE_IID(AMFContext1, 0xd9e9f868, 0x6220, 0x44c6, 0xa2, 0x2f, 0x7c, 0xd6, 0xda, 0xc6, 0x86, 0x46) - - typedef struct AMFContext1Vtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFContext1* pThis); - amf_long (AMF_STD_CALL *Release)(AMFContext1* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFContext1* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFInterface AMFPropertyStorage - - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFContext1* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFContext1* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFContext1* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFContext1* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFContext1* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFContext1* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFContext1* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFContext1* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFContext interface - - // Cleanup - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFContext1* pThis); - - // DX9 - AMF_RESULT (AMF_STD_CALL *InitDX9)(AMFContext1* pThis, void* pDX9Device); - void* (AMF_STD_CALL *GetDX9Device)(AMFContext1* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX9)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX9)(AMFContext1* pThis); - // DX11 - AMF_RESULT (AMF_STD_CALL *InitDX11)(AMFContext1* pThis, void* pDX11Device, AMF_DX_VERSION dxVersionRequired); - void* (AMF_STD_CALL *GetDX11Device)(AMFContext1* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX11)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX11)(AMFContext1* pThis); - - // OpenCL - AMF_RESULT (AMF_STD_CALL *InitOpenCL)(AMFContext1* pThis, void* pCommandQueue); - void* (AMF_STD_CALL *GetOpenCLContext)(AMFContext1* pThis); - void* (AMF_STD_CALL *GetOpenCLCommandQueue)(AMFContext1* pThis); - void* (AMF_STD_CALL *GetOpenCLDeviceID)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *GetOpenCLComputeFactory)(AMFContext1* pThis, AMFComputeFactory **ppFactory); // advanced compute - multiple queries - AMF_RESULT (AMF_STD_CALL *InitOpenCLEx)(AMFContext1* pThis, AMFComputeDevice *pDevice); - AMF_RESULT (AMF_STD_CALL *LockOpenCL)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenCL)(AMFContext1* pThis); - - // OpenGL - AMF_RESULT (AMF_STD_CALL *InitOpenGL)(AMFContext1* pThis, amf_handle hOpenGLContext, amf_handle hWindow, amf_handle hDC); - amf_handle (AMF_STD_CALL *GetOpenGLContext)(AMFContext1* pThis); - amf_handle (AMF_STD_CALL *GetOpenGLDrawable)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *LockOpenGL)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenGL)(AMFContext1* pThis); - // XV - Linux - AMF_RESULT (AMF_STD_CALL *InitXV)(AMFContext1* pThis, void* pXVDevice); - void* (AMF_STD_CALL *GetXVDevice)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *LockXV)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockXV)(AMFContext1* pThis); - - // Gralloc - Android - AMF_RESULT (AMF_STD_CALL *InitGralloc)(AMFContext1* pThis, void* pGrallocDevice); - void* (AMF_STD_CALL *GetGrallocDevice)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *LockGralloc)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockGralloc)(AMFContext1* pThis); - // Allocation - AMF_RESULT (AMF_STD_CALL *AllocBuffer)(AMFContext1* pThis, AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurface)(AMFContext1* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMFSurface** ppSurface); - AMF_RESULT (AMF_STD_CALL *AllocAudioBuffer)(AMFContext1* pThis, AMF_MEMORY_TYPE type, AMF_AUDIO_FORMAT format, amf_int32 samples, amf_int32 sampleRate, amf_int32 channels, - AMFAudioBuffer** ppAudioBuffer); - - // Wrap existing objects - AMF_RESULT (AMF_STD_CALL *CreateBufferFromHostNative)(AMFContext1* pThis, void* pHostBuffer, amf_size size, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromHostNative)(AMFContext1* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, void* pData, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX9Native)(AMFContext1* pThis, void* pDX9Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX11Native)(AMFContext1* pThis, void* pDX11Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenGLNative)(AMFContext1* pThis, AMF_SURFACE_FORMAT format, amf_handle hGLTextureID, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromGrallocNative)(AMFContext1* pThis, amf_handle hGrallocSurface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenCLNative)(AMFContext1* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, void** pClPlanes, - AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromOpenCLNative)(AMFContext1* pThis, void* pCLBuffer, amf_size size, AMFBuffer** ppBuffer); - - // Access to AMFCompute interface - AMF_MEMORY_OPENCL, AMF_MEMORY_COMPUTE_FOR_DX9, AMF_MEMORY_COMPUTE_FOR_DX11 are currently supported - AMF_RESULT (AMF_STD_CALL *GetCompute)(AMFContext1* pThis, AMF_MEMORY_TYPE eMemType, AMFCompute** ppCompute); - - // AMFContext1 interface - - AMF_RESULT (AMF_STD_CALL *CreateBufferFromDX11Native)(AMFContext1* pThis, void* pHostBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *AllocBufferEx)(AMFContext1* pThis, AMF_MEMORY_TYPE type, amf_size size, AMF_BUFFER_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurfaceEx)(AMFContext1* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMF_SURFACE_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFSurface** ppSurface); - - // Vulkan - Windows, Linux - AMF_RESULT (AMF_STD_CALL *InitVulkan)(AMFContext1* pThis, void* pVulkanDevice); - void* (AMF_STD_CALL *GetVulkanDevice)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *LockVulkan)(AMFContext1* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockVulkan)(AMFContext1* pThis); - - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromVulkanNative)(AMFContext1* pThis, void* pVulkanImage, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromVulkanNative)(AMFContext1* pThis, void* pVulkanBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *GetVulkanDeviceExtensions)(AMFContext1* pThis, amf_size *pCount, const char **ppExtensions); - - } AMFContext1Vtbl; - - struct AMFContext1 - { - const AMFContext1Vtbl *pVtbl; - }; - - typedef struct AMFContext2 AMFContext2; - AMF_DECLARE_IID(AMFContext2, 0xd9e9f868, 0x6220, 0x44c6, 0xa2, 0x2f, 0x7c, 0xd6, 0xda, 0xc6, 0x86, 0x46) - - typedef struct AMFContext2Vtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFContext2* pThis); - amf_long (AMF_STD_CALL *Release)(AMFContext2* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFContext2* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFInterface AMFPropertyStorage - - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFContext2* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFContext2* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFContext2* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFContext2* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFContext2* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFContext2* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFContext2* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFContext2* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFContext interface - - // Cleanup - AMF_RESULT (AMF_STD_CALL *Terminate)(AMFContext2* pThis); - - // DX9 - AMF_RESULT (AMF_STD_CALL *InitDX9)(AMFContext2* pThis, void* pDX9Device); - void* (AMF_STD_CALL *GetDX9Device)(AMFContext2* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX9)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX9)(AMFContext2* pThis); - // DX11 - AMF_RESULT (AMF_STD_CALL *InitDX11)(AMFContext2* pThis, void* pDX11Device, AMF_DX_VERSION dxVersionRequired); - void* (AMF_STD_CALL *GetDX11Device)(AMFContext2* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX11)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX11)(AMFContext2* pThis); - - // OpenCL - AMF_RESULT (AMF_STD_CALL *InitOpenCL)(AMFContext2* pThis, void* pCommandQueue); - void* (AMF_STD_CALL *GetOpenCLContext)(AMFContext2* pThis); - void* (AMF_STD_CALL *GetOpenCLCommandQueue)(AMFContext2* pThis); - void* (AMF_STD_CALL *GetOpenCLDeviceID)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *GetOpenCLComputeFactory)(AMFContext2* pThis, AMFComputeFactory **ppFactory); // advanced compute - multiple queries - AMF_RESULT (AMF_STD_CALL *InitOpenCLEx)(AMFContext2* pThis, AMFComputeDevice *pDevice); - AMF_RESULT (AMF_STD_CALL *LockOpenCL)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenCL)(AMFContext2* pThis); - - // OpenGL - AMF_RESULT (AMF_STD_CALL *InitOpenGL)(AMFContext2* pThis, amf_handle hOpenGLContext, amf_handle hWindow, amf_handle hDC); - amf_handle (AMF_STD_CALL *GetOpenGLContext)(AMFContext2* pThis); - amf_handle (AMF_STD_CALL *GetOpenGLDrawable)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *LockOpenGL)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockOpenGL)(AMFContext2* pThis); - // XV - Linux - AMF_RESULT (AMF_STD_CALL *InitXV)(AMFContext2* pThis, void* pXVDevice); - void* (AMF_STD_CALL *GetXVDevice)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *LockXV)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockXV)(AMFContext2* pThis); - - // Gralloc - Android - AMF_RESULT (AMF_STD_CALL *InitGralloc)(AMFContext2* pThis, void* pGrallocDevice); - void* (AMF_STD_CALL *GetGrallocDevice)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *LockGralloc)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockGralloc)(AMFContext2* pThis); - // Allocation - AMF_RESULT (AMF_STD_CALL *AllocBuffer)(AMFContext2* pThis, AMF_MEMORY_TYPE type, amf_size size, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurface)(AMFContext2* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMFSurface** ppSurface); - AMF_RESULT (AMF_STD_CALL *AllocAudioBuffer)(AMFContext2* pThis, AMF_MEMORY_TYPE type, AMF_AUDIO_FORMAT format, amf_int32 samples, amf_int32 sampleRate, amf_int32 channels, AMFAudioBuffer** ppAudioBuffer); - - // Wrap existing objects - AMF_RESULT (AMF_STD_CALL *CreateBufferFromHostNative)(AMFContext2* pThis, void* pHostBuffer, amf_size size, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromHostNative)(AMFContext2* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, amf_int32 hPitch, amf_int32 vPitch, void* pData,AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX9Native)(AMFContext2* pThis, void* pDX9Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX11Native)(AMFContext2* pThis, void* pDX11Surface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenGLNative)(AMFContext2* pThis, AMF_SURFACE_FORMAT format, amf_handle hGLTextureID, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromGrallocNative)(AMFContext2* pThis, amf_handle hGrallocSurface, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromOpenCLNative)(AMFContext2* pThis, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, void** pClPlanes, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromOpenCLNative)(AMFContext2* pThis, void* pCLBuffer, amf_size size, AMFBuffer** ppBuffer); - - // Access to AMFCompute interface - AMF_MEMORY_OPENCL, AMF_MEMORY_COMPUTE_FOR_DX9, AMF_MEMORY_COMPUTE_FOR_DX11 are currently supported - AMF_RESULT (AMF_STD_CALL *GetCompute)(AMFContext2* pThis, AMF_MEMORY_TYPE eMemType, AMFCompute** ppCompute); - - // AMFContext1 interface - - AMF_RESULT (AMF_STD_CALL *CreateBufferFromDX11Native)(AMFContext2* pThis, void* pHostBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *AllocBufferEx)(AMFContext2* pThis, AMF_MEMORY_TYPE type, amf_size size, AMF_BUFFER_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFBuffer** ppBuffer); - AMF_RESULT (AMF_STD_CALL *AllocSurfaceEx)(AMFContext2* pThis, AMF_MEMORY_TYPE type, AMF_SURFACE_FORMAT format, amf_int32 width, amf_int32 height, AMF_SURFACE_USAGE usage, AMF_MEMORY_CPU_ACCESS access, AMFSurface** ppSurface); - - // Vulkan - Windows, Linux - AMF_RESULT (AMF_STD_CALL *InitVulkan)(AMFContext2* pThis, void* pVulkanDevice); - void* (AMF_STD_CALL *GetVulkanDevice)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *LockVulkan)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockVulkan)(AMFContext2* pThis); - - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromVulkanNative)(AMFContext2* pThis, void* pVulkanImage, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromVulkanNative)(AMFContext2* pThis, void* pVulkanBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *GetVulkanDeviceExtensions)(AMFContext2* pThis, amf_size *pCount, const char **ppExtensions); - - // AMFContext2 interface - AMF_RESULT (AMF_STD_CALL *InitDX12)(AMFContext2* pThis, void* pDX11Device, AMF_DX_VERSION dxVersionRequired); - void* (AMF_STD_CALL *GetDX12Device)(AMFContext2* pThis, AMF_DX_VERSION dxVersionRequired); - AMF_RESULT (AMF_STD_CALL *LockDX12)(AMFContext2* pThis); - AMF_RESULT (AMF_STD_CALL *UnlockDX12)(AMFContext2* pThis); - - AMF_RESULT (AMF_STD_CALL *CreateSurfaceFromDX12Native)(AMFContext2* pThis, void* pResourceTexture, AMFSurface** ppSurface, AMFSurfaceObserver* pObserver); - AMF_RESULT (AMF_STD_CALL *CreateBufferFromDX12Native)(AMFContext2* pThis, void* pResourceBuffer, AMFBuffer** ppBuffer, AMFBufferObserver* pObserver); - - - } AMFContext2Vtbl; - - struct AMFContext2 - { - const AMFContext2Vtbl *pVtbl; - }; -#endif - -#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // Lockers - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFDX9Locker - { - public: - AMFDX9Locker() : m_Context(NULL) - {} - AMFDX9Locker(AMFContext* resources) : m_Context(NULL) - { - Lock(resources); - } - ~AMFDX9Locker() - { - if(m_Context != NULL) - { - m_Context->UnlockDX9(); - } - } - void Lock(AMFContext* resources) - { - if(m_Context != NULL) - { - m_Context->UnlockDX9(); - } - m_Context = resources; - if(m_Context != NULL) - { - m_Context->LockDX9(); - } - } - protected: - AMFContext* m_Context; - - private: - AMFDX9Locker(const AMFDX9Locker&); - AMFDX9Locker& operator=(const AMFDX9Locker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFDX11Locker - { - public: - AMFDX11Locker() : m_Context(NULL) - {} - AMFDX11Locker(AMFContext* resources) : m_Context(NULL) - { - Lock(resources); - } - ~AMFDX11Locker() - { - if(m_Context != NULL) - { - m_Context->UnlockDX11(); - } - } - void Lock(AMFContext* resources) - { - if(m_Context != NULL) - { - m_Context->UnlockDX11(); - } - m_Context = resources; - if(m_Context != NULL) - { - m_Context->LockDX11(); - } - } - protected: - AMFContext* m_Context; - - private: - AMFDX11Locker(const AMFDX11Locker&); - AMFDX11Locker& operator=(const AMFDX11Locker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFOpenCLLocker - { - public: - AMFOpenCLLocker() : m_Context(NULL) - {} - AMFOpenCLLocker(AMFContext* resources) : m_Context(NULL) - { - Lock(resources); - } - ~AMFOpenCLLocker() - { - if(m_Context != NULL) - { - m_Context->UnlockOpenCL(); - } - } - void Lock(AMFContext* resources) - { - if(m_Context != NULL) - { - m_Context->UnlockOpenCL(); - } - m_Context = resources; - if(m_Context != NULL) - { - m_Context->LockOpenCL(); - } - } - protected: - AMFContext* m_Context; - private: - AMFOpenCLLocker(const AMFOpenCLLocker&); - AMFOpenCLLocker& operator=(const AMFOpenCLLocker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFOpenGLLocker - { - public: - AMFOpenGLLocker(AMFContext* pContext) : m_pContext(pContext), - m_GLLocked(false) - { - if(m_pContext != NULL) - { - if(m_pContext->LockOpenGL() == AMF_OK) - { - m_GLLocked = true; - } - } - } - ~AMFOpenGLLocker() - { - if(m_GLLocked) - { - m_pContext->UnlockOpenGL(); - } - } - private: - AMFContext* m_pContext; - amf_bool m_GLLocked; ///< AMFOpenGLLocker can be called when OpenGL is not initialized yet - ///< in this case don't call UnlockOpenGL - AMFOpenGLLocker(const AMFOpenGLLocker&); - AMFOpenGLLocker& operator=(const AMFOpenGLLocker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFXVLocker - { - public: - AMFXVLocker() : m_pContext(NULL) - {} - AMFXVLocker(AMFContext* pContext) : m_pContext(NULL) - { - Lock(pContext); - } - ~AMFXVLocker() - { - if(m_pContext != NULL) - { - m_pContext->UnlockXV(); - } - } - void Lock(AMFContext* pContext) - { - if((pContext != NULL) && (pContext->GetXVDevice() != NULL)) - { - m_pContext = pContext; - m_pContext->LockXV(); - } - } - protected: - AMFContext* m_pContext; - private: - AMFXVLocker(const AMFXVLocker&); - AMFXVLocker& operator=(const AMFXVLocker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext::AMFGrallocLocker - { - public: - AMFGrallocLocker() : m_pContext(NULL) - {} - AMFGrallocLocker(AMFContext* pContext) : m_pContext(NULL) - { - Lock(pContext); - } - ~AMFGrallocLocker() - { - if(m_pContext != NULL) - { - m_pContext->UnlockGralloc(); - } - } - void Lock(AMFContext* pContext) - { - if((pContext != NULL) && (pContext->GetGrallocDevice() != NULL)) - { - m_pContext = pContext; - m_pContext->LockGralloc(); - } - } - protected: - AMFContext* m_pContext; - private: - AMFGrallocLocker(const AMFGrallocLocker&); - AMFGrallocLocker& operator=(const AMFGrallocLocker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext1::AMFVulkanLocker - { - public: - AMFVulkanLocker() : m_pContext(NULL) - {} - AMFVulkanLocker(AMFContext1* pContext) : m_pContext(NULL) - { - Lock(pContext); - } - ~AMFVulkanLocker() - { - if(m_pContext != NULL) - { - m_pContext->UnlockVulkan(); - } - } - void Lock(AMFContext1* pContext) - { - if((pContext != NULL) && (pContext->GetVulkanDevice() != NULL)) - { - m_pContext = pContext; - m_pContext->LockVulkan(); - } - } - protected: - AMFContext1* m_pContext; - private: - AMFVulkanLocker(const AMFVulkanLocker&); - AMFVulkanLocker& operator=(const AMFVulkanLocker&); - }; - //---------------------------------------------------------------------------------------------- - class AMFContext2::AMFDX12Locker - { - public: - AMFDX12Locker() : m_Context(NULL) - {} - AMFDX12Locker(AMFContext2* resources) : m_Context(NULL) - { - Lock(resources); - } - ~AMFDX12Locker() - { - if (m_Context != NULL) - { - m_Context->UnlockDX12(); - } - } - void Lock(AMFContext2* resources) - { - if (m_Context != NULL) - { - m_Context->UnlockDX12(); - } - m_Context = resources; - if (m_Context != NULL) - { - m_Context->LockDX12(); - } - } - protected: - AMFContext2* m_Context; - - private: - AMFDX12Locker(const AMFDX12Locker&); - AMFDX12Locker& operator=(const AMFDX12Locker&); - }; - //---------------------------------------------------------------------------------------------- - //---------------------------------------------------------------------------------------------- - //---------------------------------------------------------------------------------------------- -#endif -#if defined(__cplusplus) -} -#endif -enum AMF_CONTEXT_DEVICETYPE_ENUM -{ - AMF_CONTEXT_DEVICE_TYPE_GPU = 0, - AMF_CONTEXT_DEVICE_TYPE_CPU -}; -#define AMF_CONTEXT_DEVICE_TYPE L"AMF_Context_DeviceType" //Value type: amf_int64; Values : AMF_CONTEXT_DEVICE_TYPE_GPU for GPU (default) , AMF_CONTEXT_DEVICE_TYPE_CPU for CPU. -#endif //#ifndef AMF_Context_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/CurrentTime.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/CurrentTime.h deleted file mode 100644 index c8a559ad..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/CurrentTime.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_CurrentTime_h -#define AMF_CurrentTime_h - -#include "Platform.h" -#include "Interface.h" - -namespace amf -{ - // Current time interface class. This interface object can be passed - // as a property to components requiring synchronized timing. The - // implementation is: - // - first call to Get() starts time and returns 0 - // - subsequent calls to Get() returns values relative to 0 - // - Reset() puts time back at 0 at next Get() call - // - class AMF_NO_VTABLE AMFCurrentTime : public AMFInterface - { - public: - - virtual amf_pts AMF_STD_CALL Get() = 0; - - virtual void AMF_STD_CALL Reset() = 0; - }; - - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFCurrentTimePtr; - //----------------------------------------------------------------------------------------------} -} -#endif // AMF_CurrentTime_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/D3D12AMF.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/D3D12AMF.h deleted file mode 100644 index 7ad2d74f..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/D3D12AMF.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef __D3D12AMF_h__ -#define __D3D12AMF_h__ -#pragma once -#include "Platform.h" -#if defined(_WIN32)||(defined(__linux) && defined(AMF_WSL)) - -#define AMFDX12_NUMBER_OF_DESCRYPTOR_HEAPS L"NumberOfDescryptorHeaps" // amf_int64, default is 4, to be set on AMFContext -// syncronization properties set via SetPrivateData() -AMF_WEAK GUID AMFResourceStateGUID = { 0x452da9bf, 0x4ad7, 0x47a5, { 0xa6, 0x9b, 0x96, 0xd3, 0x23, 0x76, 0xf2, 0xf3 } }; // Current resource state value (D3D12_RESOURCE_STATES ), sizeof(UINT), set on ID3D12Resource -AMF_WEAK GUID AMFFenceGUID = { 0x910a7928, 0x57bd, 0x4b04, { 0x91, 0xa3, 0xe7, 0xb8, 0x04, 0x12, 0xcd, 0xa5 } }; // IUnknown (ID3D12Fence), set on ID3D12Resource syncronization fence for this resource -AMF_WEAK GUID AMFFenceValueGUID = { 0x62a693d3, 0xbb4a, 0x46c9, { 0xa5, 0x04, 0x9a, 0x8e, 0x97, 0xbf, 0xf0, 0x56 } }; // The last value to wait on the fence from AMFFenceGUID; sizeof(UINT64), set on ID3D12Fence -AMF_WEAK GUID AMFResourceDecodeGUID= { 0x56bd5bde, 0x7c89, 0x45ff, {0xba, 0x5c, 0xc2, 0xd5, 0xea, 0x55, 0x8d, 0x1a } }; // UINT indicator that the surface is decode and surface state needs to be restored after change - -// deprecated - not used vlaues -AMF_WEAK GUID AMFFenceD3D11GUID = { 0xdffdf6e0, 0x85e0, 0x4645, { 0x9d, 0x7, 0xe6, 0x4a, 0x19, 0x6b, 0xc9, 0xbf } }; // IUnknown (ID3D11Fence) OpenSharedFence for interop -AMF_WEAK GUID AMFFenceValueD3D11GUID = { 0x86581b71, 0x699f, 0x484b, { 0xb8, 0x75, 0x24, 0xda, 0x49, 0x8a, 0x74, 0xcf } }; // last value to wait on in d3d11 -AMF_WEAK GUID AMFSharedHandleFenceGUID = { 0xca60dcc8, 0x76d1, 0x4088, 0xad, 0xd, 0x97, 0x71, 0xe7, 0xb0, 0x92, 0x49 }; // ID3D12Fence shared handle for D3D11 interop -// end of deprecated - -#endif - -#endif // __D3D12AMF_h__ \ No newline at end of file diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Data.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Data.h deleted file mode 100644 index 7067606b..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Data.h +++ /dev/null @@ -1,178 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Data_h -#define AMF_Data_h -#pragma once - -#include "PropertyStorage.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - typedef enum AMF_DATA_TYPE - { - AMF_DATA_BUFFER = 0, - AMF_DATA_SURFACE = 1, - AMF_DATA_AUDIO_BUFFER = 2, - AMF_DATA_USER = 1000, - // all extensions will be AMF_DATA_USER+i - } AMF_DATA_TYPE; - //---------------------------------------------------------------------------------------------- - typedef enum AMF_MEMORY_TYPE - { - AMF_MEMORY_UNKNOWN = 0, - AMF_MEMORY_HOST = 1, - AMF_MEMORY_DX9 = 2, - AMF_MEMORY_DX11 = 3, - AMF_MEMORY_OPENCL = 4, - AMF_MEMORY_OPENGL = 5, - AMF_MEMORY_XV = 6, - AMF_MEMORY_GRALLOC = 7, - AMF_MEMORY_COMPUTE_FOR_DX9 = 8, // deprecated, the same as AMF_MEMORY_OPENCL - AMF_MEMORY_COMPUTE_FOR_DX11 = 9, // deprecated, the same as AMF_MEMORY_OPENCL - AMF_MEMORY_VULKAN = 10, - AMF_MEMORY_DX12 = 11, - AMF_MEMORY_LAST - } AMF_MEMORY_TYPE; - - //---------------------------------------------------------------------------------------------- - typedef enum AMF_DX_VERSION - { - AMF_DX9 = 90, - AMF_DX9_EX = 91, - AMF_DX11_0 = 110, - AMF_DX11_1 = 111, - AMF_DX12 = 120, - } AMF_DX_VERSION; - - //---------------------------------------------------------------------------------------------- - // AMF_MEMORY_CPU_ACCESS translates to D3D11_CPU_ACCESS_FLAG or VkImageUsageFlags - // bit mask - //---------------------------------------------------------------------------------------------- - typedef enum AMF_MEMORY_CPU_ACCESS_BITS - { // D3D11 D3D12 Vulkan - AMF_MEMORY_CPU_DEFAULT = 0x80000000, // 0 , D3D12_HEAP_TYPE_DEFAULT , VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT - AMF_MEMORY_CPU_NONE = 0x00000000, // 0 , D3D12_HEAP_TYPE_DEFAULT , - AMF_MEMORY_CPU_READ = 0x00000001, // D3D11_CPU_ACCESS_READ , D3D12_HEAP_TYPE_READBACK, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT - AMF_MEMORY_CPU_WRITE = 0x00000002, // D3D11_CPU_ACCESS_WRITE, D3D12_HEAP_TYPE_UPLOAD , VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT - AMF_MEMORY_CPU_LOCAL = 0x00000004, // , D3D12_HEAP_TYPE_DEFAULT , VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT - AMF_MEMORY_CPU_PINNED = 0x00000008, // , , VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR - } AMF_MEMORY_CPU_ACCESS_BITS; - typedef amf_flags AMF_MEMORY_CPU_ACCESS; - //---------------------------------------------------------------------------------------------- - // AMFData interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFData : public AMFPropertyStorage - { - public: - AMF_DECLARE_IID(0xa1159bf6, 0x9104, 0x4107, 0x8e, 0xaa, 0xc5, 0x3d, 0x5d, 0xba, 0xc5, 0x11) - - virtual AMF_MEMORY_TYPE AMF_STD_CALL GetMemoryType() = 0; - - virtual AMF_RESULT AMF_STD_CALL Duplicate(AMF_MEMORY_TYPE type, AMFData** ppData) = 0; - virtual AMF_RESULT AMF_STD_CALL Convert(AMF_MEMORY_TYPE type) = 0; // optimal interop if possilble. Copy through host memory if needed - virtual AMF_RESULT AMF_STD_CALL Interop(AMF_MEMORY_TYPE type) = 0; // only optimal interop if possilble. No copy through host memory for GPU objects - - virtual AMF_DATA_TYPE AMF_STD_CALL GetDataType() = 0; - - virtual amf_bool AMF_STD_CALL IsReusable() = 0; - - virtual void AMF_STD_CALL SetPts(amf_pts pts) = 0; - virtual amf_pts AMF_STD_CALL GetPts() = 0; - virtual void AMF_STD_CALL SetDuration(amf_pts duration) = 0; - virtual amf_pts AMF_STD_CALL GetDuration() = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFDataPtr; - //---------------------------------------------------------------------------------------------- - -#else // #if defined(__cplusplus) - typedef struct AMFData AMFData; - AMF_DECLARE_IID(AMFData, 0xa1159bf6, 0x9104, 0x4107, 0x8e, 0xaa, 0xc5, 0x3d, 0x5d, 0xba, 0xc5, 0x11) - - typedef struct AMFDataVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFData* pThis); - amf_long (AMF_STD_CALL *Release)(AMFData* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFData* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFData* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFData* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFData* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFData* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFData* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFData* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFData* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFData* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFData* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFData* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFData interface - - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryType)(AMFData* pThis); - - AMF_RESULT (AMF_STD_CALL *Duplicate)(AMFData* pThis, AMF_MEMORY_TYPE type, AMFData** ppData); - AMF_RESULT (AMF_STD_CALL *Convert)(AMFData* pThis, AMF_MEMORY_TYPE type); // optimal interop if possilble. Copy through host memory if needed - AMF_RESULT (AMF_STD_CALL *Interop)(AMFData* pThis, AMF_MEMORY_TYPE type); // only optimal interop if possilble. No copy through host memory for GPU objects - - AMF_DATA_TYPE (AMF_STD_CALL *GetDataType)(AMFData* pThis); - - amf_bool (AMF_STD_CALL *IsReusable)(AMFData* pThis); - - void (AMF_STD_CALL *SetPts)(AMFData* pThis, amf_pts pts); - amf_pts (AMF_STD_CALL *GetPts)(AMFData* pThis); - void (AMF_STD_CALL *SetDuration)(AMFData* pThis, amf_pts duration); - amf_pts (AMF_STD_CALL *GetDuration)(AMFData* pThis); - - } AMFDataVtbl; - - struct AMFData - { - const AMFDataVtbl *pVtbl; - }; - - -#endif // #if defined(__cplusplus) - -#if defined(__cplusplus) -} // namespace -#endif - -#endif //#ifndef AMF_Data_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Debug.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Debug.h deleted file mode 100644 index 40610b01..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Debug.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Debug_h -#define AMF_Debug_h -#pragma once - -#include "Platform.h" -#include "Result.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFDebug interface - singleton - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFDebug - { - public: - virtual void AMF_STD_CALL EnablePerformanceMonitor(amf_bool enable) = 0; - virtual amf_bool AMF_STD_CALL PerformanceMonitorEnabled() = 0; - virtual void AMF_STD_CALL AssertsEnable(amf_bool enable) = 0; - virtual amf_bool AMF_STD_CALL AssertsEnabled() = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFDebug AMFDebug; - typedef struct AMFDebugVtbl - { - // AMFDebug interface - void (AMF_STD_CALL *EnablePerformanceMonitor)(AMFDebug* pThis, amf_bool enable); - amf_bool (AMF_STD_CALL *PerformanceMonitorEnabled)(AMFDebug* pThis); - void (AMF_STD_CALL *AssertsEnable)(AMFDebug* pThis, amf_bool enable); - amf_bool (AMF_STD_CALL *AssertsEnabled)(AMFDebug* pThis); - } AMFDebugVtbl; - - struct AMFDebug - { - const AMFDebugVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) -} -#endif - -#endif // AMF_Debug_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Dump.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Dump.h deleted file mode 100644 index b8c27446..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Dump.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Dump_h -#define AMF_Dump_h -#pragma once - -#include "Platform.h" -#include "Result.h" -#include "Interface.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFDump : public AMFInterface - { - public: - AMF_DECLARE_IID(0x75366ad4, 0x504c, 0x430b, 0xbb, 0xe2, 0xad, 0x21, 0x82, 0x8, 0xf, 0x72); - - - virtual const wchar_t* AMF_STD_CALL GetDumpBasePath() const = 0; // Get application dump base path - virtual AMF_RESULT AMF_STD_CALL SetDumpBasePath(const wchar_t* path) = 0; // Set application dump base path - - // Enable/disable input and/or output stream dumps - virtual bool AMF_STD_CALL IsInputDumpEnabled() const = 0; - virtual AMF_RESULT AMF_STD_CALL EnableInputDump(bool enabled) = 0; - virtual const wchar_t* AMF_STD_CALL GetInputDumpFullName() const = 0; // Get full name of dump file - - // Enable/disable input and/or output stream dumps - virtual bool AMF_STD_CALL IsOutputDumpEnabled() const = 0; - virtual AMF_RESULT AMF_STD_CALL EnableOutputDump(bool enabled) = 0; - virtual const wchar_t* AMF_STD_CALL GetOutputDumpFullName() const = 0; // Get full name of dump file - - // When enabled, each new application session will create a subfolder with a time stamp in the base path tree (disabled by default) - virtual bool AMF_STD_CALL IsPerSessionDumpEnabled() const = 0; - virtual void AMF_STD_CALL EnablePerSessionDump(bool enabled) = 0; - }; - typedef AMFInterfacePtr_T AMFDumpPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFDump, 0x75366ad4, 0x504c, 0x430b, 0xbb, 0xe2, 0xad, 0x21, 0x82, 0x8, 0xf, 0x72); - typedef struct AMFDump AMFDump; - - typedef struct AMFDumpVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFDump* pThis); - amf_long (AMF_STD_CALL *Release)(AMFDump* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFDump* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFDump interface - const wchar_t* (AMF_STD_CALL *GetDumpBasePath)(AMFDump* pThis) const; // Get application dump base path - AMF_RESULT (AMF_STD_CALL *SetDumpBasePath)(AMFDump* pThis, const wchar_t* path); // Set application dump base path - - // Enable/disable input and/or output stream dumps - bool (AMF_STD_CALL *IsInputDumpEnabled)(AMFDump* pThis) const; - AMF_RESULT (AMF_STD_CALL *EnableInputDump)(AMFDump* pThis, bool enabled); - const wchar_t* (AMF_STD_CALL *GetInputDumpFullName)(AMFDump* pThis) const; // Get full name of dump file - - // Enable/disable input and/or output stream dumps - bool (AMF_STD_CALL *IsOutputDumpEnabled)(AMFDump* pThis) const; - AMF_RESULT (AMF_STD_CALL *EnableOutputDump)(AMFDump* pThis, bool enabled); - const wchar_t* (AMF_STD_CALL *GetOutputDumpFullName)(AMFDump* pThis) const; // Get full name of dump file - - // When enabled, each new application session will create a subfolder with a time stamp in the base path tree (disabled by default) - bool (AMF_STD_CALL *IsPerSessionDumpEnabled)(AMFDump* pThis) const; - void (AMF_STD_CALL *EnablePerSessionDump)(AMFDump* pThis, bool enabled); - - } AMFDumpVtbl; - - struct AMFDump - { - const AMFDumpVtbl *pVtbl; - }; - - -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) -} // namespace -#endif - -#endif //AMF_Dump_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Factory.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Factory.h deleted file mode 100644 index 8f4795e5..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Factory.h +++ /dev/null @@ -1,133 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Factory_h -#define AMF_Factory_h -#pragma once - -#include "Platform.h" -#include "Version.h" -#include "Result.h" -#include "Context.h" -#include "Debug.h" -#include "Trace.h" -#include "Compute.h" - -#include "../components/Component.h" - -#if defined(__cplusplus) - -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFFactory interface - singleton - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFFactory - { - public: - virtual AMF_RESULT AMF_STD_CALL CreateContext(AMFContext** ppContext) = 0; - virtual AMF_RESULT AMF_STD_CALL CreateComponent(AMFContext* pContext, const wchar_t* id, AMFComponent** ppComponent) = 0; - virtual AMF_RESULT AMF_STD_CALL SetCacheFolder(const wchar_t* path) = 0; - virtual const wchar_t* AMF_STD_CALL GetCacheFolder() = 0; - virtual AMF_RESULT AMF_STD_CALL GetDebug(AMFDebug** ppDebug) = 0; - virtual AMF_RESULT AMF_STD_CALL GetTrace(AMFTrace** ppTrace) = 0; - virtual AMF_RESULT AMF_STD_CALL GetPrograms(AMFPrograms** ppPrograms) = 0; - }; -#else - typedef struct AMFFactory AMFFactory; - - typedef struct AMFFactoryVtbl - { - AMF_RESULT (AMF_STD_CALL *CreateContext)(AMFFactory* pThis, AMFContext** ppContext); - AMF_RESULT (AMF_STD_CALL *CreateComponent)(AMFFactory* pThis, AMFContext* pContext, const wchar_t* id, AMFComponent** ppComponent); - AMF_RESULT (AMF_STD_CALL *SetCacheFolder)(AMFFactory* pThis, const wchar_t* path); - const wchar_t* (AMF_STD_CALL *GetCacheFolder)(AMFFactory* pThis); - AMF_RESULT (AMF_STD_CALL *GetDebug)(AMFFactory* pThis, AMFDebug** ppDebug); - AMF_RESULT (AMF_STD_CALL *GetTrace)(AMFFactory* pThis, AMFTrace** ppTrace); - AMF_RESULT (AMF_STD_CALL *GetPrograms)(AMFFactory* pThis, AMFPrograms** ppPrograms); - } AMFFactoryVtbl; - - struct AMFFactory - { - const AMFFactoryVtbl *pVtbl; - }; - -#endif -#if defined(__cplusplus) -} -#endif - -//---------------------------------------------------------------------------------------------- -// DLL entry points -//---------------------------------------------------------------------------------------------- - -#define AMF_INIT_FUNCTION_NAME "AMFInit" -#define AMF_QUERY_VERSION_FUNCTION_NAME "AMFQueryVersion" - -#if defined(__cplusplus) -extern "C" -{ - typedef AMF_RESULT (AMF_CDECL_CALL *AMFInit_Fn)(amf_uint64 version, amf::AMFFactory **ppFactory); - typedef AMF_RESULT (AMF_CDECL_CALL *AMFQueryVersion_Fn)(amf_uint64 *pVersion); -} -#else - typedef AMF_RESULT (AMF_CDECL_CALL *AMFInit_Fn)(amf_uint64 version, AMFFactory **ppFactory); - typedef AMF_RESULT (AMF_CDECL_CALL *AMFQueryVersion_Fn)(amf_uint64 *pVersion); -#endif - -#if defined(_WIN32) - #if defined(_M_AMD64) - #define AMF_DLL_NAME L"amfrt64.dll" - #define AMF_DLL_NAMEA "amfrt64.dll" -#else - #define AMF_DLL_NAME L"amfrt32.dll" - #define AMF_DLL_NAMEA "amfrt32.dll" - #endif -#elif defined(__ANDROID__) && !defined(AMF_ANDROID_ENCODER) - #define AMF_DLL_NAME L"libamf.so" - #define AMF_DLL_NAMEA "libamf.so" -#elif defined(__APPLE__) - #define AMF_DLL_NAME L"libamfrt.framework/libamfrt" - #define AMF_DLL_NAMEA "libamfrt.framework/libamfrt" -#elif defined(__linux__) - #if defined(__x86_64__) || defined(__aarch64__) - #define AMF_DLL_NAME L"libamfrt64.so.1" - #define AMF_DLL_NAMEA "libamfrt64.so.1" - #else - #define AMF_DLL_NAME L"libamfrt32.so.1" - #define AMF_DLL_NAMEA "libamfrt32.so.1" - #endif -#endif -//---------------------------------------------------------------------------------------------- -#endif // AMF_Factory_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Interface.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Interface.h deleted file mode 100644 index 96117f0e..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Interface.h +++ /dev/null @@ -1,258 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Interface_h -#define AMF_Interface_h -#pragma once - -#include "Result.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif -#if defined(__cplusplus) - #define AMF_DECLARE_IID(_data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48) \ - static AMF_INLINE const amf::AMFGuid IID() \ - { \ - amf::AMFGuid uid = {_data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48}; \ - return uid; \ - } -#else -#define AMF_DECLARE_IID(name, _data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48) \ - AMF_INLINE static AMFGuid IID_##name(void) \ - { \ - AMFGuid uid = {_data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48}; \ - return uid; \ - } -#endif - - //------------------------------------------------------------------------ - // AMFInterface interface - base class for all AMF interfaces - //------------------------------------------------------------------------ -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFInterface - { - public: - AMF_DECLARE_IID(0x9d872f34, 0x90dc, 0x4b93, 0xb6, 0xb2, 0x6c, 0xa3, 0x7c, 0x85, 0x25, 0xdb) - - virtual amf_long AMF_STD_CALL Acquire() = 0; - virtual amf_long AMF_STD_CALL Release() = 0; - virtual AMF_RESULT AMF_STD_CALL QueryInterface(const AMFGuid& interfaceID, void** ppInterface) = 0; - }; -#else - AMF_DECLARE_IID(AMFInterface, 0x9d872f34, 0x90dc, 0x4b93, 0xb6, 0xb2, 0x6c, 0xa3, 0x7c, 0x85, 0x25, 0xdb) - typedef struct AMFInterface AMFInterface; - - typedef struct AMFInterfaceVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFInterface* pThis); - amf_long (AMF_STD_CALL *Release)(AMFInterface* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFInterface* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - } AMFInterfaceVtbl; - - struct AMFInterface - { - const AMFInterfaceVtbl *pVtbl; - }; -#endif - //------------------------------------------------------------------------ - // template for AMF smart pointer - //------------------------------------------------------------------------ -#if defined(__cplusplus) - template - class AMFInterfacePtr_T - { - private: - _Interf* m_pInterf; - - void InternalAcquire() - { - if(m_pInterf != NULL) - { - m_pInterf->Acquire(); - } - } - void InternalRelease() - { - if(m_pInterf != NULL) - { - m_pInterf->Release(); - } - } - public: - AMFInterfacePtr_T() : m_pInterf(NULL) - {} - - AMFInterfacePtr_T(const AMFInterfacePtr_T<_Interf>& p) : m_pInterf(p.m_pInterf) - { - InternalAcquire(); - } - - AMFInterfacePtr_T(_Interf* pInterface) : m_pInterf(pInterface) - { - InternalAcquire(); - } - - template - explicit AMFInterfacePtr_T(const AMFInterfacePtr_T<_OtherInterf>& cp) : m_pInterf(NULL) - { - void* pInterf = NULL; - if((cp == NULL) || (cp->QueryInterface(_Interf::IID(), &pInterf) != AMF_OK)) - { - pInterf = NULL; - } - m_pInterf = static_cast<_Interf*>(pInterf); - } - - template - explicit AMFInterfacePtr_T(_OtherInterf* cp) : m_pInterf(NULL) - { - void* pInterf = NULL; - if((cp == NULL) || (cp->QueryInterface(_Interf::IID(), &pInterf) != AMF_OK)) - { - pInterf = NULL; - } - m_pInterf = static_cast<_Interf*>(pInterf); - } - - ~AMFInterfacePtr_T() - { - InternalRelease(); - } - - AMFInterfacePtr_T& operator=(_Interf* pInterface) - { - if(m_pInterf != pInterface) - { - _Interf* pOldInterface = m_pInterf; - m_pInterf = pInterface; - InternalAcquire(); - if(pOldInterface != NULL) - { - pOldInterface->Release(); - } - } - return *this; - } - - AMFInterfacePtr_T& operator=(const AMFInterfacePtr_T<_Interf>& cp) - { - return operator=(cp.m_pInterf); - } - - void Attach(_Interf* pInterface) - { - InternalRelease(); - m_pInterf = pInterface; - } - - _Interf* Detach() - { - _Interf* const pOld = m_pInterf; - m_pInterf = NULL; - return pOld; - } - void Release() - { - InternalRelease(); - m_pInterf = NULL; - } - - operator _Interf*() const - { - return m_pInterf; - } - - _Interf& operator*() const - { - return *m_pInterf; - } - - // Returns the address of the interface pointer contained in this - // class. This is required for initializing from C-style factory function to - // avoid getting an incorrect ref count at the beginning. - - _Interf** operator&() - { - InternalRelease(); - m_pInterf = 0; - return &m_pInterf; - } - - _Interf* operator->() const - { - return m_pInterf; - } - - bool operator==(const AMFInterfacePtr_T<_Interf>& p) - { - return (m_pInterf == p.m_pInterf); - } - - bool operator==(_Interf* p) - { - return (m_pInterf == p); - } - - bool operator!=(const AMFInterfacePtr_T<_Interf>& p) - { - return !(operator==(p)); - } - bool operator!=(_Interf* p) - { - return !(operator==(p)); - } - - _Interf* GetPtr() - { - return m_pInterf; - } - - const _Interf* GetPtr() const - { - return m_pInterf; - } - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFInterfacePtr; - //---------------------------------------------------------------------------------------------- -#endif - -#if defined(__cplusplus) -} -#endif - -#endif //#ifndef AMF_Interface_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Plane.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Plane.h deleted file mode 100644 index 6d3e9f94..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Plane.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Plane_h -#define AMF_Plane_h -#pragma once - -#include "Interface.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //--------------------------------------------------------------------------------------------- - typedef enum AMF_PLANE_TYPE - { - AMF_PLANE_UNKNOWN = 0, - AMF_PLANE_PACKED = 1, // for all packed formats: BGRA, YUY2, etc - AMF_PLANE_Y = 2, - AMF_PLANE_UV = 3, - AMF_PLANE_U = 4, - AMF_PLANE_V = 5, - } AMF_PLANE_TYPE; - //--------------------------------------------------------------------------------------------- - // AMFPlane interface - //--------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFPlane : public AMFInterface - { - public: - AMF_DECLARE_IID(0xbede1aa6, 0xd8fa, 0x4625, 0x94, 0x65, 0x6c, 0x82, 0xc4, 0x37, 0x71, 0x2e) - - virtual AMF_PLANE_TYPE AMF_STD_CALL GetType() = 0; - virtual void* AMF_STD_CALL GetNative() = 0; - virtual amf_int32 AMF_STD_CALL GetPixelSizeInBytes() = 0; - virtual amf_int32 AMF_STD_CALL GetOffsetX() = 0; - virtual amf_int32 AMF_STD_CALL GetOffsetY() = 0; - virtual amf_int32 AMF_STD_CALL GetWidth() = 0; - virtual amf_int32 AMF_STD_CALL GetHeight() = 0; - virtual amf_int32 AMF_STD_CALL GetHPitch() = 0; - virtual amf_int32 AMF_STD_CALL GetVPitch() = 0; - virtual bool AMF_STD_CALL IsTiled() = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFPlanePtr; - //---------------------------------------------------------------------------------------------- -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFPlane, 0xbede1aa6, 0xd8fa, 0x4625, 0x94, 0x65, 0x6c, 0x82, 0xc4, 0x37, 0x71, 0x2e) - typedef struct AMFPlane AMFPlane; - typedef struct AMFPlaneVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFPlane* pThis); - amf_long (AMF_STD_CALL *Release)(AMFPlane* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFPlane* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPlane interface - AMF_PLANE_TYPE (AMF_STD_CALL *GetType)(AMFPlane* pThis); - void* (AMF_STD_CALL *GetNative)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetPixelSizeInBytes)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetOffsetX)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetOffsetY)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetWidth)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetHeight)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetHPitch)(AMFPlane* pThis); - amf_int32 (AMF_STD_CALL *GetVPitch)(AMFPlane* pThis); - amf_bool (AMF_STD_CALL *IsTiled)(AMFPlane* pThis); - - } AMFPlaneVtbl; - - struct AMFPlane - { - const AMFPlaneVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - -#if defined(__cplusplus) -} // namespace amf -#endif - -#endif //#ifndef AMF_Plane_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Platform.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Platform.h deleted file mode 100644 index b1f81b2c..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Platform.h +++ /dev/null @@ -1,573 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Platform_h -#define AMF_Platform_h -#pragma once - -//---------------------------------------------------------------------------------------------- -// export declaration -//---------------------------------------------------------------------------------------------- -#if defined(_WIN32) - #if defined(AMF_CORE_STATIC) - #define AMF_CORE_LINK - #else - #if defined(AMF_CORE_EXPORTS) - #define AMF_CORE_LINK __declspec(dllexport) - #else - #define AMF_CORE_LINK __declspec(dllimport) - #endif - #endif -#elif defined(__linux) - #if defined(AMF_CORE_EXPORTS) - #define AMF_CORE_LINK __attribute__((visibility("default"))) - #else - #define AMF_CORE_LINK - #endif -#else - #define AMF_CORE_LINK -#endif // #ifdef _WIN32 - -#if defined(_DEBUG) && !defined(DEBUG) // prevents other headers to #define DEBUG without assigned value what causes failure in PAL build -#define DEBUG 1 -#endif - -#define AMF_MACRO_STRING2(x) #x -#define AMF_MACRO_STRING(x) AMF_MACRO_STRING2(x) - -#define AMF_TODO(_todo) (__FILE__ "(" AMF_MACRO_STRING(__LINE__) "): TODO: "_todo) - - -/** -******************************************************************************* -* AMF_UNICODE -* -* @brief -* Macro to convert string constant into wide char string constant -* -* Auxilary AMF_UNICODE_ macro is needed as otherwise it is not possible to use AMF_UNICODE(__FILE__) -* Microsoft macro _T also uses 2 passes to accomplish that -******************************************************************************* -*/ -#define AMF_UNICODE(s) AMF_UNICODE_(s) -#define AMF_UNICODE_(s) L ## s - - - #if defined(__GNUC__) || defined(__clang__) - #define AMF_ALIGN(n) __attribute__((aligned(n))) - #elif defined(_MSC_VER) || defined(__INTEL_COMPILER) - #define AMF_ALIGN(n) __declspec(align(n)) - #else - #define AMF_ALIGN(n) -// #error Need to define AMF_ALIGN - #endif - -#ifndef _WIN32 -typedef signed int HRESULT; -#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) -#define FAILED(hr) (((HRESULT)(hr)) < 0) -#endif - -#include -#include -#include - -#if defined(_MSC_VER) - #define AMF_NO_VTABLE __declspec(novtable) -#else - #define AMF_NO_VTABLE -#endif - -#if defined(_WIN32) - - -#ifndef NOMINMAX -#define NOMINMAX -#endif - #define AMF_STD_CALL __stdcall - #define AMF_CDECL_CALL __cdecl - #define AMF_FAST_CALL __fastcall -#if defined(__GNUC__) || defined(__clang__) - #define AMF_INLINE inline - #define AMF_FORCEINLINE inline -#else - #define AMF_INLINE __inline - #define AMF_FORCEINLINE __forceinline -#endif - -#else // !WIN32 - Linux and Mac - - #define AMF_STD_CALL - #define AMF_CDECL_CALL - #define AMF_FAST_CALL -#if defined(__GNUC__) || defined(__clang__) - #define AMF_INLINE inline - #define AMF_FORCEINLINE inline -#else - #define AMF_INLINE __inline__ - #define AMF_FORCEINLINE __inline__ -#endif - - -#endif // WIN32 - -#if defined(__cplusplus) && (__cplusplus >= 201103L) - #include - #define AMFPRId64 PRId64 - #define AMFPRIud64 PRIu64 - #define AMFPRIx64 PRIx64 -#else -#if defined(_MSC_VER) - #define AMFPRId64 "I64d" - #define AMFPRIud64 "Iu64d" - #define AMFPRIx64 "I64x" -#else - #if !defined(AMFPRId64) - #define AMFPRId64 "lld" - #define AMFPRIud64 "ulld" - #define AMFPRIx64 "llx" - #endif -#endif -#endif - -#define LPRId64 AMF_UNICODE(AMFPRId64) -#define LPRIud64 AMF_UNICODE(AMFPRIud64) -#define LPRIx64 AMF_UNICODE(AMFPRIx64) - - -#if defined(_WIN32) -#define AMF_WEAK __declspec( selectany ) -#elif defined (__GNUC__) || defined (__GCC__) || defined(__clang__)//GCC or CLANG -#define AMF_WEAK __attribute__((weak)) -#endif - -#define amf_countof(x) (sizeof(x) / sizeof(x[0])) - -//------------------------------------------------------------------------------------------------- -// basic data types -//------------------------------------------------------------------------------------------------- -typedef int64_t amf_int64; -typedef int32_t amf_int32; -typedef int16_t amf_int16; -typedef int8_t amf_int8; - -typedef uint64_t amf_uint64; -typedef uint32_t amf_uint32; -typedef uint16_t amf_uint16; -typedef uint8_t amf_uint8; -typedef size_t amf_size; - -typedef void* amf_handle; -typedef double amf_double; -typedef float amf_float; - -typedef void amf_void; - -#if defined(__cplusplus) -typedef bool amf_bool; -#else -typedef amf_uint8 amf_bool; -#define true 1 -#define false 0 -#endif - -typedef long amf_long; -typedef int amf_int; -typedef unsigned long amf_ulong; -typedef unsigned int amf_uint; - -typedef amf_int64 amf_pts; // in 100 nanosecs - -typedef amf_uint32 amf_flags; - -#define AMF_SECOND 10000000L // 1 second in 100 nanoseconds -#define AMF_MILLISECOND (AMF_SECOND / 1000) -#define AMF_MICROSECOND (AMF_MILLISECOND / 1000) - -#define AMF_MIN(a, b) ((a) < (b) ? (a) : (b)) -#define AMF_MAX(a, b) ((a) > (b) ? (a) : (b)) -#define AMF_CLAMP(x, a, b) (AMF_MIN(AMF_MAX(x, a), b)) - -#define AMF_BITS_PER_BYTE 8 - -#if defined(_WIN32) - #define PATH_SEPARATOR_WSTR L"\\" - #define PATH_SEPARATOR_WCHAR L'\\' -#elif defined(__linux) || defined(__APPLE__) // Linux & Apple - #define PATH_SEPARATOR_WSTR L"/" - #define PATH_SEPARATOR_WCHAR L'/' -#endif - -typedef struct AMFRect -{ - amf_int32 left; - amf_int32 top; - amf_int32 right; - amf_int32 bottom; -#if defined(__cplusplus) - bool operator==(const AMFRect& other) const - { - return left == other.left && top == other.top && right == other.right && bottom == other.bottom; - } - AMF_INLINE bool operator!=(const AMFRect& other) const { return !operator==(other); } - amf_int32 Width() const { return right - left; } - amf_int32 Height() const { return bottom - top; } -#endif -} AMFRect; - -static AMF_INLINE struct AMFRect AMFConstructRect(amf_int32 left, amf_int32 top, amf_int32 right, amf_int32 bottom) -{ - struct AMFRect object = {left, top, right, bottom}; - return object; -} - -typedef struct AMFSize -{ - amf_int32 width; - amf_int32 height; -#if defined(__cplusplus) - bool operator==(const AMFSize& other) const - { - return width == other.width && height == other.height; - } - AMF_INLINE bool operator!=(const AMFSize& other) const { return !operator==(other); } -#endif -} AMFSize; - -static AMF_INLINE struct AMFSize AMFConstructSize(amf_int32 width, amf_int32 height) -{ - struct AMFSize object = {width, height}; - return object; -} - -typedef struct AMFPoint -{ - amf_int32 x; - amf_int32 y; -#if defined(__cplusplus) - bool operator==(const AMFPoint& other) const - { - return x == other.x && y == other.y; - } - AMF_INLINE bool operator!=(const AMFPoint& other) const { return !operator==(other); } -#endif -} AMFPoint; - -static AMF_INLINE struct AMFPoint AMFConstructPoint(amf_int32 x, amf_int32 y) -{ - struct AMFPoint object = { x, y }; - return object; -} - -typedef struct AMFFloatPoint2D -{ - amf_float x; - amf_float y; -#if defined(__cplusplus) - bool operator==(const AMFFloatPoint2D& other) const - { - return x == other.x && y == other.y; - } - AMF_INLINE bool operator!=(const AMFFloatPoint2D& other) const { return !operator==(other); } -#endif -} AMFFloatPoint2D; - -static AMF_INLINE struct AMFFloatPoint2D AMFConstructFloatPoint2D(amf_float x, amf_float y) -{ - struct AMFFloatPoint2D object = {x, y}; - return object; -} -typedef struct AMFFloatSize -{ - amf_float width; - amf_float height; -#if defined(__cplusplus) - bool operator==(const AMFFloatSize& other) const - { - return width == other.width && height == other.height; - } - AMF_INLINE bool operator!=(const AMFFloatSize& other) const { return !operator==(other); } -#endif -} AMFFloatSize; - -static AMF_INLINE struct AMFFloatSize AMFConstructFloatSize(amf_float w, amf_float h) -{ - struct AMFFloatSize object = { w, h }; - return object; -} - - -typedef struct AMFFloatPoint3D -{ - amf_float x; - amf_float y; - amf_float z; -#if defined(__cplusplus) - bool operator==(const AMFFloatPoint3D& other) const - { - return x == other.x && y == other.y && z == other.z; - } - AMF_INLINE bool operator!=(const AMFFloatPoint3D& other) const { return !operator==(other); } -#endif -} AMFFloatPoint3D; - -static AMF_INLINE struct AMFFloatPoint3D AMFConstructFloatPoint3D(amf_float x, amf_float y, amf_float z) -{ - struct AMFFloatPoint3D object = { x, y, z }; - return object; -} - -typedef struct AMFFloatVector4D -{ - amf_float x; - amf_float y; - amf_float z; - amf_float w; -#if defined(__cplusplus) - bool operator==(const AMFFloatVector4D& other) const - { - return x == other.x && y == other.y && z == other.z && w == other.w; - } - AMF_INLINE bool operator!=(const AMFFloatVector4D& other) const { return !operator==(other); } -#endif -} AMFFloatVector4D; - -static AMF_INLINE struct AMFFloatVector4D AMFConstructFloatVector4D(amf_float x, amf_float y, amf_float z, amf_float w) -{ - struct AMFFloatVector4D object = { x, y, z, w }; - return object; -} - - -typedef struct AMFRate -{ - amf_uint32 num; - amf_uint32 den; -#if defined(__cplusplus) - bool operator==(const AMFRate& other) const - { - return num == other.num && den == other.den; - } - AMF_INLINE bool operator!=(const AMFRate& other) const { return !operator==(other); } -#endif -} AMFRate; - -static AMF_INLINE struct AMFRate AMFConstructRate(amf_uint32 num, amf_uint32 den) -{ - struct AMFRate object = {num, den}; - return object; -} - -typedef struct AMFRatio -{ - amf_uint32 num; - amf_uint32 den; -#if defined(__cplusplus) - bool operator==(const AMFRatio& other) const - { - return num == other.num && den == other.den; - } - AMF_INLINE bool operator!=(const AMFRatio& other) const { return !operator==(other); } -#endif -} AMFRatio; - -static AMF_INLINE struct AMFRatio AMFConstructRatio(amf_uint32 num, amf_uint32 den) -{ - struct AMFRatio object = {num, den}; - return object; -} - -#pragma pack(push, 1) -#if defined(_MSC_VER) - #pragma warning( push ) - #pragma warning(disable : 4200) - #pragma warning(disable : 4201) -#endif - -typedef struct AMFColor -{ - union - { - struct - { - amf_uint8 r; - amf_uint8 g; - amf_uint8 b; - amf_uint8 a; - }; - amf_uint32 rgba; - }; -#if defined(__cplusplus) - bool operator==(const AMFColor& other) const - { - return r == other.r && g == other.g && b == other.b && a == other.a; - } - AMF_INLINE bool operator!=(const AMFColor& other) const { return !operator==(other); } -#endif -} AMFColor; -#if defined(_MSC_VER) - #pragma warning( pop ) -#endif -#pragma pack(pop) - - -static AMF_INLINE struct AMFColor AMFConstructColor(amf_uint8 r, amf_uint8 g, amf_uint8 b, amf_uint8 a) -{ - struct AMFColor object; - object.r = r; - object.g = g; - object.b = b; - object.a = a; - return object; -} - -#if defined(_WIN32) - #include - - #if defined(__cplusplus) - extern "C" - { - #endif - // allocator - static AMF_INLINE void* AMF_CDECL_CALL amf_variant_alloc(amf_size count) - { - return CoTaskMemAlloc(count); - } - static AMF_INLINE void AMF_CDECL_CALL amf_variant_free(void* ptr) - { - CoTaskMemFree(ptr); - } - #if defined(__cplusplus) - } - #endif - -#else // defined(_WIN32) - #include - #if defined(__cplusplus) - extern "C" - { - #endif - // allocator - static AMF_INLINE void* AMF_CDECL_CALL amf_variant_alloc(amf_size count) - { - return malloc(count); - } - static AMF_INLINE void AMF_CDECL_CALL amf_variant_free(void* ptr) - { - free(ptr); - } - #if defined(__cplusplus) - } - #endif -#endif // defined(_WIN32) - - -#if defined(__cplusplus) -namespace amf -{ -#endif - typedef struct AMFGuid - { - amf_uint32 data1; - amf_uint16 data2; - amf_uint16 data3; - amf_uint8 data41; - amf_uint8 data42; - amf_uint8 data43; - amf_uint8 data44; - amf_uint8 data45; - amf_uint8 data46; - amf_uint8 data47; - amf_uint8 data48; -#if defined(__cplusplus) - AMFGuid(amf_uint32 _data1, amf_uint16 _data2, amf_uint16 _data3, - amf_uint8 _data41, amf_uint8 _data42, amf_uint8 _data43, amf_uint8 _data44, - amf_uint8 _data45, amf_uint8 _data46, amf_uint8 _data47, amf_uint8 _data48) - : data1 (_data1), - data2 (_data2), - data3 (_data3), - data41(_data41), - data42(_data42), - data43(_data43), - data44(_data44), - data45(_data45), - data46(_data46), - data47(_data47), - data48(_data48) - {} - - bool operator==(const AMFGuid& other) const - { - return - data1 == other.data1 && - data2 == other.data2 && - data3 == other.data3 && - data41 == other.data41 && - data42 == other.data42 && - data43 == other.data43 && - data44 == other.data44 && - data45 == other.data45 && - data46 == other.data46 && - data47 == other.data47 && - data48 == other.data48; - } - AMF_INLINE bool operator!=(const AMFGuid& other) const { return !operator==(other); } -#endif - } AMFGuid; - -#if defined(__cplusplus) - static AMF_INLINE bool AMFCompareGUIDs(const AMFGuid& guid1, const AMFGuid& guid2) - { - return guid1 == guid2; - } -#else - static AMF_INLINE amf_bool AMFCompareGUIDs(const struct AMFGuid guid1, const struct AMFGuid guid2) - { - return memcmp(&guid1, &guid2, sizeof(guid1)) == 0; - } -#endif -#if defined(__cplusplus) -} -#endif - -#if defined(__APPLE__) -//#include - -#define media_status_t int -#define ANativeWindow void -#define JNIEnv void -#define jobject int -#define JavaVM void - -#endif - -#endif //#ifndef AMF_Platform_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorage.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorage.h deleted file mode 100644 index 9fb87bec..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorage.h +++ /dev/null @@ -1,275 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_PropertyStorage_h -#define AMF_PropertyStorage_h -#pragma once - -#include "Variant.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // AMFPropertyStorageObserver interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - - class AMF_NO_VTABLE AMFPropertyStorageObserver - { - public: - virtual void AMF_STD_CALL OnPropertyChanged(const wchar_t* name) = 0; - }; -#else //#if defined(__cplusplus) - typedef struct AMFPropertyStorageObserver AMFPropertyStorageObserver; - typedef struct AMFPropertyStorageObserverVtbl - { - void (AMF_STD_CALL *OnPropertyChanged)(AMFPropertyStorageObserver *pThis, const wchar_t* name); - } AMFPropertyStorageObserverVtbl; - - struct AMFPropertyStorageObserver - { - const AMFPropertyStorageObserverVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMFPropertyStorage interface - //---------------------------------------------------------------------------------------------- - class AMF_NO_VTABLE AMFPropertyStorage : public AMFInterface - { - public: - AMF_DECLARE_IID(0xc7cec05b, 0xcfb9, 0x48af, 0xac, 0xe3, 0xf6, 0x8d, 0xf8, 0x39, 0x5f, 0xe3) - - virtual AMF_RESULT AMF_STD_CALL SetProperty(const wchar_t* name, AMFVariantStruct value) = 0; - virtual AMF_RESULT AMF_STD_CALL GetProperty(const wchar_t* name, AMFVariantStruct* pValue) const = 0; - - virtual amf_bool AMF_STD_CALL HasProperty(const wchar_t* name) const = 0; - virtual amf_size AMF_STD_CALL GetPropertyCount() const = 0; - virtual AMF_RESULT AMF_STD_CALL GetPropertyAt(amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue) const = 0; - - virtual AMF_RESULT AMF_STD_CALL Clear() = 0; - virtual AMF_RESULT AMF_STD_CALL AddTo(AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep) const= 0; - virtual AMF_RESULT AMF_STD_CALL CopyTo(AMFPropertyStorage* pDest, amf_bool deep) const = 0; - - virtual void AMF_STD_CALL AddObserver(AMFPropertyStorageObserver* pObserver) = 0; - virtual void AMF_STD_CALL RemoveObserver(AMFPropertyStorageObserver* pObserver) = 0; - - template - AMF_RESULT AMF_STD_CALL SetProperty(const wchar_t* name, const _T& value); - template - AMF_RESULT AMF_STD_CALL GetProperty(const wchar_t* name, _T* pValue) const; - template - AMF_RESULT AMF_STD_CALL GetPropertyString(const wchar_t* name, _T* pValue) const; - template - AMF_RESULT AMF_STD_CALL GetPropertyWString(const wchar_t* name, _T* pValue) const; - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFPropertyStoragePtr; - //---------------------------------------------------------------------------------------------- - -#else // #if defined(__cplusplus) - typedef struct AMFPropertyStorage AMFPropertyStorage; - AMF_DECLARE_IID(AMFPropertyStorage, 0xc7cec05b, 0xcfb9, 0x48af, 0xac, 0xe3, 0xf6, 0x8d, 0xf8, 0x39, 0x5f, 0xe3) - - typedef struct AMFPropertyStorageVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFPropertyStorage* pThis); - amf_long (AMF_STD_CALL *Release)(AMFPropertyStorage* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFPropertyStorage* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFPropertyStorage* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFPropertyStorage* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFPropertyStorage* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFPropertyStorage* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFPropertyStorage* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFPropertyStorage* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFPropertyStorage* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFPropertyStorage* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFPropertyStorage* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFPropertyStorage* pThis, AMFPropertyStorageObserver* pObserver); - - } AMFPropertyStorageVtbl; - - struct AMFPropertyStorage - { - const AMFPropertyStorageVtbl *pVtbl; - }; - - #define AMF_ASSIGN_PROPERTY_DATA(res, varType, pThis, name, val ) \ - { \ - AMFVariantStruct var = {0}; \ - AMFVariantAssign##varType(&var, val); \ - res = pThis->pVtbl->SetProperty(pThis, name, var ); \ - } - - #define AMF_QUERY_INTERFACE(res, from, InterfaceTypeTo, to) \ - { \ - AMFGuid guid_##InterfaceTypeTo = IID_##InterfaceTypeTo(); \ - res = from->pVtbl->QueryInterface(from, &guid_##InterfaceTypeTo, (void**)&to); \ - } - - #define AMF_ASSIGN_PROPERTY_INTERFACE(res, pThis, name, val) \ - { \ - AMFInterface *amf_interface; \ - AMFVariantStruct var; \ - res = AMFVariantInit(&var); \ - if (res == AMF_OK) \ - { \ - AMF_QUERY_INTERFACE(res, val, AMFInterface, amf_interface)\ - if (res == AMF_OK) \ - { \ - res = AMFVariantAssignInterface(&var, amf_interface); \ - amf_interface->pVtbl->Release(amf_interface); \ - if (res == AMF_OK) \ - { \ - res = pThis->pVtbl->SetProperty(pThis, name, var); \ - } \ - } \ - AMFVariantClear(&var); \ - } \ - } - - #define AMF_GET_PROPERTY_INTERFACE(res, pThis, name, TargetType, val) \ - { \ - AMFVariantStruct var; \ - res = AMFVariantInit(&var); \ - if (res != AMF_OK) \ - { \ - res = pThis->pVtbl->GetProperty(pThis, name, &var); \ - if (res == AMF_OK) \ - { \ - if (var.type == AMF_VARIANT_INTERFACE && AMFVariantInterface(&var)) \ - { \ - AMF_QUERY_INTERFACE(res, AMFVariantInterface(&var), TargetType, val); \ - } \ - else \ - { \ - res = AMF_INVALID_DATA_TYPE; \ - } \ - } \ - } \ - AMFVariantClear(&var); \ - } - - #define AMF_ASSIGN_PROPERTY_TYPE(res, varType, dataType , pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, varType, pThis, name, (dataType)val) - - #define AMF_ASSIGN_PROPERTY_INT64(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_TYPE(res, Int64, amf_int64, pThis, name, val) - #define AMF_ASSIGN_PROPERTY_DOUBLE(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_TYPE(res, Double, amf_double, pThis, name, val) - #define AMF_ASSIGN_PROPERTY_BOOL(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_TYPE(res, Bool, amf_bool, pThis, name, val) - #define AMF_ASSIGN_PROPERTY_RECT(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Rect, pThis, name, &val) - #define AMF_ASSIGN_PROPERTY_SIZE(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Size, pThis, name, &val) - #define AMF_ASSIGN_PROPERTY_POINT(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Point, pThis, name, &val) - #define AMF_ASSIGN_PROPERTY_RATE(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Rate, pThis, name, &val) - #define AMF_ASSIGN_PROPERTY_RATIO(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Ratio, pThis, name, &val) - #define AMF_ASSIGN_PROPERTY_COLOR(res, pThis, name, val ) AMF_ASSIGN_PROPERTY_DATA(res, Color, pThis, name, &val) - -#endif // #if defined(__cplusplus) - - -#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // template methods implementations - //---------------------------------------------------------------------------------------------- - template inline - AMF_RESULT AMF_STD_CALL AMFPropertyStorage::SetProperty(const wchar_t* name, const _T& value) - { - AMF_RESULT err = SetProperty(name, static_cast(AMFVariant(value))); - return err; - } - //---------------------------------------------------------------------------------------------- - template inline - AMF_RESULT AMF_STD_CALL AMFPropertyStorage::GetProperty(const wchar_t* name, _T* pValue) const - { - AMFVariant var; - AMF_RESULT err = GetProperty(name, static_cast(&var)); - if(err == AMF_OK) - { - *pValue = static_cast<_T>(var); - } - return err; - } - //---------------------------------------------------------------------------------------------- - template inline - AMF_RESULT AMF_STD_CALL AMFPropertyStorage::GetPropertyString(const wchar_t* name, _T* pValue) const - { - AMFVariant var; - AMF_RESULT err = GetProperty(name, static_cast(&var)); - if(err == AMF_OK) - { - *pValue = var.ToString().c_str(); - } - return err; - } - //---------------------------------------------------------------------------------------------- - template inline - AMF_RESULT AMF_STD_CALL AMFPropertyStorage::GetPropertyWString(const wchar_t* name, _T* pValue) const - { - AMFVariant var; - AMF_RESULT err = GetProperty(name, static_cast(&var)); - if(err == AMF_OK) - { - *pValue = var.ToWString().c_str(); - } - return err; - } - //---------------------------------------------------------------------------------------------- - template<> inline - AMF_RESULT AMF_STD_CALL AMFPropertyStorage::GetProperty(const wchar_t* name, - AMFInterface** ppValue) const - { - AMFVariant var; - AMF_RESULT err = GetProperty(name, static_cast(&var)); - if(err == AMF_OK) - { - *ppValue = static_cast(var); - } - if(*ppValue) - { - (*ppValue)->Acquire(); - } - return err; - } -#endif // #if defined(__cplusplus) - -#if defined(__cplusplus) -} //namespace amf -#endif - -#endif // #ifndef AMF_PropertyStorage_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorageEx.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorageEx.h deleted file mode 100644 index 94ccd1ea..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/PropertyStorageEx.h +++ /dev/null @@ -1,207 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_PropertyStorageEx_h -#define AMF_PropertyStorageEx_h -#pragma once - -#include "PropertyStorage.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - typedef enum AMF_PROPERTY_CONTENT_ENUM - { - AMF_PROPERTY_CONTENT_DEFAULT = 0, - AMF_PROPERTY_CONTENT_XML, // m_eType is AMF_VARIANT_STRING - - AMF_PROPERTY_CONTENT_FILE_OPEN_PATH, // m_eType AMF_VARIANT_WSTRING - AMF_PROPERTY_CONTENT_FILE_SAVE_PATH, // m_eType AMF_VARIANT_WSTRING - - AMF_PROPERTY_CONTENT_INTEGER_ARRAY, // m_eType AMF_VARIANT_INTERFACE - AMF_PROPERTY_CONTENT_FLOAT_ARRAY // m_eType AMF_VARIANT_INTERFACE - } AMF_PROPERTY_CONTENT_ENUM; - //---------------------------------------------------------------------------------------------- - typedef enum AMF_PROPERTY_ACCESS_TYPE - { - AMF_PROPERTY_ACCESS_PRIVATE = 0, - AMF_PROPERTY_ACCESS_READ = 0x1, - AMF_PROPERTY_ACCESS_WRITE = 0x2, - AMF_PROPERTY_ACCESS_READ_WRITE = (AMF_PROPERTY_ACCESS_READ | AMF_PROPERTY_ACCESS_WRITE), - AMF_PROPERTY_ACCESS_WRITE_RUNTIME = 0x4, - AMF_PROPERTY_ACCESS_FULL = 0xFF, - AMF_PROPERTY_ACCESS_NON_PERSISTANT = 0x4000, - AMF_PROPERTY_ACCESS_NON_PERSISTANT_READ = (AMF_PROPERTY_ACCESS_NON_PERSISTANT | AMF_PROPERTY_ACCESS_READ), - AMF_PROPERTY_ACCESS_NON_PERSISTANT_READ_WRITE = (AMF_PROPERTY_ACCESS_NON_PERSISTANT | AMF_PROPERTY_ACCESS_READ_WRITE), - AMF_PROPERTY_ACCESS_NON_PERSISTANT_FULL = (AMF_PROPERTY_ACCESS_NON_PERSISTANT | AMF_PROPERTY_ACCESS_FULL), - AMF_PROPERTY_ACCESS_INVALID = 0x8000 - } AMF_PROPERTY_ACCESS_TYPE; - - //---------------------------------------------------------------------------------------------- - typedef struct AMFEnumDescriptionEntry - { - amf_int value; - const wchar_t* name; - } AMFEnumDescriptionEntry; - //---------------------------------------------------------------------------------------------- - typedef amf_uint32 AMF_PROPERTY_CONTENT_TYPE; - - typedef struct AMFPropertyInfo - { - const wchar_t* name; - const wchar_t* desc; - AMF_VARIANT_TYPE type; - AMF_PROPERTY_CONTENT_TYPE contentType; - - AMFVariantStruct defaultValue; - AMFVariantStruct minValue; - AMFVariantStruct maxValue; - AMF_PROPERTY_ACCESS_TYPE accessType; - const AMFEnumDescriptionEntry* pEnumDescription; - -#if defined(__cplusplus) - AMFPropertyInfo() : - name(NULL), - desc(NULL), - type(), - contentType(), - defaultValue(), - minValue(), - maxValue(), - accessType(AMF_PROPERTY_ACCESS_FULL), - pEnumDescription(NULL) - {} - AMFPropertyInfo(const AMFPropertyInfo& propery) : name(propery.name), - desc(propery.desc), - type(propery.type), - contentType(propery.contentType), - defaultValue(propery.defaultValue), - minValue(propery.minValue), - maxValue(propery.maxValue), - accessType(propery.accessType), - pEnumDescription(propery.pEnumDescription) - {} - virtual ~AMFPropertyInfo(){} - - amf_bool AMF_STD_CALL AllowedRead() const - { - return (accessType & AMF_PROPERTY_ACCESS_READ) != 0; - } - amf_bool AMF_STD_CALL AllowedWrite() const - { - return (accessType & AMF_PROPERTY_ACCESS_WRITE) != 0; - } - amf_bool AMF_STD_CALL AllowedChangeInRuntime() const - { - return (accessType & AMF_PROPERTY_ACCESS_WRITE_RUNTIME) != 0; - } - - AMFPropertyInfo& operator=(const AMFPropertyInfo& propery) - { - name = propery.name; - desc = propery.desc; - type = propery.type; - contentType = propery.contentType; - defaultValue = propery.defaultValue; - minValue = propery.minValue; - maxValue = propery.maxValue; - accessType = propery.accessType; - pEnumDescription = propery.pEnumDescription; - - return *this; - } -#endif // #if defined(__cplusplus) - } AMFPropertyInfo; - //---------------------------------------------------------------------------------------------- - // AMFPropertyStorageEx interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFPropertyStorageEx : public AMFPropertyStorage - { - public: - AMF_DECLARE_IID(0x16b8958d, 0xe943, 0x4a33, 0xa3, 0x5a, 0x88, 0x5a, 0xd8, 0x28, 0xf2, 0x67) - - virtual amf_size AMF_STD_CALL GetPropertiesInfoCount() const = 0; - virtual AMF_RESULT AMF_STD_CALL GetPropertyInfo(amf_size index, const AMFPropertyInfo** ppInfo) const = 0; - virtual AMF_RESULT AMF_STD_CALL GetPropertyInfo(const wchar_t* name, const AMFPropertyInfo** ppInfo) const = 0; - virtual AMF_RESULT AMF_STD_CALL ValidateProperty(const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated) const = 0; - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFPropertyStorageExPtr; -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFPropertyStorageEx, 0x16b8958d, 0xe943, 0x4a33, 0xa3, 0x5a, 0x88, 0x5a, 0xd8, 0x28, 0xf2, 0x67) - typedef struct AMFPropertyStorageEx AMFPropertyStorageEx; - - typedef struct AMFPropertyStorageExVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFPropertyStorageEx* pThis); - amf_long (AMF_STD_CALL *Release)(AMFPropertyStorageEx* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFPropertyStorageEx* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFPropertyStorageEx* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFPropertyStorageEx* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFPropertyStorageEx* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFPropertyStorageEx* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFPropertyStorageEx* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFPropertyStorageEx* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFPropertyStorageEx* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFPropertyStorageEx* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFPropertyStorageEx* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFPropertyStorageEx* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFPropertyStorageEx interface - - amf_size (AMF_STD_CALL *GetPropertiesInfoCount)(AMFPropertyStorageEx* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfoAt)(AMFPropertyStorageEx* pThis, amf_size index, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *GetPropertyInfo)(AMFPropertyStorageEx* pThis, const wchar_t* name, const AMFPropertyInfo** ppInfo); - AMF_RESULT (AMF_STD_CALL *ValidateProperty)(AMFPropertyStorageEx* pThis, const wchar_t* name, AMFVariantStruct value, AMFVariantStruct* pOutValidated); - - } AMFPropertyStorageExVtbl; - - struct AMFPropertyStorageEx - { - const AMFPropertyStorageExVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) -} //namespace amf -#endif - - -#endif //#ifndef AMF_PropertyStorageEx_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Result.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Result.h deleted file mode 100644 index 350b72f6..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Result.h +++ /dev/null @@ -1,130 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Result_h -#define AMF_Result_h -#pragma once - -#include "Platform.h" - -//---------------------------------------------------------------------------------------------- -// result codes -//---------------------------------------------------------------------------------------------- - -typedef enum AMF_RESULT -{ - AMF_OK = 0, - AMF_FAIL , - -// common errors - AMF_UNEXPECTED , - - AMF_ACCESS_DENIED , - AMF_INVALID_ARG , - AMF_OUT_OF_RANGE , - - AMF_OUT_OF_MEMORY , - AMF_INVALID_POINTER , - - AMF_NO_INTERFACE , - AMF_NOT_IMPLEMENTED , - AMF_NOT_SUPPORTED , - AMF_NOT_FOUND , - - AMF_ALREADY_INITIALIZED , - AMF_NOT_INITIALIZED , - - AMF_INVALID_FORMAT ,// invalid data format - - AMF_WRONG_STATE , - AMF_FILE_NOT_OPEN ,// cannot open file - -// device common codes - AMF_NO_DEVICE , - -// device directx - AMF_DIRECTX_FAILED , -// device opencl - AMF_OPENCL_FAILED , -// device opengl - AMF_GLX_FAILED ,//failed to use GLX -// device XV - AMF_XV_FAILED , //failed to use Xv extension -// device alsa - AMF_ALSA_FAILED ,//failed to use ALSA - -// component common codes - - //result codes - AMF_EOF , - AMF_REPEAT , - AMF_INPUT_FULL ,//returned by AMFComponent::SubmitInput if input queue is full - AMF_RESOLUTION_CHANGED ,//resolution changed client needs to Drain/Terminate/Init - AMF_RESOLUTION_UPDATED ,//resolution changed in adaptive mode. New ROI will be set on output on newly decoded frames - - //error codes - AMF_INVALID_DATA_TYPE ,//invalid data type - AMF_INVALID_RESOLUTION ,//invalid resolution (width or height) - AMF_CODEC_NOT_SUPPORTED ,//codec not supported - AMF_SURFACE_FORMAT_NOT_SUPPORTED ,//surface format not supported - AMF_SURFACE_MUST_BE_SHARED ,//surface should be shared (DX11: (MiscFlags & D3D11_RESOURCE_MISC_SHARED) == 0, DX9: No shared handle found) - -// component video decoder - AMF_DECODER_NOT_PRESENT ,//failed to create the decoder - AMF_DECODER_SURFACE_ALLOCATION_FAILED ,//failed to create the surface for decoding - AMF_DECODER_NO_FREE_SURFACES , - -// component video encoder - AMF_ENCODER_NOT_PRESENT ,//failed to create the encoder - -// component video processor - -// component video conveter - -// component dem - AMF_DEM_ERROR , - AMF_DEM_PROPERTY_READONLY , - AMF_DEM_REMOTE_DISPLAY_CREATE_FAILED , - AMF_DEM_START_ENCODING_FAILED , - AMF_DEM_QUERY_OUTPUT_FAILED , - -// component TAN - AMF_TAN_CLIPPING_WAS_REQUIRED , // Resulting data was truncated to meet output type's value limits. - AMF_TAN_UNSUPPORTED_VERSION , // Not supported version requested, solely for TANCreateContext(). - - AMF_NEED_MORE_INPUT ,//returned by AMFComponent::SubmitInput did not produce a buffer because more input submissions are required. - - // device vulkan - AMF_VULKAN_FAILED , -} AMF_RESULT; - -#endif //#ifndef AMF_Result_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Surface.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Surface.h deleted file mode 100644 index f20396c7..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Surface.h +++ /dev/null @@ -1,292 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Surface_h -#define AMF_Surface_h -#pragma once - -#include "Data.h" -#include "Plane.h" - -#if defined(_MSC_VER) - #pragma warning( push ) - #pragma warning(disable : 4263) - #pragma warning(disable : 4264) -#endif -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - typedef enum AMF_SURFACE_FORMAT - { - AMF_SURFACE_UNKNOWN = 0, - AMF_SURFACE_NV12, ///< 1 - planar 4:2:0 Y width x height + packed UV width/2 x height/2 - 8 bit per component - AMF_SURFACE_YV12, ///< 2 - planar 4:2:0 Y width x height + V width/2 x height/2 + U width/2 x height/2 - 8 bit per component - AMF_SURFACE_BGRA, ///< 3 - packed 4:4:4 - 8 bit per component - AMF_SURFACE_ARGB, ///< 4 - packed 4:4:4 - 8 bit per component - AMF_SURFACE_RGBA, ///< 5 - packed 4:4:4 - 8 bit per component - AMF_SURFACE_GRAY8, ///< 6 - single component - 8 bit - AMF_SURFACE_YUV420P, ///< 7 - planar 4:2:0 Y width x height + U width/2 x height/2 + V width/2 x height/2 - 8 bit per component - AMF_SURFACE_U8V8, ///< 8 - packed double component - 8 bit per component - AMF_SURFACE_YUY2, ///< 9 - packed 4:2:2 Byte 0=8-bit Y'0; Byte 1=8-bit Cb; Byte 2=8-bit Y'1; Byte 3=8-bit Cr - AMF_SURFACE_P010, ///< 10 - planar 4:2:0 Y width x height + packed UV width/2 x height/2 - 10 bit per component (16 allocated, upper 10 bits are used) - AMF_SURFACE_RGBA_F16, ///< 11 - packed 4:4:4 - 16 bit per component float - AMF_SURFACE_UYVY, ///< 12 - packed 4:2:2 the similar to YUY2 but Y and UV swapped: Byte 0=8-bit Cb; Byte 1=8-bit Y'0; Byte 2=8-bit Cr Byte 3=8-bit Y'1; (used the same DX/CL/Vulkan storage as YUY2) - AMF_SURFACE_R10G10B10A2, ///< 13 - packed 4:4:4 to 4 bytes, 10 bit per RGB component, 2 bits per A - AMF_SURFACE_Y210, ///< 14 - packed 4:2:2 - Word 0=10-bit Y'0; Word 1=10-bit Cb; Word 2=10-bit Y'1; Word 3=10-bit Cr - AMF_SURFACE_AYUV, ///< 15 - packed 4:4:4 - 8 bit per component YUVA - AMF_SURFACE_Y410, ///< 16 - packed 4:4:4 - 10 bit per YUV component, 2 bits per A, AVYU - AMF_SURFACE_Y416, ///< 17 - packed 4:4:4 - 16 bit per component 4 bytes, AVYU - AMF_SURFACE_GRAY32, ///< 18 - single component - 32 bit - AMF_SURFACE_P012, ///< 19 - planar 4:2:0 Y width x height + packed UV width/2 x height/2 - 12 bit per component (16 allocated, upper 12 bits are used) - AMF_SURFACE_P016, ///< 20 - planar 4:2:0 Y width x height + packed UV width/2 x height/2 - 16 bit per component (16 allocated, all bits are used) - - AMF_SURFACE_FIRST = AMF_SURFACE_NV12, - AMF_SURFACE_LAST = AMF_SURFACE_P016 - } AMF_SURFACE_FORMAT; - //---------------------------------------------------------------------------------------------- - // AMF_SURFACE_USAGE translates to D3D11_BIND_FLAG or VkImageUsageFlags - // bit mask - //---------------------------------------------------------------------------------------------- - typedef enum AMF_SURFACE_USAGE_BITS - { // D3D11 D3D12 Vulkan - AMF_SURFACE_USAGE_DEFAULT = 0x80000000, // will apply default D3D12_RESOURCE_FLAG_NONE VK_IMAGE_USAGE_TRANSFER_SRC_BIT| VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT - AMF_SURFACE_USAGE_NONE = 0x00000000, // 0, D3D12_RESOURCE_FLAG_NONE, 0 - AMF_SURFACE_USAGE_SHADER_RESOURCE = 0x00000001, // D3D11_BIND_SHADER_RESOURCE, D3D12_RESOURCE_FLAG_NONE VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT - AMF_SURFACE_USAGE_RENDER_TARGET = 0x00000002, // D3D11_BIND_RENDER_TARGET, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT - AMF_SURFACE_USAGE_UNORDERED_ACCESS = 0x00000004, // D3D11_BIND_UNORDERED_ACCESS, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT - AMF_SURFACE_USAGE_TRANSFER_SRC = 0x00000008, // D3D12_RESOURCE_FLAG_NONE VK_IMAGE_USAGE_TRANSFER_SRC_BIT - AMF_SURFACE_USAGE_TRANSFER_DST = 0x00000010, // D3D12_RESOURCE_FLAG_NONE VK_IMAGE_USAGE_TRANSFER_DST_BIT - AMF_SURFACE_USAGE_LINEAR = 0x00000020, // - AMF_SURFACE_USAGE_NOSYNC = 0x00000040, // no fence (AMFFenceGUID) created no semaphore (AMFVulkanSync::hSemaphore) created - AMF_SURFACE_USAGE_DECODER_DST = 0x00000080, // AMFResourceDecodeGUID is set to 1 VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR - AMF_SURFACE_USAGE_DECODER_DPB = 0x00000100, // VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR - AMF_SURFACE_USAGE_NO_TRANSITION = 0x00000200, // no layout transition - } AMF_SURFACE_USAGE_BITS; - typedef amf_flags AMF_SURFACE_USAGE; - //---------------------------------------------------------------------------------------------- - -#if defined(_WIN32) - AMF_WEAK GUID AMFFormatGUID = { 0x8cd592d0, 0x8063, 0x4af8, {0xa7, 0xd0, 0x32, 0x5b, 0xc5, 0xf7, 0x48, 0xab}}; // UINT(AMF_SURFACE_FORMAT), default - AMF_SURFACE_UNKNOWN; to be set on ID3D11Texture2D objects when used natively (i.e. force UYVY on DXGI_FORMAT_YUY2 texture) -#endif - - //---------------------------------------------------------------------------------------------- - // frame type - //---------------------------------------------------------------------------------------------- - typedef enum AMF_FRAME_TYPE - { - // flags - AMF_FRAME_STEREO_FLAG = 0x10000000, - AMF_FRAME_LEFT_FLAG = AMF_FRAME_STEREO_FLAG | 0x20000000, - AMF_FRAME_RIGHT_FLAG = AMF_FRAME_STEREO_FLAG | 0x40000000, - AMF_FRAME_BOTH_FLAG = AMF_FRAME_LEFT_FLAG | AMF_FRAME_RIGHT_FLAG, - AMF_FRAME_INTERLEAVED_FLAG = 0x01000000, - AMF_FRAME_FIELD_FLAG = 0x02000000, - AMF_FRAME_EVEN_FLAG = 0x04000000, - AMF_FRAME_ODD_FLAG = 0x08000000, - - // values - AMF_FRAME_UNKNOWN =-1, - AMF_FRAME_PROGRESSIVE = 0, - - AMF_FRAME_INTERLEAVED_EVEN_FIRST = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_EVEN_FLAG, - AMF_FRAME_INTERLEAVED_ODD_FIRST = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_ODD_FLAG, - AMF_FRAME_FIELD_SINGLE_EVEN = AMF_FRAME_FIELD_FLAG | AMF_FRAME_EVEN_FLAG, - AMF_FRAME_FIELD_SINGLE_ODD = AMF_FRAME_FIELD_FLAG | AMF_FRAME_ODD_FLAG, - - AMF_FRAME_STEREO_LEFT = AMF_FRAME_LEFT_FLAG, - AMF_FRAME_STEREO_RIGHT = AMF_FRAME_RIGHT_FLAG, - AMF_FRAME_STEREO_BOTH = AMF_FRAME_BOTH_FLAG, - - AMF_FRAME_INTERLEAVED_EVEN_FIRST_STEREO_LEFT = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_EVEN_FLAG | AMF_FRAME_LEFT_FLAG, - AMF_FRAME_INTERLEAVED_EVEN_FIRST_STEREO_RIGHT = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_EVEN_FLAG | AMF_FRAME_RIGHT_FLAG, - AMF_FRAME_INTERLEAVED_EVEN_FIRST_STEREO_BOTH = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_EVEN_FLAG | AMF_FRAME_BOTH_FLAG, - - AMF_FRAME_INTERLEAVED_ODD_FIRST_STEREO_LEFT = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_ODD_FLAG | AMF_FRAME_LEFT_FLAG, - AMF_FRAME_INTERLEAVED_ODD_FIRST_STEREO_RIGHT = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_ODD_FLAG | AMF_FRAME_RIGHT_FLAG, - AMF_FRAME_INTERLEAVED_ODD_FIRST_STEREO_BOTH = AMF_FRAME_INTERLEAVED_FLAG | AMF_FRAME_ODD_FLAG | AMF_FRAME_BOTH_FLAG, - } AMF_FRAME_TYPE; - - typedef enum AMF_ROTATION_ENUM - { - AMF_ROTATION_NONE = 0, - AMF_ROTATION_90 = 1, - AMF_ROTATION_180 = 2, - AMF_ROTATION_270 = 3, - } AMF_ROTATION_ENUM; - - #define AMF_SURFACE_ROTATION L"Rotation" // amf_int64(AMF_ROTATION_ENUM); default = AMF_ROTATION_NONE, can be set on surfaces - - //---------------------------------------------------------------------------------------------- - // AMFSurfaceObserver interface - callback; is called before internal release resources. - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMFSurface; - class AMF_NO_VTABLE AMFSurfaceObserver - { - public: - virtual void AMF_STD_CALL OnSurfaceDataRelease(AMFSurface* pSurface) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFSurface AMFSurface; - typedef struct AMFSurfaceObserver AMFSurfaceObserver; - - typedef struct AMFSurfaceObserverVtbl - { - void (AMF_STD_CALL *OnSurfaceDataRelease)(AMFSurfaceObserver* pThis, AMFSurface* pSurface); - } AMFSurfaceObserverVtbl; - - struct AMFSurfaceObserver - { - const AMFSurfaceObserverVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFSurface interface - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFSurface : public AMFData - { - public: - AMF_DECLARE_IID(0x3075dbe3, 0x8718, 0x4cfa, 0x86, 0xfb, 0x21, 0x14, 0xc0, 0xa5, 0xa4, 0x51) - - virtual AMF_SURFACE_FORMAT AMF_STD_CALL GetFormat() = 0; - - // do not store planes outside. should be used together with Surface - virtual amf_size AMF_STD_CALL GetPlanesCount() = 0; - virtual AMFPlane* AMF_STD_CALL GetPlaneAt(amf_size index) = 0; - virtual AMFPlane* AMF_STD_CALL GetPlane(AMF_PLANE_TYPE type) = 0; - - virtual AMF_FRAME_TYPE AMF_STD_CALL GetFrameType() = 0; - virtual void AMF_STD_CALL SetFrameType(AMF_FRAME_TYPE type) = 0; - - virtual AMF_RESULT AMF_STD_CALL SetCrop(amf_int32 x,amf_int32 y, amf_int32 width, amf_int32 height) = 0; - virtual AMF_RESULT AMF_STD_CALL CopySurfaceRegion(AMFSurface* pDest, amf_int32 dstX, amf_int32 dstY, amf_int32 srcX, amf_int32 srcY, amf_int32 width, amf_int32 height) = 0; - - // Observer management -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Woverloaded-virtual" -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverloaded-virtual" -#endif - virtual void AMF_STD_CALL AddObserver(AMFSurfaceObserver* pObserver) = 0; - virtual void AMF_STD_CALL RemoveObserver(AMFSurfaceObserver* pObserver) = 0; -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef __clang__ - #pragma clang diagnostic pop -#endif - - }; - //---------------------------------------------------------------------------------------------- - // smart pointer - //---------------------------------------------------------------------------------------------- - typedef AMFInterfacePtr_T AMFSurfacePtr; - //---------------------------------------------------------------------------------------------- -#else // #if defined(__cplusplus) - AMF_DECLARE_IID(AMFSurface, 0x3075dbe3, 0x8718, 0x4cfa, 0x86, 0xfb, 0x21, 0x14, 0xc0, 0xa5, 0xa4, 0x51) - typedef struct AMFSurfaceVtbl - { - // AMFInterface interface - amf_long (AMF_STD_CALL *Acquire)(AMFSurface* pThis); - amf_long (AMF_STD_CALL *Release)(AMFSurface* pThis); - enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFSurface* pThis, const struct AMFGuid *interfaceID, void** ppInterface); - - // AMFPropertyStorage interface - AMF_RESULT (AMF_STD_CALL *SetProperty)(AMFSurface* pThis, const wchar_t* name, AMFVariantStruct value); - AMF_RESULT (AMF_STD_CALL *GetProperty)(AMFSurface* pThis, const wchar_t* name, AMFVariantStruct* pValue); - amf_bool (AMF_STD_CALL *HasProperty)(AMFSurface* pThis, const wchar_t* name); - amf_size (AMF_STD_CALL *GetPropertyCount)(AMFSurface* pThis); - AMF_RESULT (AMF_STD_CALL *GetPropertyAt)(AMFSurface* pThis, amf_size index, wchar_t* name, amf_size nameSize, AMFVariantStruct* pValue); - AMF_RESULT (AMF_STD_CALL *Clear)(AMFSurface* pThis); - AMF_RESULT (AMF_STD_CALL *AddTo)(AMFSurface* pThis, AMFPropertyStorage* pDest, amf_bool overwrite, amf_bool deep); - AMF_RESULT (AMF_STD_CALL *CopyTo)(AMFSurface* pThis, AMFPropertyStorage* pDest, amf_bool deep); - void (AMF_STD_CALL *AddObserver)(AMFSurface* pThis, AMFPropertyStorageObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver)(AMFSurface* pThis, AMFPropertyStorageObserver* pObserver); - - // AMFData interface - - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryType)(AMFSurface* pThis); - - AMF_RESULT (AMF_STD_CALL *Duplicate)(AMFSurface* pThis, AMF_MEMORY_TYPE type, AMFData** ppData); - AMF_RESULT (AMF_STD_CALL *Convert)(AMFSurface* pThis, AMF_MEMORY_TYPE type); // optimal interop if possilble. Copy through host memory if needed - AMF_RESULT (AMF_STD_CALL *Interop)(AMFSurface* pThis, AMF_MEMORY_TYPE type); // only optimal interop if possilble. No copy through host memory for GPU objects - - AMF_DATA_TYPE (AMF_STD_CALL *GetDataType)(AMFSurface* pThis); - - amf_bool (AMF_STD_CALL *IsReusable)(AMFSurface* pThis); - - void (AMF_STD_CALL *SetPts)(AMFSurface* pThis, amf_pts pts); - amf_pts (AMF_STD_CALL *GetPts)(AMFSurface* pThis); - void (AMF_STD_CALL *SetDuration)(AMFSurface* pThis, amf_pts duration); - amf_pts (AMF_STD_CALL *GetDuration)(AMFSurface* pThis); - - // AMFSurface interface - - AMF_SURFACE_FORMAT (AMF_STD_CALL *GetFormat)(AMFSurface* pThis); - - // do not store planes outside. should be used together with Surface - amf_size (AMF_STD_CALL *GetPlanesCount)(AMFSurface* pThis); - AMFPlane* (AMF_STD_CALL *GetPlaneAt)(AMFSurface* pThis, amf_size index); - AMFPlane* (AMF_STD_CALL *GetPlane)(AMFSurface* pThis, AMF_PLANE_TYPE type); - - AMF_FRAME_TYPE (AMF_STD_CALL *GetFrameType)(AMFSurface* pThis); - void (AMF_STD_CALL *SetFrameType)(AMFSurface* pThis, AMF_FRAME_TYPE type); - - AMF_RESULT (AMF_STD_CALL *SetCrop)(AMFSurface* pThis, amf_int32 x,amf_int32 y, amf_int32 width, amf_int32 height); - AMF_RESULT (AMF_STD_CALL *CopySurfaceRegion)(AMFSurface* pThis, AMFSurface* pDest, amf_int32 dstX, amf_int32 dstY, amf_int32 srcX, amf_int32 srcY, amf_int32 width, amf_int32 height); - - - // Observer management - void (AMF_STD_CALL *AddObserver_Surface)(AMFSurface* pThis, AMFSurfaceObserver* pObserver); - void (AMF_STD_CALL *RemoveObserver_Surface)(AMFSurface* pThis, AMFSurfaceObserver* pObserver); - - } AMFSurfaceVtbl; - - struct AMFSurface - { - const AMFSurfaceVtbl *pVtbl; - }; -#endif // #if defined(__cplusplus) -#if defined(__cplusplus) -} -#endif -#if defined(_MSC_VER) - #pragma warning( pop ) -#endif -#endif //#ifndef AMF_Surface_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Trace.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Trace.h deleted file mode 100644 index 69b80739..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Trace.h +++ /dev/null @@ -1,183 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Trace_h -#define AMF_Trace_h -#pragma once - -#include "Platform.h" -#include "Result.h" -#include "Surface.h" -#include "AudioBuffer.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // trace levels - //---------------------------------------------------------------------------------------------- - #define AMF_TRACE_ERROR 0 - #define AMF_TRACE_WARNING 1 - #define AMF_TRACE_INFO 2 // default in sdk - #define AMF_TRACE_DEBUG 3 - #define AMF_TRACE_TRACE 4 - - #define AMF_TRACE_TEST 5 - #define AMF_TRACE_NOLOG 100 - - //---------------------------------------------------------------------------------------------- - // available trace writers - //---------------------------------------------------------------------------------------------- - #define AMF_TRACE_WRITER_CONSOLE L"Console" - #define AMF_TRACE_WRITER_DEBUG_OUTPUT L"DebugOutput" - #define AMF_TRACE_WRITER_FILE L"File" - - //---------------------------------------------------------------------------------------------- - // AMFTraceWriter interface - callback - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFTraceWriter - { - public: - virtual void AMF_CDECL_CALL Write(const wchar_t* scope, const wchar_t* message) = 0; - virtual void AMF_CDECL_CALL Flush() = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFTraceWriter AMFTraceWriter; - - typedef struct AMFTraceWriterVtbl - { - // AMFTraceWriter interface - void (AMF_CDECL_CALL *Write)(AMFTraceWriter* pThis, const wchar_t* scope, const wchar_t* message); - void (AMF_CDECL_CALL *Flush)(AMFTraceWriter* pThis); - } AMFTraceWriterVtbl; - - struct AMFTraceWriter - { - const AMFTraceWriterVtbl *pVtbl; - }; - -#endif // #if defined(__cplusplus) - - //---------------------------------------------------------------------------------------------- - // AMFTrace interface - singleton - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - class AMF_NO_VTABLE AMFTrace - { - public: - virtual void AMF_STD_CALL TraceW(const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope,amf_int32 countArgs, const wchar_t* format, ...) = 0; - virtual void AMF_STD_CALL Trace(const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope, const wchar_t* message, va_list* pArglist) = 0; - - virtual amf_int32 AMF_STD_CALL SetGlobalLevel(amf_int32 level) = 0; - virtual amf_int32 AMF_STD_CALL GetGlobalLevel() = 0; - - virtual amf_bool AMF_STD_CALL EnableWriter(const wchar_t* writerID, bool enable) = 0; - virtual amf_bool AMF_STD_CALL WriterEnabled(const wchar_t* writerID) = 0; - virtual AMF_RESULT AMF_STD_CALL TraceEnableAsync(amf_bool enable) = 0; - virtual AMF_RESULT AMF_STD_CALL TraceFlush() = 0; - virtual AMF_RESULT AMF_STD_CALL SetPath(const wchar_t* path) = 0; - virtual AMF_RESULT AMF_STD_CALL GetPath(wchar_t* path, amf_size* pSize) = 0; - virtual amf_int32 AMF_STD_CALL SetWriterLevel(const wchar_t* writerID, amf_int32 level) = 0; - virtual amf_int32 AMF_STD_CALL GetWriterLevel(const wchar_t* writerID) = 0; - virtual amf_int32 AMF_STD_CALL SetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope, amf_int32 level) = 0; - virtual amf_int32 AMF_STD_CALL GetWriterLevelForScope(const wchar_t* writerID, const wchar_t* scope) = 0; - - virtual amf_int32 AMF_STD_CALL GetIndentation() = 0; - virtual void AMF_STD_CALL Indent(amf_int32 addIndent) = 0; - - virtual void AMF_STD_CALL RegisterWriter(const wchar_t* writerID, AMFTraceWriter* pWriter, amf_bool enable) = 0; - virtual void AMF_STD_CALL UnregisterWriter(const wchar_t* writerID) = 0; - - virtual const wchar_t* AMF_STD_CALL GetResultText(AMF_RESULT res) = 0; - virtual const wchar_t* AMF_STD_CALL SurfaceGetFormatName(const AMF_SURFACE_FORMAT eSurfaceFormat) = 0; - virtual AMF_SURFACE_FORMAT AMF_STD_CALL SurfaceGetFormatByName(const wchar_t* name) = 0; - - virtual const wchar_t* AMF_STD_CALL GetMemoryTypeName(const AMF_MEMORY_TYPE memoryType) = 0; - virtual AMF_MEMORY_TYPE AMF_STD_CALL GetMemoryTypeByName(const wchar_t* name) = 0; - - virtual const wchar_t* AMF_STD_CALL GetSampleFormatName(const AMF_AUDIO_FORMAT eFormat) = 0; - virtual AMF_AUDIO_FORMAT AMF_STD_CALL GetSampleFormatByName(const wchar_t* name) = 0; - }; -#else // #if defined(__cplusplus) - typedef struct AMFTrace AMFTrace; - - typedef struct AMFTraceVtbl - { - // AMFTrace interface - void (AMF_STD_CALL *TraceW)(AMFTrace* pThis, const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope,amf_int32 countArgs, const wchar_t* format, ...); - void (AMF_STD_CALL *Trace)(AMFTrace* pThis, const wchar_t* src_path, amf_int32 line, amf_int32 level, const wchar_t* scope, const wchar_t* message, va_list* pArglist); - - amf_int32 (AMF_STD_CALL *SetGlobalLevel)(AMFTrace* pThis, amf_int32 level); - amf_int32 (AMF_STD_CALL *GetGlobalLevel)(AMFTrace* pThis); - - amf_bool (AMF_STD_CALL *EnableWriter)(AMFTrace* pThis, const wchar_t* writerID, amf_bool enable); - amf_bool (AMF_STD_CALL *WriterEnabled)(AMFTrace* pThis, const wchar_t* writerID); - AMF_RESULT (AMF_STD_CALL *TraceEnableAsync)(AMFTrace* pThis, amf_bool enable); - AMF_RESULT (AMF_STD_CALL *TraceFlush)(AMFTrace* pThis); - AMF_RESULT (AMF_STD_CALL *SetPath)(AMFTrace* pThis, const wchar_t* path); - AMF_RESULT (AMF_STD_CALL *GetPath)(AMFTrace* pThis, wchar_t* path, amf_size* pSize); - amf_int32 (AMF_STD_CALL *SetWriterLevel)(AMFTrace* pThis, const wchar_t* writerID, amf_int32 level); - amf_int32 (AMF_STD_CALL *GetWriterLevel)(AMFTrace* pThis, const wchar_t* writerID); - amf_int32 (AMF_STD_CALL *SetWriterLevelForScope)(AMFTrace* pThis, const wchar_t* writerID, const wchar_t* scope, amf_int32 level); - amf_int32 (AMF_STD_CALL *GetWriterLevelForScope)(AMFTrace* pThis, const wchar_t* writerID, const wchar_t* scope); - - amf_int32 (AMF_STD_CALL *GetIndentation)(AMFTrace* pThis); - void (AMF_STD_CALL *Indent)(AMFTrace* pThis, amf_int32 addIndent); - - void (AMF_STD_CALL *RegisterWriter)(AMFTrace* pThis, const wchar_t* writerID, AMFTraceWriter* pWriter, amf_bool enable); - void (AMF_STD_CALL *UnregisterWriter)(AMFTrace* pThis, const wchar_t* writerID); - - const wchar_t* (AMF_STD_CALL *GetResultText)(AMFTrace* pThis, AMF_RESULT res); - const wchar_t* (AMF_STD_CALL *SurfaceGetFormatName)(AMFTrace* pThis, const AMF_SURFACE_FORMAT eSurfaceFormat); - AMF_SURFACE_FORMAT (AMF_STD_CALL *SurfaceGetFormatByName)(AMFTrace* pThis, const wchar_t* name); - - const wchar_t* (AMF_STD_CALL *GetMemoryTypeName)(AMFTrace* pThis, const AMF_MEMORY_TYPE memoryType); - AMF_MEMORY_TYPE (AMF_STD_CALL *GetMemoryTypeByName)(AMFTrace* pThis, const wchar_t* name); - - const wchar_t* (AMF_STD_CALL *GetSampleFormatName)(AMFTrace* pThis, const AMF_AUDIO_FORMAT eFormat); - AMF_AUDIO_FORMAT (AMF_STD_CALL *GetSampleFormatByName)(AMFTrace* pThis, const wchar_t* name); - } AMFTraceVtbl; - - struct AMFTrace - { - const AMFTraceVtbl *pVtbl; - }; - -#endif -#if defined(__cplusplus) -} -#endif - - -#endif // AMF_Trace_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Variant.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Variant.h deleted file mode 100644 index 6a51c7ab..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Variant.h +++ /dev/null @@ -1,2097 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef AMF_Variant_h -#define AMF_Variant_h -#pragma once -#if defined(_MSC_VER) - #pragma warning(disable: 4996) -#endif - -#include "Interface.h" -#include -#include -#include - -#if defined(__cplusplus) -namespace amf -{ -#endif - //---------------------------------------------------------------------------------------------- - // variant types - //---------------------------------------------------------------------------------------------- - typedef enum AMF_VARIANT_TYPE - { - AMF_VARIANT_EMPTY = 0, - - AMF_VARIANT_BOOL = 1, - AMF_VARIANT_INT64 = 2, - AMF_VARIANT_DOUBLE = 3, - - AMF_VARIANT_RECT = 4, - AMF_VARIANT_SIZE = 5, - AMF_VARIANT_POINT = 6, - AMF_VARIANT_RATE = 7, - AMF_VARIANT_RATIO = 8, - AMF_VARIANT_COLOR = 9, - - AMF_VARIANT_STRING = 10, // value is char* - AMF_VARIANT_WSTRING = 11, // value is wchar_t* - AMF_VARIANT_INTERFACE = 12, // value is AMFInterface* - AMF_VARIANT_FLOAT = 13, - - AMF_VARIANT_FLOAT_SIZE = 14, - AMF_VARIANT_FLOAT_POINT2D = 15, - AMF_VARIANT_FLOAT_POINT3D = 16, - AMF_VARIANT_FLOAT_VECTOR4D = 17 - } AMF_VARIANT_TYPE; - //---------------------------------------------------------------------------------------------- - // variant struct - //---------------------------------------------------------------------------------------------- - typedef struct AMFVariantStruct - { - AMF_VARIANT_TYPE type; - union - { - amf_bool boolValue; - amf_int64 int64Value; - amf_double doubleValue; - char* stringValue; - wchar_t* wstringValue; - AMFInterface* pInterface; - struct AMFRect rectValue; - struct AMFSize sizeValue; - struct AMFPoint pointValue; - struct AMFRate rateValue; - struct AMFRatio ratioValue; - struct AMFColor colorValue; - amf_float floatValue; - struct AMFFloatSize floatSizeValue; - struct AMFFloatPoint2D floatPoint2DValue; - struct AMFFloatPoint3D floatPoint3DValue; - struct AMFFloatVector4D floatVector4DValue; - }; - } AMFVariantStruct; - //---------------------------------------------------------------------------------------------- - // variant accessors - //---------------------------------------------------------------------------------------------- - - static AMF_INLINE AMF_VARIANT_TYPE AMF_STD_CALL AMFVariantGetType(const AMFVariantStruct* _variant) { return (_variant)->type; } -#if defined(__cplusplus) - static AMF_INLINE AMF_VARIANT_TYPE& AMF_STD_CALL AMFVariantGetType(AMFVariantStruct* _variant) { return (_variant)->type; } -#endif - static AMF_INLINE amf_bool AMF_STD_CALL AMFVariantGetBool(const AMFVariantStruct* _variant) { return (_variant)->boolValue; } - static AMF_INLINE amf_int64 AMF_STD_CALL AMFVariantGetInt64(const AMFVariantStruct* _variant) { return (_variant)->int64Value; } - static AMF_INLINE amf_double AMF_STD_CALL AMFVariantGetDouble(const AMFVariantStruct* _variant) { return (_variant)->doubleValue; } - static AMF_INLINE amf_float AMF_STD_CALL AMFVariantGetFloat(const AMFVariantStruct* _variant) { return (_variant)->floatValue; } - static AMF_INLINE const char* AMF_STD_CALL AMFVariantGetString(const AMFVariantStruct* _variant) { return (_variant)->stringValue; } - static AMF_INLINE const wchar_t* AMF_STD_CALL AMFVariantGetWString(const AMFVariantStruct* _variant) { return (_variant)->wstringValue; } -#if defined(__cplusplus) - static AMF_INLINE const AMFInterface* AMF_STD_CALL AMFVariantGetInterface(const AMFVariantStruct* _variant) { return (_variant)->pInterface; } -#endif - static AMF_INLINE AMFInterface* AMF_STD_CALL AMFVariantGetInterface(AMFVariantStruct* _variant) { return (_variant)->pInterface; } - -#if defined(__cplusplus) - static AMF_INLINE const AMFRect & AMF_STD_CALL AMFVariantGetRect (const AMFVariantStruct* _variant) { return (_variant)->rectValue; } - static AMF_INLINE const AMFSize & AMF_STD_CALL AMFVariantGetSize (const AMFVariantStruct* _variant) { return (_variant)->sizeValue; } - static AMF_INLINE const AMFPoint& AMF_STD_CALL AMFVariantGetPoint(const AMFVariantStruct* _variant) { return (_variant)->pointValue; } - static AMF_INLINE const AMFFloatSize& AMF_STD_CALL AMFVariantGetFloatSize(const AMFVariantStruct* _variant) { return (_variant)->floatSizeValue; } - static AMF_INLINE const AMFFloatPoint2D& AMF_STD_CALL AMFVariantGetFloatPoint2D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint2DValue; } - static AMF_INLINE const AMFFloatPoint3D& AMF_STD_CALL AMFVariantGetFloatPoint3D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint3DValue; } - static AMF_INLINE const AMFFloatVector4D& AMF_STD_CALL AMFVariantGetFloatVector4D(const AMFVariantStruct* _variant) { return (_variant)->floatVector4DValue; } - static AMF_INLINE const AMFRate & AMF_STD_CALL AMFVariantGetRate (const AMFVariantStruct* _variant) { return (_variant)->rateValue; } - static AMF_INLINE const AMFRatio& AMF_STD_CALL AMFVariantGetRatio(const AMFVariantStruct* _variant) { return (_variant)->ratioValue; } - static AMF_INLINE const AMFColor& AMF_STD_CALL AMFVariantGetColor(const AMFVariantStruct* _variant) { return (_variant)->colorValue; } -#else // #if defined(__cplusplus) - static AMF_INLINE AMFRect AMF_STD_CALL AMFVariantGetRect (const AMFVariantStruct* _variant) { return (_variant)->rectValue; } - static AMF_INLINE AMFSize AMF_STD_CALL AMFVariantGetSize (const AMFVariantStruct* _variant) { return (_variant)->sizeValue; } - static AMF_INLINE AMFPoint AMF_STD_CALL AMFVariantGetPoint(const AMFVariantStruct* _variant) { return (_variant)->pointValue; } - static AMF_INLINE AMFFloatSize AMF_STD_CALL AMFVariantGetFloatSize(const AMFVariantStruct* _variant) { return (_variant)->floatSizeValue; } - static AMF_INLINE AMFFloatPoint2D AMF_STD_CALL AMFVariantGetFloatPoint2D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint2DValue; } - static AMF_INLINE AMFFloatPoint3D AMF_STD_CALL AMFVariantGetFloatPoint3D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint3DValue; } - static AMF_INLINE AMFFloatVector4D AMF_STD_CALL AMFVariantGetFloatVector4D(const AMFVariantStruct* _variant) { return (_variant)->floatVector4DValue; } - static AMF_INLINE AMFRate AMF_STD_CALL AMFVariantGetRate (const AMFVariantStruct* _variant) { return (_variant)->rateValue; } - static AMF_INLINE AMFRatio AMF_STD_CALL AMFVariantGetRatio(const AMFVariantStruct* _variant) { return (_variant)->ratioValue; } - static AMF_INLINE AMFColor AMF_STD_CALL AMFVariantGetColor(const AMFVariantStruct* _variant) { return (_variant)->colorValue; } -#endif // #if defined(__cplusplus) - - - #define AMFVariantEmpty(_variant) 0 - #define AMFVariantBool(_variant) (_variant)->boolValue - #define AMFVariantInt64(_variant) (_variant)->int64Value - #define AMFVariantDouble(_variant) (_variant)->doubleValue - #define AMFVariantFloat(_variant) (_variant)->floatValue - - #define AMFVariantRect(_variant) (_variant)->rectValue - #define AMFVariantSize(_variant) (_variant)->sizeValue - #define AMFVariantPoint(_variant) (_variant)->pointValue - #define AMFVariantFloatSize(_variant) (_variant)->floatSizeValue - #define AMFVariantFloatPoint2D(_variant) (_variant)->floatPoint2DValue - #define AMFVariantFloatPoint3D(_variant) (_variant)->floatPoint3DValue - #define AMFVariantFloatVector4D(_variant) (_variant)->floatVector4DValue - #define AMFVariantRate(_variant) (_variant)->rateValue - #define AMFVariantRatio(_variant) (_variant)->ratioValue - #define AMFVariantColor(_variant) (_variant)->colorValue - - #define AMFVariantString(_variant) (_variant)->stringValue - #define AMFVariantWString(_variant) (_variant)->wstringValue - #define AMFVariantInterface(_variant) (_variant)->pInterface - //---------------------------------------------------------------------------------------------- - // variant hleper functions - //---------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantInit(AMFVariantStruct* pVariant); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantClear(AMFVariantStruct* pVariant); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantCompare(const AMFVariantStruct* pFirst, const AMFVariantStruct* pSecond, amf_bool* pEqual); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantCopy(AMFVariantStruct* pDest, const AMFVariantStruct* pSrc); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignBool(AMFVariantStruct* pDest, amf_bool value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignInt64(AMFVariantStruct* pDest, amf_int64 value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignDouble(AMFVariantStruct* pDest, amf_double value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloat(AMFVariantStruct* pDest, amf_float value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignString(AMFVariantStruct* pDest, const char* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignWString(AMFVariantStruct* pDest, const wchar_t* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignInterface(AMFVariantStruct* pDest, AMFInterface* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRect(AMFVariantStruct* pDest, const AMFRect* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignSize(AMFVariantStruct* pDest, const AMFSize* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignPoint(AMFVariantStruct* pDest, const AMFPoint* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatSize(AMFVariantStruct* pDest, const AMFFloatSize* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint2D(AMFVariantStruct* pDest, const AMFFloatPoint2D* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint3D(AMFVariantStruct* pDest, const AMFFloatPoint3D* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatVector4D(AMFVariantStruct* pDest, const AMFFloatVector4D* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRate(AMFVariantStruct* pDest, const AMFRate* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRatio(AMFVariantStruct* pDest, const AMFRatio* pValue); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignColor(AMFVariantStruct* pDest, const AMFColor* pValue); - -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRect(AMFVariantStruct* pDest, const AMFRect& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignSize(AMFVariantStruct* pDest, const AMFSize& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignPoint(AMFVariantStruct* pDest, const AMFPoint& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatSize(AMFVariantStruct* pDest, const AMFFloatSize& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint2D(AMFVariantStruct* pDest, const AMFFloatPoint2D& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint3D(AMFVariantStruct* pDest, const AMFFloatPoint3D& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatVector4D(AMFVariantStruct* pDest, const AMFFloatVector4D& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRate(AMFVariantStruct* pDest, const AMFRate& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRatio(AMFVariantStruct* pDest, const AMFRatio& value); - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignColor(AMFVariantStruct* pDest, const AMFColor& value); - - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantChangeType(AMFVariantStruct* pDest, const AMFVariantStruct* pSrc, AMF_VARIANT_TYPE newType); -#endif - static AMF_INLINE char* AMF_CDECL_CALL AMFVariantDuplicateString(const char* pFrom); - static AMF_INLINE void AMF_CDECL_CALL AMFVariantFreeString(char* pFrom); - static AMF_INLINE wchar_t* AMF_CDECL_CALL AMFVariantDuplicateWString(const wchar_t* pFrom); - static AMF_INLINE void AMF_CDECL_CALL AMFVariantFreeWString(wchar_t* pFrom); - -#if defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMF_INLINE Variant helper class - //---------------------------------------------------------------------------------------------- - class AMFVariant : public AMFVariantStruct - { - public: - class String; - class WString; - - public: - AMFVariant() { AMFVariantInit(this); } - explicit AMFVariant(const AMFVariantStruct& other) { AMFVariantInit(this); AMFVariantCopy(this, const_cast(&other)); } - - explicit AMFVariant(const AMFVariantStruct* pOther); - template - explicit AMFVariant(const AMFInterfacePtr_T& pValue); - - AMFVariant(const AMFVariant& other) { AMFVariantInit(this); AMFVariantCopy(this, const_cast(static_cast(&other))); } - - explicit AMF_INLINE AMFVariant(amf_bool value) { AMFVariantInit(this); AMFVariantAssignBool(this, value); } - explicit AMF_INLINE AMFVariant(amf_int64 value) { AMFVariantInit(this); AMFVariantAssignInt64(this, value); } - explicit AMF_INLINE AMFVariant(amf_uint64 value) { AMFVariantInit(this); AMFVariantAssignInt64(this, (amf_int64)value); } - explicit AMF_INLINE AMFVariant(amf_int32 value) { AMFVariantInit(this); AMFVariantAssignInt64(this, value); } - explicit AMF_INLINE AMFVariant(amf_uint32 value) { AMFVariantInit(this); AMFVariantAssignInt64(this, value); } - explicit AMF_INLINE AMFVariant(amf_double value) { AMFVariantInit(this); AMFVariantAssignDouble(this, value); } - explicit AMF_INLINE AMFVariant(amf_float value) { AMFVariantInit(this); AMFVariantAssignFloat(this, value); } - explicit AMF_INLINE AMFVariant(const AMFRect & value) { AMFVariantInit(this); AMFVariantAssignRect(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFSize & value) { AMFVariantInit(this); AMFVariantAssignSize(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFPoint& value) { AMFVariantInit(this); AMFVariantAssignPoint(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFFloatSize& value) { AMFVariantInit(this); AMFVariantAssignFloatSize(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFFloatPoint2D& value) { AMFVariantInit(this); AMFVariantAssignFloatPoint2D(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFFloatPoint3D& value) { AMFVariantInit(this); AMFVariantAssignFloatPoint3D(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFFloatVector4D& value) { AMFVariantInit(this); AMFVariantAssignFloatVector4D(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFRate & value) { AMFVariantInit(this); AMFVariantAssignRate(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFRatio& value) { AMFVariantInit(this); AMFVariantAssignRatio(this, &value); } - explicit AMF_INLINE AMFVariant(const AMFColor& value) { AMFVariantInit(this); AMFVariantAssignColor(this, &value); } - explicit AMF_INLINE AMFVariant(const char* pValue) { AMFVariantInit(this); AMFVariantAssignString(this, pValue); } - explicit AMF_INLINE AMFVariant(const wchar_t* pValue) { AMFVariantInit(this); AMFVariantAssignWString(this, pValue); } - explicit AMF_INLINE AMFVariant(AMFInterface* pValue) { AMFVariantInit(this); AMFVariantAssignInterface(this, pValue); } - - ~AMFVariant() { AMFVariantClear(this); } - - AMFVariant& operator=(const AMFVariantStruct& other); - AMFVariant& operator=(const AMFVariantStruct* pOther); - AMFVariant& operator=(const AMFVariant& other); - - AMFVariant& operator=(amf_bool value) { AMFVariantAssignBool(this, value); return *this;} - AMFVariant& operator=(amf_int64 value) { AMFVariantAssignInt64(this, value); return *this;} - AMFVariant& operator=(amf_uint64 value) { AMFVariantAssignInt64(this, (amf_int64)value); return *this;} - AMFVariant& operator=(amf_int32 value) { AMFVariantAssignInt64(this, value); return *this;} - AMFVariant& operator=(amf_uint32 value) { AMFVariantAssignInt64(this, value); return *this;} - AMFVariant& operator=(amf_double value) { AMFVariantAssignDouble(this, value); return *this;} - AMFVariant& operator=(amf_float value) { AMFVariantAssignFloat(this, value); return *this; } - AMFVariant& operator=(const AMFRect & value) { AMFVariantAssignRect(this, &value); return *this;} - AMFVariant& operator=(const AMFSize & value) { AMFVariantAssignSize(this, &value); return *this;} - AMFVariant& operator=(const AMFPoint& value) { AMFVariantAssignPoint(this, &value); return *this;} - AMFVariant& operator=(const AMFFloatSize& value) { AMFVariantAssignFloatSize(this, &value); return *this; } - AMFVariant& operator=(const AMFFloatPoint2D& value) { AMFVariantAssignFloatPoint2D(this, &value); return *this; } - AMFVariant& operator=(const AMFFloatPoint3D& value) { AMFVariantAssignFloatPoint3D(this, &value); return *this; } - AMFVariant& operator=(const AMFFloatVector4D& value) { AMFVariantAssignFloatVector4D(this, &value); return *this; } - AMFVariant& operator=(const AMFRate & value) { AMFVariantAssignRate(this, &value); return *this;} - AMFVariant& operator=(const AMFRatio& value) { AMFVariantAssignRatio(this, &value); return *this;} - AMFVariant& operator=(const AMFColor& value) { AMFVariantAssignColor(this, &value); return *this;} - AMFVariant& operator=(const char* pValue) { AMFVariantAssignString(this, pValue); return *this;} - AMFVariant& operator=(const wchar_t* pValue) { AMFVariantAssignWString(this, pValue); return *this;} - AMFVariant& operator=(AMFInterface* pValue) { AMFVariantAssignInterface(this, pValue); return *this;} - - template AMFVariant& operator=(const AMFInterfacePtr_T& value); - - operator amf_bool() const { return ToBool(); } - operator amf_int64() const { return ToInt64(); } - operator amf_uint64() const { return ToUInt64(); } - operator amf_int32() const { return ToInt32(); } - operator amf_uint32() const { return ToUInt32(); } - operator amf_double() const { return ToDouble(); } - operator amf_float() const { return ToFloat(); } - operator AMFRect () const { return ToRect (); } - operator AMFSize () const { return ToSize (); } - operator AMFPoint() const { return ToPoint(); } - operator AMFFloatSize() const { return ToFloatSize(); } - operator AMFFloatPoint2D() const { return ToFloatPoint2D(); } - operator AMFFloatPoint3D() const { return ToFloatPoint3D(); } - operator AMFFloatVector4D() const { return ToFloatVector4D(); } - operator AMFRate () const { return ToRate (); } - operator AMFRatio() const { return ToRatio(); } - operator AMFColor() const { return ToColor(); } - operator AMFInterface*() const { return ToInterface(); } - - AMF_INLINE amf_bool ToBool() const { return Empty() ? false : GetValue(AMFVariantGetBool); } - AMF_INLINE amf_int64 ToInt64() const { return Empty() ? 0 : GetValue(AMFVariantGetInt64); } - AMF_INLINE amf_uint64 ToUInt64() const { return Empty() ? 0 : GetValue(AMFVariantGetInt64); } - AMF_INLINE amf_int32 ToInt32() const { return Empty() ? 0 : GetValue(AMFVariantGetInt64); } - AMF_INLINE amf_uint32 ToUInt32() const { return Empty() ? 0 : GetValue(AMFVariantGetInt64); } - AMF_INLINE amf_double ToDouble() const { return Empty() ? 0 : GetValue(AMFVariantGetDouble); } - AMF_INLINE amf_float ToFloat() const { return Empty() ? 0 : GetValue(AMFVariantGetFloat); } - AMF_INLINE AMFRect ToRect () const { return Empty() ? AMFRect() : GetValue(AMFVariantGetRect); } - AMF_INLINE AMFSize ToSize () const { return Empty() ? AMFSize() : GetValue(AMFVariantGetSize); } - AMF_INLINE AMFPoint ToPoint() const { return Empty() ? AMFPoint() : GetValue(AMFVariantGetPoint); } - AMF_INLINE AMFFloatSize ToFloatSize() const { return Empty() ? AMFFloatSize() : GetValue(AMFVariantGetFloatSize); } - AMF_INLINE AMFFloatPoint2D ToFloatPoint2D() const { return Empty() ? AMFFloatPoint2D() : GetValue(AMFVariantGetFloatPoint2D); } - AMF_INLINE AMFFloatPoint3D ToFloatPoint3D() const { return Empty() ? AMFFloatPoint3D() : GetValue(AMFVariantGetFloatPoint3D); } - AMF_INLINE AMFFloatVector4D ToFloatVector4D() const { return Empty() ? AMFFloatVector4D() : GetValue(AMFVariantGetFloatVector4D); } - AMF_INLINE AMFRate ToRate () const { return Empty() ? AMFRate() : GetValue(AMFVariantGetRate); } - AMF_INLINE AMFRatio ToRatio() const { return Empty() ? AMFRatio() : GetValue(AMFVariantGetRatio); } - AMF_INLINE AMFColor ToColor() const { return Empty() ? AMFColor() : GetValue(AMFVariantGetColor); } - AMF_INLINE AMFInterface* ToInterface() const { return AMFVariantGetType(this) == AMF_VARIANT_INTERFACE ? this->pInterface : nullptr; } - AMF_INLINE String ToString() const; - AMF_INLINE WString ToWString() const; - - bool operator==(const AMFVariantStruct& other) const; - bool operator==(const AMFVariantStruct* pOther) const; - - bool operator!=(const AMFVariantStruct& other) const; - bool operator!=(const AMFVariantStruct* pOther) const; - - void Clear() { AMFVariantClear(this); } - - void Attach(AMFVariantStruct& variant); - AMFVariantStruct Detach(); - - AMFVariantStruct& GetVariant(); - - void ChangeType(AMF_VARIANT_TYPE type, const AMFVariant* pSrc = nullptr); - - bool Empty() const; - private: - template - ReturnType GetValue(Getter getter) const; - }; - //---------------------------------------------------------------------------------------------- - // helper String class - //---------------------------------------------------------------------------------------------- - class AMFVariant::String - { - friend class AMFVariant; - private: - void Free() - { - if (m_Str != nullptr) - { - AMFVariantFreeString(m_Str); - m_Str = nullptr; - } - } - public: - String() :m_Str(nullptr){} - String(const char* str) : m_Str(nullptr) - { - m_Str = AMFVariantDuplicateString(str); - } - String(const String& p_other) : m_Str(nullptr) - { - operator=(p_other); - } - -#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600) -#pragma warning (push) -#pragma warning (disable : 26439) //This kind of function may not throw. Declare it 'noexcept'. - String(String&& p_other) : m_Str(nullptr) - { - operator=(p_other); - } -#endif - ~String() - { - Free(); - } - - char& operator[](size_t index) - { - if (index >= size()) - { - resize(index); - } - return m_Str[index]; - } - - String& operator=(const String& p_other) - { - Free(); - m_Str = AMFVariantDuplicateString(p_other.m_Str); - return *this; - } -#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600) - String& operator=(String&& p_other) - { - Free(); - m_Str = p_other.m_Str; - p_other.m_Str = nullptr; // Transfer the ownership - return *this; - } -#endif - bool operator==(const String& p_other) const - { - if (m_Str == nullptr && p_other.m_Str == nullptr) - { - return true; - } - else if ((m_Str == nullptr && p_other.m_Str != nullptr) || (m_Str != nullptr && p_other.m_Str == nullptr)) - { - return false; - } - return strcmp(c_str(), p_other.c_str()) == 0; - } - const char* c_str() const { return m_Str; } - size_t size() const - { - if (m_Str == nullptr) - { - return 0; - } - return (size_t)strlen(m_Str); - } - - AMF_INLINE size_t length() const { return size(); } - - void resize(size_t sizeAlloc) - { - if (sizeAlloc == 0) - { - Free(); - return; - } - char* str = (char*)amf_variant_alloc(sizeof(char)*(sizeAlloc + 1)); - if (m_Str != nullptr) - { - size_t copySize = sizeAlloc; - if (copySize > size()) - { - copySize = size(); - } - memcpy(str, m_Str, copySize * sizeof(char)); - Free(); - str[sizeAlloc] = 0; - } - m_Str = str; - } - private: - char* m_Str; - }; - //---------------------------------------------------------------------------------------------- - // helper WString class - //---------------------------------------------------------------------------------------------- - class AMFVariant::WString - { - friend class AMFVariant; - private: - void Free() - { - if (m_Str != nullptr) - { - AMFVariantFreeWString(m_Str); - m_Str = nullptr; - } - } - public: - WString() :m_Str(nullptr){} - WString(const wchar_t* str) : m_Str(nullptr) - { - m_Str = AMFVariantDuplicateWString(str); - } - WString(const WString& p_other) : m_Str(nullptr) - { - operator=(p_other); - } -#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600) - WString(WString&& p_other) : m_Str(nullptr) - { - operator=(p_other); - } -#endif - ~WString() - { - Free(); - } - - WString& operator=(const WString& p_other) - { - Free(); - m_Str = AMFVariantDuplicateWString(p_other.m_Str); - return *this; - } -#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600) - WString& operator=(WString&& p_other) - { - Free(); - m_Str = p_other.m_Str; - p_other.m_Str = nullptr; // Transfer the ownership - return *this; - } -#pragma warning (pop) -#endif - wchar_t& operator[](size_t index) - { - if (index >= size()) - { - resize(index); - } - return m_Str[index]; - } - - bool operator==(const WString& p_other) const - { - if (m_Str == nullptr && p_other.m_Str == nullptr) - { - return true; - } - else if ((m_Str == nullptr && p_other.m_Str != nullptr) || (m_Str != nullptr && p_other.m_Str == nullptr)) - { - return false; - } - return wcscmp(c_str(), p_other.c_str()) == 0; - } - - const wchar_t* c_str() const { return m_Str; } - size_t size() const - { - if (m_Str == nullptr) - { - return 0; - } - return (size_t)wcslen(m_Str); - } - - AMF_INLINE size_t length() const { return size(); } - - void resize(size_t sizeAlloc) - { - if (sizeAlloc == 0) - { - Free(); - return; - } - wchar_t* str = (wchar_t*)amf_variant_alloc(sizeof(wchar_t)*(sizeAlloc + 1)); - if (m_Str != nullptr) - { - size_t copySize = sizeAlloc; - if (copySize > size()) - { - copySize = size(); - } - memcpy(str, m_Str, copySize * sizeof(wchar_t)); - Free(); - str[sizeAlloc] = 0; - } - m_Str = str; - } - private: - wchar_t* m_Str; - }; - //------------------------------------------------------------------------------------------------- - AMFVariant::String AMFVariant::ToString() const - { - String temp = GetValue(AMFVariantGetString); - return String(temp.c_str()); - } - //------------------------------------------------------------------------------------------------- - AMFVariant::WString AMFVariant::ToWString() const - { - WString temp = GetValue(AMFVariantGetWString); - return WString(temp.c_str()); - } -#endif // defined(__cplusplus) - //---------------------------------------------------------------------------------------------- - // AMF_INLINE implementation of helper functions - //---------------------------------------------------------------------------------------------- - #define AMF_VARIANT_RETURN_IF_INVALID_POINTER(p) \ - { \ - if (p == NULL) \ - { \ - return AMF_INVALID_POINTER; \ - } \ - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantInit(AMFVariantStruct* pVariant) - { - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pVariant); - pVariant->type = AMF_VARIANT_EMPTY; - return AMF_OK; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantClear(AMFVariantStruct* pVariant) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pVariant); - - switch (AMFVariantGetType(pVariant)) - { - case AMF_VARIANT_STRING: - amf_variant_free(AMFVariantString(pVariant)); - pVariant->type = AMF_VARIANT_EMPTY; - break; - - case AMF_VARIANT_WSTRING: - amf_variant_free(AMFVariantWString(pVariant)); - pVariant->type = AMF_VARIANT_EMPTY; - break; - - case AMF_VARIANT_INTERFACE: - if (AMFVariantInterface(pVariant) != NULL) - { -#if defined(__cplusplus) - AMFVariantInterface(pVariant)->Release(); -#else - AMFVariantInterface(pVariant)->pVtbl->Release(AMFVariantInterface(pVariant)); -#endif - AMFVariantInterface(pVariant) = NULL; - } - pVariant->type = AMF_VARIANT_EMPTY; - break; - - default: - pVariant->type = AMF_VARIANT_EMPTY; - break; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantCompare(const AMFVariantStruct* pFirst, const AMFVariantStruct* pSecond, amf_bool* pEqual) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pFirst); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pSecond); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pEqual); - - if (pFirst == pSecond) - { - *pEqual = true; - } - else if (AMFVariantGetType(pFirst) != AMFVariantGetType(pSecond)) - { - *pEqual = false; - } - else - { - switch (AMFVariantGetType(pFirst)) - { - case AMF_VARIANT_EMPTY: - *pEqual = true; - break; - case AMF_VARIANT_BOOL: - *pEqual = AMFVariantGetBool(pFirst) == AMFVariantBool(pSecond); - break; - case AMF_VARIANT_INT64: - *pEqual = AMFVariantGetInt64(pFirst) == AMFVariantInt64(pSecond); - break; - case AMF_VARIANT_DOUBLE: - *pEqual = AMFVariantGetDouble(pFirst) == AMFVariantDouble(pSecond); - break; - case AMF_VARIANT_FLOAT: - *pEqual = AMFVariantGetFloat(pFirst) == AMFVariantFloat(pSecond); - break; - case AMF_VARIANT_RECT: -#if defined(__cplusplus) - *pEqual = AMFVariantGetRect(pFirst) == AMFVariantGetRect(pSecond); -#else - *pEqual = memcmp(&pFirst->rectValue, &pSecond->rectValue, sizeof(AMFRect)) == 0; -#endif - break; - case AMF_VARIANT_SIZE: -#if defined(__cplusplus) - *pEqual = AMFVariantGetSize(pFirst) == AMFVariantGetSize(pSecond); -#else - *pEqual = memcmp(&pFirst->sizeValue, &pSecond->sizeValue, sizeof(AMFSize)) == 0; -#endif - break; - case AMF_VARIANT_POINT: -#if defined(__cplusplus) - *pEqual = AMFVariantGetPoint(pFirst) == AMFVariantGetPoint(pSecond); -#else - *pEqual = memcmp(&pFirst->pointValue, &pSecond->pointValue, sizeof(AMFPoint)) == 0; -#endif - break; - case AMF_VARIANT_FLOAT_SIZE: -#if defined(__cplusplus) - *pEqual = AMFVariantGetFloatSize(pFirst) == AMFVariantGetFloatSize(pSecond); -#else - *pEqual = memcmp(&pFirst->floatSizeValue, &pSecond->floatSizeValue, sizeof(AMFFloatPoint2D)) == 0; -#endif - break; - case AMF_VARIANT_FLOAT_POINT2D: -#if defined(__cplusplus) - *pEqual = AMFVariantGetFloatPoint2D(pFirst) == AMFVariantGetFloatPoint2D(pSecond); -#else - *pEqual = memcmp(&pFirst->floatPoint2DValue, &pSecond->floatPoint2DValue, sizeof(AMFFloatPoint2D)) == 0; -#endif - break; - case AMF_VARIANT_FLOAT_POINT3D: -#if defined(__cplusplus) - *pEqual = AMFVariantGetFloatPoint3D(pFirst) == AMFVariantGetFloatPoint3D(pSecond); -#else - *pEqual = memcmp(&pFirst->floatPoint3DValue, &pSecond->floatPoint3DValue, sizeof(AMFFloatPoint3D)) == 0; -#endif - break; - case AMF_VARIANT_FLOAT_VECTOR4D: -#if defined(__cplusplus) - *pEqual = AMFVariantGetFloatVector4D(pFirst) == AMFVariantGetFloatVector4D(pSecond); -#else - *pEqual = memcmp(&pFirst->floatVector4DValue, &pSecond->floatVector4DValue, sizeof(AMFFloatPoint3D)) == 0; -#endif - break; - case AMF_VARIANT_RATE: -#if defined(__cplusplus) - *pEqual = AMFVariantGetRate(pFirst) == AMFVariantGetRate(pSecond); -#else - *pEqual = memcmp(&pFirst->rateValue, &pSecond->rateValue, sizeof(AMFRate)) == 0; -#endif - break; - case AMF_VARIANT_RATIO: -#if defined(__cplusplus) - *pEqual = AMFVariantGetRatio(pFirst) == AMFVariantGetRatio(pSecond); -#else - *pEqual = memcmp(&pFirst->ratioValue, &pSecond->ratioValue, sizeof(AMFRatio)) == 0; -#endif - break; - case AMF_VARIANT_COLOR: -#if defined(__cplusplus) - *pEqual = AMFVariantGetColor(pFirst) == AMFVariantGetColor(pSecond); -#else - *pEqual = memcmp(&pFirst->colorValue, &pSecond->colorValue, sizeof(AMFColor)) == 0; -#endif - break; - case AMF_VARIANT_STRING: - *pEqual = strcmp(AMFVariantString(pFirst), AMFVariantString(pSecond)) == 0; - break; - case AMF_VARIANT_WSTRING: - *pEqual = wcscmp(AMFVariantWString(pFirst), AMFVariantWString(pSecond)) == 0; - break; - case AMF_VARIANT_INTERFACE: - *pEqual = AMFVariantInterface(pFirst) == AMFVariantInterface(pSecond); - break; - default: - errRet = AMF_INVALID_ARG; - break; - } - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantCopy(AMFVariantStruct* pDest, const AMFVariantStruct* pSrc) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pSrc); - if (pDest != pSrc) - { - switch (AMFVariantGetType(pSrc)) - { - case AMF_VARIANT_EMPTY: - errRet = AMFVariantInit(pDest); - break; - case AMF_VARIANT_BOOL: - errRet = AMFVariantAssignBool(pDest, AMFVariantBool(pSrc)); - break; - case AMF_VARIANT_INT64: - errRet = AMFVariantAssignInt64(pDest, AMFVariantInt64(pSrc)); - break; - case AMF_VARIANT_DOUBLE: - errRet = AMFVariantAssignDouble(pDest, AMFVariantDouble(pSrc)); - break; - case AMF_VARIANT_FLOAT: - errRet = AMFVariantAssignFloat(pDest, AMFVariantFloat(pSrc)); - break; - case AMF_VARIANT_RECT: - errRet = AMFVariantAssignRect(pDest, &pSrc->rectValue); - break; - case AMF_VARIANT_SIZE: - errRet = AMFVariantAssignSize(pDest, &pSrc->sizeValue); - break; - case AMF_VARIANT_POINT: - errRet = AMFVariantAssignPoint(pDest, &pSrc->pointValue); - break; - case AMF_VARIANT_FLOAT_SIZE: - errRet = AMFVariantAssignFloatSize(pDest, &pSrc->floatSizeValue); - break; - case AMF_VARIANT_FLOAT_POINT2D: - errRet = AMFVariantAssignFloatPoint2D(pDest, &pSrc->floatPoint2DValue); - break; - case AMF_VARIANT_FLOAT_POINT3D: - errRet = AMFVariantAssignFloatPoint3D(pDest, &pSrc->floatPoint3DValue); - break; - case AMF_VARIANT_FLOAT_VECTOR4D: - errRet = AMFVariantAssignFloatVector4D(pDest, &pSrc->floatVector4DValue); - break; - case AMF_VARIANT_RATE: - errRet = AMFVariantAssignRate(pDest, &pSrc->rateValue); - break; - case AMF_VARIANT_RATIO: - errRet = AMFVariantAssignRatio(pDest, &pSrc->ratioValue); - break; - case AMF_VARIANT_COLOR: - errRet = AMFVariantAssignColor(pDest, &pSrc->colorValue); - break; - case AMF_VARIANT_STRING: - errRet = AMFVariantAssignString(pDest, AMFVariantString(pSrc)); - break; - case AMF_VARIANT_WSTRING: - errRet = AMFVariantAssignWString(pDest, AMFVariantWString(pSrc)); - break; - case AMF_VARIANT_INTERFACE: - errRet = AMFVariantAssignInterface(pDest, AMFVariantInterface(pSrc)); - break; - default: - errRet = AMF_INVALID_ARG; - break; - } - } - return errRet; - } - #define AMFVariantTypeEmpty AMF_VARIANT_EMPTY - - #define AMFVariantTypeBool AMF_VARIANT_BOOL - #define AMFVariantTypeInt64 AMF_VARIANT_INT64 - #define AMFVariantTypeDouble AMF_VARIANT_DOUBLE - #define AMFVariantTypeFloat AMF_VARIANT_FLOAT - - #define AMFVariantTypeRect AMF_VARIANT_RECT - #define AMFVariantTypeSize AMF_VARIANT_SIZE - #define AMFVariantTypePoint AMF_VARIANT_POINT - #define AMFVariantTypeFloatPoint2D AMF_VARIANT_FLOAT_POINT2D - #define AMFVariantTypeFloatPoint3D AMF_VARIANT_FLOAT_POINT3D - #define AMFVariantTypeFloatVector4D AMF_VARIANT_FLOAT_VECTOR4D - - #define AMFVariantTypeRate AMF_VARIANT_RATE - #define AMFVariantTypeRatio AMF_VARIANT_RATIO - #define AMFVariantTypeColor AMF_VARIANT_COLOR - - #define AMFVariantTypeString AMF_VARIANT_STRING - #define AMFVariantTypeWString AMF_VARIANT_WSTRING - #define AMFVariantTypeInterface AMF_VARIANT_INTERFACE - -#if defined(__cplusplus) - - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignString(AMFVariantStruct* pDest, const AMFVariant::String& value) - { - return AMFVariantAssignString(pDest, value.c_str()); - } - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignWString(AMFVariantStruct* pDest, const AMFVariant::WString& value) - { - return AMFVariantAssignWString(pDest, value.c_str()); - } - - static AMF_INLINE amf_bool AMFConvertEmptyToBool(void*, AMF_RESULT& res) { res = AMF_OK; return false; } - static AMF_INLINE amf_int64 AMFConvertEmptyToInt64(void*, AMF_RESULT& res) {res = AMF_OK; return 0; } - static AMF_INLINE amf_double AMFConvertEmptyToDouble(void*, AMF_RESULT& res) {res = AMF_OK; return 0; } - static AMF_INLINE amf_float AMFConvertEmptyToFloat(void*, AMF_RESULT& res) { res = AMF_OK; return 0; } - - - static AMF_INLINE AMFVariant::String AMFConvertEmptyToString(void*, AMF_RESULT& res) {res = AMF_OK; return ""; } - static AMF_INLINE AMFVariant::WString AMFConvertEmptyToWString(void*, AMF_RESULT& res) {res = AMF_OK; return L""; } - static AMF_INLINE amf_int64 AMFConvertBoolToInt64(bool value, AMF_RESULT& res){res = AMF_OK; return value ? 1 : 0;} - static AMF_INLINE amf_double AMFConvertBoolToDouble(bool value, AMF_RESULT& res){res = AMF_OK; return value ? 1.0 : 0.0;} - static AMF_INLINE amf_float AMFConvertBoolToFloat(bool value, AMF_RESULT& res) { res = AMF_OK; return value ? 1.0f : 0.0f; } - static AMF_INLINE AMFVariant::String AMFConvertBoolToString(bool value, AMF_RESULT& res){res = AMF_OK; return value ? "true" : "false";} - static AMF_INLINE AMFVariant::WString AMFConvertBoolToWString(bool value, AMF_RESULT& res){res = AMF_OK; return value ? L"true" : L"false";} - static AMF_INLINE bool AMFConvertInt64ToBool(amf_int64 value, AMF_RESULT& res){res = AMF_OK;return value != 0;} - static AMF_INLINE amf_double AMFConvertInt64ToDouble(amf_int64 value, AMF_RESULT& res){res = AMF_OK;return (amf_double)value;} - static AMF_INLINE amf_float AMFConvertInt64ToFloat(amf_int64 value, AMF_RESULT& res) { res = AMF_OK; return (amf_float)value; } - static AMF_INLINE AMFVariant::String AMFConvertInt64ToString(amf_int64 value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%" AMFPRId64, value); - return buff; - } - static AMF_INLINE AMFVariant::WString AMFConvertInt64ToWString(amf_int64 value, AMF_RESULT& res) - { - res = AMF_OK; - wchar_t buff[0xFF]; - swprintf(buff, 0xFF, L"%" LPRId64, value); - return buff; - } - - static AMF_INLINE bool AMFConvertDoubleToBool(amf_double value, AMF_RESULT& res){res = AMF_OK;return value != 0;} - static AMF_INLINE bool AMFConvertFloatToBool(amf_float value, AMF_RESULT& res) { res = AMF_OK; return value != 0; } - static AMF_INLINE amf_int64 AMFConvertDoubleToInt64(amf_double value, AMF_RESULT& res){res = AMF_OK;return amf_int64(value);} - static AMF_INLINE amf_int64 AMFConvertFloatToInt64(amf_float value, AMF_RESULT& res) { res = AMF_OK; return amf_int64(value); } - static AMF_INLINE AMFVariant::String AMFConvertDoubleToString(amf_double value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%lf", value); - return buff; - } - static AMF_INLINE AMFVariant::String AMFConvertFloatToString(amf_float value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%f", value); - return buff; - } - static AMF_INLINE AMFVariant::WString AMFConvertDoubleToWString(amf_double value, AMF_RESULT& res) - { - res = AMF_OK; - wchar_t buff[0xFF]; - swprintf(buff, 0xFF, L"%lf", value); - return buff; - } - static AMF_INLINE AMFVariant::WString AMFConvertFloatToWString(amf_float value, AMF_RESULT& res) - { - res = AMF_OK; - wchar_t buff[0xFF]; - swprintf(buff, 0xFF, L"%f", value); - return buff; - } - - static AMF_INLINE bool AMFConvertStringToBool(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFVariant::String tmp = value; - if (( tmp == "true") || ( tmp == "True") || ( tmp == "TRUE") || ( tmp == "1") ) - { - return true; - } - else - { - if (( tmp == "false") || ( tmp == "False") || ( tmp == "FALSE") || ( tmp == "0") ) - { - return false; - } - } - res = AMF_INVALID_ARG; - return false; - } - - static AMF_INLINE amf_int64 AMFConvertStringToInt64(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - amf_int64 tmp = 0; - int readElements = 0; - - if (value.size() > 2 && ( value.c_str()[0] == '0') && ( value.c_str()[1] == 'x') ) - { - readElements = sscanf(value.c_str(), "0x%" AMFPRIx64, &tmp); - } - else if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%" AMFPRId64, &tmp); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return 0; - } - - static AMF_INLINE amf_double AMFConvertStringToDouble(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - amf_double tmp = 0; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%lf", &tmp); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return 0; - } - static AMF_INLINE amf_float AMFConvertStringToFloat(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - amf_float tmp = 0; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%f", &tmp); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return 0; - } - - static AMF_INLINE AMFVariant::WString AMFConvertStringToWString(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; -// return amf_from_utf8_to_unicode(value); - AMFVariant::WString result; - if (0 == value.size()) - { - return result; - } - const char* pUtf8Buff = value.c_str(); - -#if defined(_WIN32) - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); - int UnicodeBuffSize = ::MultiByteToWideChar(CP_UTF8, 0, pUtf8Buff, -1, NULL, 0); - if (0 == UnicodeBuffSize) - { - return result; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - UnicodeBuffSize = ::MultiByteToWideChar(CP_UTF8, 0, pUtf8Buff, -1, (LPWSTR)result.c_str(), UnicodeBuffSize); - UnicodeBuffSize--; - -#elif defined(__ANDROID__) - // on android mbstowcs cannot be used to define length - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - int len = value.size(); - const char* pt = pUtf8Buff; - int UnicodeBuffSize = 0; - while (len > 0) - { - size_t length = mbrlen (pt, len, &mbs); //MM TODO Android always return 1 - if ((length == 0) || (length > len)) - { - break; - } - UnicodeBuffSize++; - len -= length; - pt += length; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - - mbrlen (NULL, 0, &mbs); - len = value.size(); - pt = pUtf8Buff; - UnicodeBuffSize = 0; - while (len > 0) - { - size_t length = mbrlen (pt, len, &mbs); - if ((length == 0) || (length > len)) - { - break; - } - mbrtowc(&((wchar_t*)(result.c_str()))[UnicodeBuffSize], pt, length, &mbs); //MM TODO Android always return 1 char - UnicodeBuffSize++; - len -= length; - pt += length; - } - setlocale(LC_CTYPE, old_locale); - - #else - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - size_t UnicodeBuffSize = mbstowcs(NULL, pUtf8Buff, 0); - if (0 == UnicodeBuffSize) - { - return result; - } - UnicodeBuffSize += 8; // get some extra space - result.resize(UnicodeBuffSize); - UnicodeBuffSize = mbstowcs((wchar_t*)result.c_str(), pUtf8Buff, UnicodeBuffSize + 1); - setlocale(LC_CTYPE, old_locale); -#endif - result.resize(UnicodeBuffSize); - return result; - } - static AMF_INLINE AMFVariant::String AMFConvertWStringToString(const AMFVariant::WString& value, AMF_RESULT& res) - { - res = AMF_OK; -// return amf_from_unicode_to_utf8(value); - AMFVariant::String result; - if (0 == value.size()) - { - return result; - } - - const wchar_t* pwBuff = value.c_str(); - -#if defined(_WIN32) - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); - int Utf8BuffSize = ::WideCharToMultiByte(CP_UTF8, 0, pwBuff, -1, NULL, 0, NULL, NULL); - if (0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - Utf8BuffSize = ::WideCharToMultiByte(CP_UTF8, 0, pwBuff, -1, (LPSTR)result.c_str(), Utf8BuffSize, NULL, NULL); - Utf8BuffSize--; -#elif defined(__ANDROID__) - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - int Utf8BuffSize = value.length(); - if (0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - - mbstate_t mbs; - mbrlen(NULL, 0, &mbs); - - Utf8BuffSize = 0; - for (int i = 0; i < value.length(); i++) - { - //MM TODO Android - not implemented - //int written = wcrtomb(&result[Utf8BuffSize], pwBuff[i], &mbs); - ((char*)(result.c_str()))[Utf8BuffSize] = (char)(pwBuff[i]); - int written = 1; - // temp replacement - Utf8BuffSize += written; - } - setlocale(LC_CTYPE, old_locale); - -#else - char* old_locale = setlocale(LC_CTYPE, "en_US.UTF8"); - size_t Utf8BuffSize = wcstombs(NULL, pwBuff, 0); - if (0 == Utf8BuffSize) - { - return result; - } - Utf8BuffSize += 8; // get some extra space - result.resize(Utf8BuffSize); - Utf8BuffSize = wcstombs((char*)result.c_str(), pwBuff, Utf8BuffSize + 1); - - setlocale(LC_CTYPE, old_locale); -#endif - result.resize(Utf8BuffSize); - return result; - } - - - static AMF_INLINE bool AMFConvertWStringToBool(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToBool(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE amf_int64 AMFConvertWStringToInt64(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToInt64(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE amf_double AMFConvertWStringToDouble(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToDouble(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE amf_float AMFConvertWStringToFloat(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToFloat(AMFConvertWStringToString(value, res), res); - } - - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertRectToString(const AMFRect& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%d,%d,%d,%d", value.left, value.top, value.right, value.bottom); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertSizeToString(const AMFSize& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%d,%d", value.width, value.height); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertPointToString(const AMFPoint& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%d,%d", value.x, value.y); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertFloatSizeToString(const AMFFloatSize& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%f,%f", value.width, value.height); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertFloatPoint2DToString(const AMFFloatPoint2D& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%f,%f", value.x, value.y); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertFloatPoint3DToString(const AMFFloatPoint3D& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%f,%f,%f", value.x, value.y, value.z); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertFloatVector4DToString(const AMFFloatVector4D& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%f,%f,%f,%f", value.x, value.y, value.z, value.w); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertRateToString(const AMFRate& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%u,%u", value.num, value.den); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertRatioToString(const AMFRatio& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%u,%u", value.num, value.den); - return buff; - } - static AMF_INLINE AMFVariant::String AMF_STD_CALL AMFConvertColorToString(const AMFColor& value, AMF_RESULT& res) - { - res = AMF_OK; - char buff[0xFF]; - sprintf(buff, "%u,%u,%u,%u", value.r, value.g, value.b, value.a); - return buff; - } - - static AMF_INLINE AMFRect AMF_STD_CALL AMFConvertStringToRect(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFRect tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%d,%d,%d,%d", &tmp.left, &tmp.top, &tmp.right, &tmp.bottom); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - - static AMF_INLINE AMFSize AMF_STD_CALL AMFConvertStringToSize(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFSize tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - if (strchr(value.c_str(), ',') != nullptr) - { - readElements = sscanf(value.c_str(), "%d,%d", &tmp.width, &tmp.height); - } - else if (strchr(value.c_str(), 'x') != nullptr) - { - readElements = sscanf(value.c_str(), "%dx%d", &tmp.width, &tmp.height); - } - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFPoint AMF_STD_CALL AMFConvertStringToPoint(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFPoint tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%d,%d", &tmp.x, &tmp.y); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFFloatSize AMF_STD_CALL AMFConvertStringToFloatSize(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFFloatSize tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%f,%f", &tmp.width, &tmp.height); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFFloatPoint2D AMF_STD_CALL AMFConvertStringToFloatPoint2D(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFFloatPoint2D tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%f,%f", &tmp.x, &tmp.y); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFFloatPoint3D AMF_STD_CALL AMFConvertStringToFloatPoint3D(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFFloatPoint3D tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%f,%f,%f", &tmp.x, &tmp.y, &tmp.z); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFFloatVector4D AMF_STD_CALL AMFConvertStringToFloatVector4D(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFFloatVector4D tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%f,%f,%f,%f", &tmp.x, &tmp.y, &tmp.z, &tmp.w); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFRate AMF_STD_CALL AMFConvertStringToRate(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFRate tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%u,%u", &tmp.num, &tmp.den); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFRatio AMF_STD_CALL AMFConvertStringToRatio(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - AMFRatio tmp = {}; - int readElements = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%u,%u", &tmp.num, &tmp.den); - } - if (readElements) - { - return tmp; - } - res = AMF_INVALID_ARG; - return tmp; - } - static AMF_INLINE AMFColor AMF_STD_CALL AMFConvertStringToColor(const AMFVariant::String& value, AMF_RESULT& res) - { - res = AMF_OK; - int readElements = 0; - amf_uint32 r = 0; - amf_uint32 g = 0; - amf_uint32 b = 0; - amf_uint32 a = 0; - if (value.size() > 0) - { - readElements = sscanf(value.c_str(), "%u,%u,%u,%u", &r, &g, &b, &a); - } - if (readElements) - { - return AMFConstructColor((amf_uint8)r, (amf_uint8)g, (amf_uint8)b, (amf_uint8)a); - } - res = AMF_INVALID_ARG; - return AMFConstructColor(0, 0, 0, 255); - } -/////////////////////// - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertRectToWString(const AMFRect& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertRectToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertSizeToWString(const AMFSize& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertSizeToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertPointToWString(const AMFPoint& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertPointToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertFloatSizeToWString(const AMFFloatSize& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertFloatSizeToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertFloatPoint2DToWString(const AMFFloatPoint2D& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertFloatPoint2DToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertFloatPoint3DToWString(const AMFFloatPoint3D& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertFloatPoint3DToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertFloatVector4DToWString(const AMFFloatVector4D& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertFloatVector4DToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertRateToWString(const AMFRate& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertRateToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertRatioToWString(const AMFRatio& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertRatioToString(value, res), res); - } - static AMF_INLINE AMFVariant::WString AMF_STD_CALL AMFConvertColorToWString(const AMFColor& value, AMF_RESULT& res) - { - return AMFConvertStringToWString(AMFConvertColorToString(value, res), res); - } - - static AMF_INLINE AMFRect AMF_STD_CALL AMFConvertWStringToRect(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToRect(AMFConvertWStringToString(value, res), res); - } - - static AMF_INLINE AMFSize AMF_STD_CALL AMFConvertWStringToSize(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToSize(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFPoint AMF_STD_CALL AMFConvertWStringToPoint(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToPoint(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFFloatSize AMF_STD_CALL AMFConvertWStringToFloatSize(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToFloatSize(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFFloatPoint2D AMF_STD_CALL AMFConvertWStringToFloatPoint2D(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToFloatPoint2D(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFFloatPoint3D AMF_STD_CALL AMFConvertWStringToFloatPoint3D(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToFloatPoint3D(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFFloatVector4D AMF_STD_CALL AMFConvertWStringToFloatVector4D(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToFloatVector4D(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFRate AMF_STD_CALL AMFConvertWStringToRate(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToRate(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFRatio AMF_STD_CALL AMFConvertWStringToRatio(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToRatio(AMFConvertWStringToString(value, res), res); - } - static AMF_INLINE AMFColor AMF_STD_CALL AMFConvertWStringToColor(const AMFVariant::WString& value, AMF_RESULT& res) - { - return AMFConvertStringToColor(AMFConvertWStringToString(value, res), res); - } - - //------------------------------------------------------------------------------------------------- - #define AMFConvertTool(srcType, dstType)\ - if (AMFVariantGetType(pSrc) == AMFVariantType##srcType && newType == AMFVariantType##dstType)\ - {\ - AMF_RESULT res = AMF_OK;\ - AMFVariantAssign##dstType(pDest, AMFConvert##srcType##To##dstType(AMFVariant##srcType(pSrc), res));\ - return res;\ - }\ - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantChangeType(AMFVariantStruct* pDest, const AMFVariantStruct* pSrc, AMF_VARIANT_TYPE newType) - { - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - - if (pSrc == nullptr) - { - pSrc = pDest; - } - - if (AMFVariantGetType(pSrc) == newType) - { - if (pDest == pSrc) - { - return AMF_OK; - } - return AMFVariantCopy(pDest, pSrc); - } - - if (pDest != pSrc) - { - AMFVariantClear(pDest); - } - - AMFConvertTool(Empty, Bool); - AMFConvertTool(Empty, Int64); - AMFConvertTool(Empty, Double); - AMFConvertTool(Empty, Float); - AMFConvertTool(Empty, String); - AMFConvertTool(Empty, WString); - - AMFConvertTool(Bool, Int64); - AMFConvertTool(Bool, Double); - AMFConvertTool(Bool, Float); - AMFConvertTool(Bool, String); - AMFConvertTool(Bool, WString); - - AMFConvertTool(Int64, Bool); - AMFConvertTool(Int64, Double); - AMFConvertTool(Int64, Float); - AMFConvertTool(Int64, String); - AMFConvertTool(Int64, WString); - - AMFConvertTool(Double, Bool); - AMFConvertTool(Double, Int64); - AMFConvertTool(Double, String); - AMFConvertTool(Double, WString); - - AMFConvertTool(Float, Bool); - AMFConvertTool(Float, Int64); - AMFConvertTool(Float, String); - AMFConvertTool(Float, WString); - - AMFConvertTool(String, Bool); - AMFConvertTool(String, Int64); - AMFConvertTool(String, Double); - AMFConvertTool(String, Float); - AMFConvertTool(String, WString); - - AMFConvertTool(WString, Bool); - AMFConvertTool(WString, Int64); - AMFConvertTool(WString, Double); - AMFConvertTool(WString, Float); - AMFConvertTool(WString, String); - - AMFConvertTool(String, Rect); - AMFConvertTool(String, Size); - AMFConvertTool(String, Point); - AMFConvertTool(String, Rate); - AMFConvertTool(String, Ratio); - AMFConvertTool(String, Color); - - AMFConvertTool(Rect , String); - AMFConvertTool(Size , String); - AMFConvertTool(Point, String); - AMFConvertTool(Rate , String); - AMFConvertTool(Ratio, String); - AMFConvertTool(Color, String); - - AMFConvertTool(WString, Rect); - AMFConvertTool(WString, Size); - AMFConvertTool(WString, Point); - AMFConvertTool(WString, Rate); - AMFConvertTool(WString, Ratio); - AMFConvertTool(WString, Color); - - AMFConvertTool(Rect , WString); - AMFConvertTool(Size , WString); - AMFConvertTool(Point, WString); - AMFConvertTool(Rate , WString); - AMFConvertTool(Ratio, WString); - AMFConvertTool(Color, WString); - - return AMF_INVALID_ARG; - } -#endif // #if defined(__cplusplus) - - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignBool(AMFVariantStruct* pDest, amf_bool value) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_BOOL; - AMFVariantBool(pDest) = value; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignInt64(AMFVariantStruct* pDest, amf_int64 value) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_INT64; - AMFVariantInt64(pDest) = value; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignDouble(AMFVariantStruct* pDest, amf_double value) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_DOUBLE; - AMFVariantDouble(pDest) = value; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloat(AMFVariantStruct* pDest, amf_float value) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_FLOAT; - AMFVariantFloat(pDest) = value; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignString(AMFVariantStruct* pDest, const char* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - const size_t size = (strlen(pValue) + 1); - pDest->type = AMF_VARIANT_STRING; - AMFVariantString(pDest) = (char*)amf_variant_alloc(size * sizeof(char)); - if (AMFVariantString(pDest)) - { - memcpy(AMFVariantString(pDest), pValue, size * sizeof(char)); - } - else - { - errRet = AMF_OUT_OF_MEMORY; - } - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignWString(AMFVariantStruct* pDest, const wchar_t* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - const size_t size = (wcslen(pValue) + 1); - pDest->type = AMF_VARIANT_WSTRING; - AMFVariantWString(pDest) = (wchar_t*)amf_variant_alloc(size * sizeof(wchar_t)); - if (AMFVariantWString(pDest)) - { - memcpy(AMFVariantWString(pDest), pValue, size * sizeof(wchar_t)); - } - else - { - errRet = AMF_OUT_OF_MEMORY; - } - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignInterface(AMFVariantStruct* pDest, AMFInterface* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - //AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue);//can be NULL - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_INTERFACE; - AMFVariantInterface(pDest) = pValue; - if (AMFVariantInterface(pDest)) - { -#if defined(__cplusplus) - AMFVariantInterface(pDest)->Acquire(); -#else - AMFVariantInterface(pDest)->pVtbl->Acquire(AMFVariantInterface(pDest)); -#endif - } - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRect(AMFVariantStruct* pDest, const AMFRect& value) - { - return AMFVariantAssignRect(pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRect (AMFVariantStruct* pDest, const AMFRect* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_RECT; - AMFVariantRect(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignSize (AMFVariantStruct* pDest, const AMFSize& value) - { - return AMFVariantAssignSize (pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignSize (AMFVariantStruct* pDest, const AMFSize* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_SIZE; - AMFVariantSize(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignPoint(AMFVariantStruct* pDest, const AMFPoint& value) - { - return AMFVariantAssignPoint(pDest, &value); - } - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatSize(AMFVariantStruct* pDest, const AMFFloatSize& value) - { - return AMFVariantAssignFloatSize(pDest, &value); - } - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint2D(AMFVariantStruct* pDest, const AMFFloatPoint2D& value) - { - return AMFVariantAssignFloatPoint2D(pDest, &value); - } - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint3D(AMFVariantStruct* pDest, const AMFFloatPoint3D& value) - { - return AMFVariantAssignFloatPoint3D(pDest, &value); - } - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatVector4D(AMFVariantStruct* pDest, const AMFFloatVector4D& value) - { - return AMFVariantAssignFloatVector4D(pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignPoint(AMFVariantStruct* pDest, const AMFPoint* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_POINT; - AMFVariantPoint(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatSize(AMFVariantStruct* pDest, const AMFFloatSize* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_FLOAT_SIZE; - AMFVariantFloatSize(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint2D(AMFVariantStruct* pDest, const AMFFloatPoint2D* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_FLOAT_POINT2D; - AMFVariantFloatPoint2D(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatPoint3D(AMFVariantStruct* pDest, const AMFFloatPoint3D* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_FLOAT_POINT3D; - AMFVariantFloatPoint3D(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignFloatVector4D(AMFVariantStruct* pDest, const AMFFloatVector4D* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_FLOAT_VECTOR4D; - AMFVariantFloatVector4D(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRate (AMFVariantStruct* pDest, const AMFRate& value) - { - return AMFVariantAssignRate (pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRate (AMFVariantStruct* pDest, const AMFRate* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_RATE; - AMFVariantRate(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRatio(AMFVariantStruct* pDest, const AMFRatio& value) - { - return AMFVariantAssignRatio(pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignRatio(AMFVariantStruct* pDest, const AMFRatio* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_RATIO; - AMFVariantRatio(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignColor(AMFVariantStruct* pDest, const AMFColor& value) - { - return AMFVariantAssignColor(pDest, &value); - } -#endif - //------------------------------------------------------------------------------------------------- - static AMF_INLINE AMF_RESULT AMF_CDECL_CALL AMFVariantAssignColor(AMFVariantStruct* pDest, const AMFColor* pValue) - { - AMF_RESULT errRet = AMF_OK; - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pDest); - AMF_VARIANT_RETURN_IF_INVALID_POINTER(pValue); - - errRet = AMFVariantInit(pDest); - if (errRet == AMF_OK) - { - pDest->type = AMF_VARIANT_COLOR; - AMFVariantColor(pDest) = *pValue; - } - return errRet; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE char* AMF_CDECL_CALL AMFVariantDuplicateString(const char* pFrom) - { - char* ret = 0; - if (pFrom) - { - ret = (char*)amf_variant_alloc(sizeof(char)*(strlen(pFrom) + 1)); - if (ret) - { - strcpy(ret, pFrom); - } - } - return ret; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE void AMF_CDECL_CALL AMFVariantFreeString(char* pFrom) - { - amf_variant_free(pFrom); - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE wchar_t* AMF_CDECL_CALL AMFVariantDuplicateWString(const wchar_t* pFrom) - { - wchar_t* ret = 0; - if (pFrom) - { - ret = (wchar_t*)amf_variant_alloc(sizeof(wchar_t)*(wcslen(pFrom) + 1)); - if (ret) - { - wcscpy(ret, pFrom); - } - } - return ret; - } - //------------------------------------------------------------------------------------------------- - static AMF_INLINE void AMF_CDECL_CALL AMFVariantFreeWString(wchar_t* pFrom) - { - amf_variant_free(pFrom); - } - //---------------------------------------------------------------------------------------------- - // AMF_INLINE implementation of AMFVariant class - //---------------------------------------------------------------------------------------------- -#if defined(__cplusplus) - AMF_INLINE AMFVariant::AMFVariant(const AMFVariantStruct* pOther) - { - AMFVariantInit(this); - if (pOther != nullptr) - { - AMFVariantCopy(this, const_cast(pOther)); - } - } - //------------------------------------------------------------------------------------------------- - template - AMFVariant::AMFVariant(const AMFInterfacePtr_T& pValue) - { - AMFVariantInit(this); - AMFVariantAssignInterface(this, pValue); - } - //------------------------------------------------------------------------------------------------- - template - ReturnType AMFVariant::GetValue(Getter getter) const - { - ReturnType str = ReturnType(); - if (AMFVariantGetType(this) == variantType) - { - str = static_cast(getter(this)); - } - else - { - AMFVariant varDest; - varDest.ChangeType(variantType, this); - if (varDest.type != AMF_VARIANT_EMPTY) - { - str = static_cast(getter(&varDest)); - } - } - return str; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE AMFVariant& AMFVariant::operator=(const AMFVariantStruct& other) - { - AMFVariantClear(this); - AMFVariantCopy(this, const_cast(&other)); - return *this; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE AMFVariant& AMFVariant::operator=(const AMFVariantStruct* pOther) - { - if (pOther != nullptr) - { - AMFVariantClear(this); - AMFVariantCopy(this, const_cast(pOther)); - } - return *this; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE AMFVariant& AMFVariant::operator=(const AMFVariant& other) - { - AMFVariantClear(this); - AMFVariantCopy(this, - const_cast(static_cast(&other))); - return *this; - } - //------------------------------------------------------------------------------------------------- - template - AMFVariant& AMFVariant::operator=(const AMFInterfacePtr_T& value) - { - AMFVariantClear(this); - AMFVariantAssignInterface(this, value); - return *this; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE bool AMFVariant::operator==(const AMFVariantStruct& other) const - { - return *this == &other; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE bool AMFVariant::operator==(const AMFVariantStruct* pOther) const - { - //TODO: double check - amf_bool ret = false; - if (pOther == nullptr) - { - ret = false; - } - else - { - AMFVariantCompare(this, pOther, &ret); - } - return ret; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE bool AMFVariant::operator!=(const AMFVariantStruct& other) const - { - return !(*this == &other); - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE bool AMFVariant::operator!=(const AMFVariantStruct* pOther) const - { - return !(*this == pOther); - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE void AMFVariant::Attach(AMFVariantStruct& pVariant) - { - Clear(); - memcpy(static_cast(this), &pVariant, sizeof(pVariant)); - AMFVariantGetType(&pVariant) = AMF_VARIANT_EMPTY; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE AMFVariantStruct AMFVariant::Detach() - { - AMFVariantStruct varResult = *this; - AMFVariantGetType(this) = AMF_VARIANT_EMPTY; - return varResult; - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE AMFVariantStruct& AMFVariant::GetVariant() - { - return *static_cast(this); - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE void AMFVariant::ChangeType(AMF_VARIANT_TYPE newType, const AMFVariant* pSrc) - { - AMFVariantChangeType(this, pSrc, newType); - } - //------------------------------------------------------------------------------------------------- - AMF_INLINE bool AMFVariant::Empty() const - { - return type == AMF_VARIANT_EMPTY; - } - //------------------------------------------------------------------------------------------------- -#endif // #if defined(__cplusplus) - -#if defined(__cplusplus) -} //namespace amf -#endif - -#endif //#ifndef AMF_Variant_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Version.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Version.h deleted file mode 100644 index a4a1b5a7..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/Version.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -/** -*************************************************************************************************** -* @file Version.h -* @brief Version declaration -*************************************************************************************************** -*/ -#ifndef AMF_Version_h -#define AMF_Version_h -#pragma once - -#include "Platform.h" - -#define AMF_MAKE_FULL_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE, VERSION_BUILD_NUM) ( ((amf_uint64)(VERSION_MAJOR) << 48ull) | ((amf_uint64)(VERSION_MINOR) << 32ull) | ((amf_uint64)(VERSION_RELEASE) << 16ull) | (amf_uint64)(VERSION_BUILD_NUM)) - -#define AMF_GET_MAJOR_VERSION(x) ((x >> 48ull) & 0xFFFF) -#define AMF_GET_MINOR_VERSION(x) ((x >> 32ull) & 0xFFFF) -#define AMF_GET_SUBMINOR_VERSION(x) ((x >> 16ull) & 0xFFFF) -#define AMF_GET_BUILD_VERSION(x) ((x >> 0ull) & 0xFFFF) - -#define AMF_VERSION_MAJOR 1 -#define AMF_VERSION_MINOR 4 -#define AMF_VERSION_RELEASE 35 -#define AMF_VERSION_BUILD_NUM 0 - -#define AMF_FULL_VERSION AMF_MAKE_FULL_VERSION(AMF_VERSION_MAJOR, AMF_VERSION_MINOR, AMF_VERSION_RELEASE, AMF_VERSION_BUILD_NUM) - -#endif //#ifndef AMF_Version_h diff --git a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/VulkanAMF.h b/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/VulkanAMF.h deleted file mode 100644 index 5813ae8a..00000000 --- a/libs/hwcodec/externals/AMF_v1.4.35/amf/public/include/core/VulkanAMF.h +++ /dev/null @@ -1,119 +0,0 @@ -// -// Notice Regarding Standards. AMD does not provide a license or sublicense to -// any Intellectual Property Rights relating to any standards, including but not -// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4; -// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3 -// (collectively, the "Media Technologies"). For clarity, you will pay any -// royalties due for such third party technologies, which may include the Media -// Technologies that are owed as a result of AMD providing the Software to you. -// -// MIT license -// -// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#ifndef __VulkanAMF_h__ -#define __VulkanAMF_h__ -#pragma once -#include "Platform.h" - -#include "vulkan/vulkan.h" - -#if defined(__cplusplus) -namespace amf -{ -#endif - typedef struct AMFVulkanDevice - { - amf_size cbSizeof; // sizeof(AMFVulkanDevice) - void* pNext; // reserved for extensions - VkInstance hInstance; - VkPhysicalDevice hPhysicalDevice; - VkDevice hDevice; - } AMFVulkanDevice; - - typedef struct AMFVulkanSync - { - amf_size cbSizeof; // sizeof(AMFVulkanSync) - void* pNext; // reserved for extensions - VkSemaphore hSemaphore; // VkSemaphore; can be nullptr - amf_bool bSubmitted; // if true - wait for hSemaphore. re-submit hSemaphore if not synced by other ways and set to true - VkFence hFence; // To sync on CPU; can be nullptr. Submitted in vkQueueSubmit. If waited for hFence, null it, do not delete or reset. - } AMFVulkanSync; - - typedef struct AMFVulkanBuffer - { - amf_size cbSizeof; // sizeof(AMFVulkanBuffer) - void* pNext; // reserved for extensions - VkBuffer hBuffer; - VkDeviceMemory hMemory; - amf_int64 iSize; - amf_int64 iAllocatedSize; // for reuse - amf_uint32 eAccessFlags; // VkAccessFlagBits - amf_uint32 eUsage; // AMF_BUFFER_USAGE - amf_uint32 eAccess; // AMF_MEMORY_CPU_ACCESS - AMFVulkanSync Sync; - } AMFVulkanBuffer; - - typedef struct AMFVulkanSurface - { - amf_size cbSizeof; // sizeof(AMFVulkanSurface) - void* pNext; // reserved for extensions - // surface properties - VkImage hImage; // vulkan native image for which the surface is created - VkDeviceMemory hMemory; // memory for hImage, can be nullptr - amf_int64 iSize; // memory size - amf_uint32 eFormat; // VkFormat - amf_int32 iWidth; // image width - amf_int32 iHeight; // image height - amf_uint32 eCurrentLayout; // VkImageLayout - amf_uint32 eUsage; // AMF_SURFACE_USAGE - amf_uint32 eAccess; // AMF_MEMORY_CPU_ACCESS - AMFVulkanSync Sync; // To sync on GPU - } AMFVulkanSurface; - - typedef struct AMFVulkanSurface1 - { - amf_size cbSizeof; // sizeof(AMFVulkanSurface) - void* pNext; // reserved for extensions - // surface properties - amf_uint32 eTiling; // VkImageTiling - } AMFVulkanSurface1; - - typedef struct AMFVulkanView - { - amf_size cbSizeof; // sizeof(AMFVulkanView) - void* pNext; // reserved for extensions - // surface properties - AMFVulkanSurface *pSurface; - VkImageView hView; - amf_int32 iPlaneWidth; - amf_int32 iPlaneHeight; - amf_int32 iPlaneWidthPitch; - amf_int32 iPlaneHeightPitch; - } AMFVulkanView; - -#define AMF_CONTEXT_VULKAN_COMPUTE_QUEUE L"VulkanComputeQueue" // amf_int64; default=0; Compute queue index in range [0, (VkQueueFamilyProperties.queueCount-1)] of the compute queue family. - -#if defined(__cplusplus) -} // namespace amf -#endif -#endif // __VulkanAMF_h__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxadapter.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxadapter.h deleted file mode 100644 index 30c4fb37..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxadapter.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2019-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfxdefs.h" -#if (MFX_VERSION >= 1031) -#ifndef __MFXADAPTER_H__ -#define __MFXADAPTER_H__ - -#include "mfxstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif -mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters); -mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters); -mfxStatus MFX_CDECL MFXQueryAdaptersNumber(mfxU32* num_adapters); -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // __MFXADAPTER_H__ -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxastructures.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxastructures.h deleted file mode 100644 index 679132fc..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxastructures.h +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXASTRUCTURES_H__ -#define __MFXASTRUCTURES_H__ -#include "mfxcommon.h" - -#if !defined (__GNUC__) -#pragma warning(disable: 4201) -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* CodecId */ -enum { - MFX_CODEC_AAC =MFX_MAKEFOURCC('A','A','C',' '), - MFX_CODEC_MP3 =MFX_MAKEFOURCC('M','P','3',' ') -}; - -enum { - /* AAC Profiles & Levels */ - MFX_PROFILE_AAC_LC =2, - MFX_PROFILE_AAC_LTP =4, - MFX_PROFILE_AAC_MAIN =1, - MFX_PROFILE_AAC_SSR =3, - MFX_PROFILE_AAC_HE =5, - MFX_PROFILE_AAC_ALS =0x20, - MFX_PROFILE_AAC_BSAC =22, - MFX_PROFILE_AAC_PS =29, - - /*MPEG AUDIO*/ - MFX_AUDIO_MPEG1_LAYER1 =0x00000110, - MFX_AUDIO_MPEG1_LAYER2 =0x00000120, - MFX_AUDIO_MPEG1_LAYER3 =0x00000140, - MFX_AUDIO_MPEG2_LAYER1 =0x00000210, - MFX_AUDIO_MPEG2_LAYER2 =0x00000220, - MFX_AUDIO_MPEG2_LAYER3 =0x00000240 -}; - -/*AAC HE decoder down sampling*/ -enum { - MFX_AUDIO_AAC_HE_DWNSMPL_OFF=0, - MFX_AUDIO_AAC_HE_DWNSMPL_ON= 1 -}; - -/* AAC decoder support of PS */ -enum { - MFX_AUDIO_AAC_PS_DISABLE= 0, - MFX_AUDIO_AAC_PS_PARSER= 1, - MFX_AUDIO_AAC_PS_ENABLE_BL= 111, - MFX_AUDIO_AAC_PS_ENABLE_UR= 411 -}; - -/*AAC decoder SBR support*/ -enum { - MFX_AUDIO_AAC_SBR_DISABLE = 0, - MFX_AUDIO_AAC_SBR_ENABLE= 1, - MFX_AUDIO_AAC_SBR_UNDEF= 2 -}; - -/*AAC header type*/ -enum{ - MFX_AUDIO_AAC_ADTS= 1, - MFX_AUDIO_AAC_ADIF= 2, - MFX_AUDIO_AAC_RAW= 3, -}; - -/*AAC encoder stereo mode*/ -enum -{ - MFX_AUDIO_AAC_MONO= 0, - MFX_AUDIO_AAC_LR_STEREO= 1, - MFX_AUDIO_AAC_MS_STEREO= 2, - MFX_AUDIO_AAC_JOINT_STEREO= 3 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 CodecId; - mfxU16 CodecProfile; - mfxU16 CodecLevel; - - mfxU32 Bitrate; - mfxU32 SampleFrequency; - mfxU16 NumChannel; - mfxU16 BitPerSample; - - mfxU16 reserved1[22]; - - union { - struct { /* AAC Decoding Options */ - mfxU16 FlagPSSupportLev; - mfxU16 Layer; - mfxU16 AACHeaderDataSize; - mfxU8 AACHeaderData[64]; - }; - struct { /* AAC Encoding Options */ - mfxU16 OutputFormat; - mfxU16 StereoMode; - mfxU16 reserved2[61]; - }; - }; -} mfxAudioInfoMFX; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU16 AsyncDepth; - mfxU16 Protected; - mfxU16 reserved[14]; - - mfxAudioInfoMFX mfx; - mfxExtBuffer** ExtParam; - mfxU16 NumExtParam; -} mfxAudioParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 SuggestedInputSize; - mfxU32 SuggestedOutputSize; - mfxU32 reserved[6]; -} mfxAudioAllocRequest; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxU64 TimeStamp; /* 1/90KHz */ - mfxU16 Locked; - mfxU16 NumChannels; - mfxU32 SampleFrequency; - mfxU16 BitPerSample; - mfxU16 reserved1[7]; - - mfxU8* Data; - mfxU32 reserved2; - mfxU32 DataLength; - mfxU32 MaxLength; - - mfxU32 NumExtParam; - mfxExtBuffer **ExtParam; -} mfxAudioFrame; -MFX_PACK_END() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio++.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio++.h deleted file mode 100644 index 1abbf118..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio++.h +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXAUDIOPLUSPLUS_H -#define __MFXAUDIOPLUSPLUS_H - -#include "mfxaudio.h" - -class MFXAudioSession -{ -public: - MFXAudioSession(void) { m_session = (mfxSession) 0; } - virtual ~MFXAudioSession(void) { Close(); } - - virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) { return MFXInit(impl, ver, &m_session); } - virtual mfxStatus Close(void) - { - mfxStatus mfxRes; - mfxRes = MFXClose(m_session); m_session = (mfxSession) 0; - return mfxRes; - } - - virtual mfxStatus QueryIMPL(mfxIMPL *impl) { return MFXQueryIMPL(m_session, impl); } - virtual mfxStatus QueryVersion(mfxVersion *version) { return MFXQueryVersion(m_session, version); } - - virtual mfxStatus JoinSession(mfxSession child_session) { return MFXJoinSession(m_session, child_session);} - virtual mfxStatus DisjoinSession( ) { return MFXDisjoinSession(m_session);} - virtual mfxStatus CloneSession( mfxSession *clone) { return MFXCloneSession(m_session, clone);} - virtual mfxStatus SetPriority( mfxPriority priority) { return MFXSetPriority(m_session, priority);} - virtual mfxStatus GetPriority( mfxPriority *priority) { return MFXGetPriority(m_session, priority);} - - virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) { return MFXAudioCORE_SyncOperation(m_session, syncp, wait); } - - virtual operator mfxSession (void) { return m_session; } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - - -class MFXAudioDECODE -{ -public: - - MFXAudioDECODE(mfxSession session) { m_session = session; } - virtual ~MFXAudioDECODE(void) { Close(); } - - virtual mfxStatus Query(mfxAudioParam *in, mfxAudioParam *out) { return MFXAudioDECODE_Query(m_session, in, out); } - virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxAudioParam *par) { return MFXAudioDECODE_DecodeHeader(m_session, bs, par); } - virtual mfxStatus QueryIOSize(mfxAudioParam *par, mfxAudioAllocRequest *request) { return MFXAudioDECODE_QueryIOSize(m_session, par, request); } - virtual mfxStatus Init(mfxAudioParam *par) { return MFXAudioDECODE_Init(m_session, par); } - virtual mfxStatus Reset(mfxAudioParam *par) { return MFXAudioDECODE_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXAudioDECODE_Close(m_session); } - virtual mfxStatus GetAudioParam(mfxAudioParam *par) { return MFXAudioDECODE_GetAudioParam(m_session, par); } - virtual mfxStatus DecodeFrameAsync(mfxBitstream *bs, mfxAudioFrame *frame, mfxSyncPoint *syncp) { return MFXAudioDECODE_DecodeFrameAsync(m_session, bs, frame, syncp); } - - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - - -class MFXAudioENCODE -{ -public: - - MFXAudioENCODE(mfxSession session) { m_session = session; } - virtual ~MFXAudioENCODE(void) { Close(); } - - virtual mfxStatus Query(mfxAudioParam *in, mfxAudioParam *out) { return MFXAudioENCODE_Query(m_session, in, out); } - virtual mfxStatus QueryIOSize(mfxAudioParam *par, mfxAudioAllocRequest *request) { return MFXAudioENCODE_QueryIOSize(m_session, par, request); } - virtual mfxStatus Init(mfxAudioParam *par) { return MFXAudioENCODE_Init(m_session, par); } - virtual mfxStatus Reset(mfxAudioParam *par) { return MFXAudioENCODE_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXAudioENCODE_Close(m_session); } - virtual mfxStatus GetAudioParam(mfxAudioParam *par) { return MFXAudioENCODE_GetAudioParam(m_session, par); } - virtual mfxStatus EncodeFrameAsync(mfxAudioFrame *frame, mfxBitstream *buffer_out, mfxSyncPoint *syncp) { return MFXAudioENCODE_EncodeFrameAsync(m_session, frame, buffer_out, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio.h deleted file mode 100644 index 032fb010..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxaudio.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#ifndef __MFXAUDIO_H__ -#define __MFXAUDIO_H__ -#include "mfxsession.h" -#include "mfxastructures.h" - -#define MFX_AUDIO_VERSION_MAJOR 1 -#define MFX_AUDIO_VERSION_MINOR 15 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* AudioCORE */ -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioCORE_SyncOperation(mfxSession session, mfxSyncPoint syncp, mfxU32 wait); - -/* AudioENCODE */ -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_Query(mfxSession session, mfxAudioParam *in, mfxAudioParam *out); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_QueryIOSize(mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_Init(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_Reset(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_Close(mfxSession session); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_GetAudioParam(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioENCODE_EncodeFrameAsync(mfxSession session, mfxAudioFrame *frame, mfxBitstream *bs, mfxSyncPoint *syncp); - -/* AudioDECODE */ -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_Query(mfxSession session, mfxAudioParam *in, mfxAudioParam *out); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_DecodeHeader(mfxSession session, mfxBitstream *bs, mfxAudioParam* par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_Init(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_Reset(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_Close(mfxSession session); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_QueryIOSize(mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_GetAudioParam(mfxSession session, mfxAudioParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioDECODE_DecodeFrameAsync(mfxSession session, mfxBitstream *bs, mfxAudioFrame *frame, mfxSyncPoint *syncp); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxbrc.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxbrc.h deleted file mode 100644 index 80516c37..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxbrc.h +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2019-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXBRC_H__ -#define __MFXBRC_H__ - -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_BRC = MFX_MAKEFOURCC('E','B','R','C') -}; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { -#if (MFX_VERSION >= 1026) - mfxU32 reserved[23]; - mfxU16 SceneChange; // Frame is Scene Chg frame - mfxU16 LongTerm; // Frame is long term refrence - mfxU32 FrameCmplx; // Frame Complexity -#else - mfxU32 reserved[25]; -#endif - mfxU32 EncodedOrder; // Frame number in a sequence of reordered frames starting from encoder Init() - mfxU32 DisplayOrder; // Frame number in a sequence of frames in display order starting from last IDR - mfxU32 CodedFrameSize; // Size of frame in bytes after encoding - mfxU16 FrameType; // See FrameType enumerator - mfxU16 PyramidLayer; // B-pyramid or P-pyramid layer, frame belongs to - mfxU16 NumRecode; // Number of recodings performed for this frame - mfxU16 NumExtParam; - mfxExtBuffer** ExtParam; -} mfxBRCFrameParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxI32 QpY; // Frame-level Luma QP -#if (MFX_VERSION >= 1029) - mfxU32 InitialCpbRemovalDelay; - mfxU32 InitialCpbRemovalOffset; - mfxU32 reserved1[7]; - mfxU32 MaxFrameSize; // Max frame size in bytes (used for rePak) - mfxU8 DeltaQP[8]; // deltaQP[i] is adding to QP value while i-rePak - mfxU16 MaxNumRepak; // Max number of rePak to provide MaxFrameSize (from 0 to 8) - mfxU16 NumExtParam; - mfxExtBuffer** ExtParam; // extension buffer list -#else - mfxU32 reserved1[13]; - mfxHDL reserved2; -#endif -} mfxBRCFrameCtrl; -MFX_PACK_END() - -/* BRCStatus */ -enum { - MFX_BRC_OK = 0, // CodedFrameSize is acceptable, no further recoding/padding/skip required - MFX_BRC_BIG_FRAME = 1, // Coded frame is too big, recoding required - MFX_BRC_SMALL_FRAME = 2, // Coded frame is too small, recoding required - MFX_BRC_PANIC_BIG_FRAME = 3, // Coded frame is too big, no further recoding possible - skip frame - MFX_BRC_PANIC_SMALL_FRAME = 4 // Coded frame is too small, no further recoding possible - required padding to MinFrameSize -}; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 MinFrameSize; // Size in bytes, coded frame must be padded to when Status = MFX_BRC_PANIC_SMALL_FRAME - mfxU16 BRCStatus; // See BRCStatus enumerator - mfxU16 reserved[25]; - mfxHDL reserved1; -} mfxBRCFrameStatus; -MFX_PACK_END() - -/* Structure contains set of callbacks to perform external bit-rate control. -Can be attached to mfxVideoParam structure during encoder initialization. -Turn mfxExtCodingOption2::ExtBRC option ON to make encoder use external BRC instead of native one. */ -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - - mfxU32 reserved[14]; - mfxHDL pthis; // Pointer to user-defined BRC instance. Will be passed to each mfxExtBRC callback. - - // Initialize BRC. Will be invoked during encoder Init(). In - pthis, par. - mfxStatus (MFX_CDECL *Init) (mfxHDL pthis, mfxVideoParam* par); - - // Reset BRC. Will be invoked during encoder Reset(). In - pthis, par. - mfxStatus (MFX_CDECL *Reset) (mfxHDL pthis, mfxVideoParam* par); - - // Close BRC. Will be invoked during encoder Close(). In - pthis. - mfxStatus (MFX_CDECL *Close) (mfxHDL pthis); - - // Obtain from BRC controls required for frame encoding. - // Will be invoked BEFORE encoding of each frame. In - pthis, par; Out - ctrl. - mfxStatus (MFX_CDECL *GetFrameCtrl) (mfxHDL pthis, mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl); - - // Update BRC state and return command to continue/recode frame/do padding/skip frame. - // Will be invoked AFTER encoding of each frame. In - pthis, par, ctrl; Out - status. - mfxStatus (MFX_CDECL *Update) (mfxHDL pthis, mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl, mfxBRCFrameStatus* status); - - mfxHDL reserved1[10]; -} mfxExtBRC; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcamera.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcamera.h deleted file mode 100644 index 9af80214..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcamera.h +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXCAMERA_H__ -#define __MFXCAMERA_H__ -#include "mfxcommon.h" - -#if !defined (__GNUC__) -#pragma warning(disable: 4201) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Camera Extended Buffer Ids */ -enum { - MFX_EXTBUF_CAM_GAMMA_CORRECTION = MFX_MAKEFOURCC('C','G','A','M'), - MFX_EXTBUF_CAM_WHITE_BALANCE = MFX_MAKEFOURCC('C','W','B','L'), - MFX_EXTBUF_CAM_HOT_PIXEL_REMOVAL = MFX_MAKEFOURCC('C','H','P','R'), - MFX_EXTBUF_CAM_BLACK_LEVEL_CORRECTION = MFX_MAKEFOURCC('C','B','L','C'), - MFX_EXTBUF_CAM_VIGNETTE_CORRECTION = MFX_MAKEFOURCC('C','V','G','T'), - MFX_EXTBUF_CAM_BAYER_DENOISE = MFX_MAKEFOURCC('C','D','N','S'), - MFX_EXTBUF_CAM_COLOR_CORRECTION_3X3 = MFX_MAKEFOURCC('C','C','3','3'), - MFX_EXTBUF_CAM_PADDING = MFX_MAKEFOURCC('C','P','A','D'), - MFX_EXTBUF_CAM_PIPECONTROL = MFX_MAKEFOURCC('C','P','P','C'), - MFX_EXTBUF_CAM_FORWARD_GAMMA_CORRECTION = MFX_MAKEFOURCC('C','F','G','C'), - MFX_EXTBUF_CAM_LENS_GEOM_DIST_CORRECTION = MFX_MAKEFOURCC('C','L','G','D'), - MFX_EXTBUF_CAM_3DLUT = MFX_MAKEFOURCC('C','L','U','T'), - MFX_EXTBUF_CAM_TOTAL_COLOR_CONTROL = MFX_MAKEFOURCC('C','T','C','C'), - MFX_EXTBUF_CAM_CSC_YUV_RGB = MFX_MAKEFOURCC('C','C','Y','R') -}; - -typedef enum { - MFX_CAM_GAMMA_VALUE = 0x0001, - MFX_CAM_GAMMA_LUT = 0x0002, -} mfxCamGammaParam; - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - mfxU16 Mode; - mfxU16 reserved1; - mfxF64 GammaValue; - - mfxU16 reserved2[3]; - mfxU16 NumPoints; - mfxU16 GammaPoint[1024]; - mfxU16 GammaCorrected[1024]; - mfxU32 reserved3[4]; -} mfxExtCamGammaCorrection; -MFX_PACK_END() - -typedef enum { - MFX_CAM_WHITE_BALANCE_MANUAL = 0x0001, - MFX_CAM_WHITE_BALANCE_AUTO = 0x0002 -} mfxCamWhiteBalanceMode; - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - mfxU32 Mode; - mfxF64 R; - mfxF64 G0; - mfxF64 B; - mfxF64 G1; - mfxU32 reserved[8]; -} mfxExtCamWhiteBalance; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 R; - mfxU16 G; - mfxU16 B; - mfxU16 C; - mfxU16 M; - mfxU16 Y; - mfxU16 reserved[6]; -} mfxExtCamTotalColorControl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxF32 PreOffset[3]; - mfxF32 Matrix[3][3]; - mfxF32 PostOffset[3]; - mfxU16 reserved[30]; -} mfxExtCamCscYuvRgb; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 PixelThresholdDifference; - mfxU16 PixelCountThreshold; -} mfxExtCamHotPixelRemoval; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 R; - mfxU16 G0; - mfxU16 B; - mfxU16 G1; - mfxU32 reserved[4]; -} mfxExtCamBlackLevelCorrection; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU8 integer; - mfxU8 mantissa; -} mfxCamVignetteCorrectionElement; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxCamVignetteCorrectionElement R; - mfxCamVignetteCorrectionElement G0; - mfxCamVignetteCorrectionElement B; - mfxCamVignetteCorrectionElement G1; -} mfxCamVignetteCorrectionParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - - mfxU32 Width; - mfxU32 Height; - mfxU32 Pitch; - mfxU32 reserved[7]; - - mfxCamVignetteCorrectionParam *CorrectionMap; - -} mfxExtCamVignetteCorrection; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 Threshold; - mfxU16 reserved[27]; -} mfxExtCamBayerDenoise; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - mfxF64 CCM[3][3]; - mfxU32 reserved[4]; -} mfxExtCamColorCorrection3x3; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 Top; - mfxU16 Bottom; - mfxU16 Left; - mfxU16 Right; - mfxU32 reserved[4]; -} mfxExtCamPadding; -MFX_PACK_END() - -typedef enum { - MFX_CAM_BAYER_BGGR = 0x0000, - MFX_CAM_BAYER_RGGB = 0x0001, - MFX_CAM_BAYER_GBRG = 0x0002, - MFX_CAM_BAYER_GRBG = 0x0003 -} mfxCamBayerFormat; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 RawFormat; - mfxU16 reserved1; - mfxU32 reserved[5]; -} mfxExtCamPipeControl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct{ - mfxU16 Pixel; - mfxU16 Red; - mfxU16 Green; - mfxU16 Blue; -} mfxCamFwdGammaSegment; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[19]; - mfxU16 NumSegments; - union { - mfxCamFwdGammaSegment* Segment; - mfxU64 reserved1; - }; -} mfxExtCamFwdGamma; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxF32 a[3]; // [R, G, B] - mfxF32 b[3]; // [R, G, B] - mfxF32 c[3]; // [R, G, B] - mfxF32 d[3]; // [R, G, B] - mfxU16 reserved[36]; -} mfxExtCamLensGeomDistCorrection; -MFX_PACK_END() - -/* LUTSize */ -enum { - MFX_CAM_3DLUT17_SIZE = (17 * 17 * 17), - MFX_CAM_3DLUT33_SIZE = (33 * 33 * 33), - MFX_CAM_3DLUT65_SIZE = (65 * 65 * 65) -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 R; - mfxU16 G; - mfxU16 B; - mfxU16 Reserved; -} mfxCam3DLutEntry; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[10]; - mfxU32 Size; - union - { - mfxCam3DLutEntry* Table; - mfxU64 reserved1; - }; -} mfxExtCam3DLut; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // __MFXCAMERA_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcommon.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcommon.h deleted file mode 100644 index 0171d6d5..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxcommon.h +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) 2018-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXCOMMON_H__ -#define __MFXCOMMON_H__ -#include "mfxdefs.h" - -#if !defined (__GNUC__) -#pragma warning(disable: 4201) -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#define MFX_MAKEFOURCC(A,B,C,D) ((((int)A))+(((int)B)<<8)+(((int)C)<<16)+(((int)D)<<24)) - -/* Extended Configuration Header Structure */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 BufferId; - mfxU32 BufferSz; -} mfxExtBuffer; -MFX_PACK_END() - -/* Library initialization and deinitialization */ -typedef mfxI32 mfxIMPL; -#define MFX_IMPL_BASETYPE(x) (0x00ff & (x)) - -enum { - MFX_IMPL_AUTO = 0x0000, /* Auto Selection/In or Not Supported/Out */ - MFX_IMPL_SOFTWARE = 0x0001, /* Pure Software Implementation */ - MFX_IMPL_HARDWARE = 0x0002, /* Hardware Accelerated Implementation (default device) */ - MFX_IMPL_AUTO_ANY = 0x0003, /* Auto selection of any hardware/software implementation */ - MFX_IMPL_HARDWARE_ANY = 0x0004, /* Auto selection of any hardware implementation */ - MFX_IMPL_HARDWARE2 = 0x0005, /* Hardware accelerated implementation (2nd device) */ - MFX_IMPL_HARDWARE3 = 0x0006, /* Hardware accelerated implementation (3rd device) */ - MFX_IMPL_HARDWARE4 = 0x0007, /* Hardware accelerated implementation (4th device) */ - MFX_IMPL_RUNTIME = 0x0008, -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_IMPL_SINGLE_THREAD= 0x0009, -#endif - MFX_IMPL_VIA_ANY = 0x0100, - MFX_IMPL_VIA_D3D9 = 0x0200, - MFX_IMPL_VIA_D3D11 = 0x0300, - MFX_IMPL_VIA_VAAPI = 0x0400, - - MFX_IMPL_AUDIO = 0x8000, -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_IMPL_EXTERNAL_THREADING = 0x10000, -#endif - - MFX_IMPL_UNSUPPORTED = 0x0000 /* One of the MFXQueryIMPL returns */ -}; - -/* Version Info */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef union { - struct { - mfxU16 Minor; - mfxU16 Major; - }; - mfxU32 Version; -} mfxVersion; -MFX_PACK_END() - -/* session priority */ -typedef enum -{ - MFX_PRIORITY_LOW = 0, - MFX_PRIORITY_NORMAL = 1, - MFX_PRIORITY_HIGH = 2 - -} mfxPriority; - -typedef struct _mfxEncryptedData mfxEncryptedData; -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - union { - struct { - mfxEncryptedData* EncryptedData; - mfxExtBuffer **ExtParam; - mfxU16 NumExtParam; - }; - mfxU32 reserved[6]; - }; - mfxI64 DecodeTimeStamp; - mfxU64 TimeStamp; - mfxU8* Data; - mfxU32 DataOffset; - mfxU32 DataLength; - mfxU32 MaxLength; - - mfxU16 PicStruct; - mfxU16 FrameType; - mfxU16 DataFlag; - mfxU16 reserved2; -} mfxBitstream; -MFX_PACK_END() - -typedef struct _mfxSyncPoint *mfxSyncPoint; - -/* GPUCopy */ -enum { - MFX_GPUCOPY_DEFAULT = 0, - MFX_GPUCOPY_ON = 1, - MFX_GPUCOPY_OFF = 2 -}; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxIMPL Implementation; - mfxVersion Version; - mfxU16 ExternalThreads; - union { - struct { - mfxExtBuffer **ExtParam; - mfxU16 NumExtParam; - }; - mfxU16 reserved2[5]; - }; - mfxU16 GPUCopy; - mfxU16 reserved[21]; -} mfxInitParam; -MFX_PACK_END() - -enum { - MFX_EXTBUFF_THREADS_PARAM = MFX_MAKEFOURCC('T','H','D','P') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumThread; - mfxI32 SchedulingType; - mfxI32 Priority; - mfxU16 reserved[55]; -} mfxExtThreadsParam; -MFX_PACK_END() - -/* PlatformCodeName */ -enum { - MFX_PLATFORM_UNKNOWN = 0, - MFX_PLATFORM_SANDYBRIDGE = 1, - MFX_PLATFORM_IVYBRIDGE = 2, - MFX_PLATFORM_HASWELL = 3, - MFX_PLATFORM_BAYTRAIL = 4, - MFX_PLATFORM_BROADWELL = 5, - MFX_PLATFORM_CHERRYTRAIL = 6, - MFX_PLATFORM_SKYLAKE = 7, - MFX_PLATFORM_APOLLOLAKE = 8, - MFX_PLATFORM_KABYLAKE = 9, -#if (MFX_VERSION >= 1025) - MFX_PLATFORM_GEMINILAKE = 10, - MFX_PLATFORM_COFFEELAKE = 11, - MFX_PLATFORM_CANNONLAKE = 20, -#endif -#if (MFX_VERSION >= 1027) - MFX_PLATFORM_ICELAKE = 30, -#endif - MFX_PLATFORM_JASPERLAKE = 32, - MFX_PLATFORM_ELKHARTLAKE = 33, - MFX_PLATFORM_TIGERLAKE = 40, - MFX_PLATFORM_ROCKETLAKE = 42, - MFX_PLATFORM_ALDERLAKE_S = 43, - MFX_PLATFORM_KEEMBAY = 50, -}; - -#if (MFX_VERSION >= 1031) -typedef enum -{ - MFX_MEDIA_UNKNOWN = 0xffff, - MFX_MEDIA_INTEGRATED = 0, - MFX_MEDIA_DISCRETE = 1 -} mfxMediaAdapterType; -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 CodeName; - mfxU16 DeviceId; -#if (MFX_VERSION >= 1031) - mfxU16 MediaAdapterType; - mfxU16 reserved[13]; -#else - mfxU16 reserved[14]; -#endif -} mfxPlatform; -MFX_PACK_END() - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdefs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdefs.h deleted file mode 100644 index 2c288c7f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdefs.h +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) 2019-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXDEFS_H__ -#define __MFXDEFS_H__ - -#define MFX_VERSION_MAJOR 1 -#define MFX_VERSION_MINOR 35 - -// MFX_VERSION_NEXT is always +1 from last public release -// may be enforced by MFX_VERSION_USE_LATEST define -// if MFX_VERSION_USE_LATEST is defined MFX_VERSION is ignored - -#define MFX_VERSION_NEXT (MFX_VERSION_MAJOR * 1000 + MFX_VERSION_MINOR + 1) - -// MFX_VERSION - version of API that 'assumed' by build may be provided externally -// if it omitted then latest stable API derived from Major.Minor is assumed - - -#if !defined(MFX_VERSION) - #if defined(MFX_VERSION_USE_LATEST) - #define MFX_VERSION MFX_VERSION_NEXT - #else - #define MFX_VERSION (MFX_VERSION_MAJOR * 1000 + MFX_VERSION_MINOR) - #endif -#else - #undef MFX_VERSION_MINOR - #define MFX_VERSION_MINOR ((MFX_VERSION) % 1000) -#endif - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* In preprocessor syntax # symbol has stringize meaning, - so to expand some macro to preprocessor pragma we need to use - special compiler dependent construction */ - -#if defined(_MSC_VER) - #define MFX_PRAGMA_IMPL(x) __pragma(x) -#else - #define MFX_PRAGMA_IMPL(x) _Pragma(#x) -#endif - -#define MFX_PACK_BEGIN_X(x) MFX_PRAGMA_IMPL(pack(push, x)) -#define MFX_PACK_END() MFX_PRAGMA_IMPL(pack(pop)) - -/* The general rule for alignment is following: - - structures with pointers have 4/8 bytes alignment on 32/64 bit systems - - structures with fields of type mfxU64/mfxF64 (unsigned long long / double) - have alignment 8 bytes on 64 bit and 32 bit Windows, on Linux alignment is 4 bytes - - all the rest structures are 4 bytes aligned - - there are several exceptions: some structs which had 4-byte alignment were extended - with pointer / long type fields; such structs have 4-byte alignment to keep binary - compatibility with previously release API */ - -#define MFX_PACK_BEGIN_USUAL_STRUCT() MFX_PACK_BEGIN_X(4) - -/* 64-bit LP64 data model */ -#if defined(_WIN64) || defined(__LP64__) - #define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(8) - #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8) -/* 32-bit ILP32 data model Windows (Intel architecture) */ -#elif defined(_WIN32) || defined(_M_IX86) && !defined(__linux__) - #define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(4) - #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8) -/* 32-bit ILP32 data model Linux */ -#elif defined(__ILP32__) - #define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(4) - #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(4) -#else - #error Unknown packing -#endif - - #define __INT64 long long - #define __UINT64 unsigned long long - -#ifdef _WIN32 - #define MFX_CDECL __cdecl - #define MFX_STDCALL __stdcall -#else - #define MFX_CDECL - #define MFX_STDCALL -#endif /* _WIN32 */ - -#define MFX_INFINITE 0xFFFFFFFF - -#if !defined(MFX_DEPRECATED_OFF) && (MFX_VERSION >= 1034) -#define MFX_DEPRECATED_OFF -#endif - -#ifndef MFX_DEPRECATED_OFF - #if defined(__cplusplus) && __cplusplus >= 201402L - #define MFX_DEPRECATED [[deprecated]] - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg [[deprecated]] - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) - #elif defined(__clang__) - #define MFX_DEPRECATED __attribute__((deprecated)) - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg __attribute__((deprecated)) - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) - #elif defined(__INTEL_COMPILER) - #if (defined(_WIN32) || defined(_WIN64)) - #define MFX_DEPRECATED __declspec(deprecated) - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) __pragma(deprecated(arg)) - #elif defined(__linux__) - #define MFX_DEPRECATED __attribute__((deprecated)) - #if defined(__cplusplus) - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg __attribute__((deprecated)) - #else - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg - #endif - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) - #endif - #elif defined(_MSC_VER) && _MSC_VER > 1200 // VS 6 doesn't support deprecation - #define MFX_DEPRECATED __declspec(deprecated) - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) __pragma(deprecated(arg)) - #elif defined(__GNUC__) - #define MFX_DEPRECATED __attribute__((deprecated)) - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg __attribute__((deprecated)) - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) - #else - #define MFX_DEPRECATED - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) - #endif -#else - #define MFX_DEPRECATED - #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg - #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) -#endif - -typedef unsigned char mfxU8; -typedef char mfxI8; -typedef short mfxI16; -typedef unsigned short mfxU16; -typedef unsigned int mfxU32; -typedef int mfxI32; -#if defined( _WIN32 ) || defined ( _WIN64 ) -typedef unsigned long mfxUL32; -typedef long mfxL32; -#else -typedef unsigned int mfxUL32; -typedef int mfxL32; -#endif -typedef float mfxF32; -typedef double mfxF64; -typedef __UINT64 mfxU64; -typedef __INT64 mfxI64; -typedef void* mfxHDL; -typedef mfxHDL mfxMemId; -typedef void* mfxThreadTask; -typedef char mfxChar; - -typedef struct { - mfxI16 x; - mfxI16 y; -} mfxI16Pair; - -typedef struct { - mfxHDL first; - mfxHDL second; -} mfxHDLPair; - - -/*********************************************************************************\ -Error message -\*********************************************************************************/ -typedef enum -{ - /* no error */ - MFX_ERR_NONE = 0, /* no error */ - - /* reserved for unexpected errors */ - MFX_ERR_UNKNOWN = -1, /* unknown error. */ - - /* error codes <0 */ - MFX_ERR_NULL_PTR = -2, /* null pointer */ - MFX_ERR_UNSUPPORTED = -3, /* undeveloped feature */ - MFX_ERR_MEMORY_ALLOC = -4, /* failed to allocate memory */ - MFX_ERR_NOT_ENOUGH_BUFFER = -5, /* insufficient buffer at input/output */ - MFX_ERR_INVALID_HANDLE = -6, /* invalid handle */ - MFX_ERR_LOCK_MEMORY = -7, /* failed to lock the memory block */ - MFX_ERR_NOT_INITIALIZED = -8, /* member function called before initialization */ - MFX_ERR_NOT_FOUND = -9, /* the specified object is not found */ - MFX_ERR_MORE_DATA = -10, /* expect more data at input */ - MFX_ERR_MORE_SURFACE = -11, /* expect more surface at output */ - MFX_ERR_ABORTED = -12, /* operation aborted */ - MFX_ERR_DEVICE_LOST = -13, /* lose the HW acceleration device */ - MFX_ERR_INCOMPATIBLE_VIDEO_PARAM = -14, /* incompatible video parameters */ - MFX_ERR_INVALID_VIDEO_PARAM = -15, /* invalid video parameters */ - MFX_ERR_UNDEFINED_BEHAVIOR = -16, /* undefined behavior */ - MFX_ERR_DEVICE_FAILED = -17, /* device operation failure */ - MFX_ERR_MORE_BITSTREAM = -18, /* expect more bitstream buffers at output */ - MFX_ERR_INCOMPATIBLE_AUDIO_PARAM = -19, /* incompatible audio parameters */ - MFX_ERR_INVALID_AUDIO_PARAM = -20, /* invalid audio parameters */ - MFX_ERR_GPU_HANG = -21, /* device operation failure caused by GPU hang */ - MFX_ERR_REALLOC_SURFACE = -22, /* bigger output surface required */ - - /* warnings >0 */ - MFX_WRN_IN_EXECUTION = 1, /* the previous asynchronous operation is in execution */ - MFX_WRN_DEVICE_BUSY = 2, /* the HW acceleration device is busy */ - MFX_WRN_VIDEO_PARAM_CHANGED = 3, /* the video parameters are changed during decoding */ - MFX_WRN_PARTIAL_ACCELERATION = 4, /* SW is used */ - MFX_WRN_INCOMPATIBLE_VIDEO_PARAM = 5, /* incompatible video parameters */ - MFX_WRN_VALUE_NOT_CHANGED = 6, /* the value is saturated based on its valid range */ - MFX_WRN_OUT_OF_RANGE = 7, /* the value is out of valid range */ - MFX_WRN_FILTER_SKIPPED = 10, /* one of requested filters has been skipped */ - MFX_WRN_INCOMPATIBLE_AUDIO_PARAM = 11, /* incompatible audio parameters */ - -#if MFX_VERSION >= 1031 - /* low-delay partial output */ - MFX_ERR_NONE_PARTIAL_OUTPUT = 12, /* frame is not ready, but bitstream contains partial output */ -#endif - - /* threading statuses */ - MFX_TASK_DONE = MFX_ERR_NONE, /* task has been completed */ - MFX_TASK_WORKING = 8, /* there is some more work to do */ - MFX_TASK_BUSY = 9, /* task is waiting for resources */ - - /* plug-in statuses */ - MFX_ERR_MORE_DATA_SUBMIT_TASK = -10000, /* return MFX_ERR_MORE_DATA but submit internal asynchronous task */ - -} mfxStatus; - - -// Application -#if defined(MFX_DISPATCHER_EXPOSED_PREFIX) - -#include "mfxdispatcherprefixedfunctions.h" - -#endif // MFX_DISPATCHER_EXPOSED_PREFIX - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MFXDEFS_H__ */ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdispatcherprefixedfunctions.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdispatcherprefixedfunctions.h deleted file mode 100644 index f8237931..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxdispatcherprefixedfunctions.h +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -#ifndef __MFXDISPATCHERPREFIXEDFUNCTIONS_H__ -#define __MFXDISPATCHERPREFIXEDFUNCTIONS_H__ - -// API 1.0 functions -#define MFXInit disp_MFXInit -#define MFXClose disp_MFXClose -#define MFXQueryIMPL disp_MFXQueryIMPL -#define MFXQueryVersion disp_MFXQueryVersion - -#define MFXJoinSession disp_MFXJoinSession -#define MFXDisjoinSession disp_MFXDisjoinSession -#define MFXCloneSession disp_MFXCloneSession -#define MFXSetPriority disp_MFXSetPriority -#define MFXGetPriority disp_MFXGetPriority - -#define MFXVideoCORE_SetBufferAllocator disp_MFXVideoCORE_SetBufferAllocator -#define MFXVideoCORE_SetFrameAllocator disp_MFXVideoCORE_SetFrameAllocator -#define MFXVideoCORE_SetHandle disp_MFXVideoCORE_SetHandle -#define MFXVideoCORE_GetHandle disp_MFXVideoCORE_GetHandle -#define MFXVideoCORE_SyncOperation disp_MFXVideoCORE_SyncOperation - -#define MFXVideoENCODE_Query disp_MFXVideoENCODE_Query -#define MFXVideoENCODE_QueryIOSurf disp_MFXVideoENCODE_QueryIOSurf -#define MFXVideoENCODE_Init disp_MFXVideoENCODE_Init -#define MFXVideoENCODE_Reset disp_MFXVideoENCODE_Reset -#define MFXVideoENCODE_Close disp_MFXVideoENCODE_Close -#define MFXVideoENCODE_GetVideoParam disp_MFXVideoENCODE_GetVideoParam -#define MFXVideoENCODE_GetEncodeStat disp_MFXVideoENCODE_GetEncodeStat -#define MFXVideoENCODE_EncodeFrameAsync disp_MFXVideoENCODE_EncodeFrameAsync - -#define MFXVideoDECODE_Query disp_MFXVideoDECODE_Query -#define MFXVideoDECODE_DecodeHeader disp_MFXVideoDECODE_DecodeHeader -#define MFXVideoDECODE_QueryIOSurf disp_MFXVideoDECODE_QueryIOSurf -#define MFXVideoDECODE_Init disp_MFXVideoDECODE_Init -#define MFXVideoDECODE_Reset disp_MFXVideoDECODE_Reset -#define MFXVideoDECODE_Close disp_MFXVideoDECODE_Close -#define MFXVideoDECODE_GetVideoParam disp_MFXVideoDECODE_GetVideoParam -#define MFXVideoDECODE_GetDecodeStat disp_MFXVideoDECODE_GetDecodeStat -#define MFXVideoDECODE_SetSkipMode disp_MFXVideoDECODE_SetSkipMode -#define MFXVideoDECODE_GetPayload disp_MFXVideoDECODE_GetPayload -#define MFXVideoDECODE_DecodeFrameAsync disp_MFXVideoDECODE_DecodeFrameAsync - -#define MFXVideoVPP_Query disp_MFXVideoVPP_Query -#define MFXVideoVPP_QueryIOSurf disp_MFXVideoVPP_QueryIOSurf -#define MFXVideoVPP_Init disp_MFXVideoVPP_Init -#define MFXVideoVPP_Reset disp_MFXVideoVPP_Reset -#define MFXVideoVPP_Close disp_MFXVideoVPP_Close - -#define MFXVideoVPP_GetVideoParam disp_MFXVideoVPP_GetVideoParam -#define MFXVideoVPP_GetVPPStat disp_MFXVideoVPP_GetVPPStat -#define MFXVideoVPP_RunFrameVPPAsync disp_MFXVideoVPP_RunFrameVPPAsync - -// API 1.1 functions -#define MFXVideoUSER_Register disp_MFXVideoUSER_Register -#define MFXVideoUSER_Unregister disp_MFXVideoUSER_Unregister -#define MFXVideoUSER_ProcessFrameAsync disp_MFXVideoUSER_ProcessFrameAsync - -// API 1.10 functions - -#define MFXVideoENC_Query disp_MFXVideoENC_Query -#define MFXVideoENC_QueryIOSurf disp_MFXVideoENC_QueryIOSurf -#define MFXVideoENC_Init disp_MFXVideoENC_Init -#define MFXVideoENC_Reset disp_MFXVideoENC_Reset -#define MFXVideoENC_Close disp_MFXVideoENC_Close -#define MFXVideoENC_ProcessFrameAsync disp_MFXVideoENC_ProcessFrameAsync -#define MFXVideoVPP_RunFrameVPPAsyncEx disp_MFXVideoVPP_RunFrameVPPAsyncEx -#define MFXVideoUSER_Load disp_MFXVideoUSER_Load -#define MFXVideoUSER_UnLoad disp_MFXVideoUSER_UnLoad - -// API 1.11 functions - -#define MFXVideoPAK_Query disp_MFXVideoPAK_Query -#define MFXVideoPAK_QueryIOSurf disp_MFXVideoPAK_QueryIOSurf -#define MFXVideoPAK_Init disp_MFXVideoPAK_Init -#define MFXVideoPAK_Reset disp_MFXVideoPAK_Reset -#define MFXVideoPAK_Close disp_MFXVideoPAK_Close -#define MFXVideoPAK_ProcessFrameAsync disp_MFXVideoPAK_ProcessFrameAsync - -// API 1.13 functions - -#define MFXVideoUSER_LoadByPath disp_MFXVideoUSER_LoadByPath - -// API 1.14 functions -#define MFXInitEx disp_MFXInitEx -#define MFXDoWork disp_MFXDoWork - -// Audio library functions - -// API 1.8 functions - -#define MFXAudioCORE_SyncOperation disp_MFXAudioCORE_SyncOperation -#define MFXAudioENCODE_Query disp_MFXAudioENCODE_Query -#define MFXAudioENCODE_QueryIOSize disp_MFXAudioENCODE_QueryIOSize -#define MFXAudioENCODE_Init disp_MFXAudioENCODE_Init -#define MFXAudioENCODE_Reset disp_MFXAudioENCODE_Reset -#define MFXAudioENCODE_Close disp_MFXAudioENCODE_Close -#define MFXAudioENCODE_GetAudioParam disp_MFXAudioENCODE_GetAudioParam -#define MFXAudioENCODE_EncodeFrameAsync disp_MFXAudioENCODE_EncodeFrameAsync - -#define MFXAudioDECODE_Query disp_MFXAudioDECODE_Query -#define MFXAudioDECODE_DecodeHeader disp_MFXAudioDECODE_DecodeHeader -#define MFXAudioDECODE_Init disp_MFXAudioDECODE_Init -#define MFXAudioDECODE_Reset disp_MFXAudioDECODE_Reset -#define MFXAudioDECODE_Close disp_MFXAudioDECODE_Close -#define MFXAudioDECODE_QueryIOSize disp_MFXAudioDECODE_QueryIOSize -#define MFXAudioDECODE_GetAudioParam disp_MFXAudioDECODE_GetAudioParam -#define MFXAudioDECODE_DecodeFrameAsync disp_MFXAudioDECODE_DecodeFrameAsync - -// API 1.9 functions - -#define MFXAudioUSER_Register disp_MFXAudioUSER_Register -#define MFXAudioUSER_Unregister disp_MFXAudioUSER_Unregister -#define MFXAudioUSER_ProcessFrameAsync disp_MFXAudioUSER_ProcessFrameAsync -#define MFXAudioUSER_Load disp_MFXAudioUSER_Load -#define MFXAudioUSER_UnLoad disp_MFXAudioUSER_UnLoad - -// API 1.19 functions - -#define MFXVideoENC_GetVideoParam disp_MFXVideoENC_GetVideoParam -#define MFXVideoPAK_GetVideoParam disp_MFXVideoPAK_GetVideoParam -#define MFXVideoCORE_QueryPlatform disp_MFXVideoCORE_QueryPlatform -#define MFXVideoUSER_GetPlugin disp_MFXVideoUSER_GetPlugin - -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxenc.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxenc.h deleted file mode 100644 index 2ad30725..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxenc.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXENC_H__ -#define __MFXENC_H__ -#include "mfxdefs.h" -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct _mfxENCInput{ - mfxU32 reserved[32]; - - mfxFrameSurface1 *InSurface; - - mfxU16 NumFrameL0; - mfxFrameSurface1 **L0Surface; - mfxU16 NumFrameL1; - mfxFrameSurface1 **L1Surface; - - mfxU16 NumExtParam; - mfxExtBuffer **ExtParam; -} mfxENCInput; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct _mfxENCOutput{ - mfxU32 reserved[32]; - - mfxFrameSurface1 *OutSurface; - - mfxU16 NumExtParam; - mfxExtBuffer **ExtParam; -} mfxENCOutput; -MFX_PACK_END() - - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_Init(mfxSession session, mfxVideoParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_Reset(mfxSession session, mfxVideoParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_Close(mfxSession session); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_ProcessFrameAsync(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoENC_GetVideoParam(mfxSession session, mfxVideoParam *par); - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfei.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfei.h deleted file mode 100644 index 5eb0500b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfei.h +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXFEI_H__ -#define __MFXFEI_H__ -#include "mfxdefs.h" -#include "mfxvstructures.h" -#include "mfxpak.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 Qp; - mfxU16 LenSP; - mfxU16 SearchPath; - mfxU16 SubMBPartMask; - mfxU16 SubPelMode; - mfxU16 InterSAD; - mfxU16 IntraSAD; - mfxU16 AdaptiveSearch; - mfxU16 MVPredictor; - mfxU16 MBQp; - mfxU16 FTEnable; - mfxU16 IntraPartMask; - mfxU16 RefWidth; - mfxU16 RefHeight; - mfxU16 SearchWindow; - mfxU16 DisableMVOutput; - mfxU16 DisableStatisticsOutput; - mfxU16 Enable8x8Stat; - mfxU16 PictureType; /* Input picture type*/ - mfxU16 DownsampleInput; - - mfxU16 RefPictureType[2]; /* reference picture type, 0 -L0, 1 - L1 */ - mfxU16 DownsampleReference[2]; - mfxFrameSurface1 *RefFrame[2]; - mfxU16 reserved[28]; -} mfxExtFeiPreEncCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; /* size of allocated memory in number of macroblocks */ - mfxU16 reserved2[20]; - - struct mfxExtFeiPreEncMVPredictorsMB { - mfxI16Pair MV[2]; /* 0 for L0 and 1 for L1 */ - } *MB; -} mfxExtFeiPreEncMVPredictors; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - mfxU8 *MB; -} mfxExtFeiEncQP; -MFX_PACK_END() - -/* PreENC output */ -/* Layout is exactly the same as mfxExtFeiEncMVs, this buffer may be removed in future */ -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiPreEncMVMB { - mfxI16Pair MV[16][2]; - } *MB; -} mfxExtFeiPreEncMV; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiPreEncMBStatMB { - struct mfxExtFeiPreEncMBStatMBInter { - mfxU16 BestDistortion; - mfxU16 Mode ; - } Inter[2]; /*0 -L0, 1 - L1*/ - - mfxU16 BestIntraDistortion; - mfxU16 IntraMode ; - - mfxU16 NumOfNonZeroCoef; - mfxU16 reserved1; - mfxU32 SumOfCoef; - - mfxU32 reserved2; - - mfxU32 Variance16x16; - mfxU32 Variance8x8[4]; - mfxU32 PixelAverage16x16; - mfxU32 PixelAverage8x8[4]; - } *MB; -} mfxExtFeiPreEncMBStat; -MFX_PACK_END() - -/* 1 ENC_PAK input */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 SearchPath; - mfxU16 LenSP; - mfxU16 SubMBPartMask; - mfxU16 IntraPartMask; - mfxU16 MultiPredL0; - mfxU16 MultiPredL1; - mfxU16 SubPelMode; - mfxU16 InterSAD; - mfxU16 IntraSAD; - mfxU16 DistortionType; - mfxU16 RepartitionCheckEnable; - mfxU16 AdaptiveSearch; - mfxU16 MVPredictor; - mfxU16 NumMVPredictors[2]; - mfxU16 PerMBQp; - mfxU16 PerMBInput; - mfxU16 MBSizeCtrl; - mfxU16 RefWidth; - mfxU16 RefHeight; - mfxU16 SearchWindow; - mfxU16 ColocatedMbDistortion; - mfxU16 reserved[38]; -} mfxExtFeiEncFrameCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiEncMVPredictorsMB { - struct mfxExtFeiEncMVPredictorsMBRefIdx{ - mfxU8 RefL0: 4; - mfxU8 RefL1: 4; - } RefIdx[4]; /* index is predictor number */ - mfxU32 reserved; - mfxI16Pair MV[4][2]; /* first index is predictor number, second is 0 for L0 and 1 for L1 */ - } *MB; -} mfxExtFeiEncMVPredictors; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiEncMBCtrlMB { - mfxU32 ForceToIntra : 1; - mfxU32 ForceToSkip : 1; - mfxU32 ForceToNoneSkip : 1; -#if (MFX_VERSION >= 1025) - mfxU32 DirectBiasAdjustment : 1; - mfxU32 GlobalMotionBiasAdjustment : 1; - mfxU32 MVCostScalingFactor : 3; - - mfxU32 reserved1 : 24; -#else - mfxU32 reserved1 : 29; -#endif - mfxU32 reserved2; - mfxU32 reserved3; - - mfxU32 reserved4 : 16; - mfxU32 TargetSizeInWord : 8; - mfxU32 MaxSizeInWord : 8; - } *MB; -} mfxExtFeiEncMBCtrl; -MFX_PACK_END() - -/* 1 ENC_PAK output */ -/* Buffer holds 32 MVs per MB. MVs are located in zigzag scan order. -Number in diagram below shows location of MV in memory. -For example, MV for right top 4x4 sub block is stored in 5-th element of the array. -======================== -|| 00 | 01 || 04 | 05 || ------------------------- -|| 02 | 03 || 06 | 07 || -======================== -|| 08 | 09 || 12 | 13 || ------------------------- -|| 10 | 11 || 14 | 15 || -======================== -*/ -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiEncMVMB { - mfxI16Pair MV[16][2]; /* first index is block (4x4 pixels) number, second is 0 for L0 and 1 for L1 */ - } *MB; -} mfxExtFeiEncMV; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - struct mfxExtFeiEncMBStatMB { - mfxU16 InterDistortion[16]; - mfxU16 BestInterDistortion; - mfxU16 BestIntraDistortion; - mfxU16 ColocatedMbDistortion; - mfxU16 reserved; - mfxU32 reserved1[2]; - } *MB; -} mfxExtFeiEncMBStat; -MFX_PACK_END() - -enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PAK_OBJECT_HEADER) = 0x7149000A -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PAK_OBJECT_HEADER); - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - /* dword 0-2 */ - mfxU32 Header; /* MFX_PAK_OBJECT_HEADER */ - mfxU32 MVDataLength; - mfxU32 MVDataOffset; - - /* dword 3 */ - mfxU32 InterMbMode : 2; - mfxU32 MBSkipFlag : 1; - mfxU32 Reserved00 : 1; - mfxU32 IntraMbMode : 2; - mfxU32 Reserved01 : 1; - mfxU32 FieldMbPolarityFlag : 1; - mfxU32 MbType : 5; - mfxU32 IntraMbFlag : 1; - mfxU32 FieldMbFlag : 1; - mfxU32 Transform8x8Flag : 1; - mfxU32 Reserved02 : 1; - mfxU32 DcBlockCodedCrFlag : 1; - mfxU32 DcBlockCodedCbFlag : 1; - mfxU32 DcBlockCodedYFlag : 1; - mfxU32 MVFormat : 3; /* layout and number of MVs, 0 - no MVs, 6 - 32 MVs, the rest are reserved */ - mfxU32 Reserved03 : 8; - mfxU32 ExtendedFormat : 1; /* should be 1, specifies that LumaIntraPredModes and RefIdx are replicated for 8x8 and 4x4 block/subblock */ - - /* dword 4 */ - mfxU8 HorzOrigin; - mfxU8 VertOrigin; - mfxU16 CbpY; - - /* dword 5 */ - mfxU16 CbpCb; - mfxU16 CbpCr; - - /* dword 6 */ - mfxU32 QpPrimeY : 8; - mfxU32 Reserved30 :17; - mfxU32 MbSkipConvDisable : 1; - mfxU32 IsLastMB : 1; - mfxU32 EnableCoefficientClamp : 1; - mfxU32 Direct8x8Pattern : 4; - - union { - struct {/* Intra MBs */ - /* dword 7-8 */ - mfxU16 LumaIntraPredModes[4]; - - /* dword 9 */ - mfxU32 ChromaIntraPredMode : 2; - mfxU32 IntraPredAvailFlags : 6; - mfxU32 Reserved60 : 24; - } IntraMB; - struct {/* Inter MBs */ - /*dword 7 */ - mfxU8 SubMbShapes; - mfxU8 SubMbPredModes; - mfxU16 Reserved40; - - /* dword 8-9 */ - mfxU8 RefIdx[2][4]; /* first index is 0 for L0 and 1 for L1 */ - } InterMB; - }; - - /* dword 10 */ - mfxU16 Reserved70; - mfxU8 TargetSizeInWord; - mfxU8 MaxSizeInWord; - - mfxU32 reserved2[5]; -}mfxFeiPakMBCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 reserved2[20]; - - mfxFeiPakMBCtrl *MB; -} mfxExtFeiPakMBCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 MaxFrameSize; /* in bytes */ - mfxU32 NumPasses; /* up to 8 */ - mfxU16 reserved[8]; - mfxU8 DeltaQP[8]; /* list of delta QPs, only positive values */ -} mfxExtFeiRepackCtrl; -MFX_PACK_END() - -#if (MFX_VERSION >= 1025) -/* FEI repack status */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 NumPasses; - mfxU16 reserved[58]; -} mfxExtFeiRepackStat; -MFX_PACK_END() -#endif - -/* 1 decode stream out */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - /* dword 0 */ - mfxU32 InterMbMode : 2; - mfxU32 MBSkipFlag : 1; - mfxU32 Reserved00 : 1; - mfxU32 IntraMbMode : 2; - mfxU32 Reserved01 : 1; - mfxU32 FieldMbPolarityFlag : 1; - mfxU32 MbType : 5; - mfxU32 IntraMbFlag : 1; - mfxU32 FieldMbFlag : 1; - mfxU32 Transform8x8Flag : 1; - mfxU32 Reserved02 : 1; - mfxU32 DcBlockCodedCrFlag : 1; - mfxU32 DcBlockCodedCbFlag : 1; - mfxU32 DcBlockCodedYFlag : 1; - mfxU32 Reserved03 :12; - - /* dword 1 */ - mfxU16 HorzOrigin; - mfxU16 VertOrigin; - - /* dword 2 */ - mfxU32 CbpY :16; - mfxU32 CbpCb : 4; - mfxU32 CbpCr : 4; - mfxU32 Reserved20 : 6; - mfxU32 IsLastMB : 1; - mfxU32 ConcealMB : 1; - - /* dword 3 */ - mfxU32 QpPrimeY : 7; - mfxU32 Reserved30 : 1; - mfxU32 Reserved31 : 8; - mfxU32 NzCoeffCount : 9; - mfxU32 Reserved32 : 3; - mfxU32 Direct8x8Pattern : 4; - - /* dword 4-6 */ - union { - struct {/* Intra MBs */ - /* dword 4-5 */ - mfxU16 LumaIntraPredModes[4]; - - /* dword 6 */ - mfxU32 ChromaIntraPredMode : 2; - mfxU32 IntraPredAvailFlags : 6; - mfxU32 Reserved60 : 24; - } IntraMB; - - struct {/* Inter MBs */ - /* dword 4 */ - mfxU8 SubMbShapes; - mfxU8 SubMbPredModes; - mfxU16 Reserved40; - - /* dword 5-6 */ - mfxU8 RefIdx[2][4]; /* first index is 0 for L0 and 1 for L1 */ - } InterMB; - }; - - /* dword 7 */ - mfxU32 Reserved70; - - /* dword 8-15 */ - mfxI16Pair MV[4][2]; /* L0 - 0, L1 - 1 */ -}mfxFeiDecStreamOutMBCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[3]; - mfxU32 NumMBAlloc; - mfxU16 RemapRefIdx; /* tri-state option, default is OFF */ - mfxU16 PicStruct; - mfxU16 reserved2[18]; - - mfxFeiDecStreamOutMBCtrl *MB; -} mfxExtFeiDecStreamOut; -MFX_PACK_END() - -/* SPS, PPS, Slice Header */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 SPSId; - - mfxU16 PicOrderCntType; - mfxU16 Log2MaxPicOrderCntLsb; - mfxU16 reserved[121]; -} mfxExtFeiSPS; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 SPSId; - mfxU16 PPSId; - - mfxU16 PictureType; - mfxU16 FrameType; - mfxU16 PicInitQP; - mfxU16 NumRefIdxL0Active; - mfxU16 NumRefIdxL1Active; - mfxI16 ChromaQPIndexOffset; - mfxI16 SecondChromaQPIndexOffset; - mfxU16 Transform8x8ModeFlag; - mfxU16 reserved[114]; - - struct mfxExtFeiPpsDPB { - mfxU16 Index; /* index in mfxPAKInput::L0Surface array */ - mfxU16 PicType; - mfxI32 FrameNumWrap; - mfxU16 LongTermFrameIdx; - mfxU16 reserved[3]; - } DpbBefore[16], DpbAfter[16]; -} mfxExtFeiPPS; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 NumSlice; /* actual number of slices in the picture */ - mfxU16 reserved[11]; - - struct mfxSlice{ - mfxU16 MBAddress; - mfxU16 NumMBs; - mfxU16 SliceType; - mfxU16 PPSId; - mfxU16 IdrPicId; - - mfxU16 CabacInitIdc; - - mfxU16 NumRefIdxL0Active; - mfxU16 NumRefIdxL1Active; - - mfxI16 SliceQPDelta; - mfxU16 DisableDeblockingFilterIdc; - mfxI16 SliceAlphaC0OffsetDiv2; - mfxI16 SliceBetaOffsetDiv2; - mfxU16 reserved[20]; - - struct mfxSliceRef{ - mfxU16 PictureType; - mfxU16 Index; - mfxU16 reserved[2]; - } RefL0[32], RefL1[32]; /* index in mfxPAKInput::L0Surface array */ - - } *Slice; -}mfxExtFeiSliceHeader; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 DisableHME; /* 0 - enable, any other value means disable */ - mfxU16 DisableSuperHME; - mfxU16 DisableUltraHME; - - mfxU16 reserved[57]; -} mfxExtFeiCodingOption; -MFX_PACK_END() - -/* 1 functions */ -typedef enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FEI_FUNCTION_PREENC) =1, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FEI_FUNCTION_ENCODE) =2, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FEI_FUNCTION_ENC) =3, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FEI_FUNCTION_PAK) =4, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FEI_FUNCTION_DEC) =5, -} mfxFeiFunction; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_FEI_FUNCTION_PREENC); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_FEI_FUNCTION_ENCODE); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_FEI_FUNCTION_ENC); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_FEI_FUNCTION_PAK); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_FEI_FUNCTION_DEC); - -enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PARAM) = MFX_MAKEFOURCC('F','E','P','R'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PREENC_CTRL) = MFX_MAKEFOURCC('F','P','C','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PREENC_MV_PRED) = MFX_MAKEFOURCC('F','P','M','P'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PREENC_MV) = MFX_MAKEFOURCC('F','P','M','V'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PREENC_MB) = MFX_MAKEFOURCC('F','P','M','B'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_CTRL) = MFX_MAKEFOURCC('F','E','C','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_MV_PRED) = MFX_MAKEFOURCC('F','E','M','P'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_QP) = MFX_MAKEFOURCC('F','E','Q','P'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_MV) = MFX_MAKEFOURCC('F','E','M','V'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_MB) = MFX_MAKEFOURCC('F','E','M','B'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_ENC_MB_STAT) = MFX_MAKEFOURCC('F','E','S','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PAK_CTRL) = MFX_MAKEFOURCC('F','K','C','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_SPS) = MFX_MAKEFOURCC('F','S','P','S'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_PPS) = MFX_MAKEFOURCC('F','P','P','S'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_SLICE) = MFX_MAKEFOURCC('F','S','L','C'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_CODING_OPTION) = MFX_MAKEFOURCC('F','C','D','O'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_DEC_STREAM_OUT) = MFX_MAKEFOURCC('F','D','S','O'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_REPACK_CTRL) = MFX_MAKEFOURCC('F','E','R','P'), -#if (MFX_VERSION >= 1025) - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_FEI_REPACK_STAT) = MFX_MAKEFOURCC('F','E','R','S') -#endif -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PARAM); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PREENC_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PREENC_MV_PRED); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PREENC_MV); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PREENC_MB); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_MV_PRED); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_QP); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_MV); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_MB); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_ENC_MB_STAT); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PAK_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_SPS); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_PPS); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_SLICE); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_CODING_OPTION); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_DEC_STREAM_OUT); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_REPACK_CTRL); - -#if (MFX_VERSION >= 1025) - MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_FEI_REPACK_STAT); -#endif - -/* should be attached to mfxVideoParam during initialization to indicate FEI function */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxFeiFunction Func; - mfxU16 SingleFieldProcessing; - mfxU16 reserved[57]; -} mfxExtFeiParam; -MFX_PACK_END() - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfeihevc.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfeihevc.h deleted file mode 100644 index d80e2bab..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxfeihevc.h +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXFEIHEVC_H__ -#define __MFXFEIHEVC_H__ -#include "mfxcommon.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if (MFX_VERSION >= 1027) - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 SearchPath; - mfxU16 LenSP; - mfxU16 RefWidth; - mfxU16 RefHeight; - mfxU16 SearchWindow; - - mfxU16 NumMvPredictors[2]; /* 0 for L0 and 1 for L1 */ - mfxU16 MultiPred[2]; /* 0 for L0 and 1 for L1 */ - - mfxU16 SubPelMode; - mfxU16 AdaptiveSearch; - mfxU16 MVPredictor; - - mfxU16 PerCuQp; - mfxU16 PerCtuInput; - mfxU16 ForceCtuSplit; - mfxU16 NumFramePartitions; - mfxU16 FastIntraMode; - - mfxU16 reserved0[107]; -} mfxExtFeiHevcEncFrameCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - struct { - mfxU8 RefL0 : 4; - mfxU8 RefL1 : 4; - } RefIdx[4]; /* index is predictor number */ - - mfxU32 BlockSize : 2; - mfxU32 reserved0 : 30; - - mfxI16Pair MV[4][2]; /* first index is predictor number, second is 0 for L0 and 1 for L1 */ -} mfxFeiHevcEncMVPredictors; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved0[54]; - - mfxFeiHevcEncMVPredictors *Data; -} mfxExtFeiHevcEncMVPredictors; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved[6]; - - mfxU8 *Data; -} mfxExtFeiHevcEncQP; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxU32 ForceToIntra : 1; - mfxU32 ForceToInter : 1; - mfxU32 reserved0 : 30; - - mfxU32 reserved1[3]; -} mfxFeiHevcEncCtuCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved0[54]; - - mfxFeiHevcEncCtuCtrl *Data; -} mfxExtFeiHevcEncCtuCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 MaxFrameSize; /* in bytes */ - mfxU32 NumPasses; /* up to 8 */ - mfxU16 reserved[8]; - mfxU8 DeltaQP[8]; /* list of delta QPs, only positive values */ -} mfxExtFeiHevcRepackCtrl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 NumPasses; - mfxU16 reserved[58]; -} mfxExtFeiHevcRepackStat; -MFX_PACK_END() - -#if MFX_VERSION >= MFX_VERSION_NEXT -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - /* DWORD 0 */ - mfxU32 reserved0; - - /* DWORD 1 */ - mfxU32 SplitLevel2Part0 : 4; - mfxU32 SplitLevel2Part1 : 4; - mfxU32 SplitLevel2Part2 : 4; - mfxU32 SplitLevel2Part3 : 4; - mfxU32 SplitLevel1 : 4; - mfxU32 SplitLevel0 : 1; - mfxU32 reserved10 : 3; - mfxU32 CuCountMinus1 : 6; - mfxU32 LastCtuOfTileFlag : 1; - mfxU32 LastCtuOfSliceFlag : 1; - - - /* DWORD 2 */ - mfxU32 CtuAddrX : 16; - mfxU32 CtuAddrY : 16; - - /* DWORD 3 */ - mfxU32 reserved3; -} mfxFeiHevcPakCtuRecordV0; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved0[54]; - - mfxFeiHevcPakCtuRecordV0 *Data; -} mfxExtFeiHevcPakCtuRecordV0; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - /* DWORD 0 */ - mfxU32 CuSize : 2; - mfxU32 PredMode : 1; - mfxU32 TransquantBypass : 1; - mfxU32 PartMode : 3; - mfxU32 IpcmEnable : 1; - mfxU32 IntraChromaMode : 3; - mfxU32 ZeroOutCoeffs : 1; - mfxU32 reserved00 : 4; - mfxU32 Qp : 7; - mfxU32 QpSign : 1; - mfxU32 InterpredIdc : 8; - - - /* DWORD 1 */ - mfxU32 IntraMode0 : 6; - mfxU32 reserved10 : 2; - mfxU32 IntraMode1 : 6; - mfxU32 reserved11 : 2; - mfxU32 IntraMode2 : 6; - mfxU32 reserved12 : 2; - mfxU32 IntraMode3 : 6; - mfxU32 reserved13 : 2; - - - /* DWORD 2-9 */ - struct { - mfxI16 x[4]; - mfxI16 y[4]; - } MVs[2]; /* 0-L0, 1-L1 */ - - - /* DWORD 10 */ - struct{ - mfxU16 Ref0 : 4; - mfxU16 Ref1 : 4; - mfxU16 Ref2 : 4; - mfxU16 Ref3 : 4; - } RefIdx[2]; /* 0-L0, 1-L1 */ - - - /* DWORD 11 */ - mfxU32 TuSize; - - - /* DWORD 12 */ - mfxU32 TransformSkipY : 16; - mfxU32 reserved120 : 12; - mfxU32 TuCountM1 : 4; - - - /* DWORD 13 */ - mfxU32 TransformSkipU : 16; - mfxU32 TransformSkipV : 16; -} mfxFeiHevcPakCuRecordV0; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved0[54]; - - mfxFeiHevcPakCuRecordV0 *Data; -} mfxExtFeiHevcPakCuRecordV0; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxU32 BestDistortion; - mfxU32 ColocatedCtuDistortion; -} mfxFeiHevcDistortionCtu; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 VaBufferID; - mfxU32 Pitch; - mfxU32 Height; - mfxU16 reserved[6]; - - mfxFeiHevcDistortionCtu *Data; -} mfxExtFeiHevcDistortion; -MFX_PACK_END() -#endif - - -enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_ENC_CTRL) = MFX_MAKEFOURCC('F','H','C','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_ENC_MV_PRED) = MFX_MAKEFOURCC('F','H','P','D'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_ENC_QP) = MFX_MAKEFOURCC('F','H','Q','P'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_ENC_CTU_CTRL) = MFX_MAKEFOURCC('F','H','E','C'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_REPACK_CTRL) = MFX_MAKEFOURCC('F','H','R','P'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_REPACK_STAT) = MFX_MAKEFOURCC('F','H','R','S'), - -#if MFX_VERSION >= MFX_VERSION_NEXT - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_PAK_CTU_REC) = MFX_MAKEFOURCC('F','H','T','B'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_PAK_CU_REC) = MFX_MAKEFOURCC('F','H','C','U'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_HEVCFEI_ENC_DIST) = MFX_MAKEFOURCC('F','H','D','S') -#endif -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_ENC_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_ENC_MV_PRED); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_ENC_QP); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_ENC_CTU_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_REPACK_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_REPACK_STAT); - -#if MFX_VERSION >= MFX_VERSION_NEXT - MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_PAK_CTU_REC); - MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_PAK_CU_REC); - MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_HEVCFEI_ENC_DIST); -#endif - -#endif // MFX_VERSION - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - - -#endif // __MFXFEIHEVC_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxjpeg.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxjpeg.h deleted file mode 100644 index 7f00b67e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxjpeg.h +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFX_JPEG_H__ -#define __MFX_JPEG_H__ - -#include "mfxdefs.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* CodecId */ -enum { - MFX_CODEC_JPEG = MFX_MAKEFOURCC('J','P','E','G') -}; - -/* CodecProfile, CodecLevel */ -enum -{ - MFX_PROFILE_JPEG_BASELINE = 1 -}; - -enum -{ - MFX_ROTATION_0 = 0, - MFX_ROTATION_90 = 1, - MFX_ROTATION_180 = 2, - MFX_ROTATION_270 = 3 -}; - -enum { - MFX_EXTBUFF_JPEG_QT = MFX_MAKEFOURCC('J','P','G','Q'), - MFX_EXTBUFF_JPEG_HUFFMAN = MFX_MAKEFOURCC('J','P','G','H') -}; - -enum { - MFX_JPEG_COLORFORMAT_UNKNOWN = 0, - MFX_JPEG_COLORFORMAT_YCbCr = 1, - MFX_JPEG_COLORFORMAT_RGB = 2 -}; - -enum { - MFX_SCANTYPE_UNKNOWN = 0, - MFX_SCANTYPE_INTERLEAVED = 1, - MFX_SCANTYPE_NONINTERLEAVED = 2 -}; - -enum { - MFX_CHROMAFORMAT_JPEG_SAMPLING = 6 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[7]; - mfxU16 NumTable; - - mfxU16 Qm[4][64]; -} mfxExtJPEGQuantTables; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[2]; - mfxU16 NumDCTable; - mfxU16 NumACTable; - - struct { - mfxU8 Bits[16]; - mfxU8 Values[12]; - } DCTables[4]; - - struct { - mfxU8 Bits[16]; - mfxU8 Values[162]; - } ACTables[4]; -} mfxExtJPEGHuffmanTables; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - -#endif // __MFX_JPEG_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxla.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxla.h deleted file mode 100644 index 79cb9680..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxla.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXLA_H__ -#define __MFXLA_H__ -#include "mfxdefs.h" -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -enum -{ - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_LOOKAHEAD_CTRL) = MFX_MAKEFOURCC('L','A','C','T'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_LOOKAHEAD_STAT) = MFX_MAKEFOURCC('L','A','S','T'), -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_LOOKAHEAD_CTRL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_LOOKAHEAD_STAT); - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct -{ - mfxExtBuffer Header; - mfxU16 LookAheadDepth; - mfxU16 DependencyDepth; - mfxU16 DownScaleFactor; - mfxU16 BPyramid; - - mfxU16 reserved1[23]; - - mfxU16 NumOutStream; - struct mfxStream{ - mfxU16 Width; - mfxU16 Height; - mfxU16 reserved2[14]; - } OutStream[16]; -}mfxExtLAControl; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -MFX_DEPRECATED typedef struct -{ - mfxU16 Width; - mfxU16 Height; - - mfxU32 FrameType; - mfxU32 FrameDisplayOrder; - mfxU32 FrameEncodeOrder; - - mfxU32 IntraCost; - mfxU32 InterCost; - mfxU32 DependencyCost; //aggregated cost, how this frame influences subsequent frames - mfxU16 Layer; - mfxU16 reserved[23]; - - mfxU64 EstimatedRate[52]; -}mfxLAFrameInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[20]; - - mfxU16 NumAlloc; //number of allocated mfxLAFrameInfo structures - mfxU16 NumStream; //number of resolutions - mfxU16 NumFrame; //number of frames for each resolution - mfxLAFrameInfo *FrameStat; //frame statistics - - mfxFrameSurface1 *OutSurface; //reordered surface - -} mfxExtLAFrameStatistics; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxmvc.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxmvc.h deleted file mode 100644 index 4ec71dc1..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxmvc.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXMVC_H__ -#define __MFXMVC_H__ - -#include "mfxdefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* CodecProfile, CodecLevel */ -enum { - /* MVC profiles */ - MFX_PROFILE_AVC_MULTIVIEW_HIGH =118, - MFX_PROFILE_AVC_STEREO_HIGH =128 -}; - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_MVC_SEQ_DESC = MFX_MAKEFOURCC('M','V','C','D'), - MFX_EXTBUFF_MVC_TARGET_VIEWS = MFX_MAKEFOURCC('M','V','C','T') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 ViewId; - - mfxU16 NumAnchorRefsL0; - mfxU16 NumAnchorRefsL1; - mfxU16 AnchorRefL0[16]; - mfxU16 AnchorRefL1[16]; - - mfxU16 NumNonAnchorRefsL0; - mfxU16 NumNonAnchorRefsL1; - mfxU16 NonAnchorRefL0[16]; - mfxU16 NonAnchorRefL1[16]; -} mfxMVCViewDependency; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU16 TemporalId; - mfxU16 LevelIdc; - - mfxU16 NumViews; - mfxU16 NumTargetViews; - mfxU16 *TargetViewId; -} mfxMVCOperationPoint; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - - mfxU32 NumView; - mfxU32 NumViewAlloc; - mfxMVCViewDependency *View; - - mfxU32 NumViewId; - mfxU32 NumViewIdAlloc; - mfxU16 *ViewId; - - mfxU32 NumOP; - mfxU32 NumOPAlloc; - mfxMVCOperationPoint *OP; - - mfxU16 NumRefsTotal; - mfxU32 Reserved[16]; - -} mfxExtMVCSeqDesc; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 TemporalId; - mfxU32 NumView; - mfxU16 ViewId[1024]; -} mfxExtMVCTargetViews ; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpak.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpak.h deleted file mode 100644 index d2bdf588..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpak.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXPAK_H__ -#define __MFXPAK_H__ -#include "mfxdefs.h" -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxU16 reserved[32]; - - mfxFrameSurface1 *InSurface; - - mfxU16 NumFrameL0; - mfxFrameSurface1 **L0Surface; - mfxU16 NumFrameL1; - mfxFrameSurface1 **L1Surface; - - mfxU16 NumExtParam; - mfxExtBuffer **ExtParam; - - mfxU16 NumPayload; - mfxPayload **Payload; -} mfxPAKInput; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxU16 reserved[32]; - - mfxBitstream *Bs; - - mfxFrameSurface1 *OutSurface; - - mfxU16 NumExtParam; - mfxExtBuffer **ExtParam; -} mfxPAKOutput; -MFX_PACK_END() - -typedef struct _mfxSession *mfxSession; -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest request[2]); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_Init(mfxSession session, mfxVideoParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_Reset(mfxSession session, mfxVideoParam *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_Close(mfxSession session); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_ProcessFrameAsync(mfxSession session, mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoPAK_GetVideoParam(mfxSession session, mfxVideoParam *par); - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpcp.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpcp.h deleted file mode 100644 index d3a10b77..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxpcp.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXPCP_H__ -#define __MFXPCP_H__ -#include "mfxstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if MFX_VERSION >= 1030 -/* Protected in mfxVideoParam */ -enum { - MFX_PROTECTION_CENC_WV_CLASSIC = 0x0004, - MFX_PROTECTION_CENC_WV_GOOGLE_DASH = 0x0005, -}; - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_CENC_PARAM = MFX_MAKEFOURCC('C','E','N','P') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct _mfxExtCencParam{ - mfxExtBuffer Header; - - mfxU32 StatusReportIndex; - mfxU32 reserved[15]; -} mfxExtCencParam; -MFX_PACK_END() -#endif - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin++.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin++.h deleted file mode 100644 index 9fe7ce5f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin++.h +++ /dev/null @@ -1,717 +0,0 @@ -// Copyright (c) 2017-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#ifndef __MFXPLUGINPLUSPLUS_H -#define __MFXPLUGINPLUSPLUS_H - -#include "mfxplugin.h" - -// base class for MFXVideoUSER/MFXAudioUSER API - -class MFXBaseUSER { -public: - explicit MFXBaseUSER(mfxSession session = NULL) - : m_session(session){} - - virtual ~MFXBaseUSER() {} - - virtual mfxStatus Register(mfxU32 type, const mfxPlugin *par) = 0; - virtual mfxStatus Unregister(mfxU32 type) = 0; - virtual mfxStatus ProcessFrameAsync(const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp) = 0; - -protected: - mfxSession m_session; -}; - -//c++ wrapper over only 3 exposed functions from MFXVideoUSER module -class MFXVideoUSER: public MFXBaseUSER { -public: - explicit MFXVideoUSER(mfxSession session = NULL) - : MFXBaseUSER(session){} - - virtual mfxStatus Register(mfxU32 type, const mfxPlugin *par) { - return MFXVideoUSER_Register(m_session, type, par); - } - virtual mfxStatus Unregister(mfxU32 type) { - return MFXVideoUSER_Unregister(m_session, type); - } - virtual mfxStatus ProcessFrameAsync(const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp) { - return MFXVideoUSER_ProcessFrameAsync(m_session, in, in_num, out, out_num, syncp); - } -}; - -//c++ wrapper over only 3 exposed functions from MFXAudioUSER module -class MFXAudioUSER: public MFXBaseUSER { -public: - explicit MFXAudioUSER(mfxSession session = NULL) - : MFXBaseUSER(session){} - - virtual mfxStatus Register(mfxU32 type, const mfxPlugin *par) { - return MFXAudioUSER_Register(m_session, type, par); - } - virtual mfxStatus Unregister(mfxU32 type) { - return MFXAudioUSER_Unregister(m_session, type); - } - virtual mfxStatus ProcessFrameAsync(const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp) { - return MFXAudioUSER_ProcessFrameAsync(m_session, in, in_num, out, out_num, syncp); - } -}; - - -//initialize mfxPlugin struct -class MFXPluginParam { - mfxPluginParam m_param; - -public: - MFXPluginParam(mfxU32 CodecId, mfxU32 Type, mfxPluginUID uid, mfxThreadPolicy ThreadPolicy = MFX_THREADPOLICY_SERIAL, mfxU32 MaxThreadNum = 1) - : m_param() { - m_param.PluginUID = uid; - m_param.Type = Type; - m_param.CodecId = CodecId; - m_param.MaxThreadNum = MaxThreadNum; - m_param.ThreadPolicy = ThreadPolicy; - } - operator const mfxPluginParam& () const { - return m_param; - } - operator mfxPluginParam& () { - return m_param; - } -}; - -//common interface part for every plugin: decoder/encoder and generic -struct MFXPlugin -{ - virtual ~MFXPlugin() {}; - //init function always required for any transform or codec plugins, for codec plugins it maps to callback from MediaSDK - //for generic plugin application should call it - //MediaSDK mfxPlugin API mapping - virtual mfxStatus PluginInit(mfxCoreInterface *core) = 0; - //release CoreInterface, and destroy plugin state, not destroy plugin instance - virtual mfxStatus PluginClose() = 0; - virtual mfxStatus GetPluginParam(mfxPluginParam *par) = 0; - virtual mfxStatus Execute(mfxThreadTask task, mfxU32 uid_p, mfxU32 uid_a) = 0; - virtual mfxStatus FreeResources(mfxThreadTask task, mfxStatus sts) = 0; - //destroy plugin due to shared module distribution model plugin wont support virtual destructor - virtual void Release() = 0; - //release resources associated with current instance of plugin, but do not release CoreInterface related resource set in pluginInit - virtual mfxStatus Close() = 0; - //communication protocol between particular version of plugin and application - virtual mfxStatus SetAuxParams(void* auxParam, int auxParamSize) = 0; -}; - -//common extension interface that codec plugins should expose additionally to MFXPlugin -struct MFXCodecPlugin : MFXPlugin -{ - virtual mfxStatus Init(mfxVideoParam *par) = 0; - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *in, mfxFrameAllocRequest *out) = 0; - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) =0; - virtual mfxStatus Reset(mfxVideoParam *par) = 0; - virtual mfxStatus GetVideoParam(mfxVideoParam *par) = 0; -}; - -//common extension interface that audio codec plugins should expose additionally to MFXPlugin -struct MFXAudioCodecPlugin : MFXPlugin -{ - virtual mfxStatus Init(mfxAudioParam *par) = 0; - virtual mfxStatus Query(mfxAudioParam *in, mfxAudioParam *out) =0; - virtual mfxStatus QueryIOSize(mfxAudioParam *par, mfxAudioAllocRequest *request) = 0; - virtual mfxStatus Reset(mfxAudioParam *par) = 0; - virtual mfxStatus GetAudioParam(mfxAudioParam *par) = 0; -}; - -//general purpose transform plugin interface, not a codec plugin -struct MFXGenericPlugin : MFXPlugin -{ - virtual mfxStatus Init(mfxVideoParam *par) = 0; - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *in, mfxFrameAllocRequest *out) = 0; - virtual mfxStatus Submit(const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxThreadTask *task) = 0; -}; - -//decoder plugins may only support this interface -struct MFXDecoderPlugin : MFXCodecPlugin -{ - virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxVideoParam *par) = 0; - virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) = 0; - virtual mfxStatus DecodeFrameSubmit(mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task) = 0; -}; - -//audio decoder plugins may only support this interface -struct MFXAudioDecoderPlugin : MFXAudioCodecPlugin -{ - virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxAudioParam *par) = 0; -// virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) = 0; - virtual mfxStatus DecodeFrameSubmit(mfxBitstream *in, mfxAudioFrame *out, mfxThreadTask *task) = 0; -}; - -//encoder plugins may only support this interface -struct MFXEncoderPlugin : MFXCodecPlugin -{ - virtual mfxStatus EncodeFrameSubmit(mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxThreadTask *task) = 0; -}; - -//audio encoder plugins may only support this interface -struct MFXAudioEncoderPlugin : MFXAudioCodecPlugin -{ - virtual mfxStatus EncodeFrameSubmit(mfxAudioFrame *aFrame, mfxBitstream *out, mfxThreadTask *task) = 0; -}; - -//vpp plugins may only support this interface -struct MFXVPPPlugin : MFXCodecPlugin -{ - virtual mfxStatus VPPFrameSubmit(mfxFrameSurface1 *surface_in, mfxFrameSurface1 *surface_out, mfxExtVppAuxData *aux, mfxThreadTask *task) = 0; - virtual mfxStatus VPPFrameSubmitEx(mfxFrameSurface1 *in, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task) = 0; -}; - -struct MFXEncPlugin : MFXCodecPlugin -{ - virtual mfxStatus EncFrameSubmit(mfxENCInput *in, mfxENCOutput *out, mfxThreadTask *task) = 0; -}; - - - - -class MFXCoreInterface -{ -protected: - mfxCoreInterface m_core; -public: - - MFXCoreInterface() - : m_core() { - } - MFXCoreInterface(const mfxCoreInterface & pCore) - : m_core(pCore) { - } - - MFXCoreInterface(const MFXCoreInterface & that) - : m_core(that.m_core) { - } - MFXCoreInterface &operator = (const MFXCoreInterface & that) - { - m_core = that.m_core; - return *this; - } - bool IsCoreSet() { - return m_core.pthis != 0; - } - mfxStatus GetCoreParam(mfxCoreParam *par) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.GetCoreParam(m_core.pthis, par); - } - mfxStatus GetHandle (mfxHandleType type, mfxHDL *handle) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.GetHandle(m_core.pthis, type, handle); - } - mfxStatus IncreaseReference (mfxFrameData *fd) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.IncreaseReference(m_core.pthis, fd); - } - mfxStatus DecreaseReference (mfxFrameData *fd) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.DecreaseReference(m_core.pthis, fd); - } - mfxStatus CopyFrame (mfxFrameSurface1 *dst, mfxFrameSurface1 *src) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.CopyFrame(m_core.pthis, dst, src); - } - mfxStatus CopyBuffer(mfxU8 *dst, mfxU32 size, mfxFrameSurface1 *src) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.CopyBuffer(m_core.pthis, dst, size, src); - } - mfxStatus MapOpaqueSurface(mfxU32 num, mfxU32 type, mfxFrameSurface1 **op_surf) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.MapOpaqueSurface(m_core.pthis, num, type, op_surf); - } - mfxStatus UnmapOpaqueSurface(mfxU32 num, mfxU32 type, mfxFrameSurface1 **op_surf) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.UnmapOpaqueSurface(m_core.pthis, num, type, op_surf); - } - mfxStatus GetRealSurface(mfxFrameSurface1 *op_surf, mfxFrameSurface1 **surf) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.GetRealSurface(m_core.pthis, op_surf, surf); - } - mfxStatus GetOpaqueSurface(mfxFrameSurface1 *surf, mfxFrameSurface1 **op_surf) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.GetOpaqueSurface(m_core.pthis, surf, op_surf); - } - mfxStatus CreateAccelerationDevice(mfxHandleType type, mfxHDL *handle) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.CreateAccelerationDevice(m_core.pthis, type, handle); - } - mfxFrameAllocator & FrameAllocator() { - return m_core.FrameAllocator; - } - mfxStatus GetFrameHandle(mfxFrameData *fd, mfxHDL *handle) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.GetFrameHandle(m_core.pthis, fd, handle); - } - mfxStatus QueryPlatform(mfxPlatform *platform) { - if (!IsCoreSet()) { - return MFX_ERR_NULL_PTR; - } - return m_core.QueryPlatform(m_core.pthis, platform); - } -} ; - -/* Class adapter between "C" structure mfxPlugin and C++ interface MFXPlugin */ - -namespace detail -{ - template - class MFXPluginAdapterBase - { - protected: - mfxPlugin m_mfxAPI; - public: - MFXPluginAdapterBase( T *plugin, mfxVideoCodecPlugin *pCodec = NULL) - : m_mfxAPI() - { - SetupCallbacks(plugin, pCodec); - } - - MFXPluginAdapterBase( T *plugin, mfxAudioCodecPlugin *pCodec) - : m_mfxAPI() - { - SetupCallbacks(plugin, pCodec); - } - - operator mfxPlugin () const { - return m_mfxAPI; - } - void SetupCallbacks(T *plugin) { - m_mfxAPI.pthis = plugin; - m_mfxAPI.PluginInit = _PluginInit; - m_mfxAPI.PluginClose = _PluginClose; - m_mfxAPI.GetPluginParam = _GetPluginParam; - m_mfxAPI.Submit = 0; - m_mfxAPI.Execute = _Execute; - m_mfxAPI.FreeResources = _FreeResources; - } - - void SetupCallbacks( T *plugin, mfxVideoCodecPlugin *pCodec) { - SetupCallbacks(plugin); - m_mfxAPI.Video = pCodec; - } - - void SetupCallbacks( T *plugin, mfxAudioCodecPlugin *pCodec) { - SetupCallbacks(plugin); - m_mfxAPI.Audio = pCodec; - } - private: - - static mfxStatus _PluginInit(mfxHDL pthis, mfxCoreInterface *core) { - return reinterpret_cast(pthis)->PluginInit(core); - } - static mfxStatus _PluginClose(mfxHDL pthis) { - return reinterpret_cast(pthis)->PluginClose(); - } - static mfxStatus _GetPluginParam(mfxHDL pthis, mfxPluginParam *par) { - return reinterpret_cast(pthis)->GetPluginParam(par); - } - static mfxStatus _Execute(mfxHDL pthis, mfxThreadTask task, mfxU32 thread_id, mfxU32 call_count) { - return reinterpret_cast(pthis)->Execute(task, thread_id, call_count); - } - static mfxStatus _FreeResources(mfxHDL pthis, mfxThreadTask task, mfxStatus sts) { - return reinterpret_cast(pthis)->FreeResources(task, sts); - } - }; - - template - class MFXCodecPluginAdapterBase : public MFXPluginAdapterBase - { - protected: - //stub to feed mediasdk plugin API - mfxVideoCodecPlugin m_codecPlg; - public: - MFXCodecPluginAdapterBase(T * pCodecPlg) - : MFXPluginAdapterBase(pCodecPlg, &m_codecPlg) - , m_codecPlg() - { - m_codecPlg.Query = _Query; - m_codecPlg.QueryIOSurf = _QueryIOSurf ; - m_codecPlg.Init = _Init; - m_codecPlg.Reset = _Reset; - m_codecPlg.Close = _Close; - m_codecPlg.GetVideoParam = _GetVideoParam; - } - MFXCodecPluginAdapterBase(const MFXCodecPluginAdapterBase & that) - : MFXPluginAdapterBase(reinterpret_cast(that.m_mfxAPI.pthis), &m_codecPlg) - , m_codecPlg() { - SetupCallbacks(); - } - MFXCodecPluginAdapterBase& operator = (const MFXCodecPluginAdapterBase & that) { - MFXPluginAdapterBase :: SetupCallbacks(reinterpret_cast(that.m_mfxAPI.pthis), &m_codecPlg); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.Query = _Query; - m_codecPlg.QueryIOSurf = _QueryIOSurf ; - m_codecPlg.Init = _Init; - m_codecPlg.Reset = _Reset; - m_codecPlg.Close = _Close; - m_codecPlg.GetVideoParam = _GetVideoParam; - } - static mfxStatus _Query(mfxHDL pthis, mfxVideoParam *in, mfxVideoParam *out) { - return reinterpret_cast(pthis)->Query(in, out); - } - static mfxStatus _QueryIOSurf(mfxHDL pthis, mfxVideoParam *par, mfxFrameAllocRequest *in, mfxFrameAllocRequest *out){ - return reinterpret_cast(pthis)->QueryIOSurf(par, in, out); - } - static mfxStatus _Init(mfxHDL pthis, mfxVideoParam *par){ - return reinterpret_cast(pthis)->Init(par); - } - static mfxStatus _Reset(mfxHDL pthis, mfxVideoParam *par){ - return reinterpret_cast(pthis)->Reset(par); - } - static mfxStatus _Close(mfxHDL pthis) { - return reinterpret_cast(pthis)->Close(); - } - static mfxStatus _GetVideoParam(mfxHDL pthis, mfxVideoParam *par) { - return reinterpret_cast(pthis)->GetVideoParam(par); - } - }; - - template - class MFXAudioCodecPluginAdapterBase : public MFXPluginAdapterBase - { - protected: - //stub to feed mediasdk plugin API - mfxAudioCodecPlugin m_codecPlg; - public: - MFXAudioCodecPluginAdapterBase(T * pCodecPlg) - : MFXPluginAdapterBase(pCodecPlg, &m_codecPlg) - , m_codecPlg() - { - m_codecPlg.Query = _Query; - m_codecPlg.QueryIOSize = _QueryIOSize ; - m_codecPlg.Init = _Init; - m_codecPlg.Reset = _Reset; - m_codecPlg.Close = _Close; - m_codecPlg.GetAudioParam = _GetAudioParam; - } - MFXAudioCodecPluginAdapterBase(const MFXCodecPluginAdapterBase & that) - : MFXPluginAdapterBase(reinterpret_cast(that.m_mfxAPI.pthis), &m_codecPlg) - , m_codecPlg() { - SetupCallbacks(); - } - MFXAudioCodecPluginAdapterBase& operator = (const MFXAudioCodecPluginAdapterBase & that) { - MFXPluginAdapterBase :: SetupCallbacks(reinterpret_cast(that.m_mfxAPI.pthis), &m_codecPlg); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.Query = _Query; - m_codecPlg.QueryIOSize = _QueryIOSize; - m_codecPlg.Init = _Init; - m_codecPlg.Reset = _Reset; - m_codecPlg.Close = _Close; - m_codecPlg.GetAudioParam = _GetAudioParam; - } - static mfxStatus _Query(mfxHDL pthis, mfxAudioParam *in, mfxAudioParam *out) { - return reinterpret_cast(pthis)->Query(in, out); - } - static mfxStatus _QueryIOSize(mfxHDL pthis, mfxAudioParam *par, mfxAudioAllocRequest *request){ - return reinterpret_cast(pthis)->QueryIOSize(par, request); - } - static mfxStatus _Init(mfxHDL pthis, mfxAudioParam *par){ - return reinterpret_cast(pthis)->Init(par); - } - static mfxStatus _Reset(mfxHDL pthis, mfxAudioParam *par){ - return reinterpret_cast(pthis)->Reset(par); - } - static mfxStatus _Close(mfxHDL pthis) { - return reinterpret_cast(pthis)->Close(); - } - static mfxStatus _GetAudioParam(mfxHDL pthis, mfxAudioParam *par) { - return reinterpret_cast(pthis)->GetAudioParam(par); - } - }; - - template - struct MFXPluginAdapterInternal{}; - template<> - class MFXPluginAdapterInternal : public MFXPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXGenericPlugin *pPlugin) - : MFXPluginAdapterBase(pPlugin) - { - m_mfxAPI.Submit = _Submit; - } - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that ) - : MFXPluginAdapterBase(that) { - m_mfxAPI.Submit = that._Submit; - } - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXPluginAdapterBase::operator=(that); - m_mfxAPI.Submit = that._Submit; - return *this; - } - - private: - static mfxStatus _Submit(mfxHDL pthis, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxThreadTask *task) { - return reinterpret_cast(pthis)->Submit(in, in_num, out, out_num, task); - } - }; - - template<> - class MFXPluginAdapterInternal : public MFXCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXDecoderPlugin *pPlugin) - : MFXCodecPluginAdapterBase(pPlugin) - { - SetupCallbacks(); - } - - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXCodecPluginAdapterBase(that) { - SetupCallbacks(); - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXCodecPluginAdapterBase::operator=(that); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.DecodeHeader = _DecodeHeader; - m_codecPlg.GetPayload = _GetPayload; - m_codecPlg.DecodeFrameSubmit = _DecodeFrameSubmit; - } - static mfxStatus _DecodeHeader(mfxHDL pthis, mfxBitstream *bs, mfxVideoParam *par) { - return reinterpret_cast(pthis)->DecodeHeader(bs, par); - } - static mfxStatus _GetPayload(mfxHDL pthis, mfxU64 *ts, mfxPayload *payload) { - return reinterpret_cast(pthis)->GetPayload(ts, payload); - } - static mfxStatus _DecodeFrameSubmit(mfxHDL pthis, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task) { - return reinterpret_cast(pthis)->DecodeFrameSubmit(bs, surface_work, surface_out, task); - } - }; - - template<> - class MFXPluginAdapterInternal : public MFXAudioCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXAudioDecoderPlugin *pPlugin) - : MFXAudioCodecPluginAdapterBase(pPlugin) - { - SetupCallbacks(); - } - - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXAudioCodecPluginAdapterBase(that) { - SetupCallbacks(); - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXAudioCodecPluginAdapterBase::operator=(that); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.DecodeHeader = _DecodeHeader; - m_codecPlg.DecodeFrameSubmit = _DecodeFrameSubmit; - } - static mfxStatus _DecodeHeader(mfxHDL pthis, mfxBitstream *bs, mfxAudioParam *par) { - return reinterpret_cast(pthis)->DecodeHeader(bs, par); - } - static mfxStatus _DecodeFrameSubmit(mfxHDL pthis, mfxBitstream *in, mfxAudioFrame *out, mfxThreadTask *task) { - return reinterpret_cast(pthis)->DecodeFrameSubmit(in, out, task); - } - }; - - template<> - class MFXPluginAdapterInternal : public MFXCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXEncoderPlugin *pPlugin) - : MFXCodecPluginAdapterBase(pPlugin) - { - m_codecPlg.EncodeFrameSubmit = _EncodeFrameSubmit; - } - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXCodecPluginAdapterBase(that) { - m_codecPlg.EncodeFrameSubmit = _EncodeFrameSubmit; - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXCodecPluginAdapterBase::operator = (that); - m_codecPlg.EncodeFrameSubmit = _EncodeFrameSubmit; - return *this; - } - - private: - static mfxStatus _EncodeFrameSubmit(mfxHDL pthis, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxThreadTask *task) { - return reinterpret_cast(pthis)->EncodeFrameSubmit(ctrl, surface, bs, task); - } - }; - - template<> - class MFXPluginAdapterInternal : public MFXAudioCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXAudioEncoderPlugin *pPlugin) - : MFXAudioCodecPluginAdapterBase(pPlugin) - { - SetupCallbacks(); - } - - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXAudioCodecPluginAdapterBase(that) { - SetupCallbacks(); - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXAudioCodecPluginAdapterBase::operator=(that); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.EncodeFrameSubmit = _EncodeFrameSubmit; - } - static mfxStatus _EncodeFrameSubmit(mfxHDL pthis, mfxAudioFrame *aFrame, mfxBitstream *out, mfxThreadTask *task) { - return reinterpret_cast(pthis)->EncodeFrameSubmit(aFrame, out, task); - } - }; - - template<> - class MFXPluginAdapterInternal : public MFXCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXEncPlugin *pPlugin) - : MFXCodecPluginAdapterBase(pPlugin) - { - m_codecPlg.ENCFrameSubmit = _ENCFrameSubmit; - } - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXCodecPluginAdapterBase(that) { - m_codecPlg.ENCFrameSubmit = _ENCFrameSubmit; - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXCodecPluginAdapterBase::operator = (that); - m_codecPlg.ENCFrameSubmit = _ENCFrameSubmit; - return *this; - } - - private: - static mfxStatus _ENCFrameSubmit(mfxHDL pthis,mfxENCInput *in, mfxENCOutput *out, mfxThreadTask *task) { - return reinterpret_cast(pthis)->EncFrameSubmit(in, out, task); - } - }; - - - template<> - class MFXPluginAdapterInternal : public MFXCodecPluginAdapterBase - { - public: - MFXPluginAdapterInternal(MFXVPPPlugin *pPlugin) - : MFXCodecPluginAdapterBase(pPlugin) - { - SetupCallbacks(); - } - MFXPluginAdapterInternal(const MFXPluginAdapterInternal & that) - : MFXCodecPluginAdapterBase(that) { - SetupCallbacks(); - } - - MFXPluginAdapterInternal& operator = (const MFXPluginAdapterInternal & that) { - MFXCodecPluginAdapterBase::operator = (that); - SetupCallbacks(); - return *this; - } - - private: - void SetupCallbacks() { - m_codecPlg.VPPFrameSubmit = _VPPFrameSubmit; - m_codecPlg.VPPFrameSubmitEx = _VPPFrameSubmitEx; - } - static mfxStatus _VPPFrameSubmit(mfxHDL pthis, mfxFrameSurface1 *surface_in, mfxFrameSurface1 *surface_out, mfxExtVppAuxData *aux, mfxThreadTask *task) { - return reinterpret_cast(pthis)->VPPFrameSubmit(surface_in, surface_out, aux, task); - } - static mfxStatus _VPPFrameSubmitEx(mfxHDL pthis, mfxFrameSurface1 *surface_in, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task) { - return reinterpret_cast(pthis)->VPPFrameSubmitEx(surface_in, surface_work, surface_out, task); - } - }; -} - -/* adapter for particular plugin type*/ -template -class MFXPluginAdapter -{ -public: - detail::MFXPluginAdapterInternal m_Adapter; - - operator mfxPlugin () const { - return m_Adapter.operator mfxPlugin(); - } - - MFXPluginAdapter(T* pPlugin = NULL) - : m_Adapter(pPlugin) - { - } -}; - -template -inline MFXPluginAdapter make_mfx_plugin_adapter(T* pPlugin) { - - MFXPluginAdapter adapt(pPlugin); - return adapt; -} - -#endif // __MFXPLUGINPLUSPLUS_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin.h deleted file mode 100644 index 01b3d5c2..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxplugin.h +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXPLUGIN_H__ -#define __MFXPLUGIN_H__ -#include "mfxvideo.h" -#include "mfxaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU8 Data[16]; -} mfxPluginUID; -MFX_PACK_END() - -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCD_SW = {{0x15, 0xdd, 0x93, 0x68, 0x25, 0xad, 0x47, 0x5e, 0xa3, 0x4e, 0x35, 0xf3, 0xf5, 0x42, 0x17, 0xa6}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCD_HW = {{0x33, 0xa6, 0x1c, 0x0b, 0x4c, 0x27, 0x45, 0x4c, 0xa8, 0xd8, 0x5d, 0xde, 0x75, 0x7c, 0x6f, 0x8e}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCE_SW = {{0x2f, 0xca, 0x99, 0x74, 0x9f, 0xdb, 0x49, 0xae, 0xb1, 0x21, 0xa5, 0xb6, 0x3e, 0xf5, 0x68, 0xf7}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCE_GACC = {{0xe5, 0x40, 0x0a, 0x06, 0xc7, 0x4d, 0x41, 0xf5, 0xb1, 0x2d, 0x43, 0x0b, 0xba, 0xa2, 0x3d, 0x0b}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCE_DP_GACC = {{0x2b, 0xad, 0x6f, 0x9d, 0x77, 0x54, 0x41, 0x2d, 0xbf, 0x63, 0x03, 0xed, 0x4b, 0xb5, 0x09, 0x68}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCE_HW = {{0x6f, 0xad, 0xc7, 0x91, 0xa0, 0xc2, 0xeb, 0x47, 0x9a, 0xb6, 0xdc, 0xd5, 0xea, 0x9d, 0xa3, 0x47}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_VP8D_HW = {{0xf6, 0x22, 0x39, 0x4d, 0x8d, 0x87, 0x45, 0x2f, 0x87, 0x8c, 0x51, 0xf2, 0xfc, 0x9b, 0x41, 0x31}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_VP8E_HW = {{0xbf, 0xfc, 0x51, 0x8c, 0xde, 0x13, 0x4d, 0xf9, 0x8a, 0x96, 0xf4, 0xcf, 0x81, 0x6c, 0x0f, 0xac}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_VP9E_HW = {{0xce, 0x44, 0xef, 0x6f, 0x1a, 0x6d, 0x22, 0x46, 0xb4, 0x12, 0xbb, 0x38, 0xd6, 0xe4, 0x51, 0x82}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_VP9D_HW = {{0xa9, 0x22, 0x39, 0x4d, 0x8d, 0x87, 0x45, 0x2f, 0x87, 0x8c, 0x51, 0xf2, 0xfc, 0x9b, 0x41, 0x31}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_CAMERA_HW = {{0x54, 0x54, 0x26, 0x16, 0x24, 0x33, 0x41, 0xe6, 0x93, 0xae, 0x89, 0x99, 0x42, 0xce, 0x73, 0x55}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_CAPTURE_HW = {{0x22, 0xd6, 0x2c, 0x07, 0xe6, 0x72, 0x40, 0x8f, 0xbb, 0x4c, 0xc2, 0x0e, 0xd7, 0xa0, 0x53, 0xe4}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_ITELECINE_HW = {{0xe7, 0x44, 0x75, 0x3a, 0xcd, 0x74, 0x40, 0x2e, 0x89, 0xa2, 0xee, 0x06, 0x35, 0x49, 0x61, 0x79}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_H264LA_HW = {{0x58, 0x8f, 0x11, 0x85, 0xd4, 0x7b, 0x42, 0x96, 0x8d, 0xea, 0x37, 0x7b, 0xb5, 0xd0, 0xdc, 0xb4}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_AACD = {{0xe9, 0x34, 0x67, 0x25, 0xac, 0x2f, 0x4c, 0x93, 0xaa, 0x58, 0x5c, 0x11, 0xc7, 0x08, 0x7c, 0xf4}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_AACE = {{0xb2, 0xa2, 0xa0, 0x5a, 0x4e, 0xac, 0x46, 0xbf, 0xa9, 0xde, 0x7e, 0x80, 0xc9, 0x8d, 0x2e, 0x18}}; -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVCE_FEI_HW = {{0x87, 0xe0, 0xe8, 0x02, 0x07, 0x37, 0x52, 0x40, 0x85, 0x25, 0x15, 0xcf, 0x4a, 0x5e, 0xdd, 0xe6}}; -#if (MFX_VERSION >= 1027) -MFX_DEPRECATED static const mfxPluginUID MFX_PLUGINID_HEVC_FEI_ENCODE = {{0x54, 0x18, 0xa7, 0x06, 0x66, 0xf9, 0x4d, 0x5c, 0xb4, 0xf7, 0xb1, 0xca, 0xee, 0x86, 0x33, 0x9b}}; -#endif - - -typedef enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_VIDEO_GENERAL) = 0, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_VIDEO_DECODE) = 1, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_VIDEO_ENCODE) = 2, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_VIDEO_VPP) = 3, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_VIDEO_ENC) = 4, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_AUDIO_DECODE) = 5, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_PLUGINTYPE_AUDIO_ENCODE) = 6 -} mfxPluginType; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_VIDEO_GENERAL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_VIDEO_DECODE); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_VIDEO_ENCODE); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_VIDEO_VPP); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_VIDEO_ENC); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_AUDIO_DECODE); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_PLUGINTYPE_AUDIO_ENCODE); - -typedef enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_THREADPOLICY_SERIAL) = 0, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_THREADPOLICY_PARALLEL) = 1 -} mfxThreadPolicy; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_THREADPOLICY_SERIAL); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_THREADPOLICY_PARALLEL); - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct mfxPluginParam { - mfxU32 reserved[6]; - mfxU16 reserved1; - mfxU16 PluginVersion; - mfxVersion APIVersion; - mfxPluginUID PluginUID; - mfxU32 Type; - mfxU32 CodecId; - mfxThreadPolicy ThreadPolicy; - mfxU32 MaxThreadNum; -} mfxPluginParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct mfxCoreParam{ - mfxU32 reserved[13]; - mfxIMPL Impl; - mfxVersion Version; - mfxU32 NumWorkingThread; -} mfxCoreParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct mfxCoreInterface { - mfxHDL pthis; - - mfxHDL reserved1[2]; - mfxFrameAllocator FrameAllocator; - mfxBufferAllocator reserved3; - - mfxStatus (MFX_CDECL *GetCoreParam)(mfxHDL pthis, mfxCoreParam *par); - mfxStatus (MFX_CDECL *GetHandle) (mfxHDL pthis, mfxHandleType type, mfxHDL *handle); - mfxStatus (MFX_CDECL *IncreaseReference) (mfxHDL pthis, mfxFrameData *fd); - mfxStatus (MFX_CDECL *DecreaseReference) (mfxHDL pthis, mfxFrameData *fd); - mfxStatus (MFX_CDECL *CopyFrame) (mfxHDL pthis, mfxFrameSurface1 *dst, mfxFrameSurface1 *src); - mfxStatus (MFX_CDECL *CopyBuffer)(mfxHDL pthis, mfxU8 *dst, mfxU32 size, mfxFrameSurface1 *src); - - mfxStatus (MFX_CDECL *MapOpaqueSurface)(mfxHDL pthis, mfxU32 num, mfxU32 type, mfxFrameSurface1 **op_surf); - mfxStatus (MFX_CDECL *UnmapOpaqueSurface)(mfxHDL pthis, mfxU32 num, mfxU32 type, mfxFrameSurface1 **op_surf); - - mfxStatus (MFX_CDECL *GetRealSurface)(mfxHDL pthis, mfxFrameSurface1 *op_surf, mfxFrameSurface1 **surf); - mfxStatus (MFX_CDECL *GetOpaqueSurface)(mfxHDL pthis, mfxFrameSurface1 *surf, mfxFrameSurface1 **op_surf); - - mfxStatus (MFX_CDECL *CreateAccelerationDevice)(mfxHDL pthis, mfxHandleType type, mfxHDL *handle); - mfxStatus (MFX_CDECL *GetFrameHandle) (mfxHDL pthis, mfxFrameData *fd, mfxHDL *handle); - mfxStatus (MFX_CDECL *QueryPlatform) (mfxHDL pthis, mfxPlatform *platform); - - mfxHDL reserved4[1]; -} mfxCoreInterface; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -/* video codec plugin extension */ -MFX_DEPRECATED typedef struct _mfxENCInput mfxENCInput; -MFX_DEPRECATED typedef struct _mfxENCOutput mfxENCOutput; -MFX_DEPRECATED typedef struct mfxVideoCodecPlugin{ - mfxStatus (MFX_CDECL *Query)(mfxHDL pthis, mfxVideoParam *in, mfxVideoParam *out); - mfxStatus (MFX_CDECL *QueryIOSurf)(mfxHDL pthis, mfxVideoParam *par, mfxFrameAllocRequest *in, mfxFrameAllocRequest *out); - mfxStatus (MFX_CDECL *Init)(mfxHDL pthis, mfxVideoParam *par); - mfxStatus (MFX_CDECL *Reset)(mfxHDL pthis, mfxVideoParam *par); - mfxStatus (MFX_CDECL *Close)(mfxHDL pthis); - mfxStatus (MFX_CDECL *GetVideoParam)(mfxHDL pthis, mfxVideoParam *par); - - mfxStatus (MFX_CDECL *EncodeFrameSubmit)(mfxHDL pthis, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxThreadTask *task); - - mfxStatus (MFX_CDECL *DecodeHeader)(mfxHDL pthis, mfxBitstream *bs, mfxVideoParam *par); - mfxStatus (MFX_CDECL *GetPayload)(mfxHDL pthis, mfxU64 *ts, mfxPayload *payload); - mfxStatus (MFX_CDECL *DecodeFrameSubmit)(mfxHDL pthis, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task); - - mfxStatus (MFX_CDECL *VPPFrameSubmit)(mfxHDL pthis, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxThreadTask *task); - mfxStatus (MFX_CDECL *VPPFrameSubmitEx)(mfxHDL pthis, mfxFrameSurface1 *in, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxThreadTask *task); - - mfxStatus (MFX_CDECL *ENCFrameSubmit)(mfxHDL pthis, mfxENCInput *in, mfxENCOutput *out, mfxThreadTask *task); - - mfxHDL reserved1[3]; - mfxU32 reserved2[8]; -} mfxVideoCodecPlugin; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct mfxAudioCodecPlugin{ - mfxStatus (MFX_CDECL *Query)(mfxHDL pthis, mfxAudioParam *in, mfxAudioParam *out); - mfxStatus (MFX_CDECL *QueryIOSize)(mfxHDL pthis, mfxAudioParam *par, mfxAudioAllocRequest *request); - mfxStatus (MFX_CDECL *Init)(mfxHDL pthis, mfxAudioParam *par); - mfxStatus (MFX_CDECL *Reset)(mfxHDL pthis, mfxAudioParam *par); - mfxStatus (MFX_CDECL *Close)(mfxHDL pthis); - mfxStatus (MFX_CDECL *GetAudioParam)(mfxHDL pthis, mfxAudioParam *par); - - mfxStatus (MFX_CDECL *EncodeFrameSubmit)(mfxHDL pthis, mfxAudioFrame *aFrame, mfxBitstream *out, mfxThreadTask *task); - - mfxStatus (MFX_CDECL *DecodeHeader)(mfxHDL pthis, mfxBitstream *bs, mfxAudioParam *par); -// mfxStatus (MFX_CDECL *GetPayload)(mfxHDL pthis, mfxU64 *ts, mfxPayload *payload); - mfxStatus (MFX_CDECL *DecodeFrameSubmit)(mfxHDL pthis, mfxBitstream *in, mfxAudioFrame *out, mfxThreadTask *task); - - mfxHDL reserved1[6]; - mfxU32 reserved2[8]; -} mfxAudioCodecPlugin; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct mfxPlugin{ - mfxHDL pthis; - - mfxStatus (MFX_CDECL *PluginInit) (mfxHDL pthis, mfxCoreInterface *core); - mfxStatus (MFX_CDECL *PluginClose) (mfxHDL pthis); - - mfxStatus (MFX_CDECL *GetPluginParam)(mfxHDL pthis, mfxPluginParam *par); - - mfxStatus (MFX_CDECL *Submit)(mfxHDL pthis, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxThreadTask *task); - mfxStatus (MFX_CDECL *Execute)(mfxHDL pthis, mfxThreadTask task, mfxU32 uid_p, mfxU32 uid_a); - mfxStatus (MFX_CDECL *FreeResources)(mfxHDL pthis, mfxThreadTask task, mfxStatus sts); - - union { - mfxVideoCodecPlugin *Video; - mfxAudioCodecPlugin *Audio; - }; - - mfxHDL reserved[8]; -} mfxPlugin; -MFX_PACK_END() - - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_Register(mfxSession session, mfxU32 type, const mfxPlugin *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_Unregister(mfxSession session, mfxU32 type); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_GetPlugin(mfxSession session, mfxU32 type, mfxPlugin *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_ProcessFrameAsync(mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 len); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioUSER_Register(mfxSession session, mfxU32 type, const mfxPlugin *par); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioUSER_Unregister(mfxSession session, mfxU32 type); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioUSER_ProcessFrameAsync(mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp); - -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid); - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - -#endif /* __MFXPLUGIN_H__ */ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsc.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsc.h deleted file mode 100644 index d6bc063a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsc.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXSC_H__ -#define __MFXSC_H__ -#include "mfxdefs.h" -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* Extended Buffer Ids */ -enum -{ - MFX_EXTBUFF_SCREEN_CAPTURE_PARAM = MFX_MAKEFOURCC('S','C','P','A') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct -{ - mfxExtBuffer Header; - - mfxU32 DisplayIndex; - mfxU16 EnableDirtyRect; - mfxU16 EnableCursorCapture; - mfxU16 reserved[24]; -} mfxExtScreenCaptureParam; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif /* __cplusplus */ - - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxscd.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxscd.h deleted file mode 100644 index 117ddd66..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxscd.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXSCD_H__ -#define __MFXSCD_H__ - -#include "mfxenc.h" -#include "mfxplugin.h" - -#define MFX_ENC_SCD_PLUGIN_VERSION 1 - -#ifdef __cplusplus -extern "C" { -#endif - -static const mfxPluginUID MFX_PLUGINID_ENC_SCD = {{ 0xdf, 0xc2, 0x15, 0xb3, 0xe3, 0xd3, 0x90, 0x4d, 0x7f, 0xa5, 0x04, 0x12, 0x7e, 0xf5, 0x64, 0xd5 }}; - -/* SCD Extended Buffer Ids */ -enum { - MFX_EXTBUFF_SCD = MFX_MAKEFOURCC('S','C','D',' ') -}; - -/* SceneType */ -enum { - MFX_SCD_SCENE_SAME = 0x00, - MFX_SCD_SCENE_NEW_FIELD_1 = 0x01, - MFX_SCD_SCENE_NEW_FIELD_2 = 0x02, - MFX_SCD_SCENE_NEW_PICTURE = MFX_SCD_SCENE_NEW_FIELD_1 | MFX_SCD_SCENE_NEW_FIELD_2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 SceneType; - mfxU16 reserved[27]; -} mfxExtSCD; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsession.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsession.h deleted file mode 100644 index 2d733042..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxsession.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXSESSION_H__ -#define __MFXSESSION_H__ -#include "mfxcommon.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* Global Functions */ -typedef struct _mfxSession *mfxSession; -mfxStatus MFX_CDECL MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session); -mfxStatus MFX_CDECL MFXInitEx(mfxInitParam par, mfxSession *session); -mfxStatus MFX_CDECL MFXClose(mfxSession session); - -mfxStatus MFX_CDECL MFXQueryIMPL(mfxSession session, mfxIMPL *impl); -mfxStatus MFX_CDECL MFXQueryVersion(mfxSession session, mfxVersion *version); - -mfxStatus MFX_CDECL MFXJoinSession(mfxSession session, mfxSession child); -mfxStatus MFX_CDECL MFXDisjoinSession(mfxSession session); -mfxStatus MFX_CDECL MFXCloneSession(mfxSession session, mfxSession *clone); -mfxStatus MFX_CDECL MFXSetPriority(mfxSession session, mfxPriority priority); -mfxStatus MFX_CDECL MFXGetPriority(mfxSession session, mfxPriority *priority); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXDoWork(mfxSession session); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxstructures.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxstructures.h deleted file mode 100644 index d4b8b96b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxstructures.h +++ /dev/null @@ -1,2521 +0,0 @@ -// Copyright (c) 2018-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXSTRUCTURES_H__ -#define __MFXSTRUCTURES_H__ -#include "mfxcommon.h" - -#if !defined (__GNUC__) -#pragma warning(disable: 4201) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Frame ID for SVC and MVC */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 TemporalId; - mfxU16 PriorityId; - union { - struct { - mfxU16 DependencyId; - mfxU16 QualityId; - }; - struct { - mfxU16 ViewId; - }; - }; -} mfxFrameId; -MFX_PACK_END() - -/* This struct has 4-byte alignment for binary compatibility with previously released versions of API */ -MFX_PACK_BEGIN_USUAL_STRUCT() -/* Frame Info */ -typedef struct { - mfxU32 reserved[4]; - mfxU16 reserved4; - mfxU16 BitDepthLuma; - mfxU16 BitDepthChroma; - mfxU16 Shift; - - mfxFrameId FrameId; - - mfxU32 FourCC; - union { - struct { /* Frame parameters */ - mfxU16 Width; - mfxU16 Height; - - mfxU16 CropX; - mfxU16 CropY; - mfxU16 CropW; - mfxU16 CropH; - }; - struct { /* Buffer parameters (for plain formats like P8) */ - mfxU64 BufferSize; - mfxU32 reserved5; - }; - }; - - mfxU32 FrameRateExtN; - mfxU32 FrameRateExtD; - mfxU16 reserved3; - - mfxU16 AspectRatioW; - mfxU16 AspectRatioH; - - mfxU16 PicStruct; - mfxU16 ChromaFormat; - mfxU16 reserved2; -} mfxFrameInfo; -MFX_PACK_END() - -/* FourCC */ -enum { - MFX_FOURCC_NV12 = MFX_MAKEFOURCC('N','V','1','2'), /* Native Format */ - MFX_FOURCC_YV12 = MFX_MAKEFOURCC('Y','V','1','2'), - MFX_FOURCC_NV16 = MFX_MAKEFOURCC('N','V','1','6'), - MFX_FOURCC_YUY2 = MFX_MAKEFOURCC('Y','U','Y','2'), -#if (MFX_VERSION >= 1028) - MFX_FOURCC_RGB565 = MFX_MAKEFOURCC('R','G','B','2'), /* 2 bytes per pixel, uint16 in little-endian format, where 0-4 bits are blue, bits 5-10 are green and bits 11-15 are red */ - MFX_FOURCC_RGBP = MFX_MAKEFOURCC('R','G','B','P'), -#endif - MFX_FOURCC_RGB3 = MFX_MAKEFOURCC('R','G','B','3'), /* deprecated */ - MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'), /* ARGB in that order, A channel is 8 MSBs */ - MFX_FOURCC_P8 = 41, /* D3DFMT_P8 */ - MFX_FOURCC_P8_TEXTURE = MFX_MAKEFOURCC('P','8','M','B'), - MFX_FOURCC_P010 = MFX_MAKEFOURCC('P','0','1','0'), -#if (MFX_VERSION >= 1031) - MFX_FOURCC_P016 = MFX_MAKEFOURCC('P','0','1','6'), -#endif - MFX_FOURCC_P210 = MFX_MAKEFOURCC('P','2','1','0'), - MFX_FOURCC_BGR4 = MFX_MAKEFOURCC('B','G','R','4'), /* ABGR in that order, A channel is 8 MSBs */ - MFX_FOURCC_A2RGB10 = MFX_MAKEFOURCC('R','G','1','0'), /* ARGB in that order, A channel is two MSBs */ - MFX_FOURCC_ARGB16 = MFX_MAKEFOURCC('R','G','1','6'), /* ARGB in that order, 64 bits, A channel is 16 MSBs */ - MFX_FOURCC_ABGR16 = MFX_MAKEFOURCC('B','G','1','6'), /* ABGR in that order, 64 bits, A channel is 16 MSBs */ - MFX_FOURCC_R16 = MFX_MAKEFOURCC('R','1','6','U'), - MFX_FOURCC_AYUV = MFX_MAKEFOURCC('A','Y','U','V'), /* YUV 4:4:4, AYUV in that order, A channel is 8 MSBs */ - MFX_FOURCC_AYUV_RGB4 = MFX_MAKEFOURCC('A','V','U','Y'), /* ARGB in that order, A channel is 8 MSBs stored in AYUV surface*/ - MFX_FOURCC_UYVY = MFX_MAKEFOURCC('U','Y','V','Y'), -#if (MFX_VERSION >= 1027) - MFX_FOURCC_Y210 = MFX_MAKEFOURCC('Y','2','1','0'), - MFX_FOURCC_Y410 = MFX_MAKEFOURCC('Y','4','1','0'), -#endif -#if (MFX_VERSION >= 1031) - MFX_FOURCC_Y216 = MFX_MAKEFOURCC('Y','2','1','6'), - MFX_FOURCC_Y416 = MFX_MAKEFOURCC('Y','4','1','6'), -#endif - MFX_FOURCC_NV21 = MFX_MAKEFOURCC('N', 'V', '2', '1'), /* Same as NV12 but with weaved V and U values. */ - MFX_FOURCC_IYUV = MFX_MAKEFOURCC('I', 'Y', 'U', 'V'), /* Same as YV12 except that the U and V plane order is reversed. */ - MFX_FOURCC_I010 = MFX_MAKEFOURCC('I', '0', '1', '0'), /* 10-bit YUV 4:2:0, each component has its own plane. */ -}; - -/* PicStruct */ -enum { - MFX_PICSTRUCT_UNKNOWN =0x00, - MFX_PICSTRUCT_PROGRESSIVE =0x01, - MFX_PICSTRUCT_FIELD_TFF =0x02, - MFX_PICSTRUCT_FIELD_BFF =0x04, - - MFX_PICSTRUCT_FIELD_REPEATED=0x10, /* first field repeated, pic_struct=5 or 6 in H.264 */ - MFX_PICSTRUCT_FRAME_DOUBLING=0x20, /* pic_struct=7 in H.264 */ - MFX_PICSTRUCT_FRAME_TRIPLING=0x40, /* pic_struct=8 in H.264 */ - - MFX_PICSTRUCT_FIELD_SINGLE =0x100, - MFX_PICSTRUCT_FIELD_TOP =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_TFF, - MFX_PICSTRUCT_FIELD_BOTTOM =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_BFF, - MFX_PICSTRUCT_FIELD_PAIRED_PREV =0x200, - MFX_PICSTRUCT_FIELD_PAIRED_NEXT =0x400, -}; - -/* ColorFormat */ -enum { - MFX_CHROMAFORMAT_MONOCHROME =0, - MFX_CHROMAFORMAT_YUV420 =1, - MFX_CHROMAFORMAT_YUV422 =2, - MFX_CHROMAFORMAT_YUV444 =3, - MFX_CHROMAFORMAT_YUV400 = MFX_CHROMAFORMAT_MONOCHROME, - MFX_CHROMAFORMAT_YUV411 = 4, - MFX_CHROMAFORMAT_YUV422H = MFX_CHROMAFORMAT_YUV422, - MFX_CHROMAFORMAT_YUV422V = 5, - MFX_CHROMAFORMAT_RESERVED1 = 6 -}; - -enum { - MFX_TIMESTAMP_UNKNOWN = -1 -}; - -enum { - MFX_FRAMEORDER_UNKNOWN = -1 -}; - -/* DataFlag in mfxFrameData */ -enum { - MFX_FRAMEDATA_ORIGINAL_TIMESTAMP = 0x0001 -}; - -/* Corrupted in mfxFrameData */ -enum { - MFX_CORRUPTION_MINOR = 0x0001, - MFX_CORRUPTION_MAJOR = 0x0002, - MFX_CORRUPTION_ABSENT_TOP_FIELD = 0x0004, - MFX_CORRUPTION_ABSENT_BOTTOM_FIELD = 0x0008, - MFX_CORRUPTION_REFERENCE_FRAME = 0x0010, - MFX_CORRUPTION_REFERENCE_LIST = 0x0020 -}; - -#if (MFX_VERSION >= 1027) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct -{ - mfxU32 U : 10; - mfxU32 Y : 10; - mfxU32 V : 10; - mfxU32 A : 2; -} mfxY410; -MFX_PACK_END() -#endif - -#if (MFX_VERSION >= 1025) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct -{ - mfxU32 B : 10; - mfxU32 G : 10; - mfxU32 R : 10; - mfxU32 A : 2; -} mfxA2RGB10; -MFX_PACK_END() -#endif - -/* Frame Data Info */ -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - union { - mfxExtBuffer **ExtParam; - mfxU64 reserved2; - }; - mfxU16 NumExtParam; - - mfxU16 reserved[9]; - mfxU16 MemType; - mfxU16 PitchHigh; - - mfxU64 TimeStamp; - mfxU32 FrameOrder; - mfxU16 Locked; - union{ - mfxU16 Pitch; - mfxU16 PitchLow; - }; - - /* color planes */ - union { - mfxU8 *Y; - mfxU16 *Y16; - mfxU8 *R; - }; - union { - mfxU8 *UV; /* for UV merged formats */ - mfxU8 *VU; /* for VU merged formats */ - mfxU8 *CbCr; /* for CbCr merged formats */ - mfxU8 *CrCb; /* for CrCb merged formats */ - mfxU8 *Cb; - mfxU8 *U; - mfxU16 *U16; - mfxU8 *G; -#if (MFX_VERSION >= 1027) - mfxY410 *Y410; /* for Y410 format (merged AVYU) */ -#endif - }; - union { - mfxU8 *Cr; - mfxU8 *V; - mfxU16 *V16; - mfxU8 *B; -#if (MFX_VERSION >= 1025) - mfxA2RGB10 *A2RGB10; /* for A2RGB10 format (merged ARGB) */ -#endif - }; - mfxU8 *A; - mfxMemId MemId; - - /* Additional Flags */ - mfxU16 Corrupted; - mfxU16 DataFlag; -} mfxFrameData; -MFX_PACK_END() - -/* Frame Surface */ -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxU32 reserved[4]; - mfxFrameInfo Info; - mfxFrameData Data; -} mfxFrameSurface1; -MFX_PACK_END() - -enum { - MFX_TIMESTAMPCALC_UNKNOWN = 0, - MFX_TIMESTAMPCALC_TELECINE = 1, -}; - -/* Transcoding Info */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 reserved[7]; - - mfxU16 LowPower; - mfxU16 BRCParamMultiplier; - - mfxFrameInfo FrameInfo; - mfxU32 CodecId; - mfxU16 CodecProfile; - mfxU16 CodecLevel; - mfxU16 NumThread; - - union { - struct { /* Encoding Options */ - mfxU16 TargetUsage; - - mfxU16 GopPicSize; - mfxU16 GopRefDist; - mfxU16 GopOptFlag; - mfxU16 IdrInterval; - - mfxU16 RateControlMethod; - union { - mfxU16 InitialDelayInKB; - mfxU16 QPI; - mfxU16 Accuracy; - }; - mfxU16 BufferSizeInKB; - union { - mfxU16 TargetKbps; - mfxU16 QPP; - mfxU16 ICQQuality; - }; - union { - mfxU16 MaxKbps; - mfxU16 QPB; - mfxU16 Convergence; - }; - - mfxU16 NumSlice; - mfxU16 NumRefFrame; - mfxU16 EncodedOrder; - }; - struct { /* Decoding Options */ - mfxU16 DecodedOrder; - mfxU16 ExtendedPicStruct; - mfxU16 TimeStampCalc; - mfxU16 SliceGroupsPresent; - mfxU16 MaxDecFrameBuffering; - mfxU16 EnableReallocRequest; -#if (MFX_VERSION >= 1034) - mfxU16 FilmGrain; - mfxU16 IgnoreLevelConstrain; - mfxU16 reserved2[5]; -#else - mfxU16 reserved2[7]; -#endif - }; - struct { /* JPEG Decoding Options */ - mfxU16 JPEGChromaFormat; - mfxU16 Rotation; - mfxU16 JPEGColorFormat; - mfxU16 InterleavedDec; - mfxU8 SamplingFactorH[4]; - mfxU8 SamplingFactorV[4]; - mfxU16 reserved3[5]; - }; - struct { /* JPEG Encoding Options */ - mfxU16 Interleaved; - mfxU16 Quality; - mfxU16 RestartInterval; - mfxU16 reserved5[10]; - }; - }; -} mfxInfoMFX; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 reserved[8]; - mfxFrameInfo In; - mfxFrameInfo Out; -} mfxInfoVPP; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 AllocId; - mfxU32 reserved[2]; - mfxU16 reserved3; - mfxU16 AsyncDepth; - - union { - mfxInfoMFX mfx; - mfxInfoVPP vpp; - }; - mfxU16 Protected; - mfxU16 IOPattern; - mfxExtBuffer** ExtParam; - mfxU16 NumExtParam; - mfxU16 reserved2; -} mfxVideoParam; -MFX_PACK_END() - -/* IOPattern */ -enum { - MFX_IOPATTERN_IN_VIDEO_MEMORY = 0x01, - MFX_IOPATTERN_IN_SYSTEM_MEMORY = 0x02, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_IOPATTERN_IN_OPAQUE_MEMORY) = 0x04, - MFX_IOPATTERN_OUT_VIDEO_MEMORY = 0x10, - MFX_IOPATTERN_OUT_SYSTEM_MEMORY = 0x20, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_IOPATTERN_OUT_OPAQUE_MEMORY) = 0x40 -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_IOPATTERN_IN_OPAQUE_MEMORY); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_IOPATTERN_OUT_OPAQUE_MEMORY); - -/* CodecId */ -enum { - MFX_CODEC_AVC =MFX_MAKEFOURCC('A','V','C',' '), - MFX_CODEC_HEVC =MFX_MAKEFOURCC('H','E','V','C'), - MFX_CODEC_MPEG2 =MFX_MAKEFOURCC('M','P','G','2'), - MFX_CODEC_VC1 =MFX_MAKEFOURCC('V','C','1',' '), - MFX_CODEC_CAPTURE =MFX_MAKEFOURCC('C','A','P','T'), - MFX_CODEC_VP9 =MFX_MAKEFOURCC('V','P','9',' '), - MFX_CODEC_AV1 =MFX_MAKEFOURCC('A','V','1',' ') -}; - -/* CodecProfile, CodecLevel */ -enum { - MFX_PROFILE_UNKNOWN =0, - MFX_LEVEL_UNKNOWN =0, - - /* AVC Profiles & Levels */ - MFX_PROFILE_AVC_CONSTRAINT_SET0 = (0x100 << 0), - MFX_PROFILE_AVC_CONSTRAINT_SET1 = (0x100 << 1), - MFX_PROFILE_AVC_CONSTRAINT_SET2 = (0x100 << 2), - MFX_PROFILE_AVC_CONSTRAINT_SET3 = (0x100 << 3), - MFX_PROFILE_AVC_CONSTRAINT_SET4 = (0x100 << 4), - MFX_PROFILE_AVC_CONSTRAINT_SET5 = (0x100 << 5), - - MFX_PROFILE_AVC_BASELINE =66, - MFX_PROFILE_AVC_MAIN =77, - MFX_PROFILE_AVC_EXTENDED =88, - MFX_PROFILE_AVC_HIGH =100, - MFX_PROFILE_AVC_HIGH10 =110, - MFX_PROFILE_AVC_HIGH_422 =122, - MFX_PROFILE_AVC_CONSTRAINED_BASELINE =MFX_PROFILE_AVC_BASELINE + MFX_PROFILE_AVC_CONSTRAINT_SET1, - MFX_PROFILE_AVC_CONSTRAINED_HIGH =MFX_PROFILE_AVC_HIGH + MFX_PROFILE_AVC_CONSTRAINT_SET4 - + MFX_PROFILE_AVC_CONSTRAINT_SET5, - MFX_PROFILE_AVC_PROGRESSIVE_HIGH =MFX_PROFILE_AVC_HIGH + MFX_PROFILE_AVC_CONSTRAINT_SET4, - - MFX_LEVEL_AVC_1 =10, - MFX_LEVEL_AVC_1b =9, - MFX_LEVEL_AVC_11 =11, - MFX_LEVEL_AVC_12 =12, - MFX_LEVEL_AVC_13 =13, - MFX_LEVEL_AVC_2 =20, - MFX_LEVEL_AVC_21 =21, - MFX_LEVEL_AVC_22 =22, - MFX_LEVEL_AVC_3 =30, - MFX_LEVEL_AVC_31 =31, - MFX_LEVEL_AVC_32 =32, - MFX_LEVEL_AVC_4 =40, - MFX_LEVEL_AVC_41 =41, - MFX_LEVEL_AVC_42 =42, - MFX_LEVEL_AVC_5 =50, - MFX_LEVEL_AVC_51 =51, - MFX_LEVEL_AVC_52 =52, -#if (MFX_VERSION >= 1035) - MFX_LEVEL_AVC_6 =60, - MFX_LEVEL_AVC_61 =61, - MFX_LEVEL_AVC_62 =62, -#endif - - /* MPEG-2 Profiles & Levels */ - MFX_PROFILE_MPEG2_SIMPLE =0x50, - MFX_PROFILE_MPEG2_MAIN =0x40, - MFX_PROFILE_MPEG2_HIGH =0x10, - - MFX_LEVEL_MPEG2_LOW =0xA, - MFX_LEVEL_MPEG2_MAIN =0x8, - MFX_LEVEL_MPEG2_HIGH =0x4, - MFX_LEVEL_MPEG2_HIGH1440 =0x6, - - /* VC1 Profiles & Levels */ - MFX_PROFILE_VC1_SIMPLE =(0+1), - MFX_PROFILE_VC1_MAIN =(4+1), - MFX_PROFILE_VC1_ADVANCED =(12+1), - - /* VC1 levels for simple & main profiles */ - MFX_LEVEL_VC1_LOW =(0+1), - MFX_LEVEL_VC1_MEDIAN =(2+1), - MFX_LEVEL_VC1_HIGH =(4+1), - - /* VC1 levels for the advanced profile */ - MFX_LEVEL_VC1_0 =(0x00+1), - MFX_LEVEL_VC1_1 =(0x01+1), - MFX_LEVEL_VC1_2 =(0x02+1), - MFX_LEVEL_VC1_3 =(0x03+1), - MFX_LEVEL_VC1_4 =(0x04+1), - - /* HEVC Profiles & Levels & Tiers */ - MFX_PROFILE_HEVC_MAIN =1, - MFX_PROFILE_HEVC_MAIN10 =2, - MFX_PROFILE_HEVC_MAINSP =3, - MFX_PROFILE_HEVC_REXT =4, -#if (MFX_VERSION >= 1032) - MFX_PROFILE_HEVC_SCC =9, -#endif - - MFX_LEVEL_HEVC_1 = 10, - MFX_LEVEL_HEVC_2 = 20, - MFX_LEVEL_HEVC_21 = 21, - MFX_LEVEL_HEVC_3 = 30, - MFX_LEVEL_HEVC_31 = 31, - MFX_LEVEL_HEVC_4 = 40, - MFX_LEVEL_HEVC_41 = 41, - MFX_LEVEL_HEVC_5 = 50, - MFX_LEVEL_HEVC_51 = 51, - MFX_LEVEL_HEVC_52 = 52, - MFX_LEVEL_HEVC_6 = 60, - MFX_LEVEL_HEVC_61 = 61, - MFX_LEVEL_HEVC_62 = 62, - - MFX_TIER_HEVC_MAIN = 0, - MFX_TIER_HEVC_HIGH = 0x100, - - /* VP9 Profiles */ - MFX_PROFILE_VP9_0 = 1, - MFX_PROFILE_VP9_1 = 2, - MFX_PROFILE_VP9_2 = 3, - MFX_PROFILE_VP9_3 = 4, - -#if (MFX_VERSION >= 1034) - /* AV1 Profiles */ - MFX_PROFILE_AV1_MAIN = 1, - MFX_PROFILE_AV1_HIGH = 2, - MFX_PROFILE_AV1_PRO = 3, - - MFX_LEVEL_AV1_2 = 20, - MFX_LEVEL_AV1_21 = 21, - MFX_LEVEL_AV1_22 = 22, - MFX_LEVEL_AV1_23 = 23, - MFX_LEVEL_AV1_3 = 30, - MFX_LEVEL_AV1_31 = 31, - MFX_LEVEL_AV1_32 = 32, - MFX_LEVEL_AV1_33 = 33, - MFX_LEVEL_AV1_4 = 40, - MFX_LEVEL_AV1_41 = 41, - MFX_LEVEL_AV1_42 = 42, - MFX_LEVEL_AV1_43 = 43, - MFX_LEVEL_AV1_5 = 50, - MFX_LEVEL_AV1_51 = 51, - MFX_LEVEL_AV1_52 = 52, - MFX_LEVEL_AV1_53 = 53, - MFX_LEVEL_AV1_6 = 60, - MFX_LEVEL_AV1_61 = 61, - MFX_LEVEL_AV1_62 = 62, - MFX_LEVEL_AV1_63 = 63, -#endif -}; - -/* GopOptFlag */ -enum { - MFX_GOP_CLOSED =1, - MFX_GOP_STRICT =2 -}; - -/* TargetUsages: from 1 to 7 inclusive */ -enum { - MFX_TARGETUSAGE_1 =1, - MFX_TARGETUSAGE_2 =2, - MFX_TARGETUSAGE_3 =3, - MFX_TARGETUSAGE_4 =4, - MFX_TARGETUSAGE_5 =5, - MFX_TARGETUSAGE_6 =6, - MFX_TARGETUSAGE_7 =7, - - MFX_TARGETUSAGE_UNKNOWN =0, - MFX_TARGETUSAGE_BEST_QUALITY =MFX_TARGETUSAGE_1, - MFX_TARGETUSAGE_BALANCED =MFX_TARGETUSAGE_4, - MFX_TARGETUSAGE_BEST_SPEED =MFX_TARGETUSAGE_7 -}; - -/* RateControlMethod */ -enum { - MFX_RATECONTROL_CBR =1, - MFX_RATECONTROL_VBR =2, - MFX_RATECONTROL_CQP =3, - MFX_RATECONTROL_AVBR =4, - MFX_RATECONTROL_RESERVED1 =5, - MFX_RATECONTROL_RESERVED2 =6, - MFX_RATECONTROL_RESERVED3 =100, - MFX_RATECONTROL_RESERVED4 =7, - MFX_RATECONTROL_LA =8, - MFX_RATECONTROL_ICQ =9, - MFX_RATECONTROL_VCM =10, - MFX_RATECONTROL_LA_ICQ =11, - MFX_RATECONTROL_LA_EXT =12, - MFX_RATECONTROL_LA_HRD =13, - MFX_RATECONTROL_QVBR =14, -}; - -/* Trellis control*/ -enum { - MFX_TRELLIS_UNKNOWN =0, - MFX_TRELLIS_OFF =0x01, - MFX_TRELLIS_I =0x02, - MFX_TRELLIS_P =0x04, - MFX_TRELLIS_B =0x08 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved1; - mfxU16 RateDistortionOpt; /* tri-state option */ - mfxU16 MECostType; - mfxU16 MESearchType; - mfxI16Pair MVSearchWindow; - mfxU16 EndOfSequence; /* tri-state option */ - mfxU16 FramePicture; /* tri-state option */ - - mfxU16 CAVLC; /* tri-state option */ - mfxU16 reserved2[2]; - mfxU16 RecoveryPointSEI; /* tri-state option */ - mfxU16 ViewOutput; /* tri-state option */ - mfxU16 NalHrdConformance; /* tri-state option */ - mfxU16 SingleSeiNalUnit; /* tri-state option */ - mfxU16 VuiVclHrdParameters; /* tri-state option */ - - mfxU16 RefPicListReordering; /* tri-state option */ - mfxU16 ResetRefList; /* tri-state option */ - mfxU16 RefPicMarkRep; /* tri-state option */ - mfxU16 FieldOutput; /* tri-state option */ - - mfxU16 IntraPredBlockSize; - mfxU16 InterPredBlockSize; - mfxU16 MVPrecision; - mfxU16 MaxDecFrameBuffering; - - mfxU16 AUDelimiter; /* tri-state option */ - mfxU16 EndOfStream; /* tri-state option */ - mfxU16 PicTimingSEI; /* tri-state option */ - mfxU16 VuiNalHrdParameters; /* tri-state option */ -} mfxExtCodingOption; -MFX_PACK_END() - -enum { - MFX_B_REF_UNKNOWN = 0, - MFX_B_REF_OFF = 1, - MFX_B_REF_PYRAMID = 2 -}; - -enum { - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_LOOKAHEAD_DS_UNKNOWN) = 0, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_LOOKAHEAD_DS_OFF) = 1, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_LOOKAHEAD_DS_2x) = 2, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_LOOKAHEAD_DS_4x) = 3 -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_LOOKAHEAD_DS_UNKNOWN); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_LOOKAHEAD_DS_OFF); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_LOOKAHEAD_DS_2x); -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_LOOKAHEAD_DS_4x); - -enum { - MFX_BPSEI_DEFAULT = 0x00, - MFX_BPSEI_IFRAME = 0x01 -}; - -enum { - MFX_SKIPFRAME_NO_SKIP = 0, - MFX_SKIPFRAME_INSERT_DUMMY = 1, - MFX_SKIPFRAME_INSERT_NOTHING = 2, - MFX_SKIPFRAME_BRC_ONLY = 3, -}; - -/* Intra refresh types */ -enum { - MFX_REFRESH_NO = 0, - MFX_REFRESH_VERTICAL = 1, - MFX_REFRESH_HORIZONTAL = 2, - MFX_REFRESH_SLICE = 3 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 IntRefType; - mfxU16 IntRefCycleSize; - mfxI16 IntRefQPDelta; - - mfxU32 MaxFrameSize; - mfxU32 MaxSliceSize; - - mfxU16 BitrateLimit; /* tri-state option */ - mfxU16 MBBRC; /* tri-state option */ - mfxU16 ExtBRC; /* tri-state option */ - mfxU16 LookAheadDepth; - mfxU16 Trellis; - mfxU16 RepeatPPS; /* tri-state option */ - mfxU16 BRefType; - mfxU16 AdaptiveI; /* tri-state option */ - mfxU16 AdaptiveB; /* tri-state option */ - mfxU16 LookAheadDS; - mfxU16 NumMbPerSlice; - mfxU16 SkipFrame; - mfxU8 MinQPI; /* 1..51, 0 = default */ - mfxU8 MaxQPI; /* 1..51, 0 = default */ - mfxU8 MinQPP; /* 1..51, 0 = default */ - mfxU8 MaxQPP; /* 1..51, 0 = default */ - mfxU8 MinQPB; /* 1..51, 0 = default */ - mfxU8 MaxQPB; /* 1..51, 0 = default */ - mfxU16 FixedFrameRate; /* tri-state option */ - mfxU16 DisableDeblockingIdc; - mfxU16 DisableVUI; - mfxU16 BufferingPeriodSEI; - mfxU16 EnableMAD; /* tri-state option */ - mfxU16 UseRawRef; /* tri-state option */ -} mfxExtCodingOption2; -MFX_PACK_END() - -/* WeightedPred */ -enum { - MFX_WEIGHTED_PRED_UNKNOWN = 0, - MFX_WEIGHTED_PRED_DEFAULT = 1, - MFX_WEIGHTED_PRED_EXPLICIT = 2, - MFX_WEIGHTED_PRED_IMPLICIT = 3 -}; - -/* ScenarioInfo */ -enum { - MFX_SCENARIO_UNKNOWN = 0, - MFX_SCENARIO_DISPLAY_REMOTING = 1, - MFX_SCENARIO_VIDEO_CONFERENCE = 2, - MFX_SCENARIO_ARCHIVE = 3, - MFX_SCENARIO_LIVE_STREAMING = 4, - MFX_SCENARIO_CAMERA_CAPTURE = 5, - MFX_SCENARIO_VIDEO_SURVEILLANCE = 6, - MFX_SCENARIO_GAME_STREAMING = 7, - MFX_SCENARIO_REMOTE_GAMING = 8 -}; - -/* ContentInfo */ -enum { - MFX_CONTENT_UNKNOWN = 0, - MFX_CONTENT_FULL_SCREEN_VIDEO = 1, - MFX_CONTENT_NON_VIDEO_SCREEN = 2 -}; - -/* PRefType */ -enum { - MFX_P_REF_DEFAULT = 0, - MFX_P_REF_SIMPLE = 1, - MFX_P_REF_PYRAMID = 2 -}; - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* QuantScaleType */ -enum { - MFX_MPEG2_QUANT_SCALE_TYPE_DEFAULT = 0, - MFX_MPEG2_QUANT_SCALE_TYPE_LINEAR = 1, /* q_scale_type = 0 */ - MFX_MPEG2_QUANT_SCALE_TYPE_NONLINEAR = 2 /* q_scale_type = 1 */ -}; - -/* IntraVLCFormat */ -enum { - MFX_MPEG2_INTRA_VLC_FORMAT_DEFAULT = 0, - MFX_MPEG2_INTRA_VLC_FORMAT_B14 = 1, /* use table B.14 */ - MFX_MPEG2_INTRA_VLC_FORMAT_B15 = 2 /* use table B.15 */ -}; - -/* ScanType */ -enum { - MFX_MPEG2_SCAN_TYPE_DEFAULT = 0, - MFX_MPEG2_SCAN_TYPE_ZIGZAG = 1, /* alternate_scan = 0 */ - MFX_MPEG2_SCAN_TYPE_ALTERNATE = 2 /* alternate_scan = 1 */ -}; - -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumSliceI; - mfxU16 NumSliceP; - mfxU16 NumSliceB; - - mfxU16 WinBRCMaxAvgKbps; - mfxU16 WinBRCSize; - - mfxU16 QVBRQuality; - mfxU16 EnableMBQP; - mfxU16 IntRefCycleDist; - mfxU16 DirectBiasAdjustment; /* tri-state option */ - mfxU16 GlobalMotionBiasAdjustment; /* tri-state option */ - mfxU16 MVCostScalingFactor; - mfxU16 MBDisableSkipMap; /* tri-state option */ - - mfxU16 WeightedPred; - mfxU16 WeightedBiPred; - - mfxU16 AspectRatioInfoPresent; /* tri-state option */ - mfxU16 OverscanInfoPresent; /* tri-state option */ - mfxU16 OverscanAppropriate; /* tri-state option */ - mfxU16 TimingInfoPresent; /* tri-state option */ - mfxU16 BitstreamRestriction; /* tri-state option */ - mfxU16 LowDelayHrd; /* tri-state option */ - mfxU16 MotionVectorsOverPicBoundaries; /* tri-state option */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 Log2MaxMvLengthHorizontal; /* 0..16 */ - mfxU16 Log2MaxMvLengthVertical; /* 0..16 */ -#else - mfxU16 reserved1[2]; -#endif - - mfxU16 ScenarioInfo; - mfxU16 ContentInfo; - - mfxU16 PRefType; - mfxU16 FadeDetection; /* tri-state option */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxI16 DeblockingAlphaTcOffset; /* -12..12 (slice_alpha_c0_offset_div2 << 1) */ - mfxI16 DeblockingBetaOffset; /* -12..12 (slice_beta_offset_div2 << 1) */ -#else - mfxU16 reserved2[2]; -#endif - mfxU16 GPB; /* tri-state option */ - - mfxU32 MaxFrameSizeI; - mfxU32 MaxFrameSizeP; - mfxU32 reserved3[3]; - - mfxU16 EnableQPOffset; /* tri-state option */ - mfxI16 QPOffset[8]; /* FrameQP = QPX + QPOffset[pyramid_layer]; QPX = QPB for B-pyramid, QPP for P-pyramid */ - - mfxU16 NumRefActiveP[8]; - mfxU16 NumRefActiveBL0[8]; - mfxU16 NumRefActiveBL1[8]; - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 ConstrainedIntraPredFlag; /* tri-state option */ -#else - mfxU16 reserved6; -#endif -#if (MFX_VERSION >= 1026) - mfxU16 TransformSkip; /* tri-state option; HEVC transform_skip_enabled_flag */ -#else - mfxU16 reserved7; -#endif -#if (MFX_VERSION >= 1027) - mfxU16 TargetChromaFormatPlus1; /* Minus 1 specifies target encoding chroma format (see ColorFormat enum). May differ from input one. */ - mfxU16 TargetBitDepthLuma; /* Target encoding bit depth for luma samples. May differ from input one. */ - mfxU16 TargetBitDepthChroma; /* Target encoding bit depth for chroma samples. May differ from input one. */ -#else - mfxU16 reserved4[3]; -#endif - mfxU16 BRCPanicMode; /* tri-state option */ - - mfxU16 LowDelayBRC; /* tri-state option */ - mfxU16 EnableMBForceIntra; /* tri-state option */ - mfxU16 AdaptiveMaxFrameSize; /* tri-state option */ - - mfxU16 RepartitionCheckEnable; /* tri-state option */ -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 QuantScaleType; /* For MPEG2 specifies mapping between quantiser_scale_code and quantiser_scale (see QuantScaleType enum) */ - mfxU16 IntraVLCFormat; /* For MPEG2 specifies which table shall be used for coding of DCT coefficients of intra macroblocks (see IntraVLCFormat enum) */ - mfxU16 ScanType; /* For MPEG2 specifies transform coefficients scan pattern (see ScanType enum) */ -#else - mfxU16 reserved5[3]; -#endif -#if (MFX_VERSION >= 1025) - mfxU16 EncodedUnitsInfo; /* tri-state option */ - mfxU16 EnableNalUnitType; /* tri-state option */ -#else - mfxU16 reserved8[2]; -#endif -#if (MFX_VERSION >= 1026) - mfxU16 ExtBrcAdaptiveLTR; /* tri-state option for ExtBRC */ -#else - mfxU16 reserved9; -#endif - mfxU16 reserved[163]; -} mfxExtCodingOption3; -MFX_PACK_END() - -/* IntraPredBlockSize/InterPredBlockSize */ -enum { - MFX_BLOCKSIZE_UNKNOWN = 0, - MFX_BLOCKSIZE_MIN_16X16 = 1, /* 16x16 */ - MFX_BLOCKSIZE_MIN_8X8 = 2, /* 16x16, 8x8 */ - MFX_BLOCKSIZE_MIN_4X4 = 3 /* 16x16, 8x8, 4x4 */ -}; - -/* MVPrecision */ -enum { - MFX_MVPRECISION_UNKNOWN = 0, - MFX_MVPRECISION_INTEGER = (1 << 0), - MFX_MVPRECISION_HALFPEL = (1 << 1), - MFX_MVPRECISION_QUARTERPEL = (1 << 2) -}; - -enum { - MFX_CODINGOPTION_UNKNOWN =0, - MFX_CODINGOPTION_ON =0x10, - MFX_CODINGOPTION_OFF =0x20, - MFX_CODINGOPTION_ADAPTIVE =0x30 -}; - -/* Data Flag for mfxBitstream*/ -enum { - MFX_BITSTREAM_COMPLETE_FRAME = 0x0001, /* the bitstream contains a complete frame or field pair of data */ - MFX_BITSTREAM_EOS = 0x0002 -}; -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_CODING_OPTION = MFX_MAKEFOURCC('C','D','O','P'), - MFX_EXTBUFF_CODING_OPTION_SPSPPS = MFX_MAKEFOURCC('C','O','S','P'), - MFX_EXTBUFF_VPP_DONOTUSE = MFX_MAKEFOURCC('N','U','S','E'), - MFX_EXTBUFF_VPP_AUXDATA = MFX_MAKEFOURCC('A','U','X','D'), - MFX_EXTBUFF_VPP_DENOISE = MFX_MAKEFOURCC('D','N','I','S'), - MFX_EXTBUFF_VPP_SCENE_ANALYSIS = MFX_MAKEFOURCC('S','C','L','Y'), - MFX_EXTBUFF_VPP_SCENE_CHANGE = MFX_EXTBUFF_VPP_SCENE_ANALYSIS, - MFX_EXTBUFF_VPP_PROCAMP = MFX_MAKEFOURCC('P','A','M','P'), - MFX_EXTBUFF_VPP_DETAIL = MFX_MAKEFOURCC('D','E','T',' '), - MFX_EXTBUFF_VIDEO_SIGNAL_INFO = MFX_MAKEFOURCC('V','S','I','N'), - MFX_EXTBUFF_VPP_DOUSE = MFX_MAKEFOURCC('D','U','S','E'), - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION) = MFX_MAKEFOURCC('O','P','Q','S'), - MFX_EXTBUFF_AVC_REFLIST_CTRL = MFX_MAKEFOURCC('R','L','S','T'), - MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION = MFX_MAKEFOURCC('F','R','C',' '), - MFX_EXTBUFF_PICTURE_TIMING_SEI = MFX_MAKEFOURCC('P','T','S','E'), - MFX_EXTBUFF_AVC_TEMPORAL_LAYERS = MFX_MAKEFOURCC('A','T','M','L'), - MFX_EXTBUFF_CODING_OPTION2 = MFX_MAKEFOURCC('C','D','O','2'), - MFX_EXTBUFF_VPP_IMAGE_STABILIZATION = MFX_MAKEFOURCC('I','S','T','B'), - MFX_EXTBUFF_VPP_PICSTRUCT_DETECTION = MFX_MAKEFOURCC('I','D','E','T'), - MFX_EXTBUFF_ENCODER_CAPABILITY = MFX_MAKEFOURCC('E','N','C','P'), - MFX_EXTBUFF_ENCODER_RESET_OPTION = MFX_MAKEFOURCC('E','N','R','O'), - MFX_EXTBUFF_ENCODED_FRAME_INFO = MFX_MAKEFOURCC('E','N','F','I'), - MFX_EXTBUFF_VPP_COMPOSITE = MFX_MAKEFOURCC('V','C','M','P'), - MFX_EXTBUFF_VPP_VIDEO_SIGNAL_INFO = MFX_MAKEFOURCC('V','V','S','I'), - MFX_EXTBUFF_ENCODER_ROI = MFX_MAKEFOURCC('E','R','O','I'), - MFX_EXTBUFF_VPP_DEINTERLACING = MFX_MAKEFOURCC('V','P','D','I'), - MFX_EXTBUFF_AVC_REFLISTS = MFX_MAKEFOURCC('R','L','T','S'), - MFX_EXTBUFF_DEC_VIDEO_PROCESSING = MFX_MAKEFOURCC('D','E','C','V'), - MFX_EXTBUFF_VPP_FIELD_PROCESSING = MFX_MAKEFOURCC('F','P','R','O'), - MFX_EXTBUFF_CODING_OPTION3 = MFX_MAKEFOURCC('C','D','O','3'), - MFX_EXTBUFF_CHROMA_LOC_INFO = MFX_MAKEFOURCC('C','L','I','N'), - MFX_EXTBUFF_MBQP = MFX_MAKEFOURCC('M','B','Q','P'), - MFX_EXTBUFF_MB_FORCE_INTRA = MFX_MAKEFOURCC('M','B','F','I'), - MFX_EXTBUFF_HEVC_TILES = MFX_MAKEFOURCC('2','6','5','T'), - MFX_EXTBUFF_MB_DISABLE_SKIP_MAP = MFX_MAKEFOURCC('M','D','S','M'), - MFX_EXTBUFF_HEVC_PARAM = MFX_MAKEFOURCC('2','6','5','P'), - MFX_EXTBUFF_DECODED_FRAME_INFO = MFX_MAKEFOURCC('D','E','F','I'), - MFX_EXTBUFF_TIME_CODE = MFX_MAKEFOURCC('T','M','C','D'), - MFX_EXTBUFF_HEVC_REGION = MFX_MAKEFOURCC('2','6','5','R'), - MFX_EXTBUFF_PRED_WEIGHT_TABLE = MFX_MAKEFOURCC('E','P','W','T'), - MFX_EXTBUFF_DIRTY_RECTANGLES = MFX_MAKEFOURCC('D','R','O','I'), - MFX_EXTBUFF_MOVING_RECTANGLES = MFX_MAKEFOURCC('M','R','O','I'), - MFX_EXTBUFF_CODING_OPTION_VPS = MFX_MAKEFOURCC('C','O','V','P'), - MFX_EXTBUFF_VPP_ROTATION = MFX_MAKEFOURCC('R','O','T',' '), - MFX_EXTBUFF_ENCODED_SLICES_INFO = MFX_MAKEFOURCC('E','N','S','I'), - MFX_EXTBUFF_VPP_SCALING = MFX_MAKEFOURCC('V','S','C','L'), - MFX_EXTBUFF_HEVC_REFLIST_CTRL = MFX_EXTBUFF_AVC_REFLIST_CTRL, - MFX_EXTBUFF_HEVC_REFLISTS = MFX_EXTBUFF_AVC_REFLISTS, - MFX_EXTBUFF_HEVC_TEMPORAL_LAYERS = MFX_EXTBUFF_AVC_TEMPORAL_LAYERS, - MFX_EXTBUFF_VPP_MIRRORING = MFX_MAKEFOURCC('M','I','R','R'), - MFX_EXTBUFF_MV_OVER_PIC_BOUNDARIES = MFX_MAKEFOURCC('M','V','P','B'), - MFX_EXTBUFF_VPP_COLORFILL = MFX_MAKEFOURCC('V','C','L','F'), -#if (MFX_VERSION >= 1025) - MFX_EXTBUFF_DECODE_ERROR_REPORT = MFX_MAKEFOURCC('D', 'E', 'R', 'R'), - MFX_EXTBUFF_VPP_COLOR_CONVERSION = MFX_MAKEFOURCC('V', 'C', 'S', 'C'), - MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO = MFX_MAKEFOURCC('L', 'L', 'I', 'S'), - MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME = MFX_MAKEFOURCC('D', 'C', 'V', 'S'), - MFX_EXTBUFF_MULTI_FRAME_PARAM = MFX_MAKEFOURCC('M', 'F', 'R', 'P'), - MFX_EXTBUFF_MULTI_FRAME_CONTROL = MFX_MAKEFOURCC('M', 'F', 'R', 'C'), - MFX_EXTBUFF_ENCODED_UNITS_INFO = MFX_MAKEFOURCC('E', 'N', 'U', 'I'), -#endif -#if (MFX_VERSION >= 1026) - MFX_EXTBUFF_VPP_MCTF = MFX_MAKEFOURCC('M', 'C', 'T', 'F'), - MFX_EXTBUFF_VP9_SEGMENTATION = MFX_MAKEFOURCC('9', 'S', 'E', 'G'), - MFX_EXTBUFF_VP9_TEMPORAL_LAYERS = MFX_MAKEFOURCC('9', 'T', 'M', 'L'), - MFX_EXTBUFF_VP9_PARAM = MFX_MAKEFOURCC('9', 'P', 'A', 'R'), -#endif -#if (MFX_VERSION >= 1027) - MFX_EXTBUFF_AVC_ROUNDING_OFFSET = MFX_MAKEFOURCC('R','N','D','O'), -#endif -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_EXTBUFF_DPB = MFX_MAKEFOURCC('E','D','P','B'), - MFX_EXTBUFF_TEMPORAL_LAYERS = MFX_MAKEFOURCC('T','M','P','L'), - MFX_EXTBUFF_AVC_SCALING_MATRIX = MFX_MAKEFOURCC('A','V','S','M'), - MFX_EXTBUFF_MPEG2_QUANT_MATRIX = MFX_MAKEFOURCC('M','2','Q','M'), - MFX_EXTBUFF_TASK_DEPENDENCY = MFX_MAKEFOURCC('S','Y','N','C'), -#endif -#if (MFX_VERSION >= 1031) - MFX_EXTBUFF_PARTIAL_BITSTREAM_PARAM = MFX_MAKEFOURCC('P','B','O','P'), -#endif - MFX_EXTBUFF_ENCODER_IPCM_AREA = MFX_MAKEFOURCC('P', 'C', 'M', 'R'), - MFX_EXTBUFF_INSERT_HEADERS = MFX_MAKEFOURCC('S', 'P', 'R', 'E'), -#if (MFX_VERSION >= 1034) - MFX_EXTBUFF_AV1_FILM_GRAIN_PARAM = MFX_MAKEFOURCC('A','1','F','G'), - MFX_EXTBUFF_AV1_LST_PARAM = MFX_MAKEFOURCC('A', '1', 'L', 'S'), - MFX_EXTBUFF_AV1_SEGMENTATION = MFX_MAKEFOURCC('1', 'S', 'E', 'G'), - MFX_EXTBUFF_AV1_PARAM = MFX_MAKEFOURCC('1', 'P', 'A', 'R'), - MFX_EXTBUFF_AV1_AUXDATA = MFX_MAKEFOURCC('1', 'A', 'U', 'X'), - MFX_EXTBUFF_AV1_TEMPORAL_LAYERS = MFX_MAKEFOURCC('1', 'T', 'M', 'L') -#endif -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION); - -/* VPP Conf: Do not use certain algorithms */ -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - mfxU32 NumAlg; - mfxU32* AlgList; -} mfxExtVPPDoNotUse; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 DenoiseFactor; -} mfxExtVPPDenoise; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 DetailFactor; -} mfxExtVPPDetail; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - mfxF64 Brightness; - mfxF64 Contrast; - mfxF64 Hue; - mfxF64 Saturation; -} mfxExtVPPProcAmp; -MFX_PACK_END() - -/* statistics collected for decode, encode and vpp */ -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxU32 reserved[16]; - mfxU32 NumFrame; - mfxU64 NumBit; - mfxU32 NumCachedFrame; -} mfxEncodeStat; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 reserved[16]; - mfxU32 NumFrame; - mfxU32 NumSkippedFrame; - mfxU32 NumError; - mfxU32 NumCachedFrame; -} mfxDecodeStat; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU32 reserved[16]; - mfxU32 NumFrame; - mfxU32 NumCachedFrame; -} mfxVPPStat; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - union{ - struct{ - mfxU32 SpatialComplexity; - mfxU32 TemporalComplexity; - }; - struct{ - mfxU16 PicStruct; - mfxU16 reserved[3]; - }; - }; - mfxU16 SceneChangeRate; - mfxU16 RepeatedFrame; -} mfxExtVppAuxData; -MFX_PACK_END() - -/* CtrlFlags */ -enum { - MFX_PAYLOAD_CTRL_SUFFIX = 0x00000001 /* HEVC suffix SEI */ -}; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 CtrlFlags; - mfxU32 reserved[3]; - mfxU8 *Data; /* buffer pointer */ - mfxU32 NumBit; /* number of bits */ - mfxU16 Type; /* SEI message type in H.264 or user data start_code in MPEG-2 */ - mfxU16 BufSize; /* payload buffer size in bytes */ -} mfxPayload; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; -#if (MFX_VERSION >= 1025) - mfxU32 reserved[4]; - mfxU16 reserved1; - mfxU16 MfxNalUnitType; -#else - mfxU32 reserved[5]; -#endif - mfxU16 SkipFrame; - - mfxU16 QP; /* per frame QP */ - - mfxU16 FrameType; - mfxU16 NumExtParam; - mfxU16 NumPayload; /* MPEG-2 user data or H.264 SEI message(s) */ - mfxU16 reserved2; - - mfxExtBuffer **ExtParam; - mfxPayload **Payload; /* for field pair, first field uses even payloads and second field uses odd payloads */ -} mfxEncodeCtrl; -MFX_PACK_END() - -/* Buffer Memory Types */ -enum { - /* Buffer types */ - MFX_MEMTYPE_PERSISTENT_MEMORY =0x0002 -}; - -/* Frame Memory Types */ -#define MFX_MEMTYPE_BASE(x) (0x90ff & (x)) - -enum { - MFX_MEMTYPE_DXVA2_DECODER_TARGET =0x0010, - MFX_MEMTYPE_DXVA2_PROCESSOR_TARGET =0x0020, - MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET = MFX_MEMTYPE_DXVA2_DECODER_TARGET, - MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET = MFX_MEMTYPE_DXVA2_PROCESSOR_TARGET, - MFX_MEMTYPE_SYSTEM_MEMORY =0x0040, - MFX_MEMTYPE_RESERVED1 =0x0080, - - MFX_MEMTYPE_FROM_ENCODE = 0x0100, - MFX_MEMTYPE_FROM_DECODE = 0x0200, - MFX_MEMTYPE_FROM_VPPIN = 0x0400, - MFX_MEMTYPE_FROM_VPPOUT = 0x0800, - MFX_MEMTYPE_FROM_ENC = 0x2000, - MFX_MEMTYPE_FROM_PAK = 0x4000, //reserved - - MFX_MEMTYPE_INTERNAL_FRAME = 0x0001, - MFX_MEMTYPE_EXTERNAL_FRAME = 0x0002, - MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_MEMTYPE_OPAQUE_FRAME) = 0x0004, - MFX_MEMTYPE_EXPORT_FRAME = 0x0008, - MFX_MEMTYPE_SHARED_RESOURCE = MFX_MEMTYPE_EXPORT_FRAME, -#if (MFX_VERSION >= 1025) - MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET = 0x1000 -#else - MFX_MEMTYPE_RESERVED2 = 0x1000 -#endif -}; - -MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(MFX_MEMTYPE_OPAQUE_FRAME); - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - union { - mfxU32 AllocId; - mfxU32 reserved[1]; - }; - mfxU32 reserved3[3]; - mfxFrameInfo Info; - mfxU16 Type; /* decoder or processor render targets */ - mfxU16 NumFrameMin; - mfxU16 NumFrameSuggested; - mfxU16 reserved2; -} mfxFrameAllocRequest; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 AllocId; - mfxU32 reserved[3]; - mfxMemId *mids; /* the array allocated by application */ - mfxU16 NumFrameActual; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 MemType; -#else - mfxU16 reserved2; -#endif -} mfxFrameAllocResponse; -MFX_PACK_END() - -/* FrameType */ -enum { - MFX_FRAMETYPE_UNKNOWN =0x0000, - - MFX_FRAMETYPE_I =0x0001, - MFX_FRAMETYPE_P =0x0002, - MFX_FRAMETYPE_B =0x0004, - MFX_FRAMETYPE_S =0x0008, - - MFX_FRAMETYPE_REF =0x0040, - MFX_FRAMETYPE_IDR =0x0080, - - MFX_FRAMETYPE_xI =0x0100, - MFX_FRAMETYPE_xP =0x0200, - MFX_FRAMETYPE_xB =0x0400, - MFX_FRAMETYPE_xS =0x0800, - - MFX_FRAMETYPE_xREF =0x4000, - MFX_FRAMETYPE_xIDR =0x8000 -}; - -#if (MFX_VERSION >= 1025) -enum { - MFX_HEVC_NALU_TYPE_UNKNOWN = 0, - MFX_HEVC_NALU_TYPE_TRAIL_N = ( 0+1), - MFX_HEVC_NALU_TYPE_TRAIL_R = ( 1+1), - MFX_HEVC_NALU_TYPE_RADL_N = ( 6+1), - MFX_HEVC_NALU_TYPE_RADL_R = ( 7+1), - MFX_HEVC_NALU_TYPE_RASL_N = ( 8+1), - MFX_HEVC_NALU_TYPE_RASL_R = ( 9+1), - MFX_HEVC_NALU_TYPE_IDR_W_RADL = (19+1), - MFX_HEVC_NALU_TYPE_IDR_N_LP = (20+1), - MFX_HEVC_NALU_TYPE_CRA_NUT = (21+1) -}; -#endif - -typedef enum { - MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9 =1, /* IDirect3DDeviceManager9 */ - MFX_HANDLE_D3D9_DEVICE_MANAGER = MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9, - MFX_HANDLE_RESERVED1 = 2, - MFX_HANDLE_D3D11_DEVICE = 3, - MFX_HANDLE_VA_DISPLAY = 4, - MFX_HANDLE_RESERVED3 = 5, -#if (MFX_VERSION >= 1030) - MFX_HANDLE_VA_CONFIG_ID = 6, - MFX_HANDLE_VA_CONTEXT_ID = 7, -#endif -#if (MFX_VERSION >= MFX_VERSION_NEXT) - MFX_HANDLE_CM_DEVICE = 8 -#endif -} mfxHandleType; - -typedef enum { - MFX_SKIPMODE_NOSKIP=0, - MFX_SKIPMODE_MORE=1, - MFX_SKIPMODE_LESS=2 -} mfxSkipMode; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - mfxU8 *SPSBuffer; - mfxU8 *PPSBuffer; - mfxU16 SPSBufSize; - mfxU16 PPSBufSize; - mfxU16 SPSId; - mfxU16 PPSId; -} mfxExtCodingOptionSPSPPS; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - union { - mfxU8 *VPSBuffer; - mfxU64 reserved1; - }; - mfxU16 VPSBufSize; - mfxU16 VPSId; - - mfxU16 reserved[6]; -} mfxExtCodingOptionVPS; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 VideoFormat; - mfxU16 VideoFullRange; - mfxU16 ColourDescriptionPresent; - mfxU16 ColourPrimaries; - mfxU16 TransferCharacteristics; - mfxU16 MatrixCoefficients; -} mfxExtVideoSignalInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - mfxU32 NumAlg; - mfxU32 *AlgList; -} mfxExtVPPDoUse; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[2]; - struct { - mfxFrameSurface1 **Surfaces; - mfxU32 reserved2[5]; - mfxU16 Type; - mfxU16 NumSurface; - } In, Out; -} mfxExtOpaqueSurfaceAlloc; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 NumRefIdxL0Active; - mfxU16 NumRefIdxL1Active; - - struct { - mfxU32 FrameOrder; - mfxU16 PicStruct; - mfxU16 ViewId; - mfxU16 LongTermIdx; - mfxU16 reserved[3]; - } PreferredRefList[32], RejectedRefList[16], LongTermRefList[16]; - - mfxU16 ApplyLongTermIdx; - mfxU16 reserved[15]; -} mfxExtAVCRefListCtrl; -MFX_PACK_END() - -enum { - MFX_FRCALGM_PRESERVE_TIMESTAMP = 0x0001, - MFX_FRCALGM_DISTRIBUTED_TIMESTAMP = 0x0002, - MFX_FRCALGM_FRAME_INTERPOLATION = 0x0004 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 Algorithm; - mfxU16 reserved; - mfxU32 reserved2[15]; -} mfxExtVPPFrameRateConversion; -MFX_PACK_END() - -enum { - MFX_IMAGESTAB_MODE_UPSCALE = 0x0001, - MFX_IMAGESTAB_MODE_BOXING = 0x0002 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 Mode; - mfxU16 reserved[11]; -} mfxExtVPPImageStab; -MFX_PACK_END() - -#if (MFX_VERSION >= 1025) - -enum { - MFX_PAYLOAD_OFF = 0, - MFX_PAYLOAD_IDR = 1 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 reserved[15]; - - mfxU16 InsertPayloadToggle; - mfxU16 DisplayPrimariesX[3]; - mfxU16 DisplayPrimariesY[3]; - mfxU16 WhitePointX; - mfxU16 WhitePointY; - mfxU32 MaxDisplayMasteringLuminance; - mfxU32 MinDisplayMasteringLuminance; -} mfxExtMasteringDisplayColourVolume; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 reserved[9]; - - mfxU16 InsertPayloadToggle; - mfxU16 MaxContentLightLevel; - mfxU16 MaxPicAverageLightLevel; -} mfxExtContentLightLevelInfo; -MFX_PACK_END() -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU32 reserved[14]; - - struct { - mfxU16 ClockTimestampFlag; - mfxU16 CtType; - mfxU16 NuitFieldBasedFlag; - mfxU16 CountingType; - mfxU16 FullTimestampFlag; - mfxU16 DiscontinuityFlag; - mfxU16 CntDroppedFlag; - mfxU16 NFrames; - mfxU16 SecondsFlag; - mfxU16 MinutesFlag; - mfxU16 HoursFlag; - mfxU16 SecondsValue; - mfxU16 MinutesValue; - mfxU16 HoursValue; - mfxU32 TimeOffset; - } TimeStamp[3]; -} mfxExtPictureTimingSEI; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU32 reserved1[4]; - mfxU16 reserved2; - mfxU16 BaseLayerPID; - - struct { - mfxU16 Scale; - mfxU16 reserved[3]; - }Layer[8]; -} mfxExtAvcTemporalLayers; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU32 MBPerSec; - mfxU16 reserved[58]; -} mfxExtEncoderCapability; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 StartNewSequence; - mfxU16 reserved[11]; -} mfxExtEncoderResetOption; -MFX_PACK_END() - -/*LongTermIdx*/ -enum { - MFX_LONGTERM_IDX_NO_IDX = 0xFFFF -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU32 FrameOrder; - mfxU16 PicStruct; - mfxU16 LongTermIdx; - mfxU32 MAD; - mfxU16 BRCPanicMode; - mfxU16 QP; - mfxU32 SecondFieldOffset; - mfxU16 reserved[2]; - - struct { - mfxU32 FrameOrder; - mfxU16 PicStruct; - mfxU16 LongTermIdx; - mfxU16 reserved[4]; - } UsedRefListL0[32], UsedRefListL1[32]; -} mfxExtAVCEncodedFrameInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct mfxVPPCompInputStream { - mfxU32 DstX; - mfxU32 DstY; - mfxU32 DstW; - mfxU32 DstH; - - mfxU16 LumaKeyEnable; - mfxU16 LumaKeyMin; - mfxU16 LumaKeyMax; - - mfxU16 GlobalAlphaEnable; - mfxU16 GlobalAlpha; - mfxU16 PixelAlphaEnable; - - mfxU16 TileId; - - mfxU16 reserved2[17]; -} mfxVPPCompInputStream; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; - - /* background color*/ - union { - mfxU16 Y; - mfxU16 R; - }; - union { - mfxU16 U; - mfxU16 G; - }; - union { - mfxU16 V; - mfxU16 B; - }; - mfxU16 NumTiles; - mfxU16 reserved1[23]; - - mfxU16 NumInputStream; - mfxVPPCompInputStream *InputStream; -} mfxExtVPPComposite; -MFX_PACK_END() - -/* TransferMatrix */ -enum { - MFX_TRANSFERMATRIX_UNKNOWN = 0, - MFX_TRANSFERMATRIX_BT709 = 1, - MFX_TRANSFERMATRIX_BT601 = 2 -}; - -/* NominalRange */ -enum { - MFX_NOMINALRANGE_UNKNOWN = 0, - MFX_NOMINALRANGE_0_255 = 1, - MFX_NOMINALRANGE_16_235 = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 reserved1[4]; - - union { - struct { // Init - struct { - mfxU16 TransferMatrix; - mfxU16 NominalRange; - mfxU16 reserved2[6]; - } In, Out; - }; - struct { // Runtime - mfxU16 TransferMatrix; - mfxU16 NominalRange; - mfxU16 reserved3[14]; - }; - }; -} mfxExtVPPVideoSignalInfo; -MFX_PACK_END() - -/* ROI encoding mode */ -enum { - MFX_ROI_MODE_PRIORITY = 0, - MFX_ROI_MODE_QP_DELTA = 1, - MFX_ROI_MODE_QP_VALUE = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumROI; - mfxU16 ROIMode; - mfxU16 reserved1[10]; - - struct { - mfxU32 Left; - mfxU32 Top; - mfxU32 Right; - mfxU32 Bottom; - union { - mfxI16 Priority; - mfxI16 DeltaQP; - }; - mfxU16 reserved2[7]; - } ROI[256]; -} mfxExtEncoderROI; -MFX_PACK_END() - -/*Deinterlacing Mode*/ -enum { - MFX_DEINTERLACING_BOB = 1, - MFX_DEINTERLACING_ADVANCED = 2, - MFX_DEINTERLACING_AUTO_DOUBLE = 3, - MFX_DEINTERLACING_AUTO_SINGLE = 4, - MFX_DEINTERLACING_FULL_FR_OUT = 5, - MFX_DEINTERLACING_HALF_FR_OUT = 6, - MFX_DEINTERLACING_24FPS_OUT = 7, - MFX_DEINTERLACING_FIXED_TELECINE_PATTERN = 8, - MFX_DEINTERLACING_30FPS_OUT = 9, - MFX_DEINTERLACING_DETECT_INTERLACE = 10, - MFX_DEINTERLACING_ADVANCED_NOREF = 11, - MFX_DEINTERLACING_ADVANCED_SCD = 12, - MFX_DEINTERLACING_FIELD_WEAVING = 13 -}; - -/*TelecinePattern*/ -enum { - MFX_TELECINE_PATTERN_32 = 0, - MFX_TELECINE_PATTERN_2332 = 1, - MFX_TELECINE_PATTERN_FRAME_REPEAT = 2, - MFX_TELECINE_PATTERN_41 = 3, - MFX_TELECINE_POSITION_PROVIDED = 4 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 Mode; - mfxU16 TelecinePattern; - mfxU16 TelecineLocation; - mfxU16 reserved[9]; -} mfxExtVPPDeinterlacing; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 NumRefIdxL0Active; - mfxU16 NumRefIdxL1Active; - mfxU16 reserved[2]; - - struct mfxRefPic{ - mfxU32 FrameOrder; - mfxU16 PicStruct; - mfxU16 reserved[5]; - } RefPicList0[32], RefPicList1[32]; - -}mfxExtAVCRefLists; -MFX_PACK_END() - -enum { - MFX_VPP_COPY_FRAME =0x01, - MFX_VPP_COPY_FIELD =0x02, - MFX_VPP_SWAP_FIELDS =0x03 -}; - -/*PicType*/ -enum { - MFX_PICTYPE_UNKNOWN =0x00, - MFX_PICTYPE_FRAME =0x01, - MFX_PICTYPE_TOPFIELD =0x02, - MFX_PICTYPE_BOTTOMFIELD =0x04 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Mode; - mfxU16 InField; - mfxU16 OutField; - mfxU16 reserved[25]; -} mfxExtVPPFieldProcessing; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - struct mfxIn{ - mfxU16 CropX; - mfxU16 CropY; - mfxU16 CropW; - mfxU16 CropH; - mfxU16 reserved[12]; - }In; - - struct mfxOut{ - mfxU32 FourCC; - mfxU16 ChromaFormat; - mfxU16 reserved1; - - mfxU16 Width; - mfxU16 Height; - - mfxU16 CropX; - mfxU16 CropY; - mfxU16 CropW; - mfxU16 CropH; - mfxU16 reserved[22]; - }Out; - - mfxU16 reserved[13]; -} mfxExtDecVideoProcessing; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 ChromaLocInfoPresentFlag; - mfxU16 ChromaSampleLocTypeTopField; - mfxU16 ChromaSampleLocTypeBottomField; - mfxU16 reserved[9]; -} mfxExtChromaLocInfo; -MFX_PACK_END() - -/* MBQPMode */ -enum { - MFX_MBQP_MODE_QP_VALUE = 0, // supported in CQP mode only - MFX_MBQP_MODE_QP_DELTA = 1, - MFX_MBQP_MODE_QP_ADAPTIVE = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct{ - union { - mfxU8 QP; - mfxI8 DeltaQP; - }; - mfxU16 Mode; -} mfxQPandMode; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU32 reserved[10]; - mfxU16 Mode; // see MBQPMode enum - mfxU16 BlockSize; // QP block size, valid for HEVC only during Init and Runtime - mfxU32 NumQPAlloc; // Size of allocated by application QP or DeltaQP array - union { - mfxU8 *QP; // Block QP value. Valid when Mode = MFX_MBQP_MODE_QP_VALUE - mfxI8 *DeltaQP; // For block i: QP[i] = BrcQP[i] + DeltaQP[i]. Valid when Mode = MFX_MBQP_MODE_QP_DELTA -#if (MFX_VERSION >= 1034) - mfxQPandMode *QPmode; // Block-granularity modes when MFX_MBQP_MODE_QP_ADAPTIVE is set -#endif - mfxU64 reserved2; - }; -} mfxExtMBQP; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; /* Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_INSERT_HEADERS. */ - mfxU16 SPS; /* tri-state option to insert SPS */ - mfxU16 PPS; /* tri-state option to insert PPS */ - mfxU16 reserved[8]; -} mfxExtInsertHeaders; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxExtBuffer Header; /* Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_ENCODER_IPCM_AREA. */ - mfxU16 reserve1[10]; - - mfxU16 NumArea; /* Number of Area's */ - struct area { - mfxU32 Left; /* Left Area's coordinate. */ - mfxU32 Top; /* Top Area's coordinate. */ - mfxU32 Right; /* Right Area's coordinate. */ - mfxU32 Bottom; /* Bottom Area's coordinate. */ - - mfxU16 reserved2[8]; - } * Areas; /* Array of areas. */ -} mfxExtEncoderIPCMArea; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU32 reserved[11]; - mfxU32 MapSize; - union { - mfxU8 *Map; - mfxU64 reserved2; - }; -} mfxExtMBForceIntra; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumTileRows; - mfxU16 NumTileColumns; - mfxU16 reserved[74]; -}mfxExtHEVCTiles; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU32 reserved[11]; - mfxU32 MapSize; - union { - mfxU8 *Map; - mfxU64 reserved2; - }; -} mfxExtMBDisableSkipMap; -MFX_PACK_END() - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 DPBSize; - mfxU16 reserved[11]; - - struct { - mfxU32 FrameOrder; - mfxU16 PicType; - mfxU16 LongTermIdx; - mfxU16 reserved[4]; - } DPB[32]; -} mfxExtDPB; -MFX_PACK_END() - -#endif - -/*GeneralConstraintFlags*/ -enum { - /* REXT Profile constraint flags*/ - MFX_HEVC_CONSTR_REXT_MAX_12BIT = (1 << 0), - MFX_HEVC_CONSTR_REXT_MAX_10BIT = (1 << 1), - MFX_HEVC_CONSTR_REXT_MAX_8BIT = (1 << 2), - MFX_HEVC_CONSTR_REXT_MAX_422CHROMA = (1 << 3), - MFX_HEVC_CONSTR_REXT_MAX_420CHROMA = (1 << 4), - MFX_HEVC_CONSTR_REXT_MAX_MONOCHROME = (1 << 5), - MFX_HEVC_CONSTR_REXT_INTRA = (1 << 6), - MFX_HEVC_CONSTR_REXT_ONE_PICTURE_ONLY = (1 << 7), - MFX_HEVC_CONSTR_REXT_LOWER_BIT_RATE = (1 << 8) -}; - -#if (MFX_VERSION >= 1026) - -/* SampleAdaptiveOffset */ -enum { - MFX_SAO_UNKNOWN = 0x00, - MFX_SAO_DISABLE = 0x01, - MFX_SAO_ENABLE_LUMA = 0x02, - MFX_SAO_ENABLE_CHROMA = 0x04 -}; - -#endif - -/* This struct has 4-byte alignment for binary compatibility with previously released versions of API */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 PicWidthInLumaSamples; - mfxU16 PicHeightInLumaSamples; - mfxU64 GeneralConstraintFlags; -#if (MFX_VERSION >= 1026) - mfxU16 SampleAdaptiveOffset; /* see enum SampleAdaptiveOffset, valid during Init and Runtime */ - mfxU16 LCUSize; - mfxU16 reserved[116]; -#else - mfxU16 reserved[118]; -#endif -} mfxExtHEVCParam; -MFX_PACK_END() - -#if (MFX_VERSION >= 1025) -/*ErrorTypes in mfxExtDecodeErrorReport*/ -enum { - MFX_ERROR_PPS = (1 << 0), - MFX_ERROR_SPS = (1 << 1), - MFX_ERROR_SLICEHEADER = (1 << 2), - MFX_ERROR_SLICEDATA = (1 << 3), - MFX_ERROR_FRAME_GAP = (1 << 4), -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU32 ErrorTypes; - mfxU16 reserved[10]; -} mfxExtDecodeErrorReport; -MFX_PACK_END() - -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 FrameType; - mfxU16 reserved[59]; -} mfxExtDecodedFrameInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 DropFrameFlag; - mfxU16 TimeCodeHours; - mfxU16 TimeCodeMinutes; - mfxU16 TimeCodeSeconds; - mfxU16 TimeCodePictures; - mfxU16 reserved[7]; -} mfxExtTimeCode; -MFX_PACK_END() - -/*RegionType*/ -enum { - MFX_HEVC_REGION_SLICE = 0 -}; - -/*RegionEncoding*/ -enum { - MFX_HEVC_REGION_ENCODING_ON = 0, - MFX_HEVC_REGION_ENCODING_OFF = 1 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU32 RegionId; - mfxU16 RegionType; - mfxU16 RegionEncoding; - mfxU16 reserved[24]; -} mfxExtHEVCRegion; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 LumaLog2WeightDenom; // 0..7 - mfxU16 ChromaLog2WeightDenom; // 0..7 - mfxU16 LumaWeightFlag[2][32]; // [list] 0,1 - mfxU16 ChromaWeightFlag[2][32]; // [list] 0,1 - mfxI16 Weights[2][32][3][2]; // [list][list entry][Y, Cb, Cr][weight, offset] - mfxU16 reserved[58]; -} mfxExtPredWeightTable; -MFX_PACK_END() - -#if (MFX_VERSION >= 1027) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 EnableRoundingIntra; // tri-state option - mfxU16 RoundingOffsetIntra; // valid value [0,7] - mfxU16 EnableRoundingInter; // tri-state option - mfxU16 RoundingOffsetInter; // valid value [0,7] - - mfxU16 reserved[24]; -} mfxExtAVCRoundingOffset; -MFX_PACK_END() -#endif - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[12]; - - struct { - mfxU16 Scale; - mfxU16 QPI; - mfxU16 QPP; - mfxU16 QPB; - mfxU32 TargetKbps; - mfxU32 MaxKbps; - mfxU32 BufferSizeInKB; - mfxU32 InitialDelayInKB; - mfxU16 reserved1[20]; - } Layer[8]; -} mfxExtTemporalLayers; -MFX_PACK_END() - -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumRect; - mfxU16 reserved1[11]; - - struct { - mfxU32 Left; - mfxU32 Top; - mfxU32 Right; - mfxU32 Bottom; - - mfxU16 reserved2[8]; - } Rect[256]; -} mfxExtDirtyRect; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 NumRect; - mfxU16 reserved1[11]; - - struct { - mfxU32 DestLeft; - mfxU32 DestTop; - mfxU32 DestRight; - mfxU32 DestBottom; - - mfxU32 SourceLeft; - mfxU32 SourceTop; - mfxU16 reserved2[4]; - } Rect[256]; -} mfxExtMoveRect; -MFX_PACK_END() - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* ScalingMatrixType */ -enum { - MFX_SCALING_MATRIX_SPS = 1, - MFX_SCALING_MATRIX_PPS = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Type; - mfxU16 reserved[5]; - - /* [4x4_Intra_Y, 4x4_Intra_Cb, 4x4_Intra_Cr, - 4x4_Inter_Y, 4x4_Inter_Cb, 4x4_Inter_Cr, - 8x8_Intra_Y, 8x8_Inter_Y, 8x8_Intra_Cb, - 8x8_Inter_Cb, 8x8_Intra_Cr, 8x8_Inter_Cr] */ - mfxU8 ScalingListPresent[12]; - - /* [Intra_Y, Intra_Cb, Intra_Cr, - Inter_Y, Inter_Cb, Inter_Cr] */ - mfxU8 ScalingList4x4[6][16]; - - /* [Intra_Y, Inter_Y, Intra_Cb, - Inter_Cb, Intra_Cr, Inter_Cr] */ - mfxU8 ScalingList8x8[6][64]; -} mfxExtAVCScalingMatrix; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 reserved[28]; - - mfxU8 LoadMatrix[4]; // [LumaIntra, LumaInter, ChromaIntra, ChromaInter] - mfxU8 Matrix[4][64]; // [LumaIntra, LumaInter, ChromaIntra, ChromaInter] -} mfxExtMPEG2QuantMatrix; -MFX_PACK_END() - -#endif - -/* Angle */ -enum { - MFX_ANGLE_0 = 0, - MFX_ANGLE_90 = 90, - MFX_ANGLE_180 = 180, - MFX_ANGLE_270 = 270 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Angle; - mfxU16 reserved[11]; -} mfxExtVPPRotation; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - mfxU16 SliceSizeOverflow; - mfxU16 NumSliceNonCopliant; - mfxU16 NumEncodedSlice; - mfxU16 NumSliceSizeAlloc; - union { - mfxU16 *SliceSize; - mfxU64 reserved1; - }; - - mfxU16 reserved[20]; -} mfxExtEncodedSlicesInfo; -MFX_PACK_END() - -/* ScalingMode */ -enum { - MFX_SCALING_MODE_DEFAULT = 0, - MFX_SCALING_MODE_LOWPOWER = 1, - MFX_SCALING_MODE_QUALITY = 2 -}; - -#if (MFX_VERSION >= 1033) -/* Interpolation Method */ -enum { - MFX_INTERPOLATION_DEFAULT = 0, - MFX_INTERPOLATION_NEAREST_NEIGHBOR = 1, - MFX_INTERPOLATION_BILINEAR = 2, - MFX_INTERPOLATION_ADVANCED = 3 -}; -#endif - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 ScalingMode; -#if (MFX_VERSION >= 1033) - mfxU16 InterpolationMethod; - mfxU16 reserved[10]; -#else - mfxU16 reserved[11]; -#endif -} mfxExtVPPScaling; -MFX_PACK_END() - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* SceneChangeType */ -enum { - MFX_SCENE_NO_CHANGE = 0, - MFX_SCENE_START = 1, - MFX_SCENE_END = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Type; - mfxU16 reserved[11]; -} mfxExtSceneChange; -MFX_PACK_END() - -#endif - -typedef mfxExtAVCRefListCtrl mfxExtHEVCRefListCtrl; -typedef mfxExtAVCRefLists mfxExtHEVCRefLists; -typedef mfxExtAvcTemporalLayers mfxExtHEVCTemporalLayers; - -/* MirroringType */ -enum -{ - MFX_MIRRORING_DISABLED = 0, - MFX_MIRRORING_HORIZONTAL = 1, - MFX_MIRRORING_VERTICAL = 2 -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Type; - mfxU16 reserved[11]; -} mfxExtVPPMirroring; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 StickTop; /* tri-state option */ - mfxU16 StickBottom; /* tri-state option */ - mfxU16 StickLeft; /* tri-state option */ - mfxU16 StickRight; /* tri-state option */ - mfxU16 reserved[8]; -} mfxExtMVOverPicBoundaries; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Enable; /* tri-state option */ - mfxU16 reserved[11]; -} mfxExtVPPColorFill; -MFX_PACK_END() - -#if (MFX_VERSION >= 1025) - -/* ChromaSiting */ -enum { - MFX_CHROMA_SITING_UNKNOWN = 0x0000, - MFX_CHROMA_SITING_VERTICAL_TOP = 0x0001, /* Chroma samples are co-sited vertically on the top with the luma samples. */ - MFX_CHROMA_SITING_VERTICAL_CENTER = 0x0002, /* Chroma samples are not co-sited vertically with the luma samples. */ - MFX_CHROMA_SITING_VERTICAL_BOTTOM = 0x0004, /* Chroma samples are co-sited vertically on the bottom with the luma samples. */ - MFX_CHROMA_SITING_HORIZONTAL_LEFT = 0x0010, /* Chroma samples are co-sited horizontally on the left with the luma samples. */ - MFX_CHROMA_SITING_HORIZONTAL_CENTER = 0x0020 /* Chroma samples are not co-sited horizontally with the luma samples. */ -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 ChromaSiting; - mfxU16 reserved[27]; -} mfxExtColorConversion; -MFX_PACK_END() - -#endif - -#if (MFX_VERSION >= 1026) -/* VP9ReferenceFrame */ -enum { - MFX_VP9_REF_INTRA = 0, - MFX_VP9_REF_LAST = 1, - MFX_VP9_REF_GOLDEN = 2, - MFX_VP9_REF_ALTREF = 3 -}; - -/* SegmentIdBlockSize */ -enum { - MFX_VP9_SEGMENT_ID_BLOCK_SIZE_UNKNOWN = 0, - MFX_VP9_SEGMENT_ID_BLOCK_SIZE_8x8 = 8, - MFX_VP9_SEGMENT_ID_BLOCK_SIZE_16x16 = 16, - MFX_VP9_SEGMENT_ID_BLOCK_SIZE_32x32 = 32, - MFX_VP9_SEGMENT_ID_BLOCK_SIZE_64x64 = 64, -}; - -/* SegmentFeature */ -enum { - MFX_VP9_SEGMENT_FEATURE_QINDEX = 0x0001, - MFX_VP9_SEGMENT_FEATURE_LOOP_FILTER = 0x0002, - MFX_VP9_SEGMENT_FEATURE_REFERENCE = 0x0004, - MFX_VP9_SEGMENT_FEATURE_SKIP = 0x0008 /* (0,0) MV, no residual */ -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 FeatureEnabled; /* see enum SegmentFeature */ - mfxI16 QIndexDelta; - mfxI16 LoopFilterLevelDelta; - mfxU16 ReferenceFrame; /* see enum VP9ReferenceFrame */ - mfxU16 reserved[12]; -} mfxVP9SegmentParam; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - mfxU16 NumSegments; /* 0..8 */ - mfxVP9SegmentParam Segment[8]; - mfxU16 SegmentIdBlockSize; /* see enum SegmentIdBlockSize */ - mfxU32 NumSegmentIdAlloc; /* >= (Ceil(Width / SegmentIdBlockSize) * Ceil(Height / SegmentIdBlockSize)) */ - union { - mfxU8 *SegmentId; /*[NumSegmentIdAlloc] = 0..7, index in Segment array, blocks of SegmentIdBlockSize map */ - mfxU64 reserved1; - }; - mfxU16 reserved[52]; -} mfxExtVP9Segmentation; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 FrameRateScale; /* Layer[n].FrameRateScale = Layer[n - 1].FrameRateScale * (uint)m */ - mfxU16 TargetKbps; /* affected by BRCParamMultiplier, Layer[n].TargetKbps > Layer[n - 1].TargetKbps */ - mfxU16 reserved[14]; -} mfxVP9TemporalLayer; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxVP9TemporalLayer Layer[8]; - mfxU16 reserved[60]; -} mfxExtVP9TemporalLayers; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 FrameWidth; - mfxU16 FrameHeight; - - mfxU16 WriteIVFHeaders; /* tri-state option */ - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxI16 LoopFilterRefDelta[4]; - mfxI16 LoopFilterModeDelta[2]; -#else // API 1.26 - mfxI16 reserved1[6]; -#endif - mfxI16 QIndexDeltaLumaDC; - mfxI16 QIndexDeltaChromaAC; - mfxI16 QIndexDeltaChromaDC; -#if (MFX_VERSION >= 1029) - mfxU16 NumTileRows; - mfxU16 NumTileColumns; - mfxU16 reserved[110]; -#else - mfxU16 reserved[112]; -#endif -} mfxExtVP9Param; -MFX_PACK_END() - -#endif // #if (MFX_VERSION >= 1026) - -#if (MFX_VERSION >= 1025) -/* Multi-Frame Mode */ -enum { - MFX_MF_DEFAULT = 0, - MFX_MF_DISABLED = 1, - MFX_MF_AUTO = 2, - MFX_MF_MANUAL = 3 -}; - -/* Multi-Frame Initialization parameters */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU16 MFMode; - mfxU16 MaxNumFrames; - - mfxU16 reserved[58]; -} mfxExtMultiFrameParam; -MFX_PACK_END() - -/* Multi-Frame Run-time controls */ -MFX_PACK_BEGIN_USUAL_STRUCT() -MFX_DEPRECATED typedef struct { - mfxExtBuffer Header; - - mfxU32 Timeout; /* timeout in millisecond */ - mfxU16 Flush; /* Flush internal frame buffer, e.g. submit all collected frames. */ - - mfxU16 reserved[57]; -} mfxExtMultiFrameControl; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU16 Type; - mfxU16 reserved1; - mfxU32 Offset; - mfxU32 Size; - mfxU32 reserved[5]; -} mfxEncodedUnitInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_L_TYPE() -typedef struct { - mfxExtBuffer Header; - - union { - mfxEncodedUnitInfo *UnitInfo; - mfxU64 reserved1; - }; - mfxU16 NumUnitsAlloc; - mfxU16 NumUnitsEncoded; - - mfxU16 reserved[22]; -} mfxExtEncodedUnitsInfo; -MFX_PACK_END() - -#endif - -#if (MFX_VERSION >= 1026) -#if (MFX_VERSION >= MFX_VERSION_NEXT) -/* MCTFTemporalMode */ -enum { - MFX_MCTF_TEMPORAL_MODE_UNKNOWN = 0, - MFX_MCTF_TEMPORAL_MODE_SPATIAL = 1, - MFX_MCTF_TEMPORAL_MODE_1REF = 2, - MFX_MCTF_TEMPORAL_MODE_2REF = 3, - MFX_MCTF_TEMPORAL_MODE_4REF = 4 -}; -#endif - -/* MCTF initialization & runtime */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU16 FilterStrength; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxU16 Overlap; /* tri-state option */ - mfxU32 BitsPerPixelx100k; - mfxU16 Deblocking; /* tri-state option */ - mfxU16 TemporalMode; - mfxU16 MVPrecision; - mfxU16 reserved[21]; -#else - mfxU16 reserved[27]; -#endif -} mfxExtVppMctf; -MFX_PACK_END() - -#endif - -#if (MFX_VERSION >= 1031) -/* Multi-adapters Querying structs */ -typedef enum -{ - MFX_COMPONENT_ENCODE = 1, - MFX_COMPONENT_DECODE = 2, - MFX_COMPONENT_VPP = 3 -} mfxComponentType; - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct -{ - mfxComponentType Type; - mfxVideoParam Requirements; - - mfxU16 reserved[4]; -} mfxComponentInfo; -MFX_PACK_END() - -/* Adapter description */ -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct -{ - mfxPlatform Platform; - mfxU32 Number; - - mfxU16 reserved[14]; -} mfxAdapterInfo; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct -{ - mfxAdapterInfo * Adapters; - mfxU32 NumAlloc; - mfxU32 NumActual; - - mfxU16 reserved[4]; -} mfxAdaptersInfo; -MFX_PACK_END() - -#endif - -#if (MFX_VERSION >= 1034) -/* FilmGrainFlags */ -enum { - MFX_FILM_GRAIN_APPLY = (1 << 0), - MFX_FILM_GRAIN_UPDATE = (1 << 1), - MFX_FILM_GRAIN_CHROMA_SCALING_FROM_LUMA = (1 << 2), - MFX_FILM_GRAIN_OVERLAP = (1 << 3), - MFX_FILM_GRAIN_CLIP_TO_RESTRICTED_RANGE = (1 << 4) -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxU8 Value; - mfxU8 Scaling; -} mfxAV1FilmGrainPoint; -MFX_PACK_END() - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 FilmGrainFlags; /* FilmGrainFlags */ - mfxU16 GrainSeed; /* 0..65535 */ - - mfxU8 RefIdx; /* 0..6 */ - mfxU8 NumYPoints; /* 0..14 */ - mfxU8 NumCbPoints; /* 0..10 */ - mfxU8 NumCrPoints; /* 0..10 */ - - mfxAV1FilmGrainPoint PointY[14]; - mfxAV1FilmGrainPoint PointCb[10]; - mfxAV1FilmGrainPoint PointCr[10]; - - mfxU8 GrainScalingMinus8; /* 0..3 */ - mfxU8 ArCoeffLag; /* 0..3 */ - - mfxU8 ArCoeffsYPlus128[24]; /* 0..255 */ - mfxU8 ArCoeffsCbPlus128[25]; /* 0..255 */ - mfxU8 ArCoeffsCrPlus128[25]; /* 0..255 */ - - mfxU8 ArCoeffShiftMinus6; /* 0..3 */ - mfxU8 GrainScaleShift; /* 0..3 */ - - mfxU8 CbMult; /* 0..255 */ - mfxU8 CbLumaMult; /* 0..255 */ - mfxU16 CbOffset; /* 0..511 */ - - mfxU8 CrMult; /* 0..255 */ - mfxU8 CrLumaMult; /* 0..255 */ - mfxU16 CrOffset; /* 0..511 */ - - mfxU16 reserved[43]; -} mfxExtAV1FilmGrainParam; -MFX_PACK_END() - -#endif - -#if (MFX_VERSION >= 1031) -/* PartialBitstreamOutput */ -enum { - MFX_PARTIAL_BITSTREAM_NONE = 0, /* Don't use partial output */ - MFX_PARTIAL_BITSTREAM_SLICE = 1, /* Partial bitstream output will be aligned to slice granularity */ - MFX_PARTIAL_BITSTREAM_BLOCK = 2, /* Partial bitstream output will be aligned to user-defined block size granularity */ - MFX_PARTIAL_BITSTREAM_ANY = 3 /* Partial bitstream output will be return any coded data avilable at the end of SyncOperation timeout */ -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - mfxU32 BlockSize; /* output block granulatiry for Granularity = MFX_PARTIAL_BITSTREAM_BLOCK */ - mfxU16 Granularity; /* granulatiry of the partial bitstream: slice/block/any */ - mfxU16 reserved[8]; -} mfxExtPartialBitstreamParam; -MFX_PACK_END() -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo++.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo++.h deleted file mode 100644 index 41c18e9f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo++.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#ifndef __MFXVIDEOPLUSPLUS_H -#define __MFXVIDEOPLUSPLUS_H - -#include "mfxvideo.h" -#include "mfxenc.h" -#include "mfxpak.h" - -class MFXVideoSession -{ -public: - MFXVideoSession(void) { m_session = (mfxSession) 0; } - virtual ~MFXVideoSession(void) { Close(); } - - virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) { return MFXInit(impl, ver, &m_session); } - virtual mfxStatus InitEx(mfxInitParam par) { return MFXInitEx(par, &m_session); } - virtual mfxStatus Close(void) - { - mfxStatus mfxRes; - mfxRes = MFXClose(m_session); m_session = (mfxSession) 0; - return mfxRes; - } - - virtual mfxStatus QueryIMPL(mfxIMPL *impl) { return MFXQueryIMPL(m_session, impl); } - virtual mfxStatus QueryVersion(mfxVersion *version) { return MFXQueryVersion(m_session, version); } - - virtual mfxStatus JoinSession(mfxSession child_session) { return MFXJoinSession(m_session, child_session);} - virtual mfxStatus DisjoinSession( ) { return MFXDisjoinSession(m_session);} - virtual mfxStatus CloneSession( mfxSession *clone) { return MFXCloneSession(m_session, clone);} - virtual mfxStatus SetPriority( mfxPriority priority) { return MFXSetPriority(m_session, priority);} - virtual mfxStatus GetPriority( mfxPriority *priority) { return MFXGetPriority(m_session, priority);} - - MFX_DEPRECATED virtual mfxStatus SetBufferAllocator(mfxBufferAllocator *allocator) { return MFXVideoCORE_SetBufferAllocator(m_session, allocator); } - virtual mfxStatus SetFrameAllocator(mfxFrameAllocator *allocator) { return MFXVideoCORE_SetFrameAllocator(m_session, allocator); } - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { return MFXVideoCORE_SetHandle(m_session, type, hdl); } - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *hdl) { return MFXVideoCORE_GetHandle(m_session, type, hdl); } - virtual mfxStatus QueryPlatform(mfxPlatform* platform) { return MFXVideoCORE_QueryPlatform(m_session, platform); } - - virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) { return MFXVideoCORE_SyncOperation(m_session, syncp, wait); } - - virtual mfxStatus DoWork() { return MFXDoWork(m_session); } - - virtual operator mfxSession (void) { return m_session; } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -private: - MFXVideoSession(const MFXVideoSession &); - void operator=(MFXVideoSession &); -}; - -class MFXVideoENCODE -{ -public: - - MFXVideoENCODE(mfxSession session) { m_session = session; } - virtual ~MFXVideoENCODE(void) { Close(); } - - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { return MFXVideoENCODE_Query(m_session, in, out); } - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { return MFXVideoENCODE_QueryIOSurf(m_session, par, request); } - virtual mfxStatus Init(mfxVideoParam *par) { return MFXVideoENCODE_Init(m_session, par); } - virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoENCODE_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXVideoENCODE_Close(m_session); } - - virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoENCODE_GetVideoParam(m_session, par); } - virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) { return MFXVideoENCODE_GetEncodeStat(m_session, stat); } - - virtual mfxStatus EncodeFrameAsync(mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp) { return MFXVideoENCODE_EncodeFrameAsync(m_session, ctrl, surface, bs, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -class MFXVideoDECODE -{ -public: - - MFXVideoDECODE(mfxSession session) { m_session = session; } - virtual ~MFXVideoDECODE(void) { Close(); } - - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { return MFXVideoDECODE_Query(m_session, in, out); } - virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxVideoParam *par) { return MFXVideoDECODE_DecodeHeader(m_session, bs, par); } - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { return MFXVideoDECODE_QueryIOSurf(m_session, par, request); } - virtual mfxStatus Init(mfxVideoParam *par) { return MFXVideoDECODE_Init(m_session, par); } - virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoDECODE_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXVideoDECODE_Close(m_session); } - - virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoDECODE_GetVideoParam(m_session, par); } - - virtual mfxStatus GetDecodeStat(mfxDecodeStat *stat) { return MFXVideoDECODE_GetDecodeStat(m_session, stat); } - virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) {return MFXVideoDECODE_GetPayload(m_session, ts, payload); } - virtual mfxStatus SetSkipMode(mfxSkipMode mode) { return MFXVideoDECODE_SetSkipMode(m_session, mode); } - virtual mfxStatus DecodeFrameAsync(mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp) { return MFXVideoDECODE_DecodeFrameAsync(m_session, bs, surface_work, surface_out, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -class MFXVideoVPP -{ -public: - - MFXVideoVPP(mfxSession session) { m_session = session; } - virtual ~MFXVideoVPP(void) { Close(); } - - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { return MFXVideoVPP_Query(m_session, in, out); } - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]) { return MFXVideoVPP_QueryIOSurf(m_session, par, request); } - virtual mfxStatus Init(mfxVideoParam *par) { return MFXVideoVPP_Init(m_session, par); } - virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoVPP_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXVideoVPP_Close(m_session); } - - virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoVPP_GetVideoParam(m_session, par); } - virtual mfxStatus GetVPPStat(mfxVPPStat *stat) { return MFXVideoVPP_GetVPPStat(m_session, stat); } - virtual mfxStatus RunFrameVPPAsync(mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp) { return MFXVideoVPP_RunFrameVPPAsync(m_session, in, out, aux, syncp); } - virtual mfxStatus RunFrameVPPAsyncEx(mfxFrameSurface1 *in, mfxFrameSurface1 *work, mfxFrameSurface1 **out, mfxSyncPoint *syncp) {return MFXVideoVPP_RunFrameVPPAsyncEx(m_session, in, work, out, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -class MFXVideoENC -{ -public: - - MFXVideoENC(mfxSession session) { m_session = session; } - virtual ~MFXVideoENC(void) { Close(); } - - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { return MFXVideoENC_Query(m_session, in, out); } - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { return MFXVideoENC_QueryIOSurf(m_session, par, request); } - virtual mfxStatus Init(mfxVideoParam *par) { return MFXVideoENC_Init(m_session, par); } - virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoENC_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXVideoENC_Close(m_session); } - - virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoENC_GetVideoParam(m_session, par); } - virtual mfxStatus ProcessFrameAsync(mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp) { return MFXVideoENC_ProcessFrameAsync(m_session, in, out, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -class MFXVideoPAK -{ -public: - - MFXVideoPAK(mfxSession session) { m_session = session; } - virtual ~MFXVideoPAK(void) { Close(); } - - virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) { return MFXVideoPAK_Query(m_session, in, out); } - virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) { return MFXVideoPAK_QueryIOSurf(m_session, par, request); } - virtual mfxStatus Init(mfxVideoParam *par) { return MFXVideoPAK_Init(m_session, par); } - virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoPAK_Reset(m_session, par); } - virtual mfxStatus Close(void) { return MFXVideoPAK_Close(m_session); } - - virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoPAK_GetVideoParam(m_session, par); } - //virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) { return MFXVideoENCODE_GetEncodeStat(m_session, stat); } - - virtual mfxStatus ProcessFrameAsync(mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp) { return MFXVideoPAK_ProcessFrameAsync(m_session, in, out, syncp); } - -protected: - - mfxSession m_session; // (mfxSession) handle to the owning session -}; - -#endif // __MFXVIDEOPLUSPLUS_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo.h deleted file mode 100644 index aee387a7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvideo.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXVIDEO_H__ -#define __MFXVIDEO_H__ -#include "mfxsession.h" -#include "mfxvstructures.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* MFXVideoCORE */ -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 reserved[4]; - mfxHDL pthis; - mfxStatus (MFX_CDECL *Alloc) (mfxHDL pthis, mfxU32 nbytes, mfxU16 type, mfxMemId *mid); - mfxStatus (MFX_CDECL *Lock) (mfxHDL pthis, mfxMemId mid, mfxU8 **ptr); - mfxStatus (MFX_CDECL *Unlock) (mfxHDL pthis, mfxMemId mid); - mfxStatus (MFX_CDECL *Free) (mfxHDL pthis, mfxMemId mid); -} mfxBufferAllocator; -MFX_PACK_END() - -MFX_PACK_BEGIN_STRUCT_W_PTR() -typedef struct { - mfxU32 reserved[4]; - mfxHDL pthis; - - mfxStatus (MFX_CDECL *Alloc) (mfxHDL pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - mfxStatus (MFX_CDECL *Lock) (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr); - mfxStatus (MFX_CDECL *Unlock) (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr); - mfxStatus (MFX_CDECL *GetHDL) (mfxHDL pthis, mfxMemId mid, mfxHDL *handle); - mfxStatus (MFX_CDECL *Free) (mfxHDL pthis, mfxFrameAllocResponse *response); -} mfxFrameAllocator; -MFX_PACK_END() - -/* VideoCORE */ -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoCORE_SetBufferAllocator(mfxSession session, mfxBufferAllocator *allocator); -mfxStatus MFX_CDECL MFXVideoCORE_SetFrameAllocator(mfxSession session, mfxFrameAllocator *allocator); -mfxStatus MFX_CDECL MFXVideoCORE_SetHandle(mfxSession session, mfxHandleType type, mfxHDL hdl); -mfxStatus MFX_CDECL MFXVideoCORE_GetHandle(mfxSession session, mfxHandleType type, mfxHDL *hdl); -mfxStatus MFX_CDECL MFXVideoCORE_QueryPlatform(mfxSession session, mfxPlatform* platform); -mfxStatus MFX_CDECL MFXVideoCORE_SyncOperation(mfxSession session, mfxSyncPoint syncp, mfxU32 wait); - -/* VideoENCODE */ -mfxStatus MFX_CDECL MFXVideoENCODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); -mfxStatus MFX_CDECL MFXVideoENCODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request); -mfxStatus MFX_CDECL MFXVideoENCODE_Init(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoENCODE_Reset(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoENCODE_Close(mfxSession session); - -mfxStatus MFX_CDECL MFXVideoENCODE_GetVideoParam(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoENCODE_GetEncodeStat(mfxSession session, mfxEncodeStat *stat); -mfxStatus MFX_CDECL MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp); - -/* VideoDECODE */ -mfxStatus MFX_CDECL MFXVideoDECODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); -mfxStatus MFX_CDECL MFXVideoDECODE_DecodeHeader(mfxSession session, mfxBitstream *bs, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoDECODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request); -mfxStatus MFX_CDECL MFXVideoDECODE_Init(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoDECODE_Reset(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoDECODE_Close(mfxSession session); - -mfxStatus MFX_CDECL MFXVideoDECODE_GetVideoParam(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoDECODE_GetDecodeStat(mfxSession session, mfxDecodeStat *stat); -mfxStatus MFX_CDECL MFXVideoDECODE_SetSkipMode(mfxSession session, mfxSkipMode mode); -mfxStatus MFX_CDECL MFXVideoDECODE_GetPayload(mfxSession session, mfxU64 *ts, mfxPayload *payload); -mfxStatus MFX_CDECL MFXVideoDECODE_DecodeFrameAsync(mfxSession session, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp); - -/* VideoVPP */ -mfxStatus MFX_CDECL MFXVideoVPP_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out); -mfxStatus MFX_CDECL MFXVideoVPP_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest request[2]); -mfxStatus MFX_CDECL MFXVideoVPP_Init(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoVPP_Reset(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoVPP_Close(mfxSession session); - -mfxStatus MFX_CDECL MFXVideoVPP_GetVideoParam(mfxSession session, mfxVideoParam *par); -mfxStatus MFX_CDECL MFXVideoVPP_GetVPPStat(mfxSession session, mfxVPPStat *stat); -mfxStatus MFX_CDECL MFXVideoVPP_RunFrameVPPAsync(mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp); -MFX_DEPRECATED mfxStatus MFX_CDECL MFXVideoVPP_RunFrameVPPAsyncEx(mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp8.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp8.h deleted file mode 100644 index eda41f98..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp8.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXVP8_H__ -#define __MFXVP8_H__ - -#include "mfxdefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - MFX_CODEC_VP8 = MFX_MAKEFOURCC('V','P','8',' '), -}; - -/* CodecProfile*/ -enum { - MFX_PROFILE_VP8_0 = 0+1, - MFX_PROFILE_VP8_1 = 1+1, - MFX_PROFILE_VP8_2 = 2+1, - MFX_PROFILE_VP8_3 = 3+1, -}; - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_VP8_CODING_OPTION = MFX_MAKEFOURCC('V','P','8','E'), -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 Version; - mfxU16 EnableMultipleSegments; - mfxU16 LoopFilterType; - mfxU16 LoopFilterLevel[4]; - mfxU16 SharpnessLevel; - mfxU16 NumTokenPartitions; - mfxI16 LoopFilterRefTypeDelta[4]; - mfxI16 LoopFilterMbModeDelta[4]; - mfxI16 SegmentQPDelta[4]; - mfxI16 CoeffTypeQPDelta[5]; - mfxU16 WriteIVFHeaders; - mfxU32 NumFramesForIVFHeader; - mfxU16 reserved[223]; -} mfxExtVP8CodingOption; -MFX_PACK_END() - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp9.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp9.h deleted file mode 100644 index 7575f2a8..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvp9.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2018-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#ifndef __MFXVP9_H__ -#define __MFXVP9_H__ - -#include "mfxdefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -/* Extended Buffer Ids */ -enum { - MFX_EXTBUFF_VP9_DECODED_FRAME_INFO = MFX_MAKEFOURCC('9','D','F','I') -}; - -MFX_PACK_BEGIN_USUAL_STRUCT() -typedef struct { - mfxExtBuffer Header; - - mfxU16 DisplayWidth; - mfxU16 DisplayHeight; - mfxU16 reserved[58]; -} mfxExtVP9DecodedFrameInfo; -MFX_PACK_END() - -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvstructures.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvstructures.h deleted file mode 100644 index 5fbefece..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/include/mfxvstructures.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -#include "mfxstructures.h" - - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_ext_buffers_decl.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_ext_buffers_decl.h deleted file mode 100644 index 9d82db5e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_ext_buffers_decl.h +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 2018-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if defined(__MFXSTRUCTURES_H__) -EXTBUF(mfxExtCodingOption , MFX_EXTBUFF_CODING_OPTION ) -EXTBUF(mfxExtCodingOptionSPSPPS , MFX_EXTBUFF_CODING_OPTION_SPSPPS ) -EXTBUF(mfxExtCodingOptionVPS , MFX_EXTBUFF_CODING_OPTION_VPS ) -EXTBUF(mfxExtVPPDoNotUse , MFX_EXTBUFF_VPP_DONOTUSE ) -EXTBUF(mfxExtVppAuxData , MFX_EXTBUFF_VPP_AUXDATA ) -EXTBUF(mfxExtVPPDenoise , MFX_EXTBUFF_VPP_DENOISE ) -EXTBUF(mfxExtVPPProcAmp , MFX_EXTBUFF_VPP_PROCAMP ) -EXTBUF(mfxExtVPPDetail , MFX_EXTBUFF_VPP_DETAIL ) -EXTBUF(mfxExtVideoSignalInfo , MFX_EXTBUFF_VIDEO_SIGNAL_INFO ) -EXTBUF(mfxExtVPPDoUse , MFX_EXTBUFF_VPP_DOUSE ) -EXTBUF(mfxExtOpaqueSurfaceAlloc , MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION ) -EXTBUF(mfxExtAVCRefListCtrl , MFX_EXTBUFF_AVC_REFLIST_CTRL ) -EXTBUF(mfxExtVPPFrameRateConversion , MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION ) -EXTBUF(mfxExtPictureTimingSEI , MFX_EXTBUFF_PICTURE_TIMING_SEI ) -EXTBUF(mfxExtAvcTemporalLayers , MFX_EXTBUFF_AVC_TEMPORAL_LAYERS ) -EXTBUF(mfxExtCodingOption2 , MFX_EXTBUFF_CODING_OPTION2 ) -EXTBUF(mfxExtVPPImageStab , MFX_EXTBUFF_VPP_IMAGE_STABILIZATION ) -EXTBUF(mfxExtEncoderCapability , MFX_EXTBUFF_ENCODER_CAPABILITY ) -EXTBUF(mfxExtEncoderResetOption , MFX_EXTBUFF_ENCODER_RESET_OPTION ) -EXTBUF(mfxExtAVCEncodedFrameInfo , MFX_EXTBUFF_ENCODED_FRAME_INFO ) -EXTBUF(mfxExtVPPComposite , MFX_EXTBUFF_VPP_COMPOSITE ) -EXTBUF(mfxExtVPPVideoSignalInfo , MFX_EXTBUFF_VPP_VIDEO_SIGNAL_INFO ) -EXTBUF(mfxExtEncoderROI , MFX_EXTBUFF_ENCODER_ROI ) -EXTBUF(mfxExtVPPDeinterlacing , MFX_EXTBUFF_VPP_DEINTERLACING ) -EXTBUF(mfxExtVP8CodingOption , MFX_EXTBUFF_VP8_CODING_OPTION ) -EXTBUF(mfxExtVPPFieldProcessing , MFX_EXTBUFF_VPP_FIELD_PROCESSING ) -EXTBUF(mfxExtContentLightLevelInfo , MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO ) -EXTBUF(mfxExtMasteringDisplayColourVolume, MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME ) -EXTBUF(mfxExtMultiFrameParam , MFX_EXTBUFF_MULTI_FRAME_PARAM ) -EXTBUF(mfxExtMultiFrameControl , MFX_EXTBUFF_MULTI_FRAME_CONTROL ) -EXTBUF(mfxExtColorConversion , MFX_EXTBUFF_VPP_COLOR_CONVERSION ) -EXTBUF(mfxExtAVCRefLists , MFX_EXTBUFF_AVC_REFLISTS ) -EXTBUF(mfxExtCodingOption3 , MFX_EXTBUFF_CODING_OPTION3 ) -EXTBUF(mfxExtMBQP , MFX_EXTBUFF_MBQP ) -EXTBUF(mfxExtMBForceIntra , MFX_EXTBUFF_MB_FORCE_INTRA ) -EXTBUF(mfxExtChromaLocInfo , MFX_EXTBUFF_CHROMA_LOC_INFO ) -EXTBUF(mfxExtDecodedFrameInfo , MFX_EXTBUFF_DECODED_FRAME_INFO ) -EXTBUF(mfxExtDecodeErrorReport , MFX_EXTBUFF_DECODE_ERROR_REPORT ) -EXTBUF(mfxExtVPPRotation , MFX_EXTBUFF_VPP_ROTATION ) -EXTBUF(mfxExtVPPMirroring , MFX_EXTBUFF_VPP_MIRRORING ) -EXTBUF(mfxExtMVCSeqDesc , MFX_EXTBUFF_MVC_SEQ_DESC ) -EXTBUF(mfxExtMBDisableSkipMap , MFX_EXTBUFF_MB_DISABLE_SKIP_MAP ) -EXTBUF(mfxExtDirtyRect , MFX_EXTBUFF_DIRTY_RECTANGLES ) -EXTBUF(mfxExtMoveRect , MFX_EXTBUFF_MOVING_RECTANGLES ) -EXTBUF(mfxExtHEVCParam , MFX_EXTBUFF_HEVC_PARAM ) -EXTBUF(mfxExtHEVCTiles , MFX_EXTBUFF_HEVC_TILES ) -EXTBUF(mfxExtPredWeightTable , MFX_EXTBUFF_PRED_WEIGHT_TABLE ) -EXTBUF(mfxExtEncodedUnitsInfo , MFX_EXTBUFF_ENCODED_UNITS_INFO ) -#if (MFX_VERSION >= 1026) -EXTBUF(mfxExtVppMctf , MFX_EXTBUFF_VPP_MCTF ) -EXTBUF(mfxExtVP9Segmentation , MFX_EXTBUFF_VP9_SEGMENTATION ) -EXTBUF(mfxExtVP9TemporalLayers , MFX_EXTBUFF_VP9_TEMPORAL_LAYERS ) -EXTBUF(mfxExtVP9Param , MFX_EXTBUFF_VP9_PARAM ) -#endif -EXTBUF(mfxExtEncoderIPCMArea , MFX_EXTBUFF_ENCODER_IPCM_AREA ) -EXTBUF(mfxExtInsertHeaders , MFX_EXTBUFF_INSERT_HEADERS ) - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -EXTBUF(mfxExtAVCScalingMatrix , MFX_EXTBUFF_AVC_SCALING_MATRIX ) -EXTBUF(mfxExtDPB , MFX_EXTBUFF_DPB ) -#endif -#endif //defined(__MFXSTRUCTURES_H__) - -#if defined(__MFXFEI_H__) -EXTBUF(mfxExtFeiParam , MFX_EXTBUFF_FEI_PARAM ) -EXTBUF(mfxExtFeiSPS , MFX_EXTBUFF_FEI_SPS ) -EXTBUF(mfxExtFeiPPS , MFX_EXTBUFF_FEI_PPS ) -EXTBUF(mfxExtFeiEncFrameCtrl , MFX_EXTBUFF_FEI_ENC_CTRL ) -EXTBUF(mfxExtFeiEncMVPredictors , MFX_EXTBUFF_FEI_ENC_MV_PRED ) -EXTBUF(mfxExtFeiEncMBCtrl , MFX_EXTBUFF_FEI_ENC_MB ) -EXTBUF(mfxExtFeiEncMV , MFX_EXTBUFF_FEI_ENC_MV ) -EXTBUF(mfxExtFeiEncMBStat , MFX_EXTBUFF_FEI_ENC_MB_STAT ) -EXTBUF(mfxExtFeiEncQP , MFX_EXTBUFF_FEI_ENC_QP ) -EXTBUF(mfxExtFeiPreEncCtrl , MFX_EXTBUFF_FEI_PREENC_CTRL ) -EXTBUF(mfxExtFeiPreEncMVPredictors , MFX_EXTBUFF_FEI_PREENC_MV_PRED ) -EXTBUF(mfxExtFeiPreEncMV , MFX_EXTBUFF_FEI_PREENC_MV ) -EXTBUF(mfxExtFeiPreEncMBStat , MFX_EXTBUFF_FEI_PREENC_MB ) -EXTBUF(mfxExtFeiPakMBCtrl , MFX_EXTBUFF_FEI_PAK_CTRL ) -EXTBUF(mfxExtFeiSliceHeader , MFX_EXTBUFF_FEI_SLICE ) -EXTBUF(mfxExtFeiRepackCtrl , MFX_EXTBUFF_FEI_REPACK_CTRL ) -EXTBUF(mfxExtFeiDecStreamOut , MFX_EXTBUFF_FEI_DEC_STREAM_OUT ) -#if (MFX_VERSION >= 1027) -EXTBUF(mfxExtFeiHevcEncFrameCtrl , MFX_EXTBUFF_HEVCFEI_ENC_CTRL ) -EXTBUF(mfxExtFeiHevcEncMVPredictors , MFX_EXTBUFF_HEVCFEI_ENC_MV_PRED ) -EXTBUF(mfxExtFeiHevcEncQP , MFX_EXTBUFF_HEVCFEI_ENC_QP ) -EXTBUF(mfxExtFeiHevcEncCtuCtrl , MFX_EXTBUFF_HEVCFEI_ENC_CTU_CTRL ) -#endif -#endif //defined(__MFXFEI_H__) - -#if defined(__MFXCAMERA_H__) -EXTBUF(mfxExtCamTotalColorControl , MFX_EXTBUF_CAM_TOTAL_COLOR_CONTROL ) -EXTBUF(mfxExtCamCscYuvRgb , MFX_EXTBUF_CAM_CSC_YUV_RGB ) -EXTBUF(mfxExtCamGammaCorrection , MFX_EXTBUF_CAM_GAMMA_CORRECTION ) -EXTBUF(mfxExtCamWhiteBalance , MFX_EXTBUF_CAM_WHITE_BALANCE ) -EXTBUF(mfxExtCamHotPixelRemoval , MFX_EXTBUF_CAM_HOT_PIXEL_REMOVAL ) -EXTBUF(mfxExtCamBlackLevelCorrection, MFX_EXTBUF_CAM_BLACK_LEVEL_CORRECTION ) -EXTBUF(mfxExtCamVignetteCorrection , MFX_EXTBUF_CAM_VIGNETTE_CORRECTION ) -EXTBUF(mfxExtCamBayerDenoise , MFX_EXTBUF_CAM_BAYER_DENOISE ) -EXTBUF(mfxExtCamColorCorrection3x3 , MFX_EXTBUF_CAM_COLOR_CORRECTION_3X3 ) -EXTBUF(mfxExtCamPadding , MFX_EXTBUF_CAM_PADDING ) -EXTBUF(mfxExtCamPipeControl , MFX_EXTBUF_CAM_PIPECONTROL ) -#endif //defined(__MFXCAMERA_H__) - -#if defined(__MFXCOMMON_H__) -// Threading API -EXTBUF(mfxExtThreadsParam , MFX_EXTBUFF_THREADS_PARAM) -#endif //defined(__MFXCOMMON_H__) - -#if defined(__MFXSC_H__) -//Screen capture -EXTBUF(mfxExtScreenCaptureParam , MFX_EXTBUFF_SCREEN_CAPTURE_PARAM ) -#endif //defined(__MFXSC_H__) - -#if defined(__MFXVP9_H__) -#if (MFX_VERSION >= MFX_VERSION_NEXT) -EXTBUF(mfxExtVP9DecodedFrameInfo , MFX_EXTBUFF_VP9_DECODED_FRAME_INFO ) -#endif -#endif //defined(__MFXVP9_H__) - -#if defined(__MFXBRC_H__) -EXTBUF(mfxExtBRC, MFX_EXTBUFF_BRC) -#endif // defined(__MFXBRC_H__) - -#if defined(__MFXPCP_H__) -#if (MFX_VERSION >= 1030) -EXTBUF(mfxExtCencParam , MFX_EXTBUFF_CENC_PARAM ) -#endif -#endif // defined(__MFXPCP_H__) - -#if defined(__MFXSCD_H__) -EXTBUF(mfxExtSCD, MFX_EXTBUFF_SCD) -#endif // defined(__MFXSCD_H__) - -#ifdef __MFXLA_H__ -EXTBUF(mfxExtLAControl , MFX_EXTBUFF_LOOKAHEAD_CTRL ) -EXTBUF(mfxExtLAFrameStatistics , MFX_EXTBUFF_LOOKAHEAD_STAT ) -#endif //__MFXLA_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_struct_decl.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_struct_decl.h deleted file mode 100644 index 0a32fc10..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_struct_decl.h +++ /dev/null @@ -1,1443 +0,0 @@ -// Copyright (c) 2018-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -STRUCT(mfxI16Pair, - FIELD_T(mfxI16, x) - FIELD_T(mfxI16, y) -) - -STRUCT(mfxHDLPair, - FIELD_T(mfxHDL, first ) - FIELD_T(mfxHDL, second) -) - -STRUCT(mfxExtBuffer, - FIELD_T(mfx4CC, BufferId) - FIELD_T(mfxU32, BufferSz) -) - -STRUCT(mfxVersion, - FIELD_T(mfxU16, Minor ) - FIELD_T(mfxU16, Major ) - FIELD_T(mfxU32, Version) -) - -STRUCT(mfxBitstream, - FIELD_T(mfxEncryptedData*, EncryptedData ) - FIELD_T(mfxExtBuffer ** , ExtParam ) - FIELD_T(mfxU16 , NumExtParam ) - FIELD_T(mfxI64 , DecodeTimeStamp) - FIELD_T(mfxU64 , TimeStamp ) - FIELD_T(mfxU8* , Data ) - FIELD_T(mfxU32 , DataOffset ) - FIELD_T(mfxU32 , DataLength ) - FIELD_T(mfxU32 , MaxLength ) - FIELD_T(mfxU16 , PicStruct ) - FIELD_T(mfxU16 , FrameType ) - FIELD_T(mfxU16 , DataFlag ) -) - -STRUCT(mfxFrameId, - FIELD_T(mfxU16, TemporalId ) - FIELD_T(mfxU16, PriorityId ) - FIELD_T(mfxU16, DependencyId) - FIELD_T(mfxU16, QualityId ) - FIELD_T(mfxU16, ViewId ) -) - -STRUCT(mfxFrameInfo, - FIELD_S(mfxFrameId, FrameId) - FIELD_T(mfxU16, BitDepthLuma ) - FIELD_T(mfxU16, BitDepthChroma) - FIELD_T(mfxU16, Shift ) - FIELD_T(mfx4CC, FourCC ) - FIELD_T(mfxU16, Width ) - FIELD_T(mfxU16, Height ) - FIELD_T(mfxU16, CropX ) - FIELD_T(mfxU16, CropY ) - FIELD_T(mfxU16, CropW ) - FIELD_T(mfxU16, CropH ) - FIELD_T(mfxU32, FrameRateExtN ) - FIELD_T(mfxU32, FrameRateExtD ) - FIELD_T(mfxU16, AspectRatioW ) - FIELD_T(mfxU16, AspectRatioH ) - FIELD_T(mfxU16, PicStruct ) - FIELD_T(mfxU16, ChromaFormat ) -) - -STRUCT(mfxFrameData, - FIELD_T(mfxExtBuffer**, ExtParam ) - FIELD_T(mfxU16 , NumExtParam ) - FIELD_T(mfxU16 , PitchHigh ) - FIELD_T(mfxU64 , TimeStamp ) - FIELD_T(mfxU32 , FrameOrder ) - FIELD_T(mfxU16 , Locked ) - FIELD_T(mfxU16 , Pitch ) - FIELD_T(mfxU16 , PitchLow ) - FIELD_T(mfxU8 * , Y ) - FIELD_T(mfxU16* , Y16 ) - FIELD_T(mfxU8 * , R ) - FIELD_T(mfxU8 * , UV ) - FIELD_T(mfxU8 * , VU ) - FIELD_T(mfxU8 * , CbCr ) - FIELD_T(mfxU8 * , CrCb ) - FIELD_T(mfxU8 * , Cb ) - FIELD_T(mfxU8 * , U ) - FIELD_T(mfxU16* , U16 ) - FIELD_T(mfxU8 * , G ) - FIELD_T(mfxU8 * , Cr ) - FIELD_T(mfxU8 * , V ) - FIELD_T(mfxU16* , V16 ) - FIELD_T(mfxU8 * , B ) - FIELD_T(mfxU8 * , A ) - FIELD_T(mfxMemId, MemId ) - FIELD_T(mfxU16 , Corrupted ) - FIELD_T(mfxU16 , DataFlag ) -) - -STRUCT(mfxFrameSurface1, - FIELD_S(mfxFrameInfo, Info) - FIELD_S(mfxFrameData, Data) -) - -STRUCT(mfxInfoMFX, - FIELD_T(mfxU16, LowPower ) - FIELD_T(mfxU16, BRCParamMultiplier) - FIELD_S(mfxFrameInfo, FrameInfo ) - FIELD_T(mfx4CC, CodecId ) - FIELD_T(mfxU16, CodecProfile ) - FIELD_T(mfxU16, CodecLevel ) - FIELD_T(mfxU16, NumThread ) - FIELD_T(mfxU16, TargetUsage ) - FIELD_T(mfxU16, GopPicSize ) - FIELD_T(mfxU16, GopRefDist ) - FIELD_T(mfxU16, GopOptFlag ) - FIELD_T(mfxU16, IdrInterval ) - FIELD_T(mfxU16, RateControlMethod ) - FIELD_T(mfxU16, InitialDelayInKB ) - FIELD_T(mfxU16, QPI ) - FIELD_T(mfxU16, Accuracy ) - FIELD_T(mfxU16, BufferSizeInKB ) - FIELD_T(mfxU16, TargetKbps ) - FIELD_T(mfxU16, QPP ) - FIELD_T(mfxU16, ICQQuality ) - FIELD_T(mfxU16, MaxKbps ) - FIELD_T(mfxU16, QPB ) - FIELD_T(mfxU16, Convergence ) - FIELD_T(mfxU16, NumSlice ) - FIELD_T(mfxU16, NumRefFrame ) - FIELD_T(mfxU16, EncodedOrder ) - FIELD_T(mfxU16, DecodedOrder ) - FIELD_T(mfxU16, MaxDecFrameBuffering ) - FIELD_T(mfxU16, ExtendedPicStruct ) - FIELD_T(mfxU16, TimeStampCalc ) - FIELD_T(mfxU16, SliceGroupsPresent) - FIELD_T(mfxU16, JPEGChromaFormat ) - FIELD_T(mfxU16, Rotation ) - FIELD_T(mfxU16, JPEGColorFormat ) - FIELD_T(mfxU16, InterleavedDec ) - FIELD_T(mfxU16, Interleaved ) - FIELD_T(mfxU16, Quality ) - FIELD_T(mfxU16, RestartInterval ) -) - -STRUCT(mfxInfoVPP, - FIELD_S(mfxFrameInfo, In) - FIELD_S(mfxFrameInfo, Out) -) - -STRUCT(mfxVideoParam, - FIELD_S(mfxInfoMFX, mfx) - FIELD_S(mfxInfoVPP, vpp) - FIELD_T(mfxU16 , AsyncDepth ) - FIELD_T(mfxU16 , Protected ) - FIELD_T(mfxU16 , IOPattern ) - FIELD_T(mfxExtBuffer**, ExtParam ) - FIELD_T(mfxU16 , NumExtParam ) -) - -STRUCT(mfxExtCodingOption, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , reserved1 ) - FIELD_T(mfxU16 , RateDistortionOpt ) - FIELD_T(mfxU16 , MECostType ) - FIELD_T(mfxU16 , MESearchType ) - FIELD_S(mfxI16Pair , MVSearchWindow ) - FIELD_T(mfxU16 , EndOfSequence ) - FIELD_T(mfxU16 , FramePicture ) - FIELD_T(mfxU16 , CAVLC ) - FIELD_T(mfxU16 , RecoveryPointSEI ) - FIELD_T(mfxU16 , ViewOutput ) - FIELD_T(mfxU16 , NalHrdConformance ) - FIELD_T(mfxU16 , SingleSeiNalUnit ) - FIELD_T(mfxU16 , VuiVclHrdParameters ) - FIELD_T(mfxU16 , RefPicListReordering ) - FIELD_T(mfxU16 , ResetRefList ) - FIELD_T(mfxU16 , RefPicMarkRep ) - FIELD_T(mfxU16 , FieldOutput ) - FIELD_T(mfxU16 , IntraPredBlockSize ) - FIELD_T(mfxU16 , InterPredBlockSize ) - FIELD_T(mfxU16 , MVPrecision ) - FIELD_T(mfxU16 , MaxDecFrameBuffering ) - FIELD_T(mfxU16 , AUDelimiter ) - FIELD_T(mfxU16 , EndOfStream ) - FIELD_T(mfxU16 , PicTimingSEI ) - FIELD_T(mfxU16 , VuiNalHrdParameters ) -) - -STRUCT(mfxExtCodingOption2, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , IntRefType ) - FIELD_T(mfxU16 , IntRefCycleSize ) - FIELD_T(mfxI16 , IntRefQPDelta ) - FIELD_T(mfxU32 , MaxFrameSize ) - FIELD_T(mfxU32 , MaxSliceSize ) - FIELD_T(mfxU16 , BitrateLimit ) - FIELD_T(mfxU16 , MBBRC ) - FIELD_T(mfxU16 , ExtBRC ) - FIELD_T(mfxU16 , LookAheadDepth ) - FIELD_T(mfxU16 , Trellis ) - FIELD_T(mfxU16 , RepeatPPS ) - FIELD_T(mfxU16 , BRefType ) - FIELD_T(mfxU16 , AdaptiveI ) - FIELD_T(mfxU16 , AdaptiveB ) - FIELD_T(mfxU16 , LookAheadDS ) - FIELD_T(mfxU16 , NumMbPerSlice ) - FIELD_T(mfxU16 , SkipFrame ) - FIELD_T(mfxU8 , MinQPI ) - FIELD_T(mfxU8 , MaxQPI ) - FIELD_T(mfxU8 , MinQPP ) - FIELD_T(mfxU8 , MaxQPP ) - FIELD_T(mfxU8 , MinQPB ) - FIELD_T(mfxU8 , MaxQPB ) - FIELD_T(mfxU16 , FixedFrameRate ) - FIELD_T(mfxU16 , DisableDeblockingIdc ) - FIELD_T(mfxU16 , DisableVUI ) - FIELD_T(mfxU16 , BufferingPeriodSEI) - FIELD_T(mfxU16 , EnableMAD ) - FIELD_T(mfxU16 , UseRawRef ) -) - -STRUCT(mfxExtVPPDoNotUse, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , NumAlg) - FIELD_T(mfxU32*, AlgList) -) - -STRUCT(mfxExtVPPDenoise, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, DenoiseFactor) -) - -STRUCT(mfxExtVPPDetail, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, DetailFactor) -) - -STRUCT(mfxExtVPPProcAmp, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxF64, Brightness ) - FIELD_T(mfxF64, Contrast ) - FIELD_T(mfxF64, Hue ) - FIELD_T(mfxF64, Saturation ) -) - -STRUCT(mfxEncodeStat, - FIELD_T(mfxU32, NumFrame ) - FIELD_T(mfxU64, NumBit ) - FIELD_T(mfxU32, NumCachedFrame ) -) - -STRUCT(mfxDecodeStat, - FIELD_T(mfxU32, NumFrame ) - FIELD_T(mfxU32, NumSkippedFrame ) - FIELD_T(mfxU32, NumError ) - FIELD_T(mfxU32, NumCachedFrame ) -) - -STRUCT(mfxVPPStat, - FIELD_T(mfxU32, NumFrame ) - FIELD_T(mfxU32, NumCachedFrame ) -) - -STRUCT(mfxExtVppAuxData, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, PicStruct ) - FIELD_T(mfxU16, SceneChangeRate ) - FIELD_T(mfxU16, RepeatedFrame ) -) - -STRUCT(mfxPayload, - FIELD_T(mfxU8*, Data ) - FIELD_T(mfxU32, NumBit ) - FIELD_T(mfxU16, Type ) - FIELD_T(mfxU16, BufSize ) -) - -STRUCT(mfxEncodeCtrl, - FIELD_S(mfxExtBuffer , Header ) - FIELD_T(mfxU16 , MfxNalUnitType) - FIELD_T(mfxU16 , SkipFrame ) - FIELD_T(mfxU16 , QP ) - FIELD_T(mfxU16 , FrameType ) - FIELD_T(mfxU16 , NumExtParam) - FIELD_T(mfxU16 , NumPayload ) - FIELD_T(mfxExtBuffer**, ExtParam ) - FIELD_T(mfxPayload** , Payload ) -) - -STRUCT(mfxFrameAllocRequest, - FIELD_S(mfxFrameInfo, Info) - FIELD_T(mfxU16, Type ) - FIELD_T(mfxU16, NumFrameMin ) - FIELD_T(mfxU16, NumFrameSuggested ) - ) - -STRUCT(mfxFrameAllocResponse, - FIELD_T(mfxMemId*, mids ) - FIELD_T(mfxU16 , NumFrameActual ) -) - -STRUCT(mfxExtCodingOptionSPSPPS, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU8* , SPSBuffer ) - FIELD_T(mfxU8* , PPSBuffer ) - FIELD_T(mfxU16 , SPSBufSize) - FIELD_T(mfxU16 , PPSBufSize) - FIELD_T(mfxU16 , SPSId ) - FIELD_T(mfxU16 , PPSId ) -) - -STRUCT(mfxExtVideoSignalInfo, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16, VideoFormat ) - FIELD_T(mfxU16, VideoFullRange ) - FIELD_T(mfxU16, ColourDescriptionPresent) - FIELD_T(mfxU16, ColourPrimaries ) - FIELD_T(mfxU16, TransferCharacteristics ) - FIELD_T(mfxU16, MatrixCoefficients ) -) - -STRUCT(mfxExtVPPDoUse, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , NumAlg) - FIELD_T(mfxU32*, AlgList) -) - -STRUCT(mfxExtOpaqueSurfaceAlloc_InOut, - FIELD_T(mfxFrameSurface1 ** , Surfaces ) - FIELD_T(mfxU16 , Type ) - FIELD_T(mfxU16 , NumSurface) -) - -STRUCT(mfxExtOpaqueSurfaceAlloc, - FIELD_S(mfxExtBuffer, Header) - FIELD_S(mfxExtOpaqueSurfaceAlloc_InOut, In) - FIELD_S(mfxExtOpaqueSurfaceAlloc_InOut, Out) -) - -STRUCT(mfxExtAVCRefListCtrl_Entry, - FIELD_T(mfxU32, FrameOrder ) - FIELD_T(mfxU16, PicStruct ) - FIELD_T(mfxU16, ViewId ) - FIELD_T(mfxU16, LongTermIdx ) -) - -STRUCT(mfxExtAVCRefListCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, NumRefIdxL0Active) - FIELD_T(mfxU16, NumRefIdxL1Active) - FIELD_S(mfxExtAVCRefListCtrl_Entry, PreferredRefList) - FIELD_S(mfxExtAVCRefListCtrl_Entry, RejectedRefList ) - FIELD_S(mfxExtAVCRefListCtrl_Entry, LongTermRefList ) - FIELD_T(mfxU16, ApplyLongTermIdx ) -) - -STRUCT(mfxExtVPPFrameRateConversion, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Algorithm) -) - -STRUCT(mfxExtVPPImageStab, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Mode) -) - -STRUCT(mfxExtPictureTimingSEI_TimeStamp, - FIELD_T(mfxU16, ClockTimestampFlag) - FIELD_T(mfxU16, CtType ) - FIELD_T(mfxU16, NuitFieldBasedFlag) - FIELD_T(mfxU16, CountingType ) - FIELD_T(mfxU16, FullTimestampFlag ) - FIELD_T(mfxU16, DiscontinuityFlag ) - FIELD_T(mfxU16, CntDroppedFlag ) - FIELD_T(mfxU16, NFrames ) - FIELD_T(mfxU16, SecondsFlag ) - FIELD_T(mfxU16, MinutesFlag ) - FIELD_T(mfxU16, HoursFlag ) - FIELD_T(mfxU16, SecondsValue ) - FIELD_T(mfxU16, MinutesValue ) - FIELD_T(mfxU16, HoursValue ) - FIELD_T(mfxU32, TimeOffset ) -) - -STRUCT(mfxExtPictureTimingSEI, - FIELD_S(mfxExtBuffer, Header) - FIELD_S(mfxExtPictureTimingSEI_TimeStamp, TimeStamp) -) - -STRUCT(mfxExtAvcTemporalLayers_Layer, - FIELD_T(mfxU16, Scale) -) - -STRUCT(mfxExtAvcTemporalLayers, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, BaseLayerPID) - FIELD_S(mfxExtAvcTemporalLayers_Layer, Layer) -) - -STRUCT(mfxExtEncoderCapability, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, MBPerSec) -) - -STRUCT(mfxExtEncoderResetOption, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, StartNewSequence) -) - -STRUCT(mfxExtAVCEncodedFrameInfo_RefList, - FIELD_T(mfxU32, FrameOrder ) - FIELD_T(mfxU16, PicStruct ) - FIELD_T(mfxU16, LongTermIdx ) -) - -STRUCT(mfxExtAVCEncodedFrameInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, FrameOrder ) - FIELD_T(mfxU16, PicStruct ) - FIELD_T(mfxU16, LongTermIdx ) - FIELD_T(mfxU32, MAD ) - FIELD_T(mfxU16, BRCPanicMode) - FIELD_T(mfxU16, QP ) - FIELD_T(mfxU32, SecondFieldOffset ) - FIELD_S(mfxExtAVCEncodedFrameInfo_RefList, UsedRefListL0) - FIELD_S(mfxExtAVCEncodedFrameInfo_RefList, UsedRefListL1) -) - -STRUCT(mfxVPPCompInputStream, - FIELD_T(mfxU32, DstX ) - FIELD_T(mfxU32, DstY ) - FIELD_T(mfxU32, DstW ) - FIELD_T(mfxU32, DstH ) - FIELD_T(mfxU16, LumaKeyEnable ) - FIELD_T(mfxU16, LumaKeyMin ) - FIELD_T(mfxU16, LumaKeyMax ) - FIELD_T(mfxU16, GlobalAlphaEnable) - FIELD_T(mfxU16, GlobalAlpha ) - FIELD_T(mfxU16, PixelAlphaEnable ) - FIELD_T(mfxU16, TileId ) -) - -STRUCT(mfxExtVPPComposite, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Y) - FIELD_T(mfxU16, U) - FIELD_T(mfxU16, V) - FIELD_T(mfxU16, R) - FIELD_T(mfxU16, G) - FIELD_T(mfxU16, B) - FIELD_T(mfxU16, NumTiles) - FIELD_T(mfxU16, NumInputStream) - FIELD_T(mfxVPPCompInputStream*, InputStream) -) - -STRUCT(mfxExtColorConversion, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, ChromaSiting) -) - -STRUCT(mfxExtVPPVideoSignalInfo_InOut, - FIELD_T(mfxU16, TransferMatrix ) - FIELD_T(mfxU16, NominalRange ) -) - -STRUCT(mfxExtVPPVideoSignalInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_S(mfxExtVPPVideoSignalInfo_InOut, In ) - FIELD_S(mfxExtVPPVideoSignalInfo_InOut, Out) -) - -STRUCT(mfxExtEncoderROI_Entry, - FIELD_T(mfxU32, Left ) - FIELD_T(mfxU32, Top ) - FIELD_T(mfxU32, Right ) - FIELD_T(mfxU32, Bottom ) - FIELD_T(mfxI16, Priority) -) - -STRUCT(mfxExtEncoderROI, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxI16, NumROI) - FIELD_T(mfxU16, ROIMode) - FIELD_S(mfxExtEncoderROI_Entry, ROI) -) - -STRUCT(mfxExtVPPDeinterlacing, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Mode) - FIELD_T(mfxU16, TelecinePattern) - FIELD_T(mfxU16, TelecineLocation) -) - -STRUCT(mfxExtVP8CodingOption, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Version) - FIELD_T(mfxU16, EnableMultipleSegments) - FIELD_T(mfxU16, LoopFilterType) -) - -STRUCT(mfxPluginUID, - FIELD_T(mfxU8, Data) -) - -STRUCT(mfxExtFeiParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxFeiFunction, Func) - FIELD_T(mfxU16, SingleFieldProcessing) -) - -STRUCT(mfxExtFeiSPS, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SPSId) - FIELD_T(mfxU16, PicOrderCntType) - FIELD_T(mfxU16, Log2MaxPicOrderCntLsb) -) - -#if MFX_VERSION >= 1023 -STRUCT(mfxExtFeiPPS_mfxExtFeiPpsDPB, - FIELD_T(mfxU16, Index) - FIELD_T(mfxU16, PicType) - FIELD_T(mfxI32, FrameNumWrap) - FIELD_T(mfxU16, LongTermFrameIdx) -) - -STRUCT(mfxExtFeiPPS, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SPSId) - FIELD_T(mfxU16, PPSId) - FIELD_T(mfxU16, PictureType) - FIELD_T(mfxU16, FrameType) - FIELD_T(mfxU16, PicInitQP) - FIELD_T(mfxU16, NumRefIdxL0Active) - FIELD_T(mfxU16, NumRefIdxL1Active) - FIELD_T(mfxI16, ChromaQPIndexOffset) - FIELD_T(mfxI16, SecondChromaQPIndexOffset) - FIELD_T(mfxU16, Transform8x8ModeFlag) - FIELD_S(mfxExtFeiPPS_mfxExtFeiPpsDPB, DpbBefore) - FIELD_S(mfxExtFeiPPS_mfxExtFeiPpsDPB, DpbAfter) -) - -#else -STRUCT(mfxExtFeiPPS, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SPSId) - FIELD_T(mfxU16, PPSId) - FIELD_T(mfxU16, PictureType) - FIELD_T(mfxU16, PicInitQP) - FIELD_T(mfxU16, NumRefIdxL0Active) - FIELD_T(mfxU16, NumRefIdxL1Active) - FIELD_T(mfxU16, ReferenceFrames) - FIELD_T(mfxI16, ChromaQPIndexOffset) - FIELD_T(mfxI16, SecondChromaQPIndexOffset) - FIELD_T(mfxU16, Transform8x8ModeFlag) -) -#endif //MFX_VERSION >= 1023 - -STRUCT(mfxExtFeiPreEncCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Qp) - FIELD_T(mfxU16, LenSP) - FIELD_T(mfxU16, SearchPath) - FIELD_T(mfxU16, SubMBPartMask) - FIELD_T(mfxU16, SubPelMode) - FIELD_T(mfxU16, InterSAD) - FIELD_T(mfxU16, IntraSAD) - FIELD_T(mfxU16, AdaptiveSearch) - FIELD_T(mfxU16, MVPredictor) - FIELD_T(mfxU16, MBQp) - FIELD_T(mfxU16, FTEnable) - FIELD_T(mfxU16, IntraPartMask) - FIELD_T(mfxU16, RefWidth) - FIELD_T(mfxU16, RefHeight) - FIELD_T(mfxU16, SearchWindow) - FIELD_T(mfxU16, DisableMVOutput) - FIELD_T(mfxU16, DisableStatisticsOutput) - FIELD_T(mfxU16, Enable8x8Stat) - FIELD_T(mfxU16, PictureType) - FIELD_T(mfxU16, DownsampleInput) -) - -STRUCT(mfxExtFeiPreEncMVPredictors, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxExtFeiPreEncMVPredictors_MB*, MB) -) - -STRUCT(mfxExtFeiPreEncMV, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxExtFeiPreEncMV_MB*, MB) -) - -STRUCT(mfxExtFeiPreEncMBStat, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxExtFeiPreEncMBStat_MB*, MB) -) - -STRUCT(mfxExtFeiEncFrameCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SearchPath) - FIELD_T(mfxU16, LenSP) - FIELD_T(mfxU16, SubMBPartMask) - FIELD_T(mfxU16, IntraPartMask) - FIELD_T(mfxU16, MultiPredL0) - FIELD_T(mfxU16, MultiPredL1) - FIELD_T(mfxU16, SubPelMode) - FIELD_T(mfxU16, InterSAD) - FIELD_T(mfxU16, IntraSAD) - FIELD_T(mfxU16, DistortionType) - FIELD_T(mfxU16, RepartitionCheckEnable) - FIELD_T(mfxU16, AdaptiveSearch) - FIELD_T(mfxU16, MVPredictor) - FIELD_T(mfxU16, NumMVPredictors) - FIELD_T(mfxU16, PerMBQp) - FIELD_T(mfxU16, PerMBInput) - FIELD_T(mfxU16, MBSizeCtrl) - FIELD_T(mfxU16, RefWidth) - FIELD_T(mfxU16, RefHeight) - FIELD_T(mfxU16, SearchWindow) -) - -STRUCT(mfxExtFeiEncMVPredictors, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) -) - -STRUCT(mfxExtFeiEncMV_MB, - FIELD_S(mfxI16Pair, MV) -) - -STRUCT(mfxExtFeiEncMV, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxExtFeiEncMV_MB*, MB) -) - -STRUCT(mfxExtFeiEncMBCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxExtFeiEncMBCtrl_MB*, MB) -) -STRUCT(mfxExtFeiEncMBStat, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) -) - -STRUCT(mfxExtFeiEncQP, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) -) - -STRUCT(mfxExtFeiPakMBCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxFeiPakMBCtrl*, MB) -) - - -STRUCT(mfxExtFeiSliceHeader, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, NumSlice) -) - -STRUCT(mfxExtFeiRepackCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, MaxFrameSize) - FIELD_T(mfxU32, NumPasses) -) - -STRUCT(mfxExtFeiDecStreamOut, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, NumMBAlloc) - FIELD_T(mfxU16, RemapRefIdx) - FIELD_T(mfxU16, PicStruct) - FIELD_T(mfxFeiDecStreamOutMBCtrl*, MB) -) - -#if (MFX_VERSION >= 1027) -STRUCT(mfxExtFeiHevcEncFrameCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SearchPath) - FIELD_T(mfxU16, LenSP) - FIELD_T(mfxU16, RefWidth) - FIELD_T(mfxU16, RefHeight) - FIELD_T(mfxU16, SearchWindow) - FIELD_T(mfxU16, NumMvPredictors) - FIELD_T(mfxU16, MultiPred) - FIELD_T(mfxU16, SubPelMode) - FIELD_T(mfxU16, AdaptiveSearch) - FIELD_T(mfxU16, MVPredictor) - FIELD_T(mfxU16, PerCuQp) - FIELD_T(mfxU16, PerCtuInput) - FIELD_T(mfxU16, ForceCtuSplit) - FIELD_T(mfxU16, NumFramePartitions) - FIELD_T(mfxU16, FastIntraMode) -) - -STRUCT(mfxExtFeiHevcEncMVPredictors, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, VaBufferID) - FIELD_T(mfxU32, Pitch) - FIELD_T(mfxU32, Height) -) - -STRUCT(mfxExtFeiHevcEncCtuCtrl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, VaBufferID) - FIELD_T(mfxU32, Pitch) - FIELD_T(mfxU32, Height) -) - -STRUCT(mfxExtFeiHevcEncQP, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, VaBufferID) - FIELD_T(mfxU32, Pitch) - FIELD_T(mfxU32, Height) - FIELD_T(mfxU8*, Data) -) -#endif - -STRUCT(mfxExtCamGammaCorrection, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16, Mode ) - FIELD_T(mfxU16, reserved1 ) - FIELD_T(mfxF64, GammaValue ) - FIELD_T(mfxU16, reserved2 ) - FIELD_T(mfxU16, NumPoints ) - FIELD_T(mfxU16, GammaPoint ) - FIELD_T(mfxU16, GammaCorrected ) -) -STRUCT(mfxExtCamWhiteBalance, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU32, Mode ) - FIELD_T(mfxF64, R ) - FIELD_T(mfxF64, G0 ) - FIELD_T(mfxF64, B ) - FIELD_T(mfxF64, G1 ) - FIELD_T(mfxU32, reserved) /* Fixed size array */ -) -STRUCT(mfxExtCamHotPixelRemoval, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, PixelThresholdDifference ) - FIELD_T(mfxU16, PixelCountThreshold ) -) -STRUCT(mfxCamVignetteCorrectionElement, - FIELD_T(mfxU8, integer ) - FIELD_T(mfxU8, mantissa) -) -STRUCT(mfxExtCamBlackLevelCorrection, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16, R ) - FIELD_T(mfxU16, G0 ) - FIELD_T(mfxU16, B ) - FIELD_T(mfxU16, G1 ) - FIELD_T(mfxU32, reserved ) /* Fixed size array */ -) - STRUCT(mfxExtCamTotalColorControl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU8, R) - FIELD_T(mfxU8, G) - FIELD_T(mfxU8, B) - FIELD_T(mfxU8, C) - FIELD_T(mfxU8, M) - FIELD_T(mfxU8, Y) -) - -STRUCT(mfxExtCamCscYuvRgb, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxF32, PreOffset) - FIELD_T(mfxF32, Matrix) - FIELD_T(mfxF32, PostOffset) - FIELD_T(mfxU16, reserved) -) - -STRUCT(mfxCamVignetteCorrectionParam, - FIELD_S(mfxCamVignetteCorrectionElement, R ) - FIELD_S(mfxCamVignetteCorrectionElement, G0) - FIELD_S(mfxCamVignetteCorrectionElement, B ) - FIELD_S(mfxCamVignetteCorrectionElement, G1) -) -STRUCT(mfxExtCamVignetteCorrection, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , Width ) - FIELD_T(mfxU32 , Height) - FIELD_T(mfxU32 , Pitch ) -) -STRUCT(mfxExtCamBayerDenoise, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16, Threshold) -) -STRUCT(mfxExtCamColorCorrection3x3, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxF64, CCM ) -) -STRUCT(mfxExtCamPadding, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, Top ) - FIELD_T(mfxU16, Bottom) - FIELD_T(mfxU16, Left ) - FIELD_T(mfxU16, Right ) -) -STRUCT(mfxExtCamPipeControl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, RawFormat ) -) - -STRUCT(mfxExtAVCRefLists_mfxRefPic, - FIELD_T(mfxU32, FrameOrder) - FIELD_T(mfxU16, PicStruct ) -) - -STRUCT(mfxExtAVCRefLists, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , NumRefIdxL0Active) - FIELD_T(mfxU16 , NumRefIdxL1Active) - FIELD_S(mfxExtAVCRefLists_mfxRefPic, RefPicList0) - FIELD_S(mfxExtAVCRefLists_mfxRefPic, RefPicList1) -) - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -STRUCT(mfxExtCodingOption3, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, NumSliceI) - FIELD_T(mfxU16, NumSliceP) - FIELD_T(mfxU16, NumSliceB) - FIELD_T(mfxU16, WinBRCMaxAvgKbps) - FIELD_T(mfxU16, WinBRCSize) - FIELD_T(mfxU16, QVBRQuality) - FIELD_T(mfxU16, EnableMBQP) - FIELD_T(mfxU16, IntRefCycleDist) - FIELD_T(mfxU16, DirectBiasAdjustment) - FIELD_T(mfxU16, GlobalMotionBiasAdjustment)/* tri-state option */ - FIELD_T(mfxU16, MVCostScalingFactor) - FIELD_T(mfxU16, MBDisableSkipMap)/* tri-state option */ - FIELD_T(mfxU16, WeightedPred) - FIELD_T(mfxU16, WeightedBiPred) - FIELD_T(mfxU16, AspectRatioInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, OverscanInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, OverscanAppropriate) /* tri-state option */ - FIELD_T(mfxU16, TimingInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, BitstreamRestriction) /* tri-state option */ - FIELD_T(mfxU16, LowDelayHrd) /* tri-state option */ - FIELD_T(mfxU16, MotionVectorsOverPicBoundaries) /* tri-state option */ - FIELD_T(mfxU16, Log2MaxMvLengthHorizontal) /* 0..16 */ - FIELD_T(mfxU16, Log2MaxMvLengthVertical) /* 0..16 */ - FIELD_T(mfxU16, ScenarioInfo) - FIELD_T(mfxU16, ContentInfo) - FIELD_T(mfxU16, PRefType) - FIELD_T(mfxU16, FadeDetection) /* tri-state option */ - FIELD_T(mfxI16, DeblockingAlphaTcOffset) /* -12..12 (slice_alpha_c0_offset_div2 << 1) */ - FIELD_T(mfxI16, DeblockingBetaOffset) /* -12..12 (slice_beta_offset_div2 << 1) */ - FIELD_T(mfxU16, GPB) - FIELD_T(mfxU32, MaxFrameSizeI) - FIELD_T(mfxU32, MaxFrameSizeP) - FIELD_T(mfxU16, EnableQPOffset) - FIELD_T(mfxI16, QPOffset) - FIELD_T(mfxU16, NumRefActiveP) - FIELD_T(mfxU16, NumRefActiveBL0) - FIELD_T(mfxU16, NumRefActiveBL1) - FIELD_T(mfxU16, TransformSkip) - FIELD_T(mfxU16, TargetChromaFormatPlus1) - FIELD_T(mfxU16, TargetBitDepthLuma) - FIELD_T(mfxU16, TargetBitDepthChroma) - FIELD_T(mfxU16, BRCPanicMode) - FIELD_T(mfxU16, LowDelayBRC) - FIELD_T(mfxU16, EnableMBForceIntra) - FIELD_T(mfxU16, AdaptiveMaxFrameSize) - FIELD_T(mfxU16, RepartitionCheckEnable) /* tri-state option */ - FIELD_T(mfxU16, QuantScaleType) - FIELD_T(mfxU16, IntraVLCFormat) - FIELD_T(mfxU16, ScanType) - FIELD_T(mfxU16, EncodedUnitsInfo) - FIELD_T(mfxU16, EnableNalUnitType) - FIELD_T(mfxU16, ExtBrcAdaptiveLTR) /* tri-state option for ExtBrcAdaptiveLTR */ -) -#elif (MFX_VERSION >= 1027) -STRUCT(mfxExtCodingOption3, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, NumSliceI) - FIELD_T(mfxU16, NumSliceP) - FIELD_T(mfxU16, NumSliceB) - FIELD_T(mfxU16, WinBRCMaxAvgKbps) - FIELD_T(mfxU16, WinBRCSize) - FIELD_T(mfxU16, QVBRQuality) - FIELD_T(mfxU16, EnableMBQP) - FIELD_T(mfxU16, IntRefCycleDist) - FIELD_T(mfxU16, DirectBiasAdjustment) - FIELD_T(mfxU16, GlobalMotionBiasAdjustment)/* tri-state option */ - FIELD_T(mfxU16, MVCostScalingFactor) - FIELD_T(mfxU16, MBDisableSkipMap)/* tri-state option */ - FIELD_T(mfxU16, WeightedPred) - FIELD_T(mfxU16, WeightedBiPred) - FIELD_T(mfxU16, AspectRatioInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, OverscanInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, OverscanAppropriate) /* tri-state option */ - FIELD_T(mfxU16, TimingInfoPresent) /* tri-state option */ - FIELD_T(mfxU16, BitstreamRestriction) /* tri-state option */ - FIELD_T(mfxU16, LowDelayHrd) /* tri-state option */ - FIELD_T(mfxU16, MotionVectorsOverPicBoundaries) /* tri-state option */ - FIELD_T(mfxU16, ScenarioInfo) - FIELD_T(mfxU16, ContentInfo) - FIELD_T(mfxU16, PRefType) - FIELD_T(mfxU16, FadeDetection) /* tri-state option */ - FIELD_T(mfxU16, GPB) - FIELD_T(mfxU32, MaxFrameSizeI) - FIELD_T(mfxU32, MaxFrameSizeP) - FIELD_T(mfxU16, EnableQPOffset) - FIELD_T(mfxI16, QPOffset) - FIELD_T(mfxU16, NumRefActiveP) - FIELD_T(mfxU16, NumRefActiveBL0) - FIELD_T(mfxU16, NumRefActiveBL1) - FIELD_T(mfxU16, TransformSkip) - FIELD_T(mfxU16, TargetChromaFormatPlus1) - FIELD_T(mfxU16, TargetBitDepthLuma) - FIELD_T(mfxU16, TargetBitDepthChroma) - FIELD_T(mfxU16, BRCPanicMode) - FIELD_T(mfxU16, LowDelayBRC) - FIELD_T(mfxU16, EnableMBForceIntra) - FIELD_T(mfxU16, AdaptiveMaxFrameSize) - FIELD_T(mfxU16, RepartitionCheckEnable) /* tri-state option */ - FIELD_T(mfxU16, EncodedUnitsInfo) - FIELD_T(mfxU16, EnableNalUnitType) - FIELD_T(mfxU16, ExtBrcAdaptiveLTR) -) - -#elif (MFX_VERSION >= 1026) -STRUCT(mfxExtCodingOption3, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , NumSliceI ) - FIELD_T(mfxU16 , NumSliceP ) - FIELD_T(mfxU16 , NumSliceB ) - FIELD_T(mfxU16 , WinBRCMaxAvgKbps ) - FIELD_T(mfxU16 , WinBRCSize ) - FIELD_T(mfxU16 , QVBRQuality ) - FIELD_T(mfxU16 , EnableMBQP ) - FIELD_T(mfxU16 , IntRefCycleDist ) - FIELD_T(mfxU16 , DirectBiasAdjustment ) - FIELD_T(mfxU16 , GlobalMotionBiasAdjustment )/* tri-state option */ - FIELD_T(mfxU16 , MVCostScalingFactor ) - FIELD_T(mfxU16 , MBDisableSkipMap )/* tri-state option */ - FIELD_T(mfxU16 , WeightedPred ) - FIELD_T(mfxU16 , WeightedBiPred ) - FIELD_T(mfxU16 , AspectRatioInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , OverscanInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , OverscanAppropriate ) /* tri-state option */ - FIELD_T(mfxU16 , TimingInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , BitstreamRestriction ) /* tri-state option */ - FIELD_T(mfxU16 , LowDelayHrd ) /* tri-state option */ - FIELD_T(mfxU16 , MotionVectorsOverPicBoundaries) /* tri-state option */ - FIELD_T(mfxU16 , ScenarioInfo ) - FIELD_T(mfxU16 , ContentInfo ) - FIELD_T(mfxU16 , PRefType ) - FIELD_T(mfxU16 , FadeDetection ) /* tri-state option */ - FIELD_T(mfxU16 , GPB ) - FIELD_T(mfxU32 , MaxFrameSizeI ) - FIELD_T(mfxU32 , MaxFrameSizeP ) - FIELD_T(mfxU16 , EnableQPOffset ) - FIELD_T(mfxI16 , QPOffset ) - FIELD_T(mfxU16 , NumRefActiveP ) - FIELD_T(mfxU16 , NumRefActiveBL0 ) - FIELD_T(mfxU16 , NumRefActiveBL1 ) - FIELD_T(mfxU16 , TransformSkip) - FIELD_T(mfxU16 , BRCPanicMode ) - FIELD_T(mfxU16 , LowDelayBRC ) - FIELD_T(mfxU16 , EnableMBForceIntra ) - FIELD_T(mfxU16 , AdaptiveMaxFrameSize ) - FIELD_T(mfxU16 , RepartitionCheckEnable ) /* tri-state option */ - FIELD_T(mfxU16 , EncodedUnitsInfo ) - FIELD_T(mfxU16 , EnableNalUnitType ) - FIELD_T(mfxU16 , ExtBrcAdaptiveLTR) -) -#else -STRUCT(mfxExtCodingOption3, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , NumSliceI ) - FIELD_T(mfxU16 , NumSliceP ) - FIELD_T(mfxU16 , NumSliceB ) - FIELD_T(mfxU16 , WinBRCMaxAvgKbps ) - FIELD_T(mfxU16 , WinBRCSize ) - FIELD_T(mfxU16 , QVBRQuality ) - FIELD_T(mfxU16 , EnableMBQP ) - FIELD_T(mfxU16 , IntRefCycleDist ) - FIELD_T(mfxU16 , DirectBiasAdjustment ) - FIELD_T(mfxU16 , GlobalMotionBiasAdjustment )/* tri-state option */ - FIELD_T(mfxU16 , MVCostScalingFactor ) - FIELD_T(mfxU16 , MBDisableSkipMap )/* tri-state option */ - FIELD_T(mfxU16 , WeightedPred ) - FIELD_T(mfxU16 , WeightedBiPred ) - FIELD_T(mfxU16 , AspectRatioInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , OverscanInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , OverscanAppropriate ) /* tri-state option */ - FIELD_T(mfxU16 , TimingInfoPresent ) /* tri-state option */ - FIELD_T(mfxU16 , BitstreamRestriction ) /* tri-state option */ - FIELD_T(mfxU16 , LowDelayHrd ) /* tri-state option */ - FIELD_T(mfxU16 , MotionVectorsOverPicBoundaries) /* tri-state option */ - FIELD_T(mfxU16 , ScenarioInfo ) - FIELD_T(mfxU16 , ContentInfo ) - FIELD_T(mfxU16 , PRefType ) - FIELD_T(mfxU16 , FadeDetection ) /* tri-state option */ - FIELD_T(mfxU16 , GPB ) - FIELD_T(mfxU32 , MaxFrameSizeI ) - FIELD_T(mfxU32 , MaxFrameSizeP ) - FIELD_T(mfxU16 , EnableQPOffset ) - FIELD_T(mfxI16 , QPOffset ) - FIELD_T(mfxU16 , NumRefActiveP ) - FIELD_T(mfxU16 , NumRefActiveBL0 ) - FIELD_T(mfxU16 , NumRefActiveBL1 ) - FIELD_T(mfxU16 , BRCPanicMode ) - FIELD_T(mfxU16 , LowDelayBRC ) - FIELD_T(mfxU16 , EnableMBForceIntra ) - FIELD_T(mfxU16 , AdaptiveMaxFrameSize ) - FIELD_T(mfxU16 , RepartitionCheckEnable ) /* tri-state option */ - FIELD_T(mfxU16 , EncodedUnitsInfo ) - FIELD_T(mfxU16 , EnableNalUnitType ) -) -#endif - -STRUCT(mfxExtLAControl, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , LookAheadDepth) - FIELD_T(mfxU16 , DependencyDepth) - FIELD_T(mfxU16 , DownScaleFactor) - FIELD_T(mfxU16 , NumOutStream) - -) - -STRUCT(mfxQPandMode, - FIELD_T(mfxU8, QP) - FIELD_T(mfxU16, Mode) -) - -STRUCT(mfxExtMBQP, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , NumQPAlloc) - FIELD_T(mfxU8* , QP) -) - -STRUCT(mfxExtInsertHeaders, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SPS) - FIELD_T(mfxU16, PPS) -) - - -STRUCT(mfxExtEncoderIPCMArea_area, - FIELD_T(mfxU32, Left ) - FIELD_T(mfxU32, Top ) - FIELD_T(mfxU32, Right ) - FIELD_T(mfxU32, Bottom ) -) - -STRUCT(mfxExtEncoderIPCMArea, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , NumArea) - FIELD_T(mfxExtEncoderIPCMArea_area*, Areas) -) - -STRUCT(mfxExtChromaLocInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , ChromaLocInfoPresentFlag) - FIELD_T(mfxU16 , ChromaSampleLocTypeTopField) - FIELD_T(mfxU16 , ChromaSampleLocTypeBottomField) -) - - -STRUCT(mfxExtDecodedFrameInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , FrameType) -) - -STRUCT(mfxExtDecodeErrorReport, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , ErrorTypes) -) - - - -STRUCT(mfxInitParam, - FIELD_T(mfxIMPL, Implementation) - FIELD_S(mfxVersion, Version) - FIELD_T(mfxU16, ExternalThreads) - FIELD_T(mfxExtBuffer**, ExtParam) - FIELD_T(mfxU16, NumExtParam) - FIELD_T(mfxU16, GPUCopy) -) - - -STRUCT(mfxExtThreadsParam, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU16 , NumThread ) - FIELD_T(mfxI32 , SchedulingType) - FIELD_T(mfxI32 , Priority ) -) - -STRUCT(mfxExtVPPFieldProcessing, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , Mode) - FIELD_T(mfxU16 , InField) - FIELD_T(mfxU16 , OutField) -) - -STRUCT(mfxExtVPPRotation, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , Angle) -) - -STRUCT(mfxExtVPPMirroring, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , Type) -) - -STRUCT(mfxExtScreenCaptureParam, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU32 , DisplayIndex ) - FIELD_T(mfxU16 , EnableDirtyRect ) - FIELD_T(mfxU16 , EnableCursorCapture) -) - -STRUCT(mfxExtDirtyRect_Entry, - FIELD_T(mfxU32, Left ) - FIELD_T(mfxU32, Top ) - FIELD_T(mfxU32, Right ) - FIELD_T(mfxU32, Bottom ) -) - -STRUCT(mfxExtDirtyRect, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxI16, NumRect) - FIELD_S(mfxExtDirtyRect_Entry, Rect ) -) - -STRUCT(mfxExtMoveRect_Entry, - FIELD_T(mfxU32, DestLeft ) - FIELD_T(mfxU32, DestTop ) - FIELD_T(mfxU32, DestRight ) - FIELD_T(mfxU32, DestBottom) - - FIELD_T(mfxU32, SourceLeft) - FIELD_T(mfxU32, SourceTop ) -) - -STRUCT(mfxExtMoveRect, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxI16, NumRect) - FIELD_S(mfxExtMoveRect_Entry, Rect ) -) - -STRUCT(mfxExtMVCSeqDesc, - FIELD_S(mfxExtBuffer , Header ) - FIELD_T(mfxU32 , NumView ) - FIELD_T(mfxU32 , NumViewAlloc ) - //FIELD_S(mfxMVCViewDependency* , View ) - FIELD_T(mfxU32 , NumViewId ) - FIELD_T(mfxU32 , NumViewIdAlloc) - //FIELD_S(mfxU16* , ViewId ) - FIELD_T(mfxU32 , NumOP ) - FIELD_T(mfxU32 , NumOPAlloc ) - //FIELD_S(mfxMVCOperationPoint* , OP ) - FIELD_T(mfxU16 , NumRefsTotal ) -) - -STRUCT(mfxExtMBDisableSkipMap, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU32 , MapSize) -) - -//STRUCT(mfxExtCodingOptionVPS, -// FIELD_S(mfxExtBuffer, Header ) -// FIELD_T(mfxU8* , VPSBuffer ) -// FIELD_T(mfxU16 , VPSBufSize) -// FIELD_T(mfxU16 , VPSId) -//) - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - -STRUCT(mfxExtHEVCParam, - FIELD_S(mfxExtBuffer , Header ) - FIELD_T(mfxU16 , PicWidthInLumaSamples ) - FIELD_T(mfxU16 , PicHeightInLumaSamples) - FIELD_T(mfxU64 , GeneralConstraintFlags) - FIELD_T(mfxU16 , SampleAdaptiveOffset) - FIELD_T(mfxU16 , LCUSize) -) - -#elif (MFX_VERSION >= 1026) - -STRUCT(mfxExtHEVCParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, PicWidthInLumaSamples) - FIELD_T(mfxU16, PicHeightInLumaSamples) - FIELD_T(mfxU64, GeneralConstraintFlags) - FIELD_T(mfxU16, SampleAdaptiveOffset) - FIELD_T(mfxU16, LCUSize) -) - -#else - -STRUCT(mfxExtHEVCParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, PicWidthInLumaSamples) - FIELD_T(mfxU16, PicHeightInLumaSamples) - FIELD_T(mfxU64, GeneralConstraintFlags) - -) - -#endif - -STRUCT(mfxExtHEVCRegion, - FIELD_S(mfxExtBuffer, Header ) - FIELD_T(mfxU32 , RegionId) - FIELD_T(mfxU16 , RegionType) - FIELD_T(mfxU16 , RegionEncoding) -) - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -STRUCT(mfxExtVP9DecodedFrameInfo, - FIELD_S(mfxExtBuffer, Header ) - //FIELD_T(mfxU16 , DisplayWidth) - //FIELD_T(mfxU16 , DisplayHeight) -) -#endif - -#if (MFX_VERSION >= 1026) -STRUCT(mfxVP9SegmentParam, - FIELD_T(mfxU16, FeatureEnabled) - FIELD_T(mfxI16, QIndexDelta) - FIELD_T(mfxI16, LoopFilterLevelDelta) - FIELD_T(mfxU16, ReferenceFrame) -) - -STRUCT(mfxExtVP9Segmentation, - FIELD_S(mfxExtBuffer , Header) - FIELD_T(mfxU16 , NumSegments) - FIELD_S(mfxVP9SegmentParam, Segment) - FIELD_T(mfxU16 , SegmentIdBlockSize) - FIELD_T(mfxU32 , NumSegmentIdAlloc) - FIELD_T(mfxU8* , SegmentId) -) - -STRUCT(mfxVP9TemporalLayer, - FIELD_T(mfxU16, FrameRateScale) - FIELD_T(mfxU16, TargetKbps) -) - -STRUCT(mfxExtVP9TemporalLayers, - FIELD_S(mfxExtBuffer , Header) - FIELD_S(mfxVP9TemporalLayer , Layer) -) -#endif - -#if (MFX_VERSION >= MFX_VERSION_NEXT) -STRUCT(mfxExtVP9Param, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , FrameWidth) - FIELD_T(mfxU16 , FrameHeight) - FIELD_T(mfxU16 , WriteIVFHeaders) - FIELD_T(mfxI16 , LoopFilterRefDelta) - FIELD_T(mfxI16 , LoopFilterModeDelta) - FIELD_T(mfxI16 , QIndexDeltaLumaDC) - FIELD_T(mfxI16 , QIndexDeltaChromaAC) - FIELD_T(mfxI16 , QIndexDeltaChromaDC) - FIELD_T(mfxU16 , NumTileRows) - FIELD_T(mfxU16 , NumTileColumns) -) -#elif (MFX_VERSION >= 1029) -STRUCT(mfxExtVP9Param, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , FrameWidth) - FIELD_T(mfxU16 , FrameHeight) - FIELD_T(mfxU16 , WriteIVFHeaders) - FIELD_T(mfxI16 , QIndexDeltaLumaDC) - FIELD_T(mfxI16 , QIndexDeltaChromaAC) - FIELD_T(mfxI16 , QIndexDeltaChromaDC) - FIELD_T(mfxU16 , NumTileRows) - FIELD_T(mfxU16 , NumTileColumns) -) -#elif (MFX_VERSION >= 1026) -STRUCT(mfxExtVP9Param, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , FrameWidth) - FIELD_T(mfxU16 , FrameHeight) - FIELD_T(mfxU16 , WriteIVFHeaders) - FIELD_T(mfxI16 , QIndexDeltaLumaDC) - FIELD_T(mfxI16 , QIndexDeltaChromaAC) - FIELD_T(mfxI16 , QIndexDeltaChromaDC) -) -#endif - -STRUCT(mfxExtMBForceIntra, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32, MapSize) - FIELD_T(mfxU8*, Map) -) - -STRUCT(mfxExtMasteringDisplayColourVolume, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , InsertPayloadToggle) - FIELD_T(mfxU16 , DisplayPrimariesX) - FIELD_T(mfxU16 , DisplayPrimariesY) - FIELD_T(mfxU16 , WhitePointX) - FIELD_T(mfxU16 , WhitePointY) - FIELD_T(mfxU32 , MaxDisplayMasteringLuminance) - FIELD_T(mfxU32 , MinDisplayMasteringLuminance) -) - -STRUCT(mfxExtContentLightLevelInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , InsertPayloadToggle) - FIELD_T(mfxU16 , MaxContentLightLevel) - FIELD_T(mfxU16 , MaxPicAverageLightLevel) -) - -STRUCT(mfxExtPredWeightTable, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, LumaLog2WeightDenom) - FIELD_T(mfxU16, ChromaLog2WeightDenom) - FIELD_T(mfxU16, LumaWeightFlag) - FIELD_T(mfxU16, ChromaWeightFlag) - FIELD_T(mfxI16, Weights) -) - -#if defined(__MFXBRC_H__) -STRUCT(mfxExtBRC, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxHDL, pthis) - FIELD_T(mfxHDL, Init) - FIELD_T(mfxHDL, Reset) - FIELD_T(mfxHDL, Close) - FIELD_T(mfxHDL, GetFrameCtrl) - FIELD_T(mfxHDL, Update) -) -#endif // defined(__MFXBRC_H__) - -STRUCT(mfxExtMultiFrameParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16 , MFMode) - FIELD_T(mfxU16 , MaxNumFrames) -) - -STRUCT(mfxExtMultiFrameControl, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , Timeout) - FIELD_T(mfxU16 , Flush) -) - -STRUCT(mfxEncodedUnitInfo, - FIELD_T(mfxU16, Type) - FIELD_T(mfxU32, Offset) - FIELD_T(mfxU32, Size) -) - -STRUCT(mfxExtEncodedUnitsInfo, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxEncodedUnitInfo*, UnitInfo) - FIELD_T(mfxU16, NumUnitsAlloc) - FIELD_T(mfxU16, NumUnitsEncoded) -) - -#if defined(__MFXPCP_H__) -#if (MFX_VERSION >= 1030) -STRUCT(mfxExtCencParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU32 , StatusReportIndex) -) -#endif -#endif // defined(__MFXPCP_H__) - -#if defined(__MFXSCD_H__) -STRUCT(mfxExtSCD, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, SceneType) -) -#endif // defined(__MFXSCD_H__) - -#if (MFX_VERSION >= 1026) -#if (MFX_VERSION >= MFX_VERSION_NEXT) -STRUCT(mfxExtVppMctf, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, FilterStrength) - FIELD_T(mfxU16, Overlap) - FIELD_T(mfxU32, BitsPerPixelx100k) - FIELD_T(mfxU16, Deblocking) - FIELD_T(mfxU16, TemporalMode) - FIELD_T(mfxU16, MVPrecision) -) -#else -STRUCT(mfxExtVppMctf, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, FilterStrength) -) -#endif -#endif - -#if (MFX_VERSION >= 1034) -STRUCT(mfxAV1FilmGrainPoint, - FIELD_T(mfxU8, Value) - FIELD_T(mfxU8, Scaling) -) - -STRUCT(mfxExtAV1FilmGrainParam, - FIELD_S(mfxExtBuffer, Header) - FIELD_T(mfxU16, FilmGrainFlags) - FIELD_T(mfxU16, GrainSeed) - FIELD_T(mfxU8, RefIdx) - FIELD_T(mfxI8, NumYPoints) - FIELD_T(mfxI8, NumCbPoints) - FIELD_T(mfxI8, NumCrPoints) - FIELD_S(mfxAV1FilmGrainPoint, PointY) - FIELD_S(mfxAV1FilmGrainPoint, PointCb) - FIELD_S(mfxAV1FilmGrainPoint, PointCr) - FIELD_T(mfxI8, GrainScalingMinus8) - FIELD_T(mfxU8, ArCoeffLag) - FIELD_T(mfxU8, ArCoeffsYPlus128) - FIELD_T(mfxU8, ArCoeffsCbPlus128) - FIELD_T(mfxU8, ArCoeffsCrPlus128) - FIELD_T(mfxU8, ArCoeffShiftMinus6) - FIELD_T(mfxU8, GrainScaleShift) - FIELD_T(mfxU8, CbMult) - FIELD_T(mfxU8, CbLumaMult) - FIELD_T(mfxU16, CbOffset) - FIELD_T(mfxU8, CrMult) - FIELD_T(mfxU8, CrLumaMult) - FIELD_T(mfxU16, CrOffset) -) -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_typedef.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_typedef.h deleted file mode 100644 index 42ee614e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mediasdk_structures/ts_typedef.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2017-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once - -#if __cplusplus >= 201103L -#define TYPEDEF_MEMBER(base, member, name) typedef std::remove_referencemember)>::type name; -#else -#if defined(__GNUC__) -#define TYPEDEF_MEMBER(base, member, name) typedef typeof(((base*)0)->member) name; -#endif -#endif -TYPEDEF_MEMBER(mfxExtOpaqueSurfaceAlloc, In, mfxExtOpaqueSurfaceAlloc_InOut) -TYPEDEF_MEMBER(mfxExtAVCRefListCtrl, PreferredRefList[0], mfxExtAVCRefListCtrl_Entry) -TYPEDEF_MEMBER(mfxExtPictureTimingSEI, TimeStamp[0], mfxExtPictureTimingSEI_TimeStamp) -TYPEDEF_MEMBER(mfxExtAvcTemporalLayers, Layer[0], mfxExtAvcTemporalLayers_Layer) -TYPEDEF_MEMBER(mfxExtAVCEncodedFrameInfo, UsedRefListL0[0], mfxExtAVCEncodedFrameInfo_RefList) -TYPEDEF_MEMBER(mfxExtVPPVideoSignalInfo, In, mfxExtVPPVideoSignalInfo_InOut) -TYPEDEF_MEMBER(mfxExtEncoderROI, ROI[0], mfxExtEncoderROI_Entry) -TYPEDEF_MEMBER(mfxExtDirtyRect, Rect[0], mfxExtDirtyRect_Entry) -TYPEDEF_MEMBER(mfxExtMoveRect, Rect[0], mfxExtMoveRect_Entry) -typedef union { mfxU32 n; char c[4]; } mfx4CC; -typedef mfxExtAVCRefLists::mfxRefPic mfxExtAVCRefLists_mfxRefPic; -typedef mfxExtFeiEncMV::mfxExtFeiEncMVMB mfxExtFeiEncMV_MB; -typedef mfxExtFeiEncMBCtrl::mfxExtFeiEncMBCtrlMB mfxExtFeiEncMBCtrl_MB; -typedef mfxExtFeiPreEncMVPredictors::mfxExtFeiPreEncMVPredictorsMB mfxExtFeiPreEncMVPredictors_MB; -typedef mfxExtFeiPreEncMV::mfxExtFeiPreEncMVMB mfxExtFeiPreEncMV_MB; -typedef mfxExtFeiPreEncMBStat::mfxExtFeiPreEncMBStatMB mfxExtFeiPreEncMBStat_MB; -typedef mfxExtEncoderIPCMArea::area mfxExtEncoderIPCMArea_area; - -#if MFX_VERSION >= 1023 -typedef mfxExtFeiPPS::mfxExtFeiPpsDPB mfxExtFeiPPS_mfxExtFeiPpsDPB; -#endif // MFX_VERSION >= 1023 diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/Android.mk b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/Android.mk deleted file mode 100644 index 467a296a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Recursively call sub-folder Android.mk - -include $(call all-subdir-makefiles) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/Android.mk b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/Android.mk deleted file mode 100644 index 2afd5e3b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := \ - mfxloader.cpp \ - mfxparser.cpp - -LOCAL_C_INCLUDES := $(MFX_INCLUDES) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL) \ - -DMFX_PLUGINS_CONF_DIR=\"/vendor/etc\" -LOCAL_CFLAGS_32 := \ - $(MFX_CFLAGS_INTERNAL_32) \ - -DMFX_MODULES_DIR=\"/system/vendor/lib\" -LOCAL_CFLAGS_64 := \ - $(MFX_CFLAGS_INTERNAL_64) \ - -DMFX_MODULES_DIR=\"/system/vendor/lib64\" - -LOCAL_HEADER_LIBRARIES := libmfx_headers - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx - -include $(BUILD_STATIC_LIBRARY) - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/CMakeLists.txt b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/CMakeLists.txt deleted file mode 100644 index c09ffeee..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -cmake_minimum_required( VERSION 3.6 FATAL_ERROR ) -project( mfx ) - -set( MFX_API_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/../../include ) - -# While equal to get_mfx_version in samples/builder, this function should remain separate to make this file self-sufficient -function( get_api_version mfx_version_major mfx_version_minor ) - file(STRINGS ${MFX_API_FOLDER}/mfxdefs.h major REGEX "#define MFX_VERSION_MAJOR" LIMIT_COUNT 1) - file(STRINGS ${MFX_API_FOLDER}/mfxdefs.h minor REGEX "#define MFX_VERSION_MINOR" LIMIT_COUNT 1) - string(REPLACE "#define MFX_VERSION_MAJOR " "" major ${major}) - string(REPLACE "#define MFX_VERSION_MINOR " "" minor ${minor}) - set(${mfx_version_major} ${major} PARENT_SCOPE) - set(${mfx_version_minor} ${minor} PARENT_SCOPE) -endfunction() - -set( CMAKE_LIB_DIR ${CMAKE_BINARY_DIR}/__bin ) - -# If user did not override CMAKE_INSTALL_PREFIX, then set the default prefix -# to /opt/intel/mediasdk instead of cmake's default -if( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) - set( CMAKE_INSTALL_PREFIX /opt/intel/mediasdk CACHE PATH "Install Path Prefix" FORCE ) -endif( ) -message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" ) - -include( GNUInstallDirs ) - -if( NOT DEFINED MFX_PLUGINS_CONF_DIR ) - set( MFX_PLUGINS_CONF_DIR ${CMAKE_INSTALL_FULL_DATADIR}/mfx ) -endif( ) -add_definitions( -DMFX_PLUGINS_CONF_DIR="${MFX_PLUGINS_CONF_DIR}" ) -message( STATUS "MFX_PLUGINS_CONF_DIR=${MFX_PLUGINS_CONF_DIR}" ) - -if( NOT DEFINED MFX_MODULES_DIR ) - set( MFX_MODULES_DIR ${CMAKE_INSTALL_FULL_LIBDIR} ) -endif( ) -add_definitions( -DMFX_MODULES_DIR="${MFX_MODULES_DIR}" ) -message( STATUS "MFX_MODULES_DIR=${MFX_MODULES_DIR}" ) - -add_definitions(-DUNIX) -add_definitions(-DMFX_DEPRECATED_OFF) - -if( CMAKE_SYSTEM_NAME MATCHES Linux ) - add_definitions(-D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -DLINUX -DLINUX32) - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - add_definitions(-DLINUX64) - endif( ) -endif( ) - -if( CMAKE_SYSTEM_NAME MATCHES Darwin ) - add_definitions(-DOSX) - add_definitions(-DOSX32) - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - add_definitions(-DOSX64) - endif( ) -endif( ) - -set(no_warnings "-Wno-unknown-pragmas -Wno-unused") -set(warnings "-Wall -Wformat -Wformat-security") - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -std=c++11 ${warnings} ${no_warnings}") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") - -if (DEFINED CMAKE_FIND_ROOT_PATH) - append("--sysroot=${CMAKE_FIND_ROOT_PATH} " LINK_FLAGS) -endif (DEFINED CMAKE_FIND_ROOT_PATH) - -list(APPEND sources - ${CMAKE_CURRENT_SOURCE_DIR}/mfxloader.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mfxparser.cpp -) - -include_directories ( - ${MFX_API_FOLDER} -) - -add_library(mfx SHARED ${sources}) -target_link_libraries(mfx dl) - -get_api_version(MFX_VERSION_MAJOR MFX_VERSION_MINOR) - -set_target_properties( mfx PROPERTIES LINK_FLAGS - "-Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libmfx.map -fstack-protector") -set_target_properties( mfx PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE} FOLDER mfx ) -set_target_properties( mfx PROPERTIES VERSION ${MFX_VERSION_MAJOR}.${MFX_VERSION_MINOR}) -set_target_properties( mfx PROPERTIES SOVERSION ${MFX_VERSION_MAJOR}) - -install(TARGETS mfx LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - -set( PKG_CONFIG_FNAME "${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE}/lib${PROJECT_NAME}.pc") -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.cmake" ${PKG_CONFIG_FNAME} @ONLY) - -install( FILES ${PKG_CONFIG_FNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) -install( DIRECTORY ${MFX_API_FOLDER}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mfx FILES_MATCHING PATTERN *.h ) - -# For backwards compatibility, create a relative symbolic link without the "lib" -# prefix to the .pc file. -set( PKG_CONFIG_LFNAME "${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.pc" ) -add_custom_target(pc_link_target ALL COMMAND ${CMAKE_COMMAND} -E create_symlink lib${PROJECT_NAME}.pc ${PKG_CONFIG_LFNAME}) -install( FILES ${PKG_CONFIG_LFNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/device_ids.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/device_ids.h deleted file mode 100644 index 6a5d124a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/device_ids.h +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright (c) 2022 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include -#include -#include -#include -#include -#include - -enum eMFXHWType -{ - MFX_HW_UNKNOWN = 0, - MFX_HW_SNB = 0x300000, - - MFX_HW_IVB = 0x400000, - - MFX_HW_HSW = 0x500000, - MFX_HW_HSW_ULT = 0x500001, - - MFX_HW_VLV = 0x600000, - - MFX_HW_BDW = 0x700000, - - MFX_HW_CHT = 0x800000, - - MFX_HW_SKL = 0x900000, - - MFX_HW_APL = 0x1000000, - - MFX_HW_KBL = 0x1100000, - MFX_HW_GLK = MFX_HW_KBL + 1, - MFX_HW_CFL = MFX_HW_KBL + 2, - - MFX_HW_CNL = 0x1200000, - - MFX_HW_ICL = 0x1400000, - MFX_HW_ICL_LP = MFX_HW_ICL + 1, - MFX_HW_JSL = 0x1500001, - MFX_HW_EHL = 0x1500002, - - MFX_HW_TGL_LP = 0x1600000, - MFX_HW_RKL = MFX_HW_TGL_LP + 2, - MFX_HW_DG1 = 0x1600003, -}; - -typedef struct { - int device_id; - eMFXHWType platform; -} mfx_device_item; - -// list of dev ID supported by legacy Media SDK -const mfx_device_item msdkDevIDs[] = { - /*IVB*/ - { 0x0156, MFX_HW_IVB }, /* GT1 mobile */ - { 0x0166, MFX_HW_IVB }, /* GT2 mobile */ - { 0x0152, MFX_HW_IVB }, /* GT1 desktop */ - { 0x0162, MFX_HW_IVB }, /* GT2 desktop */ - { 0x015a, MFX_HW_IVB }, /* GT1 server */ - { 0x016a, MFX_HW_IVB }, /* GT2 server */ - /*HSW*/ - { 0x0402, MFX_HW_HSW }, /* GT1 desktop */ - { 0x0412, MFX_HW_HSW }, /* GT2 desktop */ - { 0x0422, MFX_HW_HSW }, /* GT2 desktop */ - { 0x041e, MFX_HW_HSW }, /* Core i3-4130 */ - { 0x040a, MFX_HW_HSW }, /* GT1 server */ - { 0x041a, MFX_HW_HSW }, /* GT2 server */ - { 0x042a, MFX_HW_HSW }, /* GT2 server */ - { 0x0406, MFX_HW_HSW }, /* GT1 mobile */ - { 0x0416, MFX_HW_HSW }, /* GT2 mobile */ - { 0x0426, MFX_HW_HSW }, /* GT2 mobile */ - { 0x0C02, MFX_HW_HSW }, /* SDV GT1 desktop */ - { 0x0C12, MFX_HW_HSW }, /* SDV GT2 desktop */ - { 0x0C22, MFX_HW_HSW }, /* SDV GT2 desktop */ - { 0x0C0A, MFX_HW_HSW }, /* SDV GT1 server */ - { 0x0C1A, MFX_HW_HSW }, /* SDV GT2 server */ - { 0x0C2A, MFX_HW_HSW }, /* SDV GT2 server */ - { 0x0C06, MFX_HW_HSW }, /* SDV GT1 mobile */ - { 0x0C16, MFX_HW_HSW }, /* SDV GT2 mobile */ - { 0x0C26, MFX_HW_HSW }, /* SDV GT2 mobile */ - { 0x0A02, MFX_HW_HSW }, /* ULT GT1 desktop */ - { 0x0A12, MFX_HW_HSW }, /* ULT GT2 desktop */ - { 0x0A22, MFX_HW_HSW }, /* ULT GT2 desktop */ - { 0x0A0A, MFX_HW_HSW }, /* ULT GT1 server */ - { 0x0A1A, MFX_HW_HSW }, /* ULT GT2 server */ - { 0x0A2A, MFX_HW_HSW }, /* ULT GT2 server */ - { 0x0A06, MFX_HW_HSW }, /* ULT GT1 mobile */ - { 0x0A16, MFX_HW_HSW }, /* ULT GT2 mobile */ - { 0x0A26, MFX_HW_HSW }, /* ULT GT2 mobile */ - { 0x0D02, MFX_HW_HSW }, /* CRW GT1 desktop */ - { 0x0D12, MFX_HW_HSW }, /* CRW GT2 desktop */ - { 0x0D22, MFX_HW_HSW }, /* CRW GT2 desktop */ - { 0x0D0A, MFX_HW_HSW }, /* CRW GT1 server */ - { 0x0D1A, MFX_HW_HSW }, /* CRW GT2 server */ - { 0x0D2A, MFX_HW_HSW }, /* CRW GT2 server */ - { 0x0D06, MFX_HW_HSW }, /* CRW GT1 mobile */ - { 0x0D16, MFX_HW_HSW }, /* CRW GT2 mobile */ - { 0x0D26, MFX_HW_HSW }, /* CRW GT2 mobile */ - { 0x040B, MFX_HW_HSW }, /*HASWELL_B_GT1 *//* Reserved */ - { 0x041B, MFX_HW_HSW }, /*HASWELL_B_GT2*/ - { 0x042B, MFX_HW_HSW }, /*HASWELL_B_GT3*/ - { 0x040E, MFX_HW_HSW }, /*HASWELL_E_GT1*//* Reserved */ - { 0x041E, MFX_HW_HSW }, /*HASWELL_E_GT2*/ - { 0x042E, MFX_HW_HSW }, /*HASWELL_E_GT3*/ - - { 0x0C0B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT1*/ /* Reserved */ - { 0x0C1B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT2*/ - { 0x0C2B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT3*/ - { 0x0C0E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT1*//* Reserved */ - { 0x0C1E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT2*/ - { 0x0C2E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT3*/ - - { 0x0A0B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT1*/ /* Reserved */ - { 0x0A1B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT2*/ - { 0x0A2B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT3*/ - { 0x0A0E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT1*/ /* Reserved */ - { 0x0A1E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT2*/ - { 0x0A2E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT3*/ - - { 0x0D0B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT1*/ /* Reserved */ - { 0x0D1B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT2*/ - { 0x0D2B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT3*/ - { 0x0D0E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT1*/ /* Reserved */ - { 0x0D1E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT2*/ - { 0x0D2E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT3*/ - - /* VLV */ - { 0x0f30, MFX_HW_VLV }, /* VLV mobile */ - { 0x0f31, MFX_HW_VLV }, /* VLV mobile */ - { 0x0f32, MFX_HW_VLV }, /* VLV mobile */ - { 0x0f33, MFX_HW_VLV }, /* VLV mobile */ - { 0x0157, MFX_HW_VLV }, - { 0x0155, MFX_HW_VLV }, - - /* BDW */ - /*GT3: */ - { 0x162D, MFX_HW_BDW }, - { 0x162A, MFX_HW_BDW }, - /*GT2: */ - { 0x161D, MFX_HW_BDW }, - { 0x161A, MFX_HW_BDW }, - /* GT1: */ - { 0x160D, MFX_HW_BDW }, - { 0x160A, MFX_HW_BDW }, - /* BDW-ULT */ - /* (16x2 - ULT, 16x6 - ULT, 16xB - Iris, 16xE - ULX) */ - /*GT3: */ - { 0x162E, MFX_HW_BDW }, - { 0x162B, MFX_HW_BDW }, - { 0x1626, MFX_HW_BDW }, - { 0x1622, MFX_HW_BDW }, - { 0x1636, MFX_HW_BDW }, /* ULT */ - { 0x163B, MFX_HW_BDW }, /* Iris */ - { 0x163E, MFX_HW_BDW }, /* ULX */ - { 0x1632, MFX_HW_BDW }, /* ULT */ - { 0x163A, MFX_HW_BDW }, /* Server */ - { 0x163D, MFX_HW_BDW }, /* Workstation */ - - /* GT2: */ - { 0x161E, MFX_HW_BDW }, - { 0x161B, MFX_HW_BDW }, - { 0x1616, MFX_HW_BDW }, - { 0x1612, MFX_HW_BDW }, - /* GT1: */ - { 0x160E, MFX_HW_BDW }, - { 0x160B, MFX_HW_BDW }, - { 0x1606, MFX_HW_BDW }, - { 0x1602, MFX_HW_BDW }, - - /* CHT */ - { 0x22b0, MFX_HW_CHT }, - { 0x22b1, MFX_HW_CHT }, - { 0x22b2, MFX_HW_CHT }, - { 0x22b3, MFX_HW_CHT }, - - /* SKL */ - /* GT1F */ - { 0x1902, MFX_HW_SKL }, // DT, 2x1F, 510 - { 0x1906, MFX_HW_SKL }, // U-ULT, 2x1F, 510 - { 0x190A, MFX_HW_SKL }, // Server, 4x1F - { 0x190B, MFX_HW_SKL }, - { 0x190E, MFX_HW_SKL }, // Y-ULX 2x1F - /*GT1.5*/ - { 0x1913, MFX_HW_SKL }, // U-ULT, 2x1.5 - { 0x1915, MFX_HW_SKL }, // Y-ULX, 2x1.5 - { 0x1917, MFX_HW_SKL }, // DT, 2x1.5 - /* GT2 */ - { 0x1912, MFX_HW_SKL }, // DT, 2x2, 530 - { 0x1916, MFX_HW_SKL }, // U-ULD 2x2, 520 - { 0x191A, MFX_HW_SKL }, // 2x2,4x2, Server - { 0x191B, MFX_HW_SKL }, // DT, 2x2, 530 - { 0x191D, MFX_HW_SKL }, // 4x2, WKS, P530 - { 0x191E, MFX_HW_SKL }, // Y-ULX, 2x2, P510,515 - { 0x1921, MFX_HW_SKL }, // U-ULT, 2x2F, 540 - /* GT3 */ - { 0x1923, MFX_HW_SKL }, // U-ULT, 2x3, 535 - { 0x1926, MFX_HW_SKL }, // U-ULT, 2x3, 540 (15W) - { 0x1927, MFX_HW_SKL }, // U-ULT, 2x3e, 550 (28W) - { 0x192A, MFX_HW_SKL }, // Server, 2x3 - { 0x192B, MFX_HW_SKL }, // Halo 3e - { 0x192D, MFX_HW_SKL }, - /* GT4e*/ - { 0x1932, MFX_HW_SKL }, // DT - { 0x193A, MFX_HW_SKL }, // SRV - { 0x193B, MFX_HW_SKL }, // Halo - { 0x193D, MFX_HW_SKL }, // WKS - - /* APL */ - { 0x0A84, MFX_HW_APL }, - { 0x0A85, MFX_HW_APL }, - { 0x0A86, MFX_HW_APL }, - { 0x0A87, MFX_HW_APL }, - { 0x1A84, MFX_HW_APL }, - { 0x1A85, MFX_HW_APL }, - { 0x5A84, MFX_HW_APL }, - { 0x5A85, MFX_HW_APL }, - - /* KBL */ - { 0x5902, MFX_HW_KBL }, // DT GT1 - { 0x5906, MFX_HW_KBL }, // ULT GT1 - { 0x5908, MFX_HW_KBL }, // HALO GT1F - { 0x590A, MFX_HW_KBL }, // SERV GT1 - { 0x590B, MFX_HW_KBL }, // HALO GT1 - { 0x590E, MFX_HW_KBL }, // ULX GT1 - { 0x5912, MFX_HW_KBL }, // DT GT2 - { 0x5913, MFX_HW_KBL }, // ULT GT1 5 - { 0x5915, MFX_HW_KBL }, // ULX GT1 5 - { 0x5916, MFX_HW_KBL }, // ULT GT2 - { 0x5917, MFX_HW_KBL }, // ULT GT2 R - { 0x591A, MFX_HW_KBL }, // SERV GT2 - { 0x591B, MFX_HW_KBL }, // HALO GT2 - { 0x591C, MFX_HW_KBL }, // ULX GT2 - { 0x591D, MFX_HW_KBL }, // WRK GT2 - { 0x591E, MFX_HW_KBL }, // ULX GT2 - { 0x5921, MFX_HW_KBL }, // ULT GT2F - { 0x5923, MFX_HW_KBL }, // ULT GT3 - { 0x5926, MFX_HW_KBL }, // ULT GT3 15W - { 0x5927, MFX_HW_KBL }, // ULT GT3 28W - { 0x592A, MFX_HW_KBL }, // SERV GT3 - { 0x592B, MFX_HW_KBL }, // HALO GT3 - { 0x5932, MFX_HW_KBL }, // DT GT4 - { 0x593A, MFX_HW_KBL }, // SERV GT4 - { 0x593B, MFX_HW_KBL }, // HALO GT4 - { 0x593D, MFX_HW_KBL }, // WRK GT4 - { 0x87C0, MFX_HW_KBL }, // ULX GT2 - - /* GLK */ - { 0x3184, MFX_HW_GLK }, - { 0x3185, MFX_HW_GLK }, - - /* CFL */ - { 0x3E90, MFX_HW_CFL }, - { 0x3E91, MFX_HW_CFL }, - { 0x3E92, MFX_HW_CFL }, - { 0x3E93, MFX_HW_CFL }, - { 0x3E94, MFX_HW_CFL }, - { 0x3E96, MFX_HW_CFL }, - { 0x3E98, MFX_HW_CFL }, - { 0x3E99, MFX_HW_CFL }, - { 0x3E9A, MFX_HW_CFL }, - { 0x3E9C, MFX_HW_CFL }, - { 0x3E9B, MFX_HW_CFL }, - { 0x3EA5, MFX_HW_CFL }, - { 0x3EA6, MFX_HW_CFL }, - { 0x3EA7, MFX_HW_CFL }, - { 0x3EA8, MFX_HW_CFL }, - { 0x3EA9, MFX_HW_CFL }, - { 0x87CA, MFX_HW_CFL }, - - /* WHL */ - { 0x3EA0, MFX_HW_CFL }, - { 0x3EA1, MFX_HW_CFL }, - { 0x3EA2, MFX_HW_CFL }, - { 0x3EA3, MFX_HW_CFL }, - { 0x3EA4, MFX_HW_CFL }, - - - /* CML GT1 */ - { 0x9b21, MFX_HW_CFL }, - { 0x9baa, MFX_HW_CFL }, - { 0x9bab, MFX_HW_CFL }, - { 0x9bac, MFX_HW_CFL }, - { 0x9ba0, MFX_HW_CFL }, - { 0x9ba5, MFX_HW_CFL }, - { 0x9ba8, MFX_HW_CFL }, - { 0x9ba4, MFX_HW_CFL }, - { 0x9ba2, MFX_HW_CFL }, - - /* CML GT2 */ - { 0x9b41, MFX_HW_CFL }, - { 0x9bca, MFX_HW_CFL }, - { 0x9bcb, MFX_HW_CFL }, - { 0x9bcc, MFX_HW_CFL }, - { 0x9bc0, MFX_HW_CFL }, - { 0x9bc5, MFX_HW_CFL }, - { 0x9bc8, MFX_HW_CFL }, - { 0x9bc4, MFX_HW_CFL }, - { 0x9bc2, MFX_HW_CFL }, - { 0x9bc6, MFX_HW_CFL }, - { 0x9be6, MFX_HW_CFL }, - { 0x9bf6, MFX_HW_CFL }, - - - /* CNL */ - { 0x5A51, MFX_HW_CNL }, - { 0x5A52, MFX_HW_CNL }, - { 0x5A5A, MFX_HW_CNL }, - { 0x5A40, MFX_HW_CNL }, - { 0x5A42, MFX_HW_CNL }, - { 0x5A4A, MFX_HW_CNL }, - { 0x5A4C, MFX_HW_CNL }, - { 0x5A50, MFX_HW_CNL }, - { 0x5A54, MFX_HW_CNL }, - { 0x5A59, MFX_HW_CNL }, - { 0x5A5C, MFX_HW_CNL }, - { 0x5A41, MFX_HW_CNL }, - { 0x5A44, MFX_HW_CNL }, - { 0x5A49, MFX_HW_CNL }, - - /* ICL LP */ - { 0xFF05, MFX_HW_ICL_LP }, - { 0x8A50, MFX_HW_ICL_LP }, - { 0x8A51, MFX_HW_ICL_LP }, - { 0x8A52, MFX_HW_ICL_LP }, - { 0x8A53, MFX_HW_ICL_LP }, - { 0x8A54, MFX_HW_ICL_LP }, - { 0x8A56, MFX_HW_ICL_LP }, - { 0x8A57, MFX_HW_ICL_LP }, - { 0x8A58, MFX_HW_ICL_LP }, - { 0x8A59, MFX_HW_ICL_LP }, - { 0x8A5A, MFX_HW_ICL_LP }, - { 0x8A5B, MFX_HW_ICL_LP }, - { 0x8A5C, MFX_HW_ICL_LP }, - { 0x8A5D, MFX_HW_ICL_LP }, - { 0x8A70, MFX_HW_ICL_LP }, - { 0x8A71, MFX_HW_ICL_LP }, // GT05, but 1 ok in this context - - /* JSL */ - { 0x4E51, MFX_HW_JSL }, - { 0x4E55, MFX_HW_JSL }, - { 0x4E61, MFX_HW_JSL }, - { 0x4E71, MFX_HW_JSL }, - - /* EHL */ - { 0x4500, MFX_HW_EHL }, - { 0x4541, MFX_HW_EHL }, - { 0x4551, MFX_HW_EHL }, - { 0x4555, MFX_HW_EHL }, - { 0x4569, MFX_HW_EHL }, - { 0x4571, MFX_HW_EHL }, - - /* TGL */ - { 0x9A40, MFX_HW_TGL_LP }, - { 0x9A49, MFX_HW_TGL_LP }, - { 0x9A59, MFX_HW_TGL_LP }, - { 0x9A60, MFX_HW_TGL_LP }, - { 0x9A68, MFX_HW_TGL_LP }, - { 0x9A70, MFX_HW_TGL_LP }, - { 0x9A78, MFX_HW_TGL_LP }, - - /* DG1/SG1 */ - { 0x4905, MFX_HW_DG1 }, - { 0x4906, MFX_HW_DG1 }, - { 0x4907, MFX_HW_DG1 }, - { 0x4908, MFX_HW_DG1 }, - - /* RKL */ - { 0x4C80, MFX_HW_RKL }, // RKL-S - { 0x4C8A, MFX_HW_RKL }, // RKL-S - { 0x4C81, MFX_HW_RKL }, // RKL-S - { 0x4C8B, MFX_HW_RKL }, // RKL-S - { 0x4C90, MFX_HW_RKL }, // RKL-S - { 0x4C9A, MFX_HW_RKL }, // RKL-S -}; - -typedef struct { - int vendor_id; - int device_id; - eMFXHWType platform; -} Device; - -static inline eMFXHWType get_platform(int device_id) { - for (unsigned i = 0; i < sizeof(msdkDevIDs) / sizeof(msdkDevIDs[0]); ++i) { - if (msdkDevIDs[i].device_id == device_id) { - return msdkDevIDs[i].platform; - } - } - return MFX_HW_UNKNOWN; -} - -std::vector get_devices() { - const char *dir = "/sys/class/drm"; - const char *device_id_file = "/device/device"; - const char *vendor_id_file = "/device/vendor"; - int i = 0; - int err = 0; - std::vector result; - for (; i < 64; ++i) { - Device device; - std::string node_num = std::to_string(128 + i); - std::string path = std::string(dir) + "/renderD" + node_num + vendor_id_file; - FILE *file = fopen(path.c_str(), "r"); - if (!file) continue; - err = fscanf(file, "%x", &device.vendor_id); - fclose(file); - if (err == EOF) continue; - if (device.vendor_id != 0x8086) { // Filter out non-Intel devices - continue; - } - path = std::string(dir) + "/renderD" + node_num + device_id_file; - file = fopen(path.c_str(), "r"); - if (!file) continue; - err = fscanf(file, "%x", &device.device_id); - fclose(file); - if (err == EOF) continue; - - // if user only mapped /dev/dri/renderD129 in container, need to skip /dev/dri/renderD128 - path = "/dev/dri/renderD" + node_num; - int fd = open(path.c_str(), O_RDWR); - if (fd < 0) continue; //device not accessible - close(fd); - - device.platform = get_platform(device.device_id); - result.emplace_back(device); - } - std::sort(result.begin(), result.end(), [](const Device &a, const Device &b) { - return a.platform < b.platform; - }); - return result; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/libmfx.map b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/libmfx.map deleted file mode 100644 index 3d8cfb39..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/libmfx.map +++ /dev/null @@ -1,111 +0,0 @@ -LIBMFX_1.0 { - global: - MFXInit; - MFXClose; - MFXQueryIMPL; - MFXQueryVersion; - - MFXJoinSession; - MFXDisjoinSession; - MFXCloneSession; - MFXSetPriority; - MFXGetPriority; - - MFXVideoCORE_SetBufferAllocator; - MFXVideoCORE_SetFrameAllocator; - MFXVideoCORE_SetHandle; - MFXVideoCORE_GetHandle; - MFXVideoCORE_SyncOperation; - - MFXVideoENCODE_Query; - MFXVideoENCODE_QueryIOSurf; - MFXVideoENCODE_Init; - MFXVideoENCODE_Reset; - MFXVideoENCODE_Close; - MFXVideoENCODE_GetVideoParam; - MFXVideoENCODE_GetEncodeStat; - MFXVideoENCODE_EncodeFrameAsync; - - MFXVideoDECODE_Query; - MFXVideoDECODE_DecodeHeader; - MFXVideoDECODE_QueryIOSurf; - MFXVideoDECODE_Init; - MFXVideoDECODE_Reset; - MFXVideoDECODE_Close; - MFXVideoDECODE_GetVideoParam; - MFXVideoDECODE_GetDecodeStat; - MFXVideoDECODE_SetSkipMode; - MFXVideoDECODE_GetPayload; - MFXVideoDECODE_DecodeFrameAsync; - - MFXVideoVPP_Query; - MFXVideoVPP_QueryIOSurf; - MFXVideoVPP_Init; - MFXVideoVPP_Reset; - MFXVideoVPP_Close; - - MFXVideoVPP_GetVideoParam; - MFXVideoVPP_GetVPPStat; - MFXVideoVPP_RunFrameVPPAsync; - - local: - *; -}; - -LIBMFX_1.1 { - global: - MFXVideoUSER_Register; - MFXVideoUSER_Unregister; - MFXVideoUSER_ProcessFrameAsync; -} LIBMFX_1.0; - -LIBMFX_1.8 { - global: - MFXVideoUSER_Load; - MFXVideoUSER_UnLoad; -} LIBMFX_1.1; - -LIBMFX_1.10 { - global: - MFXVideoENC_Query; - MFXVideoENC_QueryIOSurf; - MFXVideoENC_Init; - MFXVideoENC_Reset; - MFXVideoENC_Close; - MFXVideoENC_ProcessFrameAsync; - MFXVideoVPP_RunFrameVPPAsyncEx; - -} LIBMFX_1.1; - -LIBMFX_1.13 { - global: - MFXVideoPAK_Query; - MFXVideoPAK_QueryIOSurf; - MFXVideoPAK_Init; - MFXVideoPAK_Reset; - MFXVideoPAK_Close; - MFXVideoPAK_ProcessFrameAsync; - MFXVideoUSER_LoadByPath; -} LIBMFX_1.10; - -LIBMFX_1.14 { - global: - MFXInitEx; - MFXDoWork; -} LIBMFX_1.13; - -LIBMFX_1.19 { - global: - MFXVideoENC_GetVideoParam; - MFXVideoPAK_GetVideoParam; - MFXVideoCORE_QueryPlatform; - MFXVideoUSER_GetPlugin; -} LIBMFX_1.14; - -LIBMFXAUDIO_1.9 { - global: - MFXAudioUSER_Load; - MFXAudioUSER_UnLoad; - local: - *; -}; diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxaudio_functions.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxaudio_functions.h deleted file mode 100644 index a178f26e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxaudio_functions.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// -// WARNING: -// this file doesn't contain an include guard by intension. -// The file may be included into a source file many times. -// That is why this header doesn't contain any include directive. -// Please, do no try to fix it. -// - -// -// API version 1.8 functions -// - -// Minor value should precedes the major value -#define API_VERSION {{8, 1}} - -// CORE interface functions -FUNCTION(mfxStatus, MFXAudioCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait)) - -// ENCODE interface functions -FUNCTION(mfxStatus, MFXAudioENCODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXAudioENCODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXAudioENCODE_Init, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXAudioENCODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_EncodeFrameAsync, (mfxSession session, mfxAudioFrame *frame, mfxBitstream *buffer_out, mfxSyncPoint *syncp), (session, frame, buffer_out, syncp)) - -// DECODE interface functions -FUNCTION(mfxStatus, MFXAudioDECODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXAudioDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxAudioParam *par), (session, bs, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Init, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXAudioDECODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXAudioDECODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxAudioFrame *frame_out, mfxSyncPoint *syncp), (session, bs, frame_out, syncp)) - -#undef API_VERSION - -// -// API version 1.9 functions -// - -#define API_VERSION {{9, 1}} - -FUNCTION(mfxStatus, MFXAudioUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par)) -FUNCTION(mfxStatus, MFXAudioUSER_Unregister, (mfxSession session, mfxU32 type), (session, type)) -FUNCTION(mfxStatus, MFXAudioUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp)) - - -#undef API_VERSION diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.cpp deleted file mode 100644 index 39b6bff1..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.cpp +++ /dev/null @@ -1,621 +0,0 @@ -// Copyright (c) 2017-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "mfxvideo.h" -#include "mfxplugin.h" -#include "mfxpak.h" - -#include "mfxloader.h" - -#include "device_ids.h" - -namespace MFX { - -#if defined(__i386__) - #ifdef ANDROID - #define LIBMFXSW "libmfxsw32.so" - #define LIBMFXHW "libmfxhw32.so" - #else - #define LIBMFXSW "libmfxsw32.so.1" - #define LIBMFXHW "libmfxhw32.so.1" - #define ONEVPLRT "libmfx-gen.so.1.2" - #endif -#elif defined(__x86_64__) - #ifdef ANDROID - #define LIBMFXSW "libmfxsw64.so" - #define LIBMFXHW "libmfxhw64.so" - #else - #define LIBMFXSW "libmfxsw64.so.1" - #define LIBMFXHW "libmfxhw64.so.1" - #define ONEVPLRT "libmfx-gen.so.1.2" - #endif -#else - #error Unsupported architecture -#endif - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - e##func_name, - -enum Function -{ - eMFXInit, - eMFXInitEx, - eMFXClose, - eMFXJoinSession, -#include "mfxvideo_functions.h" - eFunctionsNum, - eNoMoreFunctions = eFunctionsNum -}; - -struct FunctionsTable -{ - Function id; - const char* name; - mfxVersion version; -}; - -#define VERSION(major, minor) {{minor, major}} - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - { e##func_name, #func_name, API_VERSION }, - -static const FunctionsTable g_mfxFuncTable[] = -{ - { eMFXInit, "MFXInit", VERSION(1, 0) }, - { eMFXInitEx, "MFXInitEx", VERSION(1, 14) }, - { eMFXClose, "MFXClose", VERSION(1, 0) }, - { eMFXJoinSession, "MFXJoinSession", VERSION(1, 1) }, -#include "mfxvideo_functions.h" - { eNoMoreFunctions } -}; - -typedef mfxStatus (MFX_CDECL *CreatePluginPtr)(mfxPluginUID, mfxPlugin*); - -class LoaderCtx; - -class PluginCtx -{ -public: - PluginCtx(LoaderCtx& loader) - : m_loader(loader) - {} - - mfxStatus Load(const mfxPluginUID& uid, mfxU32 version, const char *path); - mfxStatus Unload(); - - inline mfxPluginUID getUID() const { return m_uid; } - -private: - LoaderCtx& m_loader; - std::shared_ptr m_dlh; - CreatePluginPtr m_create_plugin = nullptr; - mfxPluginUID m_uid{}; - mfxPlugin m_plugin{}; - mfxPluginParam m_plugin_param{}; -}; - -class LoaderCtx -{ -public: - mfxStatus Init(mfxInitParam& par); - mfxStatus Close(); - - mfxStatus LoadPlugin(const mfxPluginUID& uid, mfxU32 version, const char *path); - mfxStatus UnloadPlugin(const mfxPluginUID& uid); - - inline void* getFunction(Function func) const { - return m_table[func]; - } - - inline mfxSession getSession() const { - return m_session; - } - - inline mfxIMPL getImpl() const { - return m_implementation; - } - - inline mfxVersion getVersion() const { - return m_version; - } - -private: - std::shared_ptr m_dlh; - mfxVersion m_version{}; - mfxIMPL m_implementation{}; - mfxSession m_session = nullptr; - void* m_table[eFunctionsNum]{}; - - std::mutex m_guard; - std::list m_plugins; -}; - -struct GlobalCtx -{ - std::mutex m_mutex; - std::list m_plugins; -}; - -static GlobalCtx g_GlobalCtx; - -std::shared_ptr make_dlopen(const char* filename, int flags) -{ - return std::shared_ptr( - dlopen(filename, flags), - [] (void* handle) { if (handle) dlclose(handle); }); -} - -mfxStatus LoaderCtx::Init(mfxInitParam& par) -{ - if (par.Implementation & MFX_IMPL_AUDIO) { - return MFX_ERR_UNSUPPORTED; - } - - eMFXHWType platform = MFX_HW_UNKNOWN; - auto devices = get_devices(); - if (devices.size()) { - platform = devices[devices.size() - 1].platform; - } - - std::vector libs; - - const char *selected_runtime = getenv("INTEL_MEDIA_RUNTIME"); - if (selected_runtime && strcmp(selected_runtime, "ONEVPL") == 0) { - libs.emplace_back(ONEVPLRT); - libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT); - } else if ((selected_runtime && strcmp(selected_runtime, "MSDK") == 0) || (platform != MFX_HW_UNKNOWN)) { - if (MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO || - MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO_ANY) { - libs.emplace_back(LIBMFXHW); - libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXHW); - libs.emplace_back(LIBMFXSW); - libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXSW); - } else if (par.Implementation & MFX_IMPL_HARDWARE || - par.Implementation & MFX_IMPL_HARDWARE_ANY) { - libs.emplace_back(LIBMFXHW); - libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXHW); - } else if (par.Implementation & MFX_IMPL_SOFTWARE) { - libs.emplace_back(LIBMFXSW); - libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXSW); - } else { - return MFX_ERR_UNSUPPORTED; - } - } else { - libs.emplace_back(ONEVPLRT); - libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT); - } - - mfxStatus mfx_res = MFX_ERR_UNSUPPORTED; - - for (auto& lib: libs) { - std::shared_ptr hdl = make_dlopen(lib.c_str(), RTLD_LOCAL|RTLD_NOW); - if (hdl) { - do { - /* Loading functions table */ - bool wrong_version = false; - for (int i = 0; i < eFunctionsNum; ++i) { - assert(i == g_mfxFuncTable[i].id); - m_table[i] = dlsym(hdl.get(), g_mfxFuncTable[i].name); - if (!m_table[i] && ((par.Version <= g_mfxFuncTable[i].version) || - (g_mfxFuncTable[i].version <= mfxVersion(VERSION(1, 14))))) { - // this version of dispatcher requires MFXInitEx which appeared - // in Media SDK API 1.14 - wrong_version = true; - break; - } - } - if (wrong_version) { - mfx_res = MFX_ERR_UNSUPPORTED; - break; - } - - /* Initializing loaded library */ - mfx_res = ((decltype(MFXInitEx)*)m_table[eMFXInitEx])(par, &m_session); - if (MFX_ERR_NONE != mfx_res) { - break; - } - - // Below we just get some data and double check that we got what we have expected - // to get. Some of these checks are done inside mediasdk init function - mfx_res = ((decltype(MFXQueryVersion)*)m_table[eMFXQueryVersion])(m_session, &m_version); - if (MFX_ERR_NONE != mfx_res) { - break; - } - - if (m_version < par.Version) { - mfx_res = MFX_ERR_UNSUPPORTED; - break; - } - - mfx_res = ((decltype(MFXQueryIMPL)*)m_table[eMFXQueryIMPL])(m_session, &m_implementation); - if (MFX_ERR_NONE != mfx_res) { - mfx_res = MFX_ERR_UNSUPPORTED; - break; - } - } while(false); - - if (MFX_ERR_NONE == mfx_res) { - m_dlh = std::move(hdl); - break; - } else { - Close(); - } - } - } - - return mfx_res; -} - -mfxStatus LoaderCtx::Close() -{ - auto proc = (decltype(MFXClose)*)m_table[eMFXClose]; - mfxStatus mfx_res = (proc)? (*proc)(m_session): MFX_ERR_NONE; - - m_implementation = {}; - m_version = {}; - m_session = nullptr; - std::fill(std::begin(m_table), std::end(m_table), nullptr); - return mfx_res; -} - -mfxStatus PluginCtx::Load(const mfxPluginUID& uid, mfxU32 version, const char *path) -{ - if (!path) { - return MFX_ERR_NULL_PTR; - } - - mfxStatus mfx_res = MFX_ERR_NONE; - std::shared_ptr hdl = make_dlopen(path, RTLD_LOCAL|RTLD_NOW); - - if (!hdl) { - return MFX_ERR_NOT_FOUND; - } - - do { - m_uid = uid; - m_create_plugin = (CreatePluginPtr)dlsym(hdl.get(), "CreatePlugin"); - if (!m_create_plugin) { - mfx_res = MFX_ERR_NOT_FOUND; - break; - } - - mfx_res = m_create_plugin(m_uid, &m_plugin); - if (MFX_ERR_NONE != mfx_res) { - break; - } - - mfx_res = m_plugin.GetPluginParam(m_plugin.pthis, &m_plugin_param); - if (MFX_ERR_NONE != mfx_res) { - break; - } - - mfx_res = MFXVideoUSER_Register((mfxSession)&m_loader, m_plugin_param.Type, &m_plugin); - if (MFX_ERR_NONE != mfx_res) { - break; - } - } while(false); - - if (MFX_ERR_NONE == mfx_res) { - m_dlh = std::move(hdl); - } else { - m_uid = {}; - m_create_plugin = nullptr; - m_plugin = {}; - m_plugin_param = {}; - } - return mfx_res; -} - -mfxStatus PluginCtx::Unload() -{ - return MFXVideoUSER_Unregister((mfxSession)&m_loader, m_plugin_param.Type); -} - -mfxStatus LoaderCtx::LoadPlugin(const mfxPluginUID &uid, mfxU32 version, const char *path) -{ - if (!path) return MFX_ERR_NULL_PTR; - - std::lock_guard lock(m_guard); - - for (auto& it: m_plugins) { - if (it.getUID() == uid) return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - PluginCtx ctx(*this); - - mfxStatus mfx_res = ctx.Load(uid, version, path); - if (MFX_ERR_NONE != mfx_res) { - return mfx_res; - } - - m_plugins.emplace_back(std::move(ctx)); - - return MFX_ERR_NONE; -} - -mfxStatus LoaderCtx::UnloadPlugin(const mfxPluginUID& uid) -{ - std::list ctx; - { - // We will move plugin ctx which we are going to delete to the - // array allocated on stack. In this way we will move bottom half - // of plugin ctx destroy, including potentially long dlclose, out - // of the mutex. - std::lock_guard lock(m_guard); - auto it = std::find_if(std::begin(m_plugins), std::end(m_plugins), - [&uid](const PluginCtx& cur_ctx){ return cur_ctx.getUID() == uid; }); - - if (it != std::end(m_plugins)) { - mfxStatus mfx_res = it->Unload(); - if (MFX_ERR_NONE != mfx_res) { - return mfx_res; - } - ctx.splice(ctx.end(), m_plugins, it); - } - } - return MFX_ERR_NONE; -} - -} // namespace MFX - -#ifdef __cplusplus -extern "C" -{ -#endif - -mfxStatus MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session) -{ - mfxInitParam par{}; - - par.Implementation = impl; - if (ver) { - par.Version = *ver; - } else { - par.Version = VERSION(MFX_VERSION_MAJOR, MFX_VERSION_MINOR); - } - - return MFXInitEx(par, session); -} - -mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session) -{ - if (!session) return MFX_ERR_NULL_PTR; - - try { - std::unique_ptr loader; - - loader.reset(new MFX::LoaderCtx{}); - - mfxStatus mfx_res = loader->Init(par); - if (MFX_ERR_NONE == mfx_res) { - *session = (mfxSession)loader.release(); - } else { - *session = nullptr; - } - - return mfx_res; - } catch(...) { - return MFX_ERR_MEMORY_ALLOC; - } -} - -mfxStatus MFXClose(mfxSession session) -{ - if (!session) return MFX_ERR_INVALID_HANDLE; - - try { - std::unique_ptr loader((MFX::LoaderCtx*)session); - mfxStatus mfx_res = loader->Close(); - - if (mfx_res == MFX_ERR_UNDEFINED_BEHAVIOR) { - // It is possible, that there is an active child session. - // Can't unload library in this case. - loader.release(); - } - return mfx_res; - } catch(...) { - return MFX_ERR_MEMORY_ALLOC; - } -} - -static inline bool IsEmbeddedPlugin(const mfxPluginUID *uid) -{ - return ( - *uid == MFX_PLUGINID_HEVCD_HW || - *uid == MFX_PLUGINID_HEVCE_HW || - *uid == MFX_PLUGINID_VP8D_HW || - *uid == MFX_PLUGINID_VP8E_HW || - *uid == MFX_PLUGINID_VP9D_HW || - *uid == MFX_PLUGINID_VP9E_HW); -} - -mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version) -{ - if (!session) return MFX_ERR_INVALID_HANDLE; - if (!uid) return MFX_ERR_NULL_PTR; - if (IsEmbeddedPlugin(uid)) { - return MFX_ERR_NONE; - } - - try { - MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session; - std::string path; - - { - std::lock_guard lock(MFX::g_GlobalCtx.m_mutex); - - auto find_uid = [](const mfxPluginUID& puid) { - return std::find_if( - MFX::g_GlobalCtx.m_plugins.begin(), - MFX::g_GlobalCtx.m_plugins.end(), - [&puid](MFX::PluginInfo& item){ return item.getUID() == puid; } - ); - }; - - if (MFX::g_GlobalCtx.m_plugins.empty()) { - // Parsing plugin configuration file and loading information of - // _all_ plugins registered on the system. - parse(MFX_PLUGINS_CONF_DIR "/plugins.cfg", MFX::g_GlobalCtx.m_plugins); - } - - // search for plugin description - auto it = find_uid(*uid); - if (it == MFX::g_GlobalCtx.m_plugins.end()) { - return MFX_ERR_NOT_FOUND; - } - - path = it->getPath(); - } - - return loader->LoadPlugin(*uid, version, path.c_str()); - } catch(...) { - return MFX_ERR_MEMORY_ALLOC; - } -} - -mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 /*len*/) -{ - if (!session) return MFX_ERR_INVALID_HANDLE; - if (!uid) return MFX_ERR_NULL_PTR; - if (IsEmbeddedPlugin(uid)) { - return MFX_ERR_NONE; - } - - try { - MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session; - return loader->LoadPlugin(*uid, version, path); - } catch(...) { - return MFX_ERR_MEMORY_ALLOC; - } -} - -mfxStatus MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid) -{ - if (!session) return MFX_ERR_INVALID_HANDLE; - if (!uid) return MFX_ERR_NULL_PTR; - if (IsEmbeddedPlugin(uid)) { - return MFX_ERR_NONE; - } - - try { - MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session; - return loader->UnloadPlugin(*uid); - } catch(...) { - return MFX_ERR_MEMORY_ALLOC; - } -} - -mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version) -{ - return MFX_ERR_NOT_FOUND; -} - -mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid) -{ - return MFX_ERR_NOT_FOUND; -} - -mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session) -{ - if (!session || !child_session) { - return MFX_ERR_INVALID_HANDLE; - } - - MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session; - MFX::LoaderCtx* child_loader = (MFX::LoaderCtx*)child_session; - - if (loader->getVersion().Version != child_loader->getVersion().Version) { - return MFX_ERR_INVALID_HANDLE; - } - - auto proc = (decltype(MFXJoinSession)*)loader->getFunction(MFX::eMFXJoinSession); - if (!proc) { - return MFX_ERR_INVALID_HANDLE; - } - - return (*proc)(loader->getSession(), child_loader->getSession()); -} - -mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) -{ - if (!session) return MFX_ERR_INVALID_HANDLE; - - MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session; - // initialize the clone session - mfxVersion version = loader->getVersion(); - mfxStatus mfx_res = MFXInit(loader->getImpl(), &version, clone); - if (MFX_ERR_NONE != mfx_res) { - return mfx_res; - } - - // join the sessions - mfx_res = MFXJoinSession(session, *clone); - if (MFX_ERR_NONE != mfx_res) { - MFXClose(*clone); - *clone = nullptr; - return mfx_res; - } - - return MFX_ERR_NONE; -} - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ -return_value MFX_CDECL func_name formal_param_list \ -{ \ - /* get the function's address and make a call */ \ - if (!session) return MFX_ERR_INVALID_HANDLE; \ - \ - MFX::LoaderCtx *loader = (MFX::LoaderCtx*) session; \ - \ - auto proc = (decltype(func_name)*)loader->getFunction(MFX::e##func_name); \ - if (!proc) return MFX_ERR_INVALID_HANDLE; \ - \ - /* get the real session pointer */ \ - session = loader->getSession(); \ - /* pass down the call */ \ - return (*proc) actual_param_list; \ -} - -#include "mfxvideo_functions.h" - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) -// as of now we don't expose audio support, but we still want to check certain -// consistency of mfxaudio_functions.h file, so include it here - -#include "mfxaudio_functions.h" - -#ifdef __cplusplus -} -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.h deleted file mode 100644 index ab57588c..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#ifndef __MFXLOADER_H__ -#define __MFXLOADER_H__ - -#include - -#include -#include - -#include "mfxdefs.h" -#include "mfxplugin.h" - -inline bool operator == (const mfxPluginUID &lhs, const mfxPluginUID & rhs) -{ - return !memcmp(lhs.Data, rhs.Data, sizeof(mfxPluginUID)); -} - -inline bool operator != (const mfxPluginUID &lhs, const mfxPluginUID & rhs) -{ - return !(lhs == rhs); -} - -inline bool operator < (const mfxVersion &lhs, const mfxVersion & rhs) -{ - return (lhs.Major < rhs.Major || - (lhs.Major == rhs.Major && lhs.Minor < rhs.Minor)); -} - -inline bool operator <= (const mfxVersion &lhs, const mfxVersion & rhs) -{ - return (lhs < rhs || (lhs.Major == rhs.Major && lhs.Minor == rhs.Minor)); -} - -namespace MFX { - -class PluginInfo : public mfxPluginParam -{ -public: - PluginInfo() - : mfxPluginParam() - , m_parsed() - , m_path() - , m_default() - {} - - inline bool isValid() { - return m_parsed; - } - - inline mfxPluginUID getUID() { - return PluginUID; - } - - inline std::string getPath() { - return std::string(m_path); - } - - void Load(const char* name, const char* value); - void Print(); - -private: - enum - { - PARSED_TYPE = 0x1, - PARSED_CODEC_ID = 0x2, - PARSED_UID = 0x4, - PARSED_PATH = 0x8, - PARSED_DEFAULT = 0x10, - PARSED_VERSION = 0x20, - PARSED_API_VERSION = 0x40, - PARSED_NAME = 0x80, - }; - - mfxU32 m_parsed; - - char m_path[PATH_MAX]; - bool m_default; -}; - -void parse(const char* file_name, std::list& all_records); - - -} // namespace MFX - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxparser.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxparser.cpp deleted file mode 100644 index 9d3823ec..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxparser.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) 2017-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include -#include -#include -#include - -#include - -#include "mfxloader.h" - -namespace MFX { - -static bool parseGUID(const char* src, mfxPluginUID* uid) -{ - mfxPluginUID plugin_uid{}; - mfxU8* p = plugin_uid.Data; - - int res = sscanf(src, - "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx", - p, p + 1, p + 2, p + 3, p + 4, p + 5, p + 6, p + 7, - p + 8, p + 9, p + 10, p + 11, p + 12, p + 13, p + 14, p + 15); - - if (res != sizeof(uid->Data)) { - return false; - } - - *uid = plugin_uid; - return true; -} - -static std::string printUID(const mfxPluginUID& uid) -{ - std::stringstream ss; - ss << std::hex; - for (auto c: uid.Data) ss << static_cast(c); - return ss.str(); -} - -static std::string printCodecId(mfxU32 id) -{ - uint8_t* data = reinterpret_cast(&id); - std::stringstream ss; - for (size_t i=0; i < sizeof(id); ++i) ss << data[i]; - return ss.str(); -} - -void PluginInfo::Load(const char* name, const char* value) -{ -#ifdef LINUX64 - #define FIELD_FileName "FileName64" -#else - #define FIELD_FileName "FileName32" -#endif - - if (!strcmp(name, "Type")) { - Type = atoi(value); - m_parsed |= PARSED_TYPE; - } else if (!strcmp(name, "CodecID")) { - const int fourccLen = 4; - if (strlen(value) == 0 || strlen(value) > fourccLen) - return; - - CodecId = MFX_MAKEFOURCC(' ',' ',' ',' '); - char* id = reinterpret_cast(&CodecId); - for (size_t i = 0; i < strlen(value); ++i) - id[i] = value[i]; - - m_parsed |= PARSED_CODEC_ID; - } else if (!strcmp(name, "GUID")) { - if (!parseGUID(value, &PluginUID)) - return; - - m_parsed |= PARSED_UID; - } else if (!strcmp(name, "Path") || !strcmp(name, FIELD_FileName)) { - // strip quotes - std::string str_value(value); - - if (!str_value.empty() && str_value.front() == '"' && str_value.back() == '"') - { - str_value.pop_back(); - - if (!str_value.empty()) - str_value.erase(0, 1); - } - - if (strlen(m_path) + strlen("/") + str_value.size() >= PATH_MAX) - return; - strncpy(m_path + strlen(m_path), str_value.c_str(), str_value.size() + 1); - m_parsed |= PARSED_PATH; - } else if (0 == strcmp(name, "Default")) { - m_default = (0 != atoi(value)); - m_parsed |= PARSED_DEFAULT; - } else if (0 == strcmp(name, "PluginVersion")) { - PluginVersion = atoi(value); - m_parsed |= PARSED_VERSION; - } else if (0 == strcmp(name, "APIVersion")) { - APIVersion.Version = atoi(value); - m_parsed |= PARSED_API_VERSION; - } -} - -void PluginInfo::Print() -{ - printf("[%s]\n", printUID(PluginUID).c_str()); - printf(" GUID=%s\n", printUID(PluginUID).c_str()); - printf(" PluginVersion=%d\n", PluginVersion); - printf(" APIVersion=%d\n", APIVersion.Version); - printf(" Path=%s\n", m_path); - printf(" Type=%d\n", Type); - printf(" CodecID=%s\n", printCodecId(CodecId).c_str()); - printf(" Default=%d\n", m_default); -} - -const std::string space_search_pattern(" \f\n\r\t\v"); -// strip tailing spaces -void strip(std::string & str) -{ - static_assert(std::string::npos + 1 == 0, ""); - str.erase(str.find_last_not_of(space_search_pattern) + 1); -} - -// skip initial spaces -void skip(std::string & str) -{ - str.erase(0, str.find_first_not_of(space_search_pattern)); -} - -void parse(const char* file_name, std::list& plugins) -{ -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7) - const char* mode = "re"; -#else - const char* mode = "r"; -#endif - - FILE* file = fopen(file_name, mode); - if (!file) - return; - - char c_line[PATH_MAX]; - PluginInfo plg; - std::string line; - - while(fgets(c_line, PATH_MAX, file)) - { - line = c_line; - - strip(line); - skip(line); - - if (line.find_first_not_of(";#") != 0) - { - // skip comments - continue; - } - else if (line[0] == '[') - { - if (plg.isValid()) { - plugins.push_back(std::move(plg)); - plg = PluginInfo{}; - } - } - else - { - std::string name = line, value = line; - - size_t pos = value.find_first_of("=:"); - if (pos != std::string::npos) - { - // Get left part relative to delimiter - name.erase(pos); - strip(name); - - // Get right part relative to delimiter - value.erase(0, pos + 1); - skip(value); - - static_assert(std::string::npos + 1 == 0, ""); - value.erase(value.find_last_not_of(";#") + 1); - } - if (!name.empty() && !value.empty()) { - plg.Load(name.c_str(), value.c_str()); - } - } - } - - if (plg.isValid()) { - plugins.push_back(std::move(plg)); - } - - fclose(file); - - //print(plugins); // for debug -} - -} // namespace MFX diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxvideo_functions.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxvideo_functions.h deleted file mode 100644 index 06b7fada..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxvideo_functions.h +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2017 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// -// WARNING: -// this file doesn't contain an include guard by intension. -// The file may be included into a source file many times. -// That is why this header doesn't contain any include directive. -// Please, do no try to fix it. -// - - - -// Use define API_VERSION to set the API of functions listed further -// When new functions are added new section with functions declarations must be started with updated define - -// -// API version 1.0 functions -// - -// API version where a function is added. Minor value should precedes the major value -#define API_VERSION {{0, 1}} - -FUNCTION(mfxStatus, MFXQueryIMPL, (mfxSession session, mfxIMPL *impl), (session, impl)) -FUNCTION(mfxStatus, MFXQueryVersion, (mfxSession session, mfxVersion *version), (session, version)) - -// CORE interface functions -FUNCTION(mfxStatus, MFXVideoCORE_SetBufferAllocator, (mfxSession session, mfxBufferAllocator *allocator), (session, allocator)) -FUNCTION(mfxStatus, MFXVideoCORE_SetFrameAllocator, (mfxSession session, mfxFrameAllocator *allocator), (session, allocator)) -FUNCTION(mfxStatus, MFXVideoCORE_SetHandle, (mfxSession session, mfxHandleType type, mfxHDL hdl), (session, type, hdl)) -FUNCTION(mfxStatus, MFXVideoCORE_GetHandle, (mfxSession session, mfxHandleType type, mfxHDL *hdl), (session, type, hdl)) - -FUNCTION(mfxStatus, MFXVideoCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait)) - -// ENCODE interface functions -FUNCTION(mfxStatus, MFXVideoENCODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoENCODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoENCODE_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoENCODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_GetEncodeStat, (mfxSession session, mfxEncodeStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoENCODE_EncodeFrameAsync, (mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp), (session, ctrl, surface, bs, syncp)) - -// DECODE interface functions -FUNCTION(mfxStatus, MFXVideoDECODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxVideoParam *par), (session, bs, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoDECODE_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoDECODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_GetDecodeStat, (mfxSession session, mfxDecodeStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoDECODE_SetSkipMode, (mfxSession session, mfxSkipMode mode), (session, mode)) -FUNCTION(mfxStatus, MFXVideoDECODE_GetPayload, (mfxSession session, mfxU64 *ts, mfxPayload *payload), (session, ts, payload)) -FUNCTION(mfxStatus, MFXVideoDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp), (session, bs, surface_work, surface_out, syncp)) - -// VPP interface functions -FUNCTION(mfxStatus, MFXVideoVPP_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoVPP_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoVPP_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoVPP_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_GetVPPStat, (mfxSession session, mfxVPPStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsync, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp), (session, in, out, aux, syncp)) - -#undef API_VERSION - -// -// API version 1.1 functions -// - -#define API_VERSION {{1, 1}} - -FUNCTION(mfxStatus, MFXDisjoinSession, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXSetPriority, (mfxSession session, mfxPriority priority), (session, priority)) -FUNCTION(mfxStatus, MFXGetPriority, (mfxSession session, mfxPriority *priority), (session, priority)) - -FUNCTION(mfxStatus, MFXVideoUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par)) -FUNCTION(mfxStatus, MFXVideoUSER_Unregister, (mfxSession session, mfxU32 type), (session, type)) -FUNCTION(mfxStatus, MFXVideoUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp)) - -#undef API_VERSION - -// -// API version 1.10 functions -// - -#define API_VERSION {{10, 1}} - -FUNCTION(mfxStatus, MFXVideoENC_Query,(mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session,in,out)) -FUNCTION(mfxStatus, MFXVideoENC_QueryIOSurf,(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session,par,request)) -FUNCTION(mfxStatus, MFXVideoENC_Init,(mfxSession session, mfxVideoParam *par), (session,par)) -FUNCTION(mfxStatus, MFXVideoENC_Reset,(mfxSession session, mfxVideoParam *par), (session,par)) -FUNCTION(mfxStatus, MFXVideoENC_Close,(mfxSession session),(session)) -FUNCTION(mfxStatus, MFXVideoENC_ProcessFrameAsync,(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp),(session,in,out,syncp)) - -FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsyncEx, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *work, mfxFrameSurface1 **out, mfxSyncPoint *syncp), (session, in, work, out, syncp)) - -#undef API_VERSION - -#define API_VERSION {{13, 1}} - -FUNCTION(mfxStatus, MFXVideoPAK_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoPAK_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoPAK_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXVideoPAK_ProcessFrameAsync, (mfxSession session, mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp), (session, in, out, syncp)) - -#undef API_VERSION - -#define API_VERSION {{14, 1}} - -// FUNCTION(mfxStatus, MFXInitEx, (mfxInitParam par, mfxSession session), (par, session)) -FUNCTION(mfxStatus, MFXDoWork, (mfxSession session), (session)) - -#undef API_VERSION - -#define API_VERSION {{19, 1}} - -FUNCTION(mfxStatus, MFXVideoENC_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoCORE_QueryPlatform, (mfxSession session, mfxPlatform* platform), (session, platform)) -FUNCTION(mfxStatus, MFXVideoUSER_GetPlugin, (mfxSession session, mfxU32 type, mfxPlugin *par), (session, type, par)) - -#undef API_VERSION diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config-shared.pc.cmake b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config-shared.pc.cmake deleted file mode 100644 index 27ac0ca7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config-shared.pc.cmake +++ /dev/null @@ -1,10 +0,0 @@ -Name: @PROJECT_NAME@ -Description: Intel(R) Media SDK Dispatcher -Version: @MFX_VERSION_MAJOR@.@MFX_VERSION_MINOR@ - -prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ -Libs: -L${libdir} -ldispatch_shared -lstdc++ -ldl -Cflags: -I${includedir} -I${includedir}/mfx -DMFX_DISPATCHER_EXPOSED_PREFIX - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config.pc.cmake b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config.pc.cmake deleted file mode 100644 index 3695ea7e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config.pc.cmake +++ /dev/null @@ -1,9 +0,0 @@ -Name: @PROJECT_NAME@ -Description: Intel(R) Media SDK Dispatcher -Version: @MFX_VERSION_MAJOR@.@MFX_VERSION_MINOR@ - -prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ -Libs: -L${libdir} -lmfx -lstdc++ -ldl -Cflags: -I${includedir} -I${includedir}/mfx diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_critical_section.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_critical_section.h deleted file mode 100644 index e2e39c4b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_critical_section.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_CRITICAL_SECTION_H) -#define __MFX_CRITICAL_SECTION_H - -#include - -namespace MFX -{ - -// Just set "critical section" instance to zero for initialization. -typedef volatile mfxL32 mfxCriticalSection; - -// Enter the global critical section. -void mfxEnterCriticalSection(mfxCriticalSection *pCSection); - -// Leave the global critical section. -void mfxLeaveCriticalSection(mfxCriticalSection *pCSection); - -class MFXAutomaticCriticalSection -{ -public: - // Constructor - explicit MFXAutomaticCriticalSection(mfxCriticalSection *pCSection) - { - m_pCSection = pCSection; - mfxEnterCriticalSection(m_pCSection); - } - - // Destructor - ~MFXAutomaticCriticalSection() - { - mfxLeaveCriticalSection(m_pCSection); - } - -protected: - // Pointer to a critical section - mfxCriticalSection *m_pCSection; - -private: - // unimplemented by intent to make this class non-copyable - MFXAutomaticCriticalSection(const MFXAutomaticCriticalSection &); - void operator=(const MFXAutomaticCriticalSection &); -}; - -} // namespace MFX - -#endif // __MFX_CRITICAL_SECTION_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher.h deleted file mode 100644 index 41ceb54f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher.h +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_DISPATCHER_H) -#define __MFX_DISPATCHER_H - -#include -#include -#include -#include -#include "mfx_dispatcher_defs.h" -#include "mfx_load_plugin.h" -#include "mfxenc.h" -#include "mfxpak.h" - -#define INTEL_VENDOR_ID 0x8086 - -mfxStatus MFXQueryVersion(mfxSession session, mfxVersion *version); - - - -enum -{ - // to avoid code changing versions are just inherited - // from the API header file. - DEFAULT_API_VERSION_MAJOR = MFX_VERSION_MAJOR, - DEFAULT_API_VERSION_MINOR = MFX_VERSION_MINOR -}; - -// -// declare functions' integer identifiers. -// - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - e##func_name, - -enum eFunc -{ - eMFXInit, - eMFXClose, - eMFXQueryIMPL, - eMFXQueryVersion, - eMFXJoinSession, - eMFXDisjoinSession, - eMFXCloneSession, - eMFXSetPriority, - eMFXGetPriority, - eMFXInitEx, -#include "mfx_exposed_functions_list.h" - eVideoFuncTotal -}; - -enum ePluginFunc -{ - eMFXVideoUSER_Load, - eMFXVideoUSER_LoadByPath, - eMFXVideoUSER_UnLoad, - eMFXAudioUSER_Load, - eMFXAudioUSER_UnLoad, - ePluginFuncTotal -}; - -enum eAudioFunc -{ - eFakeAudioEnum = eMFXGetPriority, -#include "mfxaudio_exposed_functions_list.h" - eAudioFuncTotal -}; - -// declare max buffer length for regsitry key name -enum -{ - MFX_MAX_REGISTRY_KEY_NAME = 256 -}; - -// declare the maximum DLL path -enum -{ - MFX_MAX_DLL_PATH = 1024 -}; - -// declare library's implementation types -enum eMfxImplType -{ - MFX_LIB_HARDWARE = 0, - MFX_LIB_SOFTWARE = 1, - MFX_LIB_PSEUDO = 2, - - MFX_LIB_IMPL_TYPES -}; - -// declare dispatcher's version -enum -{ - MFX_DISPATCHER_VERSION_MAJOR = 1, - MFX_DISPATCHER_VERSION_MINOR = 3 -}; - -struct _mfxSession -{ - // A real handle from MFX engine passed to a called function - mfxSession session; - - mfxFunctionPointer callTable[eVideoFuncTotal]; - mfxFunctionPointer callPlugInsTable[ePluginFuncTotal]; - mfxFunctionPointer callAudioTable[eAudioFuncTotal]; - - // Current library's implementation (exact implementation) - mfxIMPL impl; -}; - -// declare a dispatcher's handle -struct MFX_DISP_HANDLE : public _mfxSession -{ - // Default constructor - MFX_DISP_HANDLE(const mfxVersion requiredVersion); - // Destructor - ~MFX_DISP_HANDLE(void); - - // Load the library's module - mfxStatus LoadSelectedDLL(const wchar_t *pPath, eMfxImplType implType, mfxIMPL impl, mfxIMPL implInterface, mfxInitParam &par); - // Unload the library's module - mfxStatus UnLoadSelectedDLL(void); - - // Close the handle - mfxStatus Close(void); - - // NOTE: changing order of struct's members can make different version of - // dispatchers incompatible. Think of different modules (e.g. MFT filters) - // within a single application. - - // Library's implementation type (hardware or software) - eMfxImplType implType; - // Current library's VIA interface - mfxIMPL implInterface; - // Dispatcher's version. If version is 1.1 or lower, then old dispatcher's - // architecture is used. Otherwise it means current dispatcher's version. - mfxVersion dispVersion; - // Required API version of session initialized - const mfxVersion apiVersion; - // Actual library API version - mfxVersion actualApiVersion; - // Status of loaded dll - mfxStatus loadStatus; - // Resgistry subkey name for windows version - wchar_t subkeyName[MFX_MAX_REGISTRY_KEY_NAME]; - // Storage ID for windows version - int storageID; - - // Library's module handle - mfxModuleHandle hModule; - - MFX::MFXPluginStorage pluginHive; - MFX::MFXPluginFactory pluginFactory; - -private: - // Declare assignment operator and copy constructor to prevent occasional assignment - MFX_DISP_HANDLE(const MFX_DISP_HANDLE &); - MFX_DISP_HANDLE & operator = (const MFX_DISP_HANDLE &); - -}; - -// This struct extends MFX_DISP_HANDLE, we cannot extend MFX_DISP_HANDLE itself due to possible compatibility issues -// This struct was added in dispatcher version 1.3 -// Check dispatcher handle's version when you cast session struct which came from outside of MSDK API function to this -struct MFX_DISP_HANDLE_EX : public MFX_DISP_HANDLE -{ - MFX_DISP_HANDLE_EX(const mfxVersion requiredVersion); - - mfxU16 mediaAdapterType; - mfxU16 reserved[10]; -}; - -// declare comparison operator -inline -bool operator == (const mfxVersion &one, const mfxVersion &two) -{ - return (one.Version == two.Version); - -} - -inline -bool operator < (const mfxVersion &one, const mfxVersion &two) -{ - return (one.Major < two.Major) || ((one.Major == two.Major) && (one.Minor < two.Minor)); - -} - -inline -bool operator <= (const mfxVersion &one, const mfxVersion &two) -{ - return (one == two) || (one < two); -} - - -// -// declare a table with functions descriptions -// - -typedef -struct FUNCTION_DESCRIPTION -{ - // Literal function's name - const char *pName; - // API version when function appeared first time - mfxVersion apiVersion; -} FUNCTION_DESCRIPTION; - -extern const -FUNCTION_DESCRIPTION APIFunc[eVideoFuncTotal]; - -extern const -FUNCTION_DESCRIPTION APIAudioFunc[eAudioFuncTotal]; -#endif // __MFX_DISPATCHER_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_defs.h deleted file mode 100644 index d525e079..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_defs.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2013-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once -#include "mfxdefs.h" -#include -#include - -#if defined(MFX_DISPATCHER_LOG) -#include -#include -#endif - -#define MAX_PLUGIN_PATH MAX_PATH -#define MAX_PLUGIN_NAME MAX_PATH - -#if _MSC_VER < 1400 -#define wcscpy_s(to,to_size, from) wcscpy(to, from) -#define wcscat_s(to,to_size, from) wcscat(to, from) -#endif - -// declare library module's handle -typedef void * mfxModuleHandle; - -typedef void (MFX_CDECL * mfxFunctionPointer)(void); - -// Tracer uses lib loading from Program Files logic (via Dispatch reg key) to make dispatcher load tracer dll. -// With DriverStore loading put at 1st place, dispatcher loads real lib before it finds tracer dll. -// This workaround explicitly checks tracer presence in Dispatch reg key and loads tracer dll before the search for lib in all other places. -#define MFX_TRACER_WA_FOR_DS 1 diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_log.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_log.h deleted file mode 100644 index a9589729..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_log.h +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_DISPATCHER_LOG_H) -#define __MFX_DISPATCHER_LOG_H - -////////////////////////////////////////////////////////////////////////// -//dispatcher log (DL) level -#define DL_INFO 1 -#define DL_WRN 2 -#define DL_ERROR 4 -#define DL_LOADED_LIBRARY 8 -////////////////////////////////////////////////////////////////////////// -//opcodes used only in events -enum -{ - DL_EVENT_START = 1, - DL_EVENT_STOP, - DL_EVENT_MSG -}; -////////////////////////////////////////////////////////////////////////// -#define DL_SINK_NULL 0 -#define DL_SINK_PRINTF 1 -#define DL_SINK_IMsgHandler 2 - -#define MFXFOURCCTYPE() "%c%c%c%c" -#define ZERO_OR_SPACE(value) ((0==(value)) ? '0' : (value)) -#define MFXU32TOFOURCC(mfxu32)\ - ZERO_OR_SPACE((char)(mfxu32 & 0xFF)), \ - ZERO_OR_SPACE((char)((mfxu32 >> 8) & 0xFF)),\ - ZERO_OR_SPACE((char)((mfxu32 >> 16) & 0xFF)),\ - ZERO_OR_SPACE((char)((mfxu32 >> 24) & 0xFF)) - -#define MFXGUIDTYPE() "%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X-%X" - -#define MFXGUIDTOHEX(guid)\ - (guid)->Data[0],\ - (guid)->Data[1],\ - (guid)->Data[2],\ - (guid)->Data[3],\ - (guid)->Data[4],\ - (guid)->Data[5],\ - (guid)->Data[6],\ - (guid)->Data[7],\ - (guid)->Data[8],\ - (guid)->Data[9],\ - (guid)->Data[10],\ - (guid)->Data[11],\ - (guid)->Data[12],\ - (guid)->Data[13],\ - (guid)->Data[14],\ - (guid)->Data[15] - -#if defined(MFX_DISPATCHER_LOG) - -//---------------------------setup section------------------------ -//using of formating instead of variadic macro with NULL end, -//leads to more flexibility in format, however constructing string -//with vsprintf_s is a time wasting -#define DISPATCHER_LOG_USE_FORMATING 1 - -//creates unique object, event guid registration, factories on heap -//heap reduce stack allocation and reduce reservation time at startup -//is a vital if mediasdk wont use -#define DISPATCHER_LOG_HEAP_SINGLETONES - -// guid for all dispatcher events -#define DISPATCHER_LOG_EVENT_GUID L"{EB0538CC-4FEE-484d-ACEE-1182E9F37A57}" - -//puts a sink into listeners list -//#define DISPATCHER_LOG_REGISTER_EVENT_PROVIDER - -//puts a sink into listeners list -//#define DISPATCHER_LOG_REGISTER_FILE_WRITER -#define DISPACTHER_LOG_FW_PATH "c:\\dispatcher.log" - -#include -#include - -//callback interface for intercept logging messages -class IMsgHandler -{ -public: - virtual ~IMsgHandler(){} - virtual void Write(int level, int opcode, const char * msg, va_list argptr) = 0; -}; - -#if DISPATCHER_LOG_USE_FORMATING - - #define DISPATCHER_LOG(lvl, opcode, str)\ - {\ - DispatcherLogBracketsHelper wrt(lvl,opcode);\ - wrt.Write str;\ - } -#else - #define DISPATCHER_LOG_VA_ARGS(...) wrt.Write(__VA_ARGS__, NULL) - //WARNING: don't use types that occupy more that 4 bytes in memory - //WARNING: don't use %s in format specifier - #define DISPATCHER_LOG(lvl, opcode, str) \ - {\ - DispatcherLogBracketsHelper wrt(lvl, opcode);\ - DISPATCHER_LOG_VA_ARGS str;\ - } -#endif//DISPATCHER_LOG_USE_FORMATING - -#define DISPATCHER_LOG_OPERATION(operation) operation - -#define __name_from_line( name, line ) name ## line -#define _name_from_line( name , line) __name_from_line( name, line ) -#define name_from_line( name ) _name_from_line( name, __LINE__) - - -#define DISPATCHER_LOG_AUTO(lvl, msg)\ - DispatchLogBlockHelper name_from_line(__auto_log_)(lvl); name_from_line(__auto_log_).Write msg; - -#include -#include -#include -#include - -template -class DSSingleTone -{ -public: - template - inline static T & get(TParam1 par1) - { - T * pstored; - if (NULL == (pstored = store_or_load())) - { - return *store_or_load(new T(par1)); - } - return *pstored; - } - - inline static T & get() - { - T * pstored; - if (NULL == (pstored = store_or_load())) - { - return *store_or_load(new T()); - } - return *pstored; - } -private: - //if obj == NULL, then it load - //if obj != NULL then it store obj - inline static T * store_or_load(T * obj = NULL) - { - static std::unique_ptr instance; - if (NULL != obj) - { - instance.reset(obj); - } - return instance.get(); - } -}; - -class DispatchLog - : public DSSingleTone -{ - friend class DSSingleTone; - std::listm_Recepients; - int m_DispatcherLogSink; - -public: - //sets current sink - void SetSink(int nsink, IMsgHandler *pHandler); - void AttachSink(int nsink, IMsgHandler *pHandler); - void DetachSink(int nsink, IMsgHandler *pHandler); - void ExchangeSink(int nsink, IMsgHandler *pOld, IMsgHandler *pNew); - void DetachAllSinks(); - void Write(int level, int opcode, const char * msg, va_list argptr); - -protected: - DispatchLog(); -}; - -//allows to push arguments on the stack without declaring them as function parameters -struct DispatcherLogBracketsHelper -{ - int m_level; - int m_opcode; - DispatcherLogBracketsHelper(int level, int opcode) - :m_level(level) - ,m_opcode(opcode) - { - } - void Write(const char * str, ...); -} ; - -//auto log on ctor dtor -struct DispatchLogBlockHelper -{ - int m_level; - void Write(const char * str, ...); - DispatchLogBlockHelper (int level) - : m_level(level) - { - } - ~DispatchLogBlockHelper(); -}; - -//----utility sinks----- -#if defined(DISPATCHER_LOG_REGISTER_EVENT_PROVIDER) -class ETWHandlerFactory - : public DSSingleTone -{ - friend class DSSingleTone; - typedef std::map _storage_type; - _storage_type m_storage; - -public: - ~ETWHandlerFactory(); - IMsgHandler *GetSink(const wchar_t* sguid = DISPATCHER_LOG_EVENT_GUID); - -protected: - ETWHandlerFactory(){} -}; -#endif - -#if defined(DISPATCHER_LOG_REGISTER_FILE_WRITER) -class FileSink - : public DSSingleTone - , public IMsgHandler -{ - friend class DSSingleTone; -public: - virtual void Write(int level, int opcode, const char * msg, va_list argptr); - FileSink() - : m_hdl(NULL) - { - } - ~FileSink() - { - if (NULL != m_hdl) - fclose(m_hdl); - } -private: - FILE * m_hdl; - FileSink(const std::string & log_file) - { - fopen_s(&m_hdl, log_file.c_str(), "a"); - } - -}; -#endif - -//-----utility functions -//since they are not called outside of macro we can define them here -std::string DispatcherLog_GetMFXImplString(int impl); -const char *DispatcherLog_GetMFXStatusString(int sts); - -#else // !defined(MFX_DISPATCHER_LOG) - - #define DISPATCHER_LOG(level, opcode, message) - #define DISPATCHER_LOG_AUTO(level, message) - #define DISPATCHER_LOG_OPERATION(operation) - -#endif// !defined(MFX_DISPATCHER_LOG) - - -#define DISPATCHER_LOG_INFO(msg) DISPATCHER_LOG(DL_INFO, DL_EVENT_MSG, msg) -#define DISPATCHER_LOG_WRN(msg) DISPATCHER_LOG(DL_WRN, DL_EVENT_MSG, msg) -#define DISPATCHER_LOG_ERROR(msg) DISPATCHER_LOG(DL_ERROR, DL_EVENT_MSG, msg) -#define DISPATCHER_LOG_LIBRARY(msg) DISPATCHER_LOG(DL_LOADED_LIBRARY, DL_EVENT_MSG, msg) -#define DISPATCHER_LOG_BLOCK(msg) DISPATCHER_LOG_AUTO(DL_INFO, msg) - -#endif // !defined(__MFX_DISPATCHER_LOG_H) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_uwp.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_uwp.h deleted file mode 100644 index c3cbad39..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dispatcher_uwp.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_DISPATCHER_UWP_H) -#define __MFX_DISPATCHER_UWP_H - -// Loads intel_gfx_api dll from DriverStore fro specified device and calls InitialiseMediaSession from it -mfxStatus GfxApiInit(mfxInitParam par, mfxU32 deviceID, mfxSession *session, mfxModuleHandle& hModule); - -// Calls DisposeMediaSession from the intel_gfx_api dll and unloads it -mfxStatus GfxApiClose(mfxSession& session, mfxModuleHandle& hModule); - -// Initializes intel_gfx_api for specified adapter number -mfxStatus GfxApiInitByAdapterNum(mfxInitParam par, mfxU32 adapterNum, mfxSession *session, mfxModuleHandle& hModule); - -// Initializes intel_gfx_api for any Intel adapter, chooses integrated adapter with higher priority -mfxStatus GfxApiInitPriorityIntegrated(mfxInitParam par, mfxSession *session, mfxModuleHandle& hModule); - -#endif // __MFX_DISPATCHER_UWP_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_driver_store_loader.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_driver_store_loader.h deleted file mode 100644 index 87eb1be8..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_driver_store_loader.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2019-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_DRIVER_STORE_LOADER_H) -#define __MFX_DRIVER_STORE_LOADER_H - -#include -#include -#include - -#include "mfx_dispatcher_defs.h" - -namespace MFX -{ - -typedef CONFIGRET(WINAPI *Func_CM_Get_Device_ID_List_SizeW)(PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags); -typedef CONFIGRET(WINAPI *Func_CM_Get_Device_ID_ListW)(PCWSTR pszFilter, PZZWSTR Buffer, ULONG BufferLen, ULONG ulFlags); -typedef CONFIGRET(WINAPI *Func_CM_Locate_DevNodeW)(PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags); -typedef CONFIGRET(WINAPI *Func_CM_Open_DevNode_Key)(DEVINST dnDevNode, REGSAM samDesired, ULONG ulHardwareProfile, REGDISPOSITION Disposition, PHKEY phkDevice, ULONG ulFlags); - -class DriverStoreLoader -{ -public: - DriverStoreLoader(void); - ~DriverStoreLoader(void); - - bool GetDriverStorePath(wchar_t *path, DWORD dwPathSize, mfxU32 deviceID); - -protected: - bool LoadCfgMgr(); - bool LoadCmFuncs(); - - mfxModuleHandle m_moduleCfgMgr; - Func_CM_Get_Device_ID_List_SizeW m_pCM_Get_Device_ID_List_Size; - Func_CM_Get_Device_ID_ListW m_pCM_Get_Device_ID_List; - Func_CM_Locate_DevNodeW m_pCM_Locate_DevNode; - Func_CM_Open_DevNode_Key m_pCM_Open_DevNode_Key; - -private: - // unimplemented by intent to make this class non-copyable - DriverStoreLoader(const DriverStoreLoader &); - void operator=(const DriverStoreLoader &); - -}; - -} // namespace MFX - -#endif // __MFX_DRIVER_STORE_LOADER_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dxva2_device.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dxva2_device.h deleted file mode 100644 index eadef56c..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_dxva2_device.h +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_DXVA2_DEVICE_H) -#define __MFX_DXVA2_DEVICE_H - -#include - -#define TOSTRING(L) #L -#define STRINGIFY(L) TOSTRING(L) - -#if defined(MEDIASDK_UWP_DISPATCHER) - #if defined(MFX_D3D9_ENABLED) && !defined(MFX_FORCE_D3D9_ENABLED) - #undef MFX_D3D9_ENABLED - #pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ " (" STRINGIFY(__LINE__) "):\nUsing of D3D9 disabled for UWP!\n\n") - #endif - #if defined(MFX_FORCE_D3D9_ENABLED) - #define MFX_D3D9_ENABLED - #endif -#else - #define MFX_D3D9_ENABLED - #pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ " (" STRINGIFY(__LINE__) "):\nUsing of D3D9 enabled!\n\n") -#endif - -#include - -#ifdef DXVA2DEVICE_LOG -#include -#define DXVA2DEVICE_TRACE(expr) printf expr; -#define DXVA2DEVICE_TRACE_OPERATION(expr) expr; -#else -#define DXVA2DEVICE_TRACE(expr) -#define DXVA2DEVICE_TRACE_OPERATION(expr) -#endif - -namespace MFX -{ - -class DXDevice -{ -public: - // Default constructor - DXDevice(void); - // Destructor - virtual - ~DXDevice(void) = 0; - - // Initialize device using DXGI 1.1 or VAAPI interface - virtual - bool Init(const mfxU32 adapterNum) = 0; - - // Obtain graphic card's parameter - mfxU32 GetVendorID(void) const; - mfxU32 GetDeviceID(void) const; - mfxU64 GetDriverVersion(void) const; - mfxU64 GetLUID(void) const; - - // Provide the number of available adapters - mfxU32 GetAdapterCount(void) const; - - // Close the object - virtual - void Close(void); - - // Load the required DLL module - void LoadDLLModule(const wchar_t *pModuleName); - -protected: - - // Free DLL module - void UnloadDLLModule(void); - - // Handle to the DLL library - HMODULE m_hModule; - - // Number of adapters available - mfxU32 m_numAdapters; - - // Vendor ID - mfxU32 m_vendorID; - // Device ID - mfxU32 m_deviceID; - // x.x.x.x each x of two bytes - mfxU64 m_driverVersion; - // LUID - mfxU64 m_luid; - -private: - // unimplemented by intent to make this class and its descendants non-copyable - DXDevice(const DXDevice &); - void operator=(const DXDevice &); -}; - -#ifdef MFX_D3D9_ENABLED -class D3D9Device : public DXDevice -{ -public: - // Default constructor - D3D9Device(void); - // Destructor - virtual - ~D3D9Device(void); - - // Initialize device using D3D v9 interface - virtual - bool Init(const mfxU32 adapterNum); - - // Close the object - virtual - void Close(void); - -protected: - - // Pointer to the D3D v9 interface - void *m_pD3D9; - // Pointer to the D3D v9 extended interface - void *m_pD3D9Ex; - -}; -#endif // MFX_D3D9_ENABLED - -class DXGI1Device : public DXDevice -{ -public: - // Default constructor - DXGI1Device(void); - // Destructor - virtual - ~DXGI1Device(void); - - // Initialize device - virtual - bool Init(const mfxU32 adapterNum); - - // Close the object - virtual - void Close(void); - -protected: - - // Pointer to the DXGI1 factory - void *m_pDXGIFactory1; - // Pointer to the current DXGI1 adapter - void *m_pDXGIAdapter1; - -}; - -class DXVA2Device -{ -public: - // Default constructor - DXVA2Device(void); - // Destructor - ~DXVA2Device(void); - - // Initialize device using D3D v9 interface - bool InitD3D9(const mfxU32 adapterNum); - - // Initialize device using DXGI 1.1 interface - bool InitDXGI1(const mfxU32 adapterNum); - - // Obtain graphic card's parameter - mfxU32 GetVendorID(void) const; - mfxU32 GetDeviceID(void) const; - mfxU64 GetDriverVersion(void) const; - - // Provide the number of available adapters - mfxU32 GetAdapterCount(void) const; - - void Close(void); - -protected: - -#ifdef MFX_D3D9_ENABLED - // Get vendor & device IDs by alternative way (D3D9 in Remote Desktop sessions) - void UseAlternativeWay(const D3D9Device *pD3D9Device); -#endif // MFX_D3D9_ENABLED - // Number of adapters available - mfxU32 m_numAdapters; - - // Vendor ID - mfxU32 m_vendorID; - // Device ID - mfxU32 m_deviceID; - //x.x.x.x - mfxU64 m_driverVersion; - -private: - // unimplemented by intent to make this class non-copyable - DXVA2Device(const DXVA2Device &); - void operator=(const DXVA2Device &); -}; - -} // namespace MFX - -#endif // __MFX_DXVA2_DEVICE_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_exposed_functions_list.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_exposed_functions_list.h deleted file mode 100644 index 18934ee2..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_exposed_functions_list.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// -// WARNING: -// this file doesn't contain an include guard by intension. -// The file may be included into a source file many times. -// That is why this header doesn't contain any include directive. -// Please, do no try to fix it. -// - - - -// Use define API_VERSION to set the API of functions listed further -// When new functions are added new section with functions declarations must be started with updated define - -// -// API version 1.0 functions -// - -// API version where a function is added. Minor value should precedes the major value -#define API_VERSION {{0, 1}} - -// CORE interface functions -FUNCTION(mfxStatus, MFXVideoCORE_SetBufferAllocator, (mfxSession session, mfxBufferAllocator *allocator), (session, allocator)) -FUNCTION(mfxStatus, MFXVideoCORE_SetFrameAllocator, (mfxSession session, mfxFrameAllocator *allocator), (session, allocator)) -FUNCTION(mfxStatus, MFXVideoCORE_SetHandle, (mfxSession session, mfxHandleType type, mfxHDL hdl), (session, type, hdl)) -FUNCTION(mfxStatus, MFXVideoCORE_GetHandle, (mfxSession session, mfxHandleType type, mfxHDL *hdl), (session, type, hdl)) - -FUNCTION(mfxStatus, MFXVideoCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait)) - -// ENCODE interface functions -FUNCTION(mfxStatus, MFXVideoENCODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoENCODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoENCODE_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoENCODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoENCODE_GetEncodeStat, (mfxSession session, mfxEncodeStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoENCODE_EncodeFrameAsync, (mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp), (session, ctrl, surface, bs, syncp)) - -// DECODE interface functions -FUNCTION(mfxStatus, MFXVideoDECODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxVideoParam *par), (session, bs, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoDECODE_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoDECODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoDECODE_GetDecodeStat, (mfxSession session, mfxDecodeStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoDECODE_SetSkipMode, (mfxSession session, mfxSkipMode mode), (session, mode)) -FUNCTION(mfxStatus, MFXVideoDECODE_GetPayload, (mfxSession session, mfxU64 *ts, mfxPayload *payload), (session, ts, payload)) -FUNCTION(mfxStatus, MFXVideoDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp), (session, bs, surface_work, surface_out, syncp)) - -// VPP interface functions -FUNCTION(mfxStatus, MFXVideoVPP_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoVPP_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoVPP_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_Close, (mfxSession session), (session)) - -FUNCTION(mfxStatus, MFXVideoVPP_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoVPP_GetVPPStat, (mfxSession session, mfxVPPStat *stat), (session, stat)) -FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsync, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp), (session, in, out, aux, syncp)) - -#undef API_VERSION - -// -// API version 1.1 functions -// - -#define API_VERSION {{1, 1}} - -FUNCTION(mfxStatus, MFXVideoUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par)) -FUNCTION(mfxStatus, MFXVideoUSER_Unregister, (mfxSession session, mfxU32 type), (session, type)) -FUNCTION(mfxStatus, MFXVideoUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp)) - -#undef API_VERSION - -// -// API version 1.10 functions -// - -#define API_VERSION {{10, 1}} - -FUNCTION(mfxStatus, MFXVideoENC_Query,(mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session,in,out)) -FUNCTION(mfxStatus, MFXVideoENC_QueryIOSurf,(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session,par,request)) -FUNCTION(mfxStatus, MFXVideoENC_Init,(mfxSession session, mfxVideoParam *par), (session,par)) -FUNCTION(mfxStatus, MFXVideoENC_Reset,(mfxSession session, mfxVideoParam *par), (session,par)) -FUNCTION(mfxStatus, MFXVideoENC_Close,(mfxSession session),(session)) -FUNCTION(mfxStatus, MFXVideoENC_ProcessFrameAsync,(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp),(session,in,out,syncp)) - -FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsyncEx, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *work, mfxFrameSurface1 **out, mfxSyncPoint *syncp), (session, in, work, out, syncp)) - -#undef API_VERSION - -#define API_VERSION {{13, 1}} - -FUNCTION(mfxStatus, MFXVideoPAK_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXVideoPAK_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXVideoPAK_Init, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_Reset, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXVideoPAK_ProcessFrameAsync, (mfxSession session, mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp), (session, in, out, syncp)) - -#undef API_VERSION - -#define API_VERSION {{14, 1}} - -// FUNCTION(mfxStatus, MFXInitEx, (mfxInitParam par, mfxSession session), (par, session)) -FUNCTION(mfxStatus, MFXDoWork, (mfxSession session), (session)) - -#undef API_VERSION - -#define API_VERSION {{19, 1}} - -FUNCTION(mfxStatus, MFXVideoENC_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoPAK_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par)) -FUNCTION(mfxStatus, MFXVideoCORE_QueryPlatform, (mfxSession session, mfxPlatform* platform), (session, platform)) -FUNCTION(mfxStatus, MFXVideoUSER_GetPlugin, (mfxSession session, mfxU32 type, mfxPlugin *par), (session, type, par)) - -#undef API_VERSION \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_library_iterator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_library_iterator.h deleted file mode 100644 index 21210965..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_library_iterator.h +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_LIBRARY_ITERATOR_H) -#define __MFX_LIBRARY_ITERATOR_H - - -#include - -#if !defined(MEDIASDK_UWP_DISPATCHER) -#include "mfx_win_reg_key.h" -#endif - -#include "mfx_driver_store_loader.h" - -#include "mfx_dispatcher.h" - -namespace MFX -{ - -// declare desired storage ID -enum -{ -#if defined (MFX_TRACER_WA_FOR_DS) - MFX_UNKNOWN_KEY = -1, - MFX_TRACER = 0, - MFX_DRIVER_STORE = 1, - MFX_CURRENT_USER_KEY = 2, - MFX_LOCAL_MACHINE_KEY = 3, - MFX_APP_FOLDER = 4, - MFX_PATH_MSDK_FOLDER = 5, - MFX_STORAGE_ID_FIRST = MFX_TRACER, - MFX_STORAGE_ID_LAST = MFX_PATH_MSDK_FOLDER -#else - MFX_UNKNOWN_KEY = -1, - MFX_DRIVER_STORE = 0, - MFX_CURRENT_USER_KEY = 1, - MFX_LOCAL_MACHINE_KEY = 2, - MFX_APP_FOLDER = 3, - MFX_PATH_MSDK_FOLDER = 4, - MFX_STORAGE_ID_FIRST = MFX_DRIVER_STORE, - MFX_STORAGE_ID_LAST = MFX_PATH_MSDK_FOLDER -#endif -}; - -// Try to initialize using given implementation type. Select appropriate type automatically in case of MFX_IMPL_VIA_ANY. -// Params: adapterNum - in, pImplInterface - in/out, pVendorID - out, pDeviceID - out -mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterface, mfxU32 *pVendorID, mfxU32 *pDeviceID); - -const mfxU32 msdk_disp_path_len = 1024; - -class MFXLibraryIterator -{ -public: - // Default constructor - MFXLibraryIterator(void); - // Destructor - ~MFXLibraryIterator(void); - - // Initialize the iterator - mfxStatus Init(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID); - - // Get the next library path - mfxStatus SelectDLLVersion(wchar_t *pPath, size_t pathSize, - eMfxImplType *pImplType, mfxVersion minVersion); - - // Return interface type on which Intel adapter was found (if any): D3D9 or D3D11 - mfxIMPL GetImplementationType(); - - // Retrun registry subkey name on which dll was selected after sucesfull call to selectDllVesion - bool GetSubKeyName(wchar_t *subKeyName, size_t length) const; - - int GetStorageID() const { return m_StorageID; } -protected: - - // Release the iterator - void Release(void); - - // Initialize the registry iterator - mfxStatus InitRegistry(int storageID); -#if defined(MFX_TRACER_WA_FOR_DS) - // Initialize the registry iterator for searching for tracer - mfxStatus InitRegistryTracer(); -#endif - // Initialize the app/module folder iterator - mfxStatus InitFolder(eMfxImplType implType, const wchar_t * path, const int storageID); - - - eMfxImplType m_implType; // Required library implementation - mfxIMPL m_implInterface; // Required interface (D3D9, D3D11) - - mfxU32 m_vendorID; // (mfxU32) property of used graphic card - mfxU32 m_deviceID; // (mfxU32) property of used graphic card - bool m_bIsSubKeyValid; - wchar_t m_SubKeyName[MFX_MAX_REGISTRY_KEY_NAME]; // registry subkey for selected module loaded - int m_StorageID; - -#if !defined(MEDIASDK_UWP_DISPATCHER) - WinRegKey m_baseRegKey; // (WinRegKey) main registry key -#endif - - mfxU32 m_lastLibIndex; // (mfxU32) index of previously returned library - mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library - - wchar_t m_path[msdk_disp_path_len]; - - DriverStoreLoader m_driverStoreLoader; // for loading MediaSDK from DriverStore - -private: - // unimplemented by intent to make this class non-copyable - MFXLibraryIterator(const MFXLibraryIterator &); - void operator=(const MFXLibraryIterator &); -}; - -} // namespace MFX - -#endif // __MFX_LIBRARY_ITERATOR_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_dll.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_dll.h deleted file mode 100644 index 7348af71..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_dll.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(__MFX_LOAD_DLL_H) -#define __MFX_LOAD_DLL_H - -#include "mfx_dispatcher.h" - -namespace MFX -{ - - - // - // declare DLL loading routines - // - - mfxStatus mfx_get_rt_dll_name(wchar_t *pPath, size_t pathSize); - mfxStatus mfx_get_default_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType); - mfxStatus mfx_get_default_plugin_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType); -#if defined(MEDIASDK_UWP_DISPATCHER) - mfxStatus mfx_get_default_intel_gfx_api_dll_name(wchar_t *pPath, size_t pathSize); -#endif - - mfxStatus mfx_get_default_audio_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType); - - - mfxModuleHandle mfx_dll_load(const wchar_t *file_name); - //increments reference counter - mfxModuleHandle mfx_get_dll_handle(const wchar_t *file_name); - mfxFunctionPointer mfx_dll_get_addr(mfxModuleHandle handle, const char *func_name); - bool mfx_dll_free(mfxModuleHandle handle); - -} // namespace MFX - -#endif // __MFX_LOAD_DLL_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_plugin.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_plugin.h deleted file mode 100644 index e36ac7f4..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_load_plugin.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once -#include "mfxplugin.h" -#include "mfx_dispatcher_defs.h" -#include "mfx_plugin_hive.h" - -namespace MFX -{ - typedef mfxStatus (MFX_CDECL *CreatePluginPtr_t)(mfxPluginUID uid, mfxPlugin* plugin); - - class PluginModule - { - mfxModuleHandle mHmodule; - CreatePluginPtr_t mCreatePluginPtr; - wchar_t mPath[MAX_PLUGIN_PATH]; - - public: - PluginModule(); - PluginModule(const wchar_t * path); - PluginModule(const PluginModule & that) ; - PluginModule & operator = (const PluginModule & that); - bool Create(mfxPluginUID guid, mfxPlugin&); - ~PluginModule(void); - - private: - void Tidy(); - }; - - class MFXPluginFactory { - struct FactoryRecord { - mfxPluginParam plgParams; - PluginModule module; - mfxPlugin plugin; - FactoryRecord () - : plgParams(), plugin() - {} - FactoryRecord(const mfxPluginParam &plgParams, - PluginModule &module, - mfxPlugin plugin) - : plgParams(plgParams) - , module(module) - , plugin(plugin) { - } - }; - MFXVector mPlugins; - mfxU32 nPlugins; - mfxSession mSession; - public: - MFXPluginFactory(mfxSession session); - void Close(); - mfxStatus Create(const PluginDescriptionRecord &); - bool Destroy(const mfxPluginUID &); - - ~MFXPluginFactory(); - protected: - void DestroyPlugin( FactoryRecord & ); - static bool RunVerification( const mfxPlugin & plg, const PluginDescriptionRecord &dsc, mfxPluginParam &pluginParams ); - static bool VerifyEncoder( const mfxVideoCodecPlugin &videoCodec ); - static bool VerifyAudioEncoder( const mfxAudioCodecPlugin &audioCodec ); - static bool VerifyEnc( const mfxVideoCodecPlugin &videoEnc ); - static bool VerifyVpp( const mfxVideoCodecPlugin &videoCodec ); - static bool VerifyDecoder( const mfxVideoCodecPlugin &videoCodec ); - static bool VerifyAudioDecoder( const mfxAudioCodecPlugin &audioCodec ); - static bool VerifyCodecCommon( const mfxVideoCodecPlugin & Video ); - }; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_plugin_hive.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_plugin_hive.h deleted file mode 100644 index 9a304c9e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_plugin_hive.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once - -#include "mfx_dispatcher_defs.h" -#include "mfxplugin.h" -#include "mfx_win_reg_key.h" -#include "mfx_vector.h" -#include -#include -#include - -struct MFX_DISP_HANDLE; - -namespace MFX { - - inline bool operator == (const mfxPluginUID &lhs, const mfxPluginUID & rhs) - { - return !memcmp(lhs.Data, rhs.Data, sizeof(mfxPluginUID)); - } - - inline bool operator != (const mfxPluginUID &lhs, const mfxPluginUID & rhs) - { - return !(lhs == rhs); - } -#ifdef _WIN32 - //warning C4351: new behavior: elements of array 'MFX::PluginDescriptionRecord::sName' will be default initialized - #pragma warning (disable: 4351) -#endif - class PluginDescriptionRecord : public mfxPluginParam - { - public: - wchar_t sPath[MAX_PLUGIN_PATH]; - char sName[MAX_PLUGIN_NAME]; - //used for FS plugins that has poor description - bool onlyVersionRegistered; - bool Default; - PluginDescriptionRecord() - : mfxPluginParam() - , sPath() - , sName() - , onlyVersionRegistered() - , Default() - { - } - }; - - typedef MFXVector MFXPluginStorage; - - class MFXPluginStorageBase : public MFXPluginStorage - { - protected: - mfxVersion mCurrentAPIVersion; - protected: - MFXPluginStorageBase(mfxVersion currentAPIVersion) - : mCurrentAPIVersion(currentAPIVersion) - { - } - void ConvertAPIVersion( mfxU32 APIVersion, PluginDescriptionRecord &descriptionRecord) const - { - descriptionRecord.APIVersion.Minor = static_cast (APIVersion & 0x0ff); - descriptionRecord.APIVersion.Major = static_cast (APIVersion >> 8); - } - }; - -#if !defined(MEDIASDK_UWP_DISPATCHER) - - //populated from registry - class MFXPluginsInHive : public MFXPluginStorageBase - { - public: - MFXPluginsInHive(int mfxStorageID, const wchar_t *msdkLibSubKey, mfxVersion currentAPIVersion); - }; - - //plugins are loaded from FS close to executable - class MFXPluginsInFS : public MFXPluginStorageBase - { - bool mIsVersionParsed; - bool mIsAPIVersionParsed; - public: - MFXPluginsInFS(mfxVersion currentAPIVersion); - private: - bool ParseFile(FILE * f, PluginDescriptionRecord & des); - bool ParseKVPair( wchar_t *key, wchar_t * value, PluginDescriptionRecord & des); - }; - -#endif //#if !defined(MEDIASDK_UWP_DISPATCHER) - - //plugins are loaded from FS close to Runtime library - class MFXDefaultPlugins : public MFXPluginStorageBase - { - public: - MFXDefaultPlugins(mfxVersion currentAPIVersion, MFX_DISP_HANDLE * hdl, int implType); - private: - }; - -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_vector.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_vector.h deleted file mode 100644 index dbe98448..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfx_vector.h +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once -#include "mfxstructures.h" -#include - -namespace MFX -{ - template - class iterator_tmpl - { - template friend class MFXVector; - mfxU32 mIndex; - T* mRecords; - iterator_tmpl(mfxU32 index , T * records) - : mIndex (index) - , mRecords(records) - {} - public: - iterator_tmpl() - : mIndex () - , mRecords() - {} - bool operator ==(const iterator_tmpl & that )const - { - return mIndex == that.mIndex; - } - bool operator !=(const iterator_tmpl & that )const - { - return mIndex != that.mIndex; - } - mfxU32 operator - (const iterator_tmpl &that) const - { - return mIndex - that.mIndex; - } - iterator_tmpl & operator ++() - { - mIndex++; - return * this; - } - iterator_tmpl & operator ++(int) - { - mIndex++; - return * this; - } - T & operator *() - { - return mRecords[mIndex]; - } - T * operator ->() - { - return mRecords + mIndex; - } - }; - - class MFXVectorRangeError : public std::exception - { - }; - - template - class MFXVector - { - T* mRecords; - mfxU32 mNrecords; - public: - MFXVector() - : mRecords() - , mNrecords() - {} - MFXVector(const MFXVector & rhs) - : mRecords() - , mNrecords() - { - insert(end(), rhs.begin(), rhs.end()); - } - MFXVector & operator = (const MFXVector & rhs) - { - if (this != &rhs) - { - clear(); - insert(end(), rhs.begin(), rhs.end()); - } - return *this; - } - virtual ~MFXVector () - { - clear(); - } - typedef iterator_tmpl iterator; - - iterator begin() const - { - return iterator(0u, mRecords); - } - iterator end() const - { - return iterator(mNrecords, mRecords); - } - void insert(iterator where, iterator beg_iter, iterator end_iter) - { - mfxU32 elementsToInsert = (end_iter - beg_iter); - if (!elementsToInsert) - { - return; - } - if (where.mIndex > mNrecords) - { - throw MFXVectorRangeError(); - } - - T *newRecords = new T[mNrecords + elementsToInsert](); - mfxU32 i = 0; - - // save left - for (; i < where.mIndex; i++) - { - newRecords[i] = mRecords[i]; - } - // insert - for (; beg_iter != end_iter; beg_iter++, i++) - { - newRecords[i] = *beg_iter; - } - - //save right - for (; i < mNrecords + elementsToInsert; i++) - { - newRecords[i] = mRecords[i - elementsToInsert]; - } - - delete [] mRecords; - - mRecords = newRecords; - mNrecords = i; - } - T& operator [] (mfxU32 idx) - { - return mRecords[idx]; - } - void push_back(const T& obj) - { - T *newRecords = new T[mNrecords + 1](); - mfxU32 i = 0; - for (; i = mNrecords) - { - throw MFXVectorRangeError(); - } - mNrecords--; - mfxU32 i = at.mIndex; - for (; i != mNrecords; i++) - { - mRecords[i] = mRecords[i+1]; - } - //destroy last element - mRecords[i] = T(); - } - void resize(mfxU32 nSize) - { - T * newRecords = new T[nSize](); - for (mfxU32 i = 0; i -#include "mfxplugin.h" -#include "mfx_dispatcher_log.h" - -#if !defined(MEDIASDK_UWP_DISPATCHER) -namespace MFX { - -template struct RegKey{}; -template<> struct RegKey{enum {type = REG_DWORD};}; -template<> struct RegKey{enum {type = REG_DWORD};}; -template<> struct RegKey{enum {type = REG_BINARY};}; -template<> struct RegKey{enum {type = REG_DWORD};}; -template<> struct RegKey{enum {type = REG_SZ};}; -template<> struct RegKey{enum {type = REG_SZ};}; - - -class WinRegKey -{ -public: - // Default constructor - WinRegKey(void); - // Destructor - ~WinRegKey(void); - - // Open a registry key - bool Open(HKEY hRootKey, const wchar_t *pSubKey, REGSAM samDesired); - bool Open(WinRegKey &rootKey, const wchar_t *pSubKey, REGSAM samDesired); - - // Query value - bool QueryInfo(LPDWORD lpcSubkeys); - - bool QueryValueSize(const wchar_t *pValueName, DWORD type, LPDWORD pcbData); - bool Query(const wchar_t *pValueName, DWORD type, LPBYTE pData, LPDWORD pcbData); - - bool Query(const wchar_t *pValueName, wchar_t *pData, mfxU32 &nData) { - DWORD dw = (DWORD)nData; - if (!Query(pValueName, RegKey::type, (LPBYTE)pData, &dw)){ - return false; - } - nData = dw; - return true; - } - - // Enumerate value names - bool EnumValue(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName, LPDWORD pType); - bool EnumKey(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName); - -protected: - - // Release the object - void Release(void); - - HKEY m_hKey; // (HKEY) handle to the opened key - -private: - // unimplemented by intent to make this class non-copyable - WinRegKey(const WinRegKey &); - void operator=(const WinRegKey &); - -}; - - -template -inline bool QueryKey(WinRegKey & key, const wchar_t *pValueName, T &data ) { - DWORD size = sizeof(data); - return key.Query(pValueName, RegKey::type, (LPBYTE) &data, &size); -} - -template<> -inline bool QueryKey(WinRegKey & key, const wchar_t *pValueName, bool &data ) { - mfxU32 value = 0; - bool bRes = QueryKey(key, pValueName, value); - data = (1 == value); - return bRes; -} - - -} // namespace MFX -#endif // #if !defined(MEDIASDK_UWP_DISPATCHER) - -#endif // __MFX_WIN_REG_KEY_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfxaudio_exposed_functions_list.h b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfxaudio_exposed_functions_list.h deleted file mode 100644 index 44a046be..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/include/mfxaudio_exposed_functions_list.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// -// WARNING: -// this file doesn't contain an include guard by intension. -// The file may be included into a source file many times. -// That is why this header doesn't contain any include directive. -// Please, do no try to fix it. -// - -// -// API version 1.8 functions -// - -// Minor value should precedes the major value -#define API_VERSION {{8, 1}} - -// CORE interface functions -FUNCTION(mfxStatus, MFXAudioCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait)) - -// ENCODE interface functions -FUNCTION(mfxStatus, MFXAudioENCODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXAudioENCODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXAudioENCODE_Init, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXAudioENCODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioENCODE_EncodeFrameAsync, (mfxSession session, mfxAudioFrame *frame, mfxBitstream *buffer_out, mfxSyncPoint *syncp), (session, frame, buffer_out, syncp)) - -// DECODE interface functions -FUNCTION(mfxStatus, MFXAudioDECODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out)) -FUNCTION(mfxStatus, MFXAudioDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxAudioParam *par), (session, bs, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Init, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_Close, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXAudioDECODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request)) -FUNCTION(mfxStatus, MFXAudioDECODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par)) -FUNCTION(mfxStatus, MFXAudioDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxAudioFrame *frame_out, mfxSyncPoint *syncp), (session, bs, frame_out, syncp)) - -#undef API_VERSION - -// -// API version 1.9 functions -// - -#define API_VERSION {{9, 1}} - -FUNCTION(mfxStatus, MFXAudioUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par)) -FUNCTION(mfxStatus, MFXAudioUSER_Unregister, (mfxSession session, mfxU32 type), (session, type)) -FUNCTION(mfxStatus, MFXAudioUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp)) - - -#undef API_VERSION diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj deleted file mode 100644 index df723632..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj +++ /dev/null @@ -1,179 +0,0 @@ - - - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - Win32 - - - Release - x64 - - - - {336AEFC3-987C-40AA-9678-E8BF1EC9C26F} - libmfx_uwp - Win32Proj - libmfx_uwp - 10.0.17134.0 - 10.0.18362.0 - Windows Store - true - en-US - 10.0 - - - - false - StaticLibrary - Unicode - v141 - - - StaticLibrary - Unicode - v141 - - - - $(ProjectName) - ..\..\..\..\build\win_$(Platform)\$(Configuration)\lib\ - $(OutDir)..\objs\$(Configuration)\$(ProjectName)\ - $(MINIDDK_ROOT)\Include\um;$(MINIDDK_ROOT)\Include\shared;$(IncludePath) - $(MINIDDK_ROOT)\Lib\win8\um\x86;$(LibraryPath) - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - AllRules.ruleset - - - - - - - /bigobj %(AdditionalOptions) - 4453;28204 - Level4 - false - ProgramDatabase - Async - _LIB;WINAPI_FAMILY=WINAPI_FAMILY_APP;MEDIASDK_UWP_DISPATCHER;MFX_D3D11_ENABLED;_UNICODE;UNICODE;MFX_VA;_ALLOW_MSC_VER_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_RUNTIME_LIBRARY_MISMATCH;%(PreprocessorDefinitions);WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP - NotUsing - include;..\..\include;%(AdditionalIncludeDirectories) - false - - - true - true - false - - - - - - - MultiThreadedDebugDLL - Disabled - false - EnableFastChecks - _DEBUG;%(PreprocessorDefinitions) - false - $(OutDir)$(TargetName).pdb - Guard - - - - - MultiThreadedDLL - MaxSpeed - AnySuitable - true - Speed - NDEBUG;%(PreprocessorDefinitions) - true - $(OutDir)$(TargetName).pdb - Guard - - - true - true - - - - - $(MfxBuildDir)..\build\win_$(Platform)\lib\ - true - - - true - - - - - - - WIN32;%(PreprocessorDefinitions) - - - - - X64 - - - WIN64;%(PreprocessorDefinitions) - - - - - MEDIASDK_ARM_LOADER;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj.filters b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj.filters deleted file mode 100644 index 6a430039..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_uwp.vcxproj.filters +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - {a76fc74b-469b-40f4-888b-abe6d364d3e2} - - - \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj deleted file mode 100644 index a58b40bc..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj +++ /dev/null @@ -1,248 +0,0 @@ - - - - - MultiThreadedDebug - Disabled - true - EnableFastChecks - - - - - MultiThreaded - MaxSpeed - AnySuitable - true - true - Speed - - - true - true - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {A9F7AEFB-DC6C-49E8-8E71-5351ABDCE627} - libmfx - Win32Proj - libmfx_vs2015 - 10.0.17134.0 - - - - false - StaticLibrary - Unicode - v141 - false - - - StaticLibrary - v141 - - - false - StaticLibrary - Unicode - v141 - false - - - StaticLibrary - v141 - - - Unicode - v141 - false - - - Unicode - v141 - false - - - - ..\..\..\..\build\win_$(Platform)\$(Configuration)\lib\ - $(OutDir)..\objs\$(ProjectName)\ - $(MINIDDK_ROOT)\Include\um;$(MINIDDK_ROOT)\Include\shared;$(IncludePath) - $(MINIDDK_ROOT)\Lib\win8\um\x86;$(LibraryPath) - - - $(ProjectName) - - - $(ProjectName) - - - - $(CPPFLAGS) %(AdditionalOptions) - Level4 - false - ProgramDatabase - Async - MFX_D3D11_ENABLED;_UNICODE;UNICODE;%(PreprocessorDefinitions) - - - true - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(ProjectName) - $(ProjectName) - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - include;..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;MFX_VA;MFX_DEPRECATED_OFF;_ALLOW_MSC_VER_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_RUNTIME_LIBRARY_MISMATCH;%(PreprocessorDefinitions) - Async - MultiThreadedDebug - Level4 - ProgramDatabase - false - $(OutDir)$(TargetName).pdb - Guard - - - - - - X64 - - - Disabled - include;..\..\include;%(AdditionalIncludeDirectories) - WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level4 - ProgramDatabase - $(OutDir)$(TargetName).pdb - Guard - - - - - - AnySuitable - true - Speed - include;..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;MFX_VA;MFX_DEPRECATED_OFF;_ALLOW_MSC_VER_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_RUNTIME_LIBRARY_MISMATCH;%(PreprocessorDefinitions) - Async - MultiThreaded - true - Level4 - ProgramDatabase - true - $(OutDir)$(TargetName).pdb - Guard - - - - - - X64 - - - AnySuitable - true - Speed - include;..\..\include;%(AdditionalIncludeDirectories) - WIN64;NDEBUG;_LIB;_ALLOW_MSC_VER_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_RUNTIME_LIBRARY_MISMATCH;%(PreprocessorDefinitions) - Async - MultiThreaded - true - Level4 - ProgramDatabase - true - $(OutDir)$(TargetName).pdb - Guard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj.user b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj.user deleted file mode 100644 index 88a55094..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/libmfx_vs2015.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/mfx_prefixed_dispatch_trace_lib.vcxproj b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/mfx_prefixed_dispatch_trace_lib.vcxproj deleted file mode 100644 index ef0ad31d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/mfx_prefixed_dispatch_trace_lib.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - mfx_dispatch_trace_lib - {45806EE4-0256-4B1D-A730-EB70966E070A} - mfx_dispatch_trace - Win32Proj - 10.0.18362.0 - - - - StaticLibrary - MultiByte - true - v141 - - - StaticLibrary - MultiByte - v141 - - - StaticLibrary - MultiByte - true - v141 - - - StaticLibrary - MultiByte - v141 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\win_$(Platform)\lib\ - $(OutDir)..\objs\$(Platform)\$(Configuration)\$(ProjectName)\ - ..\..\..\..\build\win_$(Platform)\lib\ - $(OutDir)..\objs\$(Platform)\$(Configuration)\$(ProjectName)\ - ..\..\..\..\build\win_$(Platform)\lib\ - $(OutDir)..\objs\$(Platform)\$(Configuration)\$(ProjectName)\ - ..\..\..\..\build\win_$(Platform)\lib\ - $(OutDir)..\objs\$(Platform)\$(Configuration)\$(ProjectName)\ - $(ProjectName)_mbcs - $(ProjectName)_mbcs - - - $(ProjectName)_d_mbcs - - - $(ProjectName)_d_mbcs - - - - Disabled - include;../shared/include;../../include;$(MfxIppIncludeDir);../mfx_lib/shared/include;../shared/umc/core/umc/include;../shared/umc/core/vm/include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;MFX_DISPATCHER_LOG;DXVA2DEVICE_LOG;MFX_DISPATCHER_EXPOSED_PREFIX;MFX_VA;NOMINMAX;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebug - Level4 - ProgramDatabase - - - $(OutDir)\$(TargetName)$(TargetExt) - - - - - X64 - - - Disabled - include;../shared/include;../../include;$(MfxIppIncludeDir);../mfx_lib/shared/include;../shared/umc/core/umc/include;../shared/umc/core/vm/include;%(AdditionalIncludeDirectories) - WIN64;_DEBUG;_CONSOLE;MFX_DISPATCHER_LOG;DXVA2DEVICE_LOG;MFX_DISPATCHER_EXPOSED_PREFIX;MFX_VA;NOMINMAX;%(PreprocessorDefinitions) - Async - EnableFastChecks - MultiThreadedDebug - Level4 - ProgramDatabase - - - $(OutDir)\$(TargetName)$(TargetExt) - - - - - AnySuitable - true - Speed - include;../shared/include;../../include;$(MfxIppIncludeDir);../mfx_lib/shared/include;../shared/umc/core/umc/include;../shared/umc/core/vm/include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;MFX_DISPATCHER_LOG;DXVA2DEVICE_LOG;MFX_DISPATCHER_EXPOSED_PREFIX;MFX_VA;NOMINMAX;%(PreprocessorDefinitions) - Async - Default - MultiThreaded - false - Level4 - - - - - - $(OutDir)\$(TargetName)$(TargetExt) - - - - - X64 - - - AnySuitable - true - Speed - include;../shared/include;../../include;$(MfxIppIncludeDir);../mfx_lib/shared/include;../shared/umc/core/umc/include;../shared/umc/core/vm/include;%(AdditionalIncludeDirectories) - WIN64;NDEBUG;_CONSOLE;MFX_DISPATCHER_LOG;DXVA2DEVICE_LOG;MFX_DISPATCHER_EXPOSED_PREFIX;MFX_VA;NOMINMAX;%(PreprocessorDefinitions) - Async - Default - MultiThreaded - false - Level4 - - - - - - $(OutDir)\$(TargetName)$(TargetExt) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_critical_section.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_critical_section.cpp deleted file mode 100644 index 3920f423..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_critical_section.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_critical_section.h" - -#include -// SDK re-declares the following functions with different call declarator. -// We don't need them. Just redefine them to nothing. -#define _interlockedbittestandset fake_set -#define _interlockedbittestandreset fake_reset -#define _interlockedbittestandset64 fake_set64 -#define _interlockedbittestandreset64 fake_reset64 -#include - -#define MFX_WAIT() SwitchToThread() - -// static section of the file -namespace -{ - -enum -{ - MFX_SC_IS_FREE = 0, - MFX_SC_IS_TAKEN = 1 -}; - -} // namespace - -namespace MFX -{ - -mfxU32 mfxInterlockedCas32(mfxCriticalSection *pCSection, mfxU32 value_to_exchange, mfxU32 value_to_compare) -{ - return _InterlockedCompareExchange(pCSection, value_to_exchange, value_to_compare); -} - -mfxU32 mfxInterlockedXchg32(mfxCriticalSection *pCSection, mfxU32 value) -{ - return _InterlockedExchange(pCSection, value); -} - -void mfxEnterCriticalSection(mfxCriticalSection *pCSection) -{ - while (MFX_SC_IS_TAKEN == mfxInterlockedCas32(pCSection, - MFX_SC_IS_TAKEN, - MFX_SC_IS_FREE)) - { - MFX_WAIT(); - } -} // void mfxEnterCriticalSection(mfxCriticalSection *pCSection) - -void mfxLeaveCriticalSection(mfxCriticalSection *pCSection) -{ - mfxInterlockedXchg32(pCSection, MFX_SC_IS_FREE); -} // void mfxLeaveCriticalSection(mfxCriticalSection *pCSection) - -} // namespace MFX diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher.cpp deleted file mode 100644 index d3b9c5a1..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher.cpp +++ /dev/null @@ -1,661 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_dispatcher.h" -#include "mfx_dispatcher_log.h" -#include "mfx_load_dll.h" - -#include - -#include -#include - -#include "mfx_dxva2_device.h" -#include "mfxvideo++.h" -#include "mfx_vector.h" -#include "mfxadapter.h" -#include - -#pragma warning(disable:4355) - -MFX_DISP_HANDLE::MFX_DISP_HANDLE(const mfxVersion requiredVersion) : - _mfxSession() - ,apiVersion(requiredVersion) - ,pluginHive() - ,pluginFactory((mfxSession)this) -{ - actualApiVersion.Version = 0; - implType = MFX_LIB_SOFTWARE; - impl = MFX_IMPL_SOFTWARE; - loadStatus = MFX_ERR_NOT_FOUND; - dispVersion.Major = MFX_DISPATCHER_VERSION_MAJOR; - dispVersion.Minor = MFX_DISPATCHER_VERSION_MINOR; - storageID = 0; - implInterface = MFX_IMPL_HARDWARE_ANY; - - hModule = (mfxModuleHandle) 0; - -} // MFX_DISP_HANDLE::MFX_DISP_HANDLE(const mfxVersion requiredVersion) - -MFX_DISP_HANDLE::~MFX_DISP_HANDLE(void) -{ - Close(); - -} // MFX_DISP_HANDLE::~MFX_DISP_HANDLE(void) - -mfxStatus MFX_DISP_HANDLE::Close(void) -{ - mfxStatus mfxRes; - - mfxRes = UnLoadSelectedDLL(); - - // need to reset dispatcher state after unloading dll - if (MFX_ERR_NONE == mfxRes) - { - implType = MFX_LIB_SOFTWARE; - impl = MFX_IMPL_SOFTWARE; - loadStatus = MFX_ERR_NOT_FOUND; - dispVersion.Major = MFX_DISPATCHER_VERSION_MAJOR; - dispVersion.Minor = MFX_DISPATCHER_VERSION_MINOR; - *static_cast<_mfxSession*>(this) = _mfxSession(); - hModule = (mfxModuleHandle) 0; - } - - return mfxRes; - -} // mfxStatus MFX_DISP_HANDLE::Close(void) - -mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const wchar_t *pPath, eMfxImplType reqImplType, - mfxIMPL reqImpl, mfxIMPL reqImplInterface, mfxInitParam &par) -{ - mfxStatus mfxRes = MFX_ERR_NONE; - - // check error(s) - if ((MFX_LIB_SOFTWARE != reqImplType) && - (MFX_LIB_HARDWARE != reqImplType)) - { - DISPATCHER_LOG_ERROR((("implType == %s, should be either MFX_LIB_SOFTWARE ot MFX_LIB_HARDWARE\n"), DispatcherLog_GetMFXImplString(reqImplType).c_str())); - loadStatus = MFX_ERR_ABORTED; - return loadStatus; - } - // only exact types of implementation is allowed - if (!(reqImpl & MFX_IMPL_AUDIO) && -#if (MFX_VERSION >= MFX_VERSION_NEXT) - !(reqImpl & MFX_IMPL_EXTERNAL_THREADING) && -#endif - (MFX_IMPL_SOFTWARE != reqImpl) && - (MFX_IMPL_HARDWARE != reqImpl) && - (MFX_IMPL_HARDWARE2 != reqImpl) && - (MFX_IMPL_HARDWARE3 != reqImpl) && - (MFX_IMPL_HARDWARE4 != reqImpl)) - { - DISPATCHER_LOG_ERROR((("invalid implementation impl == %s\n"), DispatcherLog_GetMFXImplString(impl).c_str())); - loadStatus = MFX_ERR_ABORTED; - return loadStatus; - } - // only mfxExtThreadsParam is allowed - if (par.NumExtParam) - { - if ((par.NumExtParam > 1) || !par.ExtParam) - { - loadStatus = MFX_ERR_ABORTED; - return loadStatus; - } - if ((par.ExtParam[0]->BufferId != MFX_EXTBUFF_THREADS_PARAM) || - (par.ExtParam[0]->BufferSz != sizeof(mfxExtThreadsParam))) - { - loadStatus = MFX_ERR_ABORTED; - return loadStatus; - } - } - - // close the handle before initialization - Close(); - - // save the library's type - this->implType = reqImplType; - this->impl = reqImpl; - this->implInterface = reqImplInterface; - - { - assert(hModule == (mfxModuleHandle)0); - DISPATCHER_LOG_BLOCK(("invoking LoadLibrary(%S)\n", pPath)); - - // load the DLL into the memory - hModule = MFX::mfx_dll_load(pPath); - - if (hModule) - { - int i; - - DISPATCHER_LOG_OPERATION({ - wchar_t modulePath[1024]; - GetModuleFileNameW((HMODULE)hModule, modulePath, sizeof(modulePath)/sizeof(modulePath[0])); - DISPATCHER_LOG_INFO((("loaded module %S\n"), modulePath)) - }); - - if (impl & MFX_IMPL_AUDIO) - { - // load audio functions: pointers to exposed functions - for (i = 0; i < eAudioFuncTotal; i += 1) - { - // construct correct name of the function - remove "_a" postfix - - mfxFunctionPointer pProc = (mfxFunctionPointer) MFX::mfx_dll_get_addr(hModule, APIAudioFunc[i].pName); - if (pProc) - { - // function exists in the library, - // save the pointer. - callAudioTable[i] = pProc; - } - else - { - // The library doesn't contain the function - DISPATCHER_LOG_WRN((("Can't find API function \"%s\"\n"), APIAudioFunc[i].pName)); - if (apiVersion.Version >= APIAudioFunc[i].apiVersion.Version) - { - DISPATCHER_LOG_ERROR((("\"%s\" is required for API %u.%u\n"), APIAudioFunc[i].pName, apiVersion.Major, apiVersion.Minor)); - mfxRes = MFX_ERR_UNSUPPORTED; - break; - } - } - } - } - else - { - // load video functions: pointers to exposed functions - for (i = 0; i < eVideoFuncTotal; i += 1) - { - mfxFunctionPointer pProc = (mfxFunctionPointer) MFX::mfx_dll_get_addr(hModule, APIFunc[i].pName); - if (pProc) - { - // function exists in the library, - // save the pointer. - callTable[i] = pProc; - } - else - { - // The library doesn't contain the function - DISPATCHER_LOG_WRN((("Can't find API function \"%s\"\n"), APIFunc[i].pName)); - if (apiVersion.Version >= APIFunc[i].apiVersion.Version) - { - DISPATCHER_LOG_ERROR((("\"%s\" is required for API %u.%u\n"), APIFunc[i].pName, apiVersion.Major, apiVersion.Minor)); - mfxRes = MFX_ERR_UNSUPPORTED; - break; - } - } - } - } - } - else - { - DISPATCHER_LOG_WRN((("can't find DLL: GetLastErr()=0x%x\n"), GetLastError())) - mfxRes = MFX_ERR_UNSUPPORTED; - } - } - - // initialize the loaded DLL - if (MFX_ERR_NONE == mfxRes) - { - mfxVersion version(apiVersion); - - /* check whether it is audio session or video */ - mfxFunctionPointer *actualTable = (impl & MFX_IMPL_AUDIO) ? callAudioTable : callTable; - - // Call old-style MFXInit init for older libraries and audio library - bool callOldInit = (impl & MFX_IMPL_AUDIO) || !actualTable[eMFXInitEx]; // if true call eMFXInit, if false - eMFXInitEx - int tableIndex = (callOldInit) ? eMFXInit : eMFXInitEx; - - mfxFunctionPointer pFunc = actualTable[tableIndex]; - - { - if (callOldInit) - { - DISPATCHER_LOG_BLOCK(("MFXInit(%s,ver=%u.%u,session=0x%p)\n" - , DispatcherLog_GetMFXImplString(impl | implInterface).c_str() - , apiVersion.Major - , apiVersion.Minor - , &session)); - - mfxRes = (*(mfxStatus(MFX_CDECL *) (mfxIMPL, mfxVersion *, mfxSession *)) pFunc) (impl | implInterface, &version, &session); - } - else - { - DISPATCHER_LOG_BLOCK(("MFXInitEx(%s,ver=%u.%u,ExtThreads=%d,session=0x%p)\n" - , DispatcherLog_GetMFXImplString(impl | implInterface).c_str() - , apiVersion.Major - , apiVersion.Minor - , par.ExternalThreads - , &session)); - - mfxInitParam initPar = par; - // adjusting user parameters - initPar.Implementation = impl | implInterface; - initPar.Version = version; - mfxRes = (*(mfxStatus(MFX_CDECL *) (mfxInitParam, mfxSession *)) pFunc) (initPar, &session); - } - } - - if (MFX_ERR_NONE != mfxRes) - { - DISPATCHER_LOG_WRN((("library can't be load. MFXInit returned %s \n"), DispatcherLog_GetMFXStatusString(mfxRes))) - } - else - { - mfxRes = MFXQueryVersion((mfxSession) this, &actualApiVersion); - - if (MFX_ERR_NONE != mfxRes) - { - DISPATCHER_LOG_ERROR((("MFXQueryVersion returned: %d, skiped this library\n"), mfxRes)) - } - else - { - DISPATCHER_LOG_INFO((("MFXQueryVersion returned API: %d.%d\n"), actualApiVersion.Major, actualApiVersion.Minor)) - //special hook for applications that uses sink api to get loaded library path - DISPATCHER_LOG_LIBRARY(("%p" , hModule)); - DISPATCHER_LOG_INFO(("library loaded succesfully\n")) - } - } - } - - loadStatus = mfxRes; - return mfxRes; - -} // mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const wchar_t *pPath, eMfxImplType implType, mfxIMPL impl) - -mfxStatus MFX_DISP_HANDLE::UnLoadSelectedDLL(void) -{ - mfxStatus mfxRes = MFX_ERR_NONE; - - //unregistered plugins if any - pluginFactory.Close(); - - // close the loaded DLL - if (session) - { - /* check whether it is audio session or video */ - int tableIndex = eMFXClose; - mfxFunctionPointer pFunc; - if (impl & MFX_IMPL_AUDIO) - { - pFunc = callAudioTable[tableIndex]; - } - else - { - pFunc = callTable[tableIndex]; - } - - mfxRes = (*(mfxStatus (MFX_CDECL *) (mfxSession)) pFunc) (session); - if (MFX_ERR_NONE == mfxRes) - { - session = (mfxSession) 0; - } - - DISPATCHER_LOG_INFO((("MFXClose(0x%x) returned %d\n"), session, mfxRes)); - // actually, the return value is required to pass outside only. - } - - // it is possible, that there is an active child session. - // can't unload library in that case. - if ((MFX_ERR_UNDEFINED_BEHAVIOR != mfxRes) && - (hModule)) - { - // unload the library. - if (!MFX::mfx_dll_free(hModule)) - { - mfxRes = MFX_ERR_UNDEFINED_BEHAVIOR; - } - hModule = (mfxModuleHandle) 0; - } - - return mfxRes; - -} // mfxStatus MFX_DISP_HANDLE::UnLoadSelectedDLL(void) - - -MFX_DISP_HANDLE_EX::MFX_DISP_HANDLE_EX(const mfxVersion requiredVersion) - : MFX_DISP_HANDLE(requiredVersion) - , mediaAdapterType(MFX_MEDIA_UNKNOWN) -{} - - -#if (defined(_WIN64) || defined(_WIN32)) && (MFX_VERSION >= 1031) -static mfxStatus InitDummySession(mfxU32 adapter_n, MFXVideoSession & dummy_session) -{ - mfxInitParam initPar; - memset(&initPar, 0, sizeof(initPar)); - - initPar.Version.Major = 1; - initPar.Version.Minor = 0; - - switch (adapter_n) - { - case 0: - initPar.Implementation = MFX_IMPL_HARDWARE; - break; - case 1: - initPar.Implementation = MFX_IMPL_HARDWARE2; - break; - case 2: - initPar.Implementation = MFX_IMPL_HARDWARE3; - break; - case 3: - initPar.Implementation = MFX_IMPL_HARDWARE4; - break; - - default: - // try searching on all display adapters - initPar.Implementation = MFX_IMPL_HARDWARE_ANY; - break; - } - - initPar.Implementation |= MFX_IMPL_VIA_D3D11; - - return dummy_session.InitEx(initPar); -} - -static inline bool is_iGPU(const mfxAdapterInfo& adapter_info) -{ - return adapter_info.Platform.MediaAdapterType == MFX_MEDIA_INTEGRATED; -} - -static inline bool is_dGPU(const mfxAdapterInfo& adapter_info) -{ - return adapter_info.Platform.MediaAdapterType == MFX_MEDIA_DISCRETE; -} - -// This function implies that iGPU has higher priority -static inline mfxI32 iGPU_priority(const void* ll, const void* rr) -{ - const mfxAdapterInfo& l = *(reinterpret_cast(ll)); - const mfxAdapterInfo& r = *(reinterpret_cast(rr)); - - if (is_iGPU(l) && is_iGPU(r) || is_dGPU(l) && is_dGPU(r)) - return 0; - - if (is_iGPU(l) && is_dGPU(r)) - return -1; - - // The only combination left is_dGPU(l) && is_iGPU(r)) - return 1; -} - - -static void RearrangeInPriorityOrder(const mfxComponentInfo & info, MFX::MFXVector & vec) -{ - (void)info; - { - // Move iGPU to top priority - qsort(vec.data(), vec.size(), sizeof(mfxAdapterInfo), &iGPU_priority); - } -} - -static mfxStatus PrepareAdaptersInfo(const mfxComponentInfo * info, MFX::MFXVector & vec, mfxAdaptersInfo& adapters) -{ - // No suitable adapters on system to handle user's workload - if (vec.empty()) - { - adapters.NumActual = 0; - return MFX_ERR_NOT_FOUND; - } - - if (info) - { - RearrangeInPriorityOrder(*info, vec); - } - - mfxU32 num_to_copy = (std::min)(mfxU32(vec.size()), adapters.NumAlloc); - for (mfxU32 i = 0; i < num_to_copy; ++i) - { - adapters.Adapters[i] = vec[i]; - } - - adapters.NumActual = num_to_copy; - - if (vec.size() > adapters.NumAlloc) - { - return MFX_WRN_OUT_OF_RANGE; - } - - return MFX_ERR_NONE; -} - -static inline bool QueryAdapterInfo(mfxU32 adapter_n, mfxU32& VendorID, mfxU32& DeviceID) -{ - MFX::DXVA2Device dxvaDevice; - - if (!dxvaDevice.InitDXGI1(adapter_n)) - return false; - - VendorID = dxvaDevice.GetVendorID(); - DeviceID = dxvaDevice.GetDeviceID(); - - return true; -} - -static inline mfxU32 MakeVersion(mfxU16 major, mfxU16 minor) -{ - return major * 1000 + minor; -} - -mfxStatus MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters) -{ - if (!adapters || !bitstream) - return MFX_ERR_NULL_PTR; - - MFX::MFXVector obtained_info; - - mfxU32 adapter_n = 0, VendorID, DeviceID; - - mfxComponentInfo input_info; - memset(&input_info, 0, sizeof(input_info)); - input_info.Type = mfxComponentType::MFX_COMPONENT_DECODE; - input_info.Requirements.mfx.CodecId = codec_id; - - for(;;) - { - if (!QueryAdapterInfo(adapter_n, VendorID, DeviceID)) - break; - - ++adapter_n; - - if (VendorID != INTEL_VENDOR_ID) - continue; - - // Check if requested capabilities are supported - MFXVideoSession dummy_session; - - mfxStatus sts = InitDummySession(adapter_n - 1, dummy_session); - if (sts != MFX_ERR_NONE) - { - continue; - } - - mfxVideoParam stream_params, out; - memset(&out, 0, sizeof(out)); - memset(&stream_params, 0, sizeof(stream_params)); - out.mfx.CodecId = stream_params.mfx.CodecId = codec_id; - - sts = MFXVideoDECODE_DecodeHeader(dummy_session.operator mfxSession(), bitstream, &stream_params); - - if (sts != MFX_ERR_NONE) - { - continue; - } - - sts = MFXVideoDECODE_Query(dummy_session.operator mfxSession(), &stream_params, &out); - - if (sts != MFX_ERR_NONE) // skip MFX_ERR_UNSUPPORTED as well as MFX_WRN_INCOMPATIBLE_VIDEO_PARAM - continue; - - mfxAdapterInfo info; - memset(&info, 0, sizeof(info)); - - //WA for initialization when application built w/ new API, but lib w/ old one. - mfxVersion apiVersion; - sts = dummy_session.QueryVersion(&apiVersion); - if (sts != MFX_ERR_NONE) - continue; - - mfxU32 version = MakeVersion(apiVersion.Major, apiVersion.Minor); - - if (version >= 1019) - { - sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform); - - if (sts != MFX_ERR_NONE) - { - continue; - } - } - else - { - // for API versions greater than 1.19 Device id is set inside QueryPlatform call - info.Platform.DeviceId = static_cast(DeviceID); - } - - info.Number = adapter_n - 1; - - obtained_info.push_back(info); - } - - return PrepareAdaptersInfo(&input_info, obtained_info, *adapters); -} - -mfxStatus MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters) -{ - if (!adapters) - return MFX_ERR_NULL_PTR; - - MFX::MFXVector obtained_info; - //obtained_info.reserve(adapters->NumAdaptersAlloc); - - mfxU32 adapter_n = 0, VendorID, DeviceID; - - for (;;) - { - if (!QueryAdapterInfo(adapter_n, VendorID, DeviceID)) - break; - - ++adapter_n; - - if (VendorID != INTEL_VENDOR_ID) - continue; - - // Check if requested capabilities are supported - MFXVideoSession dummy_session; - - mfxStatus sts = InitDummySession(adapter_n - 1, dummy_session); - if (sts != MFX_ERR_NONE) - { - continue; - } - - // If input_info is NULL just return all Intel adapters and information about them - if (input_info) - { - mfxVideoParam out; - memset(&out, 0, sizeof(out)); - - switch (input_info->Type) - { - case mfxComponentType::MFX_COMPONENT_ENCODE: - { - out.mfx.CodecId = input_info->Requirements.mfx.CodecId; - - sts = MFXVideoENCODE_Query(dummy_session.operator mfxSession(), &input_info->Requirements, &out); - } - break; - case mfxComponentType::MFX_COMPONENT_DECODE: - { - out.mfx.CodecId = input_info->Requirements.mfx.CodecId; - - sts = MFXVideoDECODE_Query(dummy_session.operator mfxSession(), &input_info->Requirements, &out); - } - break; - case mfxComponentType::MFX_COMPONENT_VPP: - { - sts = MFXVideoVPP_Query(dummy_session.operator mfxSession(), &input_info->Requirements, &out); - } - break; - default: - sts = MFX_ERR_UNSUPPORTED; - } - } - - if (sts != MFX_ERR_NONE) // skip MFX_ERR_UNSUPPORTED as well as MFX_WRN_INCOMPATIBLE_VIDEO_PARAM - continue; - - mfxAdapterInfo info; - memset(&info, 0, sizeof(info)); - - //WA for initialization when application built w/ new API, but lib w/ old one. - mfxVersion apiVersion; - sts = dummy_session.QueryVersion(&apiVersion); - if (sts != MFX_ERR_NONE) - continue; - - mfxU32 version = MakeVersion(apiVersion.Major, apiVersion.Minor); - - if (version >= 1019) - { - sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform); - - if (sts != MFX_ERR_NONE) - { - continue; - } - } - else - { - // for API versions greater than 1.19 Device id is set inside QueryPlatform call - info.Platform.DeviceId = static_cast(DeviceID); - } - - info.Number = adapter_n - 1; - - obtained_info.push_back(info); - } - - return PrepareAdaptersInfo(input_info, obtained_info, *adapters); -} - -mfxStatus MFXQueryAdaptersNumber(mfxU32* num_adapters) -{ - if (!num_adapters) - return MFX_ERR_NULL_PTR; - - mfxU32 intel_adapter_count = 0, VendorID, DeviceID; - - for (mfxU32 cur_adapter = 0; ; ++cur_adapter) - { - if (!QueryAdapterInfo(cur_adapter, VendorID, DeviceID)) - break; - - if (VendorID == INTEL_VENDOR_ID) - ++intel_adapter_count; - } - - *num_adapters = intel_adapter_count; - - return MFX_ERR_NONE; -} - -#endif // (defined(_WIN64) || defined(_WIN32)) && (MFX_VERSION >= 1031) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_log.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_log.cpp deleted file mode 100644 index 73989e22..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_log.cpp +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if defined(MFX_DISPATCHER_LOG) - -#include "mfx_dispatcher_log.h" -#include "mfxstructures.h" -#include -#if defined(DISPATCHER_LOG_REGISTER_EVENT_PROVIDER) -#include -#include -#endif -#include -#include -#include -#include - -struct CodeStringTable -{ - int code; - const char *string; -} LevelStrings []= -{ - {DL_INFO, "INFO: "}, - {DL_WRN, "WARNING:"}, - {DL_ERROR, "ERROR: "} -}; - -#define DEFINE_CODE(code)\ - {code, #code} - -static CodeStringTable StringsOfImpl[] = { - DEFINE_CODE(MFX_IMPL_AUTO), - DEFINE_CODE(MFX_IMPL_SOFTWARE), - DEFINE_CODE(MFX_IMPL_HARDWARE), - DEFINE_CODE(MFX_IMPL_AUTO_ANY), - DEFINE_CODE(MFX_IMPL_HARDWARE_ANY), - DEFINE_CODE(MFX_IMPL_HARDWARE2), - DEFINE_CODE(MFX_IMPL_HARDWARE3), - DEFINE_CODE(MFX_IMPL_HARDWARE4), - - DEFINE_CODE(MFX_IMPL_UNSUPPORTED) -}; - -static CodeStringTable StringsOfImplVIA[] = { - DEFINE_CODE(MFX_IMPL_VIA_ANY), - DEFINE_CODE(MFX_IMPL_VIA_D3D9), - DEFINE_CODE(MFX_IMPL_VIA_D3D11), -}; - -static CodeStringTable StringsOfStatus[] = -{ - DEFINE_CODE(MFX_ERR_NONE ), - DEFINE_CODE(MFX_ERR_UNKNOWN ), - DEFINE_CODE(MFX_ERR_NULL_PTR ), - DEFINE_CODE(MFX_ERR_UNSUPPORTED ), - DEFINE_CODE(MFX_ERR_MEMORY_ALLOC ), - DEFINE_CODE(MFX_ERR_NOT_ENOUGH_BUFFER ), - DEFINE_CODE(MFX_ERR_INVALID_HANDLE ), - DEFINE_CODE(MFX_ERR_LOCK_MEMORY ), - DEFINE_CODE(MFX_ERR_NOT_INITIALIZED ), - DEFINE_CODE(MFX_ERR_NOT_FOUND ), - DEFINE_CODE(MFX_ERR_MORE_DATA ), - DEFINE_CODE(MFX_ERR_MORE_SURFACE ), - DEFINE_CODE(MFX_ERR_ABORTED ), - DEFINE_CODE(MFX_ERR_DEVICE_LOST ), - DEFINE_CODE(MFX_ERR_INCOMPATIBLE_VIDEO_PARAM), - DEFINE_CODE(MFX_ERR_INVALID_VIDEO_PARAM ), - DEFINE_CODE(MFX_ERR_UNDEFINED_BEHAVIOR ), - DEFINE_CODE(MFX_ERR_DEVICE_FAILED ), - DEFINE_CODE(MFX_ERR_MORE_BITSTREAM ), - DEFINE_CODE(MFX_ERR_INVALID_AUDIO_PARAM ), - DEFINE_CODE(MFX_ERR_GPU_HANG ), - DEFINE_CODE(MFX_ERR_REALLOC_SURFACE ), - DEFINE_CODE(MFX_WRN_IN_EXECUTION ), - DEFINE_CODE(MFX_WRN_DEVICE_BUSY ), - DEFINE_CODE(MFX_WRN_VIDEO_PARAM_CHANGED ), - DEFINE_CODE(MFX_WRN_PARTIAL_ACCELERATION ), - DEFINE_CODE(MFX_WRN_INCOMPATIBLE_VIDEO_PARAM), - DEFINE_CODE(MFX_WRN_VALUE_NOT_CHANGED ), - DEFINE_CODE(MFX_WRN_OUT_OF_RANGE ), - DEFINE_CODE(MFX_WRN_FILTER_SKIPPED ), - DEFINE_CODE(MFX_WRN_INCOMPATIBLE_AUDIO_PARAM), - DEFINE_CODE(MFX_ERR_NONE_PARTIAL_OUTPUT ), - DEFINE_CODE(MFX_TASK_WORKING ), - DEFINE_CODE(MFX_TASK_BUSY ), - DEFINE_CODE(MFX_ERR_MORE_DATA_SUBMIT_TASK ), -}; - -#define CODE_TO_STRING(code, array)\ - CodeToString(code, array, sizeof(array)/sizeof(array[0])) - -const char* CodeToString(int code, CodeStringTable array[], int len ) -{ - for (int i = 0 ; i < len; i++) - { - if (array[i].code == code) - return array[i].string; - } - return "undef"; -} - -std::string DispatcherLog_GetMFXImplString(int impl) -{ - std::string str1 = CODE_TO_STRING(impl & ~(-MFX_IMPL_VIA_ANY), StringsOfImpl); - std::string str2 = CODE_TO_STRING(impl & (-MFX_IMPL_VIA_ANY), StringsOfImplVIA); - - return str1 + (str2 == "undef" ? "" : "|"+str2); -} - -const char *DispatcherLog_GetMFXStatusString(int sts) -{ - return CODE_TO_STRING(sts, StringsOfStatus); -} - -////////////////////////////////////////////////////////////////////////// - - -void DispatcherLogBracketsHelper::Write(const char * str, ...) -{ - va_list argsptr; - va_start(argsptr, str); - DispatchLog::get().Write(m_level, m_opcode, str, argsptr); - va_end(argsptr); -} - -void DispatchLogBlockHelper::Write(const char * str, ...) -{ - va_list argsptr; - va_start(argsptr, str); - DispatchLog::get().Write(m_level, DL_EVENT_START, str, argsptr); - va_end(argsptr); -} - -DispatchLogBlockHelper::~DispatchLogBlockHelper() -{ - DispatchLog::get().Write(m_level, DL_EVENT_STOP, NULL, NULL); -} - -////////////////////////////////////////////////////////////////////////// - -DispatchLog::DispatchLog() - : m_DispatcherLogSink(DL_SINK_PRINTF) -{ - -} - -void DispatchLog::SetSink(int nSink, IMsgHandler * pHandler) -{ - DetachAllSinks(); - AttachSink(nSink, pHandler); -} - -void DispatchLog::AttachSink(int nsink, IMsgHandler *pHandler) -{ - m_DispatcherLogSink |= nsink; - if (NULL != pHandler) - m_Recepients.push_back(pHandler); -} - -void DispatchLog::DetachSink(int nsink, IMsgHandler *pHandler) -{ - if (nsink & DL_SINK_IMsgHandler) - { - m_Recepients.remove(pHandler); - } - - m_DispatcherLogSink &= ~nsink; -} - -void DispatchLog::ExchangeSink(int nsink, IMsgHandler *oldHdl, IMsgHandler *newHdl) -{ - if (nsink & DL_SINK_IMsgHandler) - { - std::list :: iterator it = std::find(m_Recepients.begin(), m_Recepients.end(), oldHdl); - - //cannot exchange in that case - if (m_Recepients.end() == it) - return; - - *it = newHdl; - } -} - - -void DispatchLog::DetachAllSinks() -{ - m_Recepients.clear(); - m_DispatcherLogSink = DL_SINK_NULL; -} - -void DispatchLog::Write(int level, int opcode, const char * msg, va_list argptr) -{ - int sinkTable[] = - { - DL_SINK_PRINTF, - DL_SINK_IMsgHandler, - }; - - for (size_t i = 0; i < sizeof(sinkTable) / sizeof(sinkTable[0]); i++) - { - switch(m_DispatcherLogSink & sinkTable[i]) - { - case DL_SINK_NULL: - break; - - case DL_SINK_PRINTF: - { - char msg_formated[8048] = {0}; - - if (NULL != msg && level != DL_LOADED_LIBRARY) - { -#if _MSC_VER >= 1400 - vsprintf_s(msg_formated, sizeof(msg_formated)/sizeof(msg_formated[0]), msg, argptr); -#else - vsnprintf(msg_formated, sizeof(msg_formated)/sizeof(msg_formated[0]), msg, argptr); -#endif - //TODO: improve this , add opcode handling - printf("%s %s", CODE_TO_STRING(level, LevelStrings), msg_formated); - } - break; - } - - case DL_SINK_IMsgHandler: - { - std::list::iterator it; - - for (it = m_Recepients.begin(); it != m_Recepients.end(); ++it) - { - (*it)->Write(level, opcode, msg, argptr); - } - break; - } - } - } -} - -#if defined(DISPATCHER_LOG_REGISTER_EVENT_PROVIDER) -class ETWHandler : public IMsgHandler -{ -public: - ETWHandler(const wchar_t * guid_str) - : m_bUseFormatter(DISPATCHER_LOG_USE_FORMATING) - , m_EventHandle() - , m_bProviderEnable() - { - GUID rguid = GUID_NULL; - if (FAILED(CLSIDFromString(guid_str, &rguid))) - { - return; - } - - EventRegister(&rguid, NULL, NULL, &m_EventHandle); - - m_bProviderEnable = 0 != EventProviderEnabled(m_EventHandle, 1,0); - } - - ~ETWHandler() - { - if (m_EventHandle) - { - EventUnregister(m_EventHandle); - } - } - - virtual void Write(int level, int opcode, const char * msg, va_list argptr) - { - //event not registered - if (0==m_EventHandle) - { - return; - } - if (!m_bProviderEnable) - { - return; - } - if (level == DL_LOADED_LIBRARY) - { - return; - } - - char msg_formated[1024]; - EVENT_DESCRIPTOR descriptor; - EVENT_DATA_DESCRIPTOR data_descriptor; - - EventDescZero(&descriptor); - - descriptor.Opcode = (UCHAR)opcode; - descriptor.Level = (UCHAR)level; - - if (m_bUseFormatter) - { - if (NULL != msg) - { -#if _MSC_VER >= 1400 - vsprintf_s(msg_formated, sizeof (msg_formated) / sizeof (msg_formated[0]), msg, argptr); -#else - vsnprintf(msg_formated, sizeof (msg_formated) / sizeof (msg_formated[0]), msg, argptr); -#endif - EventDataDescCreate(&data_descriptor, msg_formated, (ULONG)(strlen(msg_formated) + 1)); - }else - { - EventDataDescCreate(&data_descriptor, NULL, 0); - } - }else - { - //TODO: non formated events supports under zbb - } - - EventWrite(m_EventHandle, &descriptor, 1, &data_descriptor); - } - -protected: - - //we may not use formatter in some cases described in dispatch_log macro - //it significantly increases performance by eliminating any vsprintf operations - bool m_bUseFormatter; - //consumer is attached, dispatcher trace to reduce formating overhead - //submits event only if consumer attached - bool m_bProviderEnable; - REGHANDLE m_EventHandle; -}; -// - - -IMsgHandler *ETWHandlerFactory::GetSink(const wchar_t* sguid) -{ - _storage_type::iterator it; - it = m_storage.find(sguid); - if (it == m_storage.end()) - { - ETWHandler * handler = new ETWHandler(sguid); - _storage_type::_Pairib it_bool = m_storage.insert(_storage_type::value_type(sguid, handler)); - it = it_bool.first; - } - - return it->second; -} - -ETWHandlerFactory::~ETWHandlerFactory() -{ - for each(_storage_type::value_type val in m_storage) - { - delete val.second; - } -} - -class EventRegistrator : public IMsgHandler -{ - const wchar_t * m_sguid; -public: - EventRegistrator(const wchar_t* sguid = DISPATCHER_LOG_EVENT_GUID) - :m_sguid(sguid) - { - DispatchLog::get().AttachSink( DL_SINK_IMsgHandler - , this); - } - - virtual void Write(int level, int opcode, const char * msg, va_list argptr) - { - //we cannot call attach sink since we may have been called from iteration - //we axchanging preserve that placeholding - IMsgHandler * pSink = NULL; - DispatchLog::get().ExchangeSink(DL_SINK_IMsgHandler, - this, - pSink = ETWHandlerFactory::get().GetSink(m_sguid)); - //need to call only once here all next calls will be done inside dispatcherlog - if (NULL != pSink) - { - pSink->Write(level, opcode, msg, argptr); - } - } -}; -#endif - -template -class SinkRegistrator -{ -}; - -#if defined(DISPATCHER_LOG_REGISTER_EVENT_PROVIDER) -template <> -class SinkRegistrator -{ -public: - SinkRegistrator(const wchar_t* sguid = DISPATCHER_LOG_EVENT_GUID) - { - DispatchLog::get().AttachSink( DL_SINK_IMsgHandler - , ETWHandlerFactory::get().GetSink(sguid)); - } -}; -#endif - -#if defined(DISPATCHER_LOG_REGISTER_FILE_WRITER) -template <> -class SinkRegistrator -{ -public: - SinkRegistrator() - { - DispatchLog::get().AttachSink( DL_SINK_IMsgHandler, &FileSink::get(DISPACTHER_LOG_FW_PATH)); - } -}; - -void FileSink::Write(int level, int /*opcode*/, const char * msg, va_list argptr) -{ - if (NULL != m_hdl && NULL != msg) - { - fprintf(m_hdl, "%s", CODE_TO_STRING(level, LevelStrings)); - vfprintf(m_hdl, msg, argptr); - } -} -#endif - -////////////////////////////////////////////////////////////////////////// -//singletons initialization section - - -#ifdef DISPATCHER_LOG_REGISTER_EVENT_PROVIDER - static SinkRegistrator g_registrator1; -#endif - - -#ifdef DISPATCHER_LOG_REGISTER_FILE_WRITER - static SinkRegistrator g_registrator2; -#endif - - -#endif//(MFX_DISPATCHER_LOG) \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_main.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_main.cpp deleted file mode 100644 index e644d582..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_main.cpp +++ /dev/null @@ -1,1180 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include -#include - -#include -#include - -#include "mfx_dispatcher.h" -#include "mfx_load_dll.h" -#include "mfx_dispatcher_log.h" -#include "mfx_library_iterator.h" -#include "mfx_critical_section.h" - -#if defined(MEDIASDK_UWP_DISPATCHER) -#include "mfx_dispatcher_uwp.h" -#endif - -#include /* for memset on Linux */ - -#include /* for qsort on Linux */ -#include "mfx_load_plugin.h" -#include "mfx_plugin_hive.h" - -// module-local definitions -namespace -{ - - const - struct - { - // instance implementation type - eMfxImplType implType; - // real implementation - mfxIMPL impl; - // adapter numbers - mfxU32 adapterID; - - } implTypes[] = - { - // MFX_IMPL_AUTO case - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE, 0}, - {MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE, 0}, - - // MFX_IMPL_ANY case - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE, 0}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE2, 1}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE3, 2}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE4, 3}, - {MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE, 0}, - {MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE | MFX_IMPL_AUDIO, 0}, -#if (MFX_VERSION >= MFX_VERSION_NEXT) - //MFX_SINGLE_THREAD case - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE | MFX_IMPL_EXTERNAL_THREADING, 0}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE2 | MFX_IMPL_EXTERNAL_THREADING, 1}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE3 | MFX_IMPL_EXTERNAL_THREADING, 2}, - {MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE4 | MFX_IMPL_EXTERNAL_THREADING, 3}, -#endif - }; - - const - struct - { - // start index in implTypes table for specified implementation - mfxU32 minIndex; - // last index in implTypes table for specified implementation - mfxU32 maxIndex; - - } implTypesRange[] = - { - {0, 1}, // MFX_IMPL_AUTO - {1, 1}, // MFX_IMPL_SOFTWARE - {0, 0}, // MFX_IMPL_HARDWARE - {2, 6}, // MFX_IMPL_AUTO_ANY - {2, 5}, // MFX_IMPL_HARDWARE_ANY - {3, 3}, // MFX_IMPL_HARDWARE2 - {4, 4}, // MFX_IMPL_HARDWARE3 - {5, 5}, // MFX_IMPL_HARDWARE4 - {2, 6}, // MFX_IMPL_RUNTIME, same as MFX_IMPL_HARDWARE_ANY -#if (MFX_VERSION >= MFX_VERSION_NEXT) - {8, 11}, // MFX_SINGLE_THREAD, -#endif - {7, 7} // MFX_IMPL_AUDIO - }; - - MFX::mfxCriticalSection dispGuard = 0; - -} // namespace - -using namespace MFX; - -#if !defined(MEDIASDK_UWP_DISPATCHER) - -// -// Implement DLL exposed functions. MFXInit and MFXClose have to do -// slightly more than other. They require to be implemented explicitly. -// All other functions are implemented implicitly. -// - -typedef MFXVector HandleVector; -typedef MFXVector StatusVector; - -struct VectorHandleGuard -{ - VectorHandleGuard(HandleVector& aVector): m_vector(aVector) {} - ~VectorHandleGuard() - { - HandleVector::iterator it = m_vector.begin(), - et = m_vector.end(); - for ( ; it != et; ++it) - { - delete *it; - } - } - - HandleVector& m_vector; -private: - void operator=(const VectorHandleGuard&); -}; - - -static int HandleSort (const void * plhs, const void * prhs) -{ - const MFX_DISP_HANDLE_EX * lhs = *(const MFX_DISP_HANDLE_EX **)plhs; - const MFX_DISP_HANDLE_EX * rhs = *(const MFX_DISP_HANDLE_EX **)prhs; - - // prefer HW implementation - if (lhs->implType != MFX_LIB_HARDWARE && rhs->implType == MFX_LIB_HARDWARE) - { - return 1; - } - if (lhs->implType == MFX_LIB_HARDWARE && rhs->implType != MFX_LIB_HARDWARE) - { - return -1; - } - - // prefer integrated GPU - if (lhs->mediaAdapterType != MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType == MFX_MEDIA_INTEGRATED) - { - return 1; - } - if (lhs->mediaAdapterType == MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType != MFX_MEDIA_INTEGRATED) - { - return -1; - } - - // prefer dll with lower API version - if (lhs->actualApiVersion < rhs->actualApiVersion) - { - return -1; - } - if (rhs->actualApiVersion < lhs->actualApiVersion) - { - return 1; - } - - // if versions are equal prefer library with HW - if (lhs->loadStatus == MFX_WRN_PARTIAL_ACCELERATION && rhs->loadStatus == MFX_ERR_NONE) - { - return 1; - } - if (lhs->loadStatus == MFX_ERR_NONE && rhs->loadStatus == MFX_WRN_PARTIAL_ACCELERATION) - { - return -1; - } - - return 0; -} - -mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session) -{ - MFX::MFXAutomaticCriticalSection guard(&dispGuard); - - DISPATCHER_LOG_BLOCK( ("MFXInitEx (impl=%s, pVer=%d.%d, ExternalThreads=%d session=0x%p\n" - , DispatcherLog_GetMFXImplString(par.Implementation).c_str() - , par.Version.Major - , par.Version.Minor - , par.ExternalThreads - , session)); - - mfxStatus mfxRes = MFX_ERR_UNSUPPORTED; - HandleVector allocatedHandle; - VectorHandleGuard handleGuard(allocatedHandle); - - MFX_DISP_HANDLE_EX *pHandle; - wchar_t dllName[MFX_MAX_DLL_PATH] = { 0 }; - MFX::MFXLibraryIterator libIterator; - - // there iterators are used only if the caller specified implicit type like AUTO - mfxU32 curImplIdx, maxImplIdx; - // implementation method masked from the input parameter - // special case for audio library - const mfxIMPL implMethod = (par.Implementation & MFX_IMPL_AUDIO) ? (sizeof(implTypesRange) / sizeof(implTypesRange[0]) - 1) : (par.Implementation & (MFX_IMPL_VIA_ANY - 1)); - - // implementation interface masked from the input parameter - mfxIMPL implInterface = par.Implementation & -MFX_IMPL_VIA_ANY; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - bool isSingleThread = (implInterface & MFX_IMPL_EXTERNAL_THREADING) > 0; - implInterface &= ~MFX_IMPL_EXTERNAL_THREADING; -#endif - mfxIMPL implInterfaceOrig = implInterface; - mfxVersion requiredVersion = {{MFX_VERSION_MINOR, MFX_VERSION_MAJOR}}; - - // check error(s) - if (NULL == session) - { - return MFX_ERR_NULL_PTR; - } - -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (((MFX_IMPL_AUTO > implMethod) || (MFX_IMPL_SINGLE_THREAD < implMethod)) && !(par.Implementation & MFX_IMPL_AUDIO)) -#else - if (((MFX_IMPL_AUTO > implMethod) || (MFX_IMPL_RUNTIME < implMethod)) && !(par.Implementation & MFX_IMPL_AUDIO)) -#endif - { - return MFX_ERR_UNSUPPORTED; - } - - // set the minimal required version - requiredVersion = par.Version; - - try - { - // reset the session value - *session = 0; - - // allocate the dispatching handle and call-table - pHandle = new MFX_DISP_HANDLE_EX(requiredVersion); - } - catch(...) - { - return MFX_ERR_MEMORY_ALLOC; - } - - DISPATCHER_LOG_INFO((("Required API version is %u.%u\n"), requiredVersion.Major, requiredVersion.Minor)); - // particular implementation value - mfxIMPL curImpl; - - // Load HW library or RT from system location - curImplIdx = implTypesRange[implMethod].minIndex; - maxImplIdx = implTypesRange[implMethod].maxIndex; - do - { -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread && implTypes[curImplIdx].implType != MFX_LIB_HARDWARE) - continue; -#endif - - int currentStorage = MFX::MFX_STORAGE_ID_FIRST; - implInterface = implInterfaceOrig; - do - { - // this storage will be checked below - if (currentStorage == MFX::MFX_APP_FOLDER) - { - currentStorage += 1; - continue; - } - - // initialize the library iterator - mfxRes = libIterator.Init(implTypes[curImplIdx].implType, - implInterface, - implTypes[curImplIdx].adapterID, - currentStorage); - - // look through the list of installed SDK version, - // looking for a suitable library with higher merit value. - if (MFX_ERR_NONE == mfxRes) - { - - if ( - MFX_LIB_HARDWARE == implTypes[curImplIdx].implType - && (!implInterface - || MFX_IMPL_VIA_ANY == implInterface)) - { - implInterface = libIterator.GetImplementationType(); - } - - do - { - eMfxImplType implType = implTypes[curImplIdx].implType; - - // select a desired DLL - mfxRes = libIterator.SelectDLLVersion(dllName, - sizeof(dllName) / sizeof(dllName[0]), - &implType, - pHandle->apiVersion); - if (MFX_ERR_NONE != mfxRes) - { - break; - } - DISPATCHER_LOG_INFO((("loading library %S\n"), dllName)); - // try to load the selected DLL - curImpl = implTypes[curImplIdx].impl; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread) - curImpl |= MFX_IMPL_EXTERNAL_THREADING; -#endif - mfxRes = pHandle->LoadSelectedDLL(dllName, implType, curImpl, implInterface, par); - // unload the failed DLL - if (MFX_ERR_NONE != mfxRes) - { - pHandle->Close(); - continue; - } - - mfxPlatform platform = { MFX_PLATFORM_UNKNOWN, 0, MFX_MEDIA_UNKNOWN }; - if (pHandle->callTable[eMFXVideoCORE_QueryPlatform]) - { - mfxRes = MFXVideoCORE_QueryPlatform((mfxSession)pHandle, &platform); - if (MFX_ERR_NONE != mfxRes) - { - DISPATCHER_LOG_WRN(("MFXVideoCORE_QueryPlatform failed, rejecting loaded library\n")); - pHandle->Close(); - continue; - } - } - pHandle->mediaAdapterType = platform.MediaAdapterType; - DISPATCHER_LOG_INFO((("media adapter type is %d\n"), pHandle->mediaAdapterType)); - - libIterator.GetSubKeyName(pHandle->subkeyName, sizeof(pHandle->subkeyName) / sizeof(pHandle->subkeyName[0])); - pHandle->storageID = libIterator.GetStorageID(); - allocatedHandle.push_back(pHandle); - pHandle = new MFX_DISP_HANDLE_EX(requiredVersion); - - } while (MFX_ERR_NONE != mfxRes); - } - - // select another place for loading engine - currentStorage += 1; - - } while ((MFX_ERR_NONE != mfxRes) && (MFX::MFX_STORAGE_ID_LAST >= currentStorage)); - - } while (++curImplIdx <= maxImplIdx); - - curImplIdx = implTypesRange[implMethod].minIndex; - maxImplIdx = implTypesRange[implMethod].maxIndex; - - // Load RT from app folder (libmfxsw64 with API >= 1.10) - do - { -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread && implTypes[curImplIdx].implType != MFX_LIB_HARDWARE) - continue; -#endif - - implInterface = implInterfaceOrig; - // initialize the library iterator - mfxRes = libIterator.Init(implTypes[curImplIdx].implType, - implInterface, - implTypes[curImplIdx].adapterID, - MFX::MFX_APP_FOLDER); - - if (MFX_ERR_NONE == mfxRes) - { - - if ( - MFX_LIB_HARDWARE == implTypes[curImplIdx].implType - && (!implInterface - || MFX_IMPL_VIA_ANY == implInterface)) - { - implInterface = libIterator.GetImplementationType(); - } - - do - { - eMfxImplType implType; - - // select a desired DLL - mfxRes = libIterator.SelectDLLVersion(dllName, - sizeof(dllName) / sizeof(dllName[0]), - &implType, - pHandle->apiVersion); - if (MFX_ERR_NONE != mfxRes) - { - break; - } - DISPATCHER_LOG_INFO((("loading library %S\n"), dllName)); - - // try to load the selected DLL - curImpl = implTypes[curImplIdx].impl; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread) - curImpl |= MFX_IMPL_EXTERNAL_THREADING; -#endif - mfxRes = pHandle->LoadSelectedDLL(dllName, implType, curImpl, implInterface, par); - // unload the failed DLL - if (MFX_ERR_NONE != mfxRes) - { - pHandle->Close(); - } - else - { - if (pHandle->actualApiVersion.Major == 1 && pHandle->actualApiVersion.Minor <= 9) - { - // this is not RT, skip it - mfxRes = MFX_ERR_ABORTED; - break; - } - pHandle->storageID = MFX::MFX_UNKNOWN_KEY; - allocatedHandle.push_back(pHandle); - pHandle = new MFX_DISP_HANDLE_EX(requiredVersion); - } - - } while (MFX_ERR_NONE != mfxRes); - } - } while ((MFX_ERR_NONE != mfxRes) && (++curImplIdx <= maxImplIdx)); - - // Load HW and SW libraries using legacy default DLL search mechanism - // set current library index again - curImplIdx = implTypesRange[implMethod].minIndex; - do - { -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread && implTypes[curImplIdx].implType != MFX_LIB_HARDWARE) - continue; -#endif - - implInterface = implInterfaceOrig; - - if (par.Implementation & MFX_IMPL_AUDIO) - { - mfxRes = MFX::mfx_get_default_audio_dll_name(dllName, - sizeof(dllName) / sizeof(dllName[0]), - implTypes[curImplIdx].implType); - } - else - { - mfxRes = MFX::mfx_get_default_dll_name(dllName, - sizeof(dllName) / sizeof(dllName[0]), - implTypes[curImplIdx].implType); - } - - if (MFX_ERR_NONE == mfxRes) - { - DISPATCHER_LOG_INFO((("loading default library %S\n"), dllName)) - - // try to load the selected DLL using default DLL search mechanism - if (MFX_LIB_HARDWARE == implTypes[curImplIdx].implType) - { - if (!implInterface) - { - implInterface = MFX_IMPL_VIA_ANY; - } - mfxU32 curVendorID = 0, curDeviceID = 0; - mfxRes = MFX::SelectImplementationType(implTypes[curImplIdx].adapterID, &implInterface, &curVendorID, &curDeviceID); - if (curVendorID != INTEL_VENDOR_ID) - mfxRes = MFX_ERR_UNKNOWN; - } - if (MFX_ERR_NONE == mfxRes) - { - curImpl = implTypes[curImplIdx].impl; -#if (MFX_VERSION >= MFX_VERSION_NEXT) - if (isSingleThread) - curImpl |= MFX_IMPL_EXTERNAL_THREADING; -#endif - // try to load the selected DLL using default DLL search mechanism - mfxRes = pHandle->LoadSelectedDLL(dllName, - implTypes[curImplIdx].implType, - curImpl, - implInterface, - par); - } - // unload the failed DLL - if ((MFX_ERR_NONE != mfxRes) && - (MFX_WRN_PARTIAL_ACCELERATION != mfxRes)) - { - pHandle->Close(); - } - else - { - mfxPlatform platform = { MFX_PLATFORM_UNKNOWN, 0, MFX_MEDIA_UNKNOWN }; - if (pHandle->callTable[eMFXVideoCORE_QueryPlatform]) - { - mfxRes = MFXVideoCORE_QueryPlatform((mfxSession)pHandle, &platform); - if (MFX_ERR_NONE != mfxRes) - { - DISPATCHER_LOG_WRN(("MFXVideoCORE_QueryPlatform failed, rejecting loaded library\n")); - pHandle->Close(); - continue; - } - } - pHandle->mediaAdapterType = platform.MediaAdapterType; - DISPATCHER_LOG_INFO((("media adapter type is %d\n"), pHandle->mediaAdapterType)); - - pHandle->storageID = MFX::MFX_UNKNOWN_KEY; - allocatedHandle.push_back(pHandle); - pHandle = new MFX_DISP_HANDLE_EX(requiredVersion); - } - } - } - while ((MFX_ERR_NONE >= mfxRes) && (++curImplIdx <= maxImplIdx)); - delete pHandle; - - if (allocatedHandle.size() == 0) - return MFX_ERR_UNSUPPORTED; - - { // sort candidate list - bool NeedSort = false; - HandleVector::iterator first = allocatedHandle.begin(), - it = allocatedHandle.begin(), - et = allocatedHandle.end(); - for (it++; it != et; ++it) - if (HandleSort(&(*first), &(*it)) != 0) - NeedSort = true; - - // sort allocatedHandle so that the most preferred dll is at the beginning - if (NeedSort) - qsort(&(*allocatedHandle.begin()), allocatedHandle.size(), sizeof(MFX_DISP_HANDLE_EX*), &HandleSort); - } - HandleVector::iterator candidate = allocatedHandle.begin(); - // check the final result of loading - try - { - pHandle = *candidate; - //pulling up current mediasdk version, that required to match plugin version - mfxVersion apiVerActual = { { 0, 0 } }; - mfxStatus stsQueryVersion = MFXQueryVersion((mfxSession)pHandle, &apiVerActual); - - if (MFX_ERR_NONE != stsQueryVersion) - { - DISPATCHER_LOG_ERROR((("MFXQueryVersion returned: %d, cannot load plugins\n"), mfxRes)) - } - else - { - MFX::MFXPluginStorage & hive = pHandle->pluginHive; - - HandleVector::iterator it = allocatedHandle.begin(), - et = allocatedHandle.end(); - for (; it != et; ++it) - { - // Registering default plugins set - MFX::MFXDefaultPlugins defaultPugins(apiVerActual, *it, (*it)->implType); - hive.insert(hive.end(), defaultPugins.begin(), defaultPugins.end()); - - if ((*it)->storageID != MFX::MFX_UNKNOWN_KEY) - { - // Scan HW plugins in subkeys of registry library - MFX::MFXPluginsInHive plgsInHive((*it)->storageID, (*it)->subkeyName, apiVerActual); - hive.insert(hive.end(), plgsInHive.begin(), plgsInHive.end()); - } - } - - //setting up plugins records - for(int i = MFX::MFX_STORAGE_ID_FIRST; i <= MFX::MFX_STORAGE_ID_LAST; i++) - { - MFX::MFXPluginsInHive plgsInHive(i, NULL, apiVerActual); - hive.insert(hive.end(), plgsInHive.begin(), plgsInHive.end()); - } - - // SOLID dispatcher also loads plug-ins from file system - MFX::MFXPluginsInFS plgsInFS(apiVerActual); - hive.insert(hive.end(), plgsInFS.begin(), plgsInFS.end()); - } - - pHandle->callPlugInsTable[eMFXVideoUSER_Load] = (mfxFunctionPointer)MFXVideoUSER_Load; - pHandle->callPlugInsTable[eMFXVideoUSER_LoadByPath] = (mfxFunctionPointer)MFXVideoUSER_LoadByPath; - pHandle->callPlugInsTable[eMFXVideoUSER_UnLoad] = (mfxFunctionPointer)MFXVideoUSER_UnLoad; - pHandle->callPlugInsTable[eMFXAudioUSER_Load] = (mfxFunctionPointer)MFXAudioUSER_Load; - pHandle->callPlugInsTable[eMFXAudioUSER_UnLoad] = (mfxFunctionPointer)MFXAudioUSER_UnLoad; - - } - catch(...) - { - DISPATCHER_LOG_ERROR((("unknown exception while loading plugins\n"))) - } - - // everything is OK. Save pointers to the output variable - *candidate = 0; // keep this one safe from guard destructor - - - //=================================== - - // MFXVideoCORE_QueryPlatform call creates d3d device handle, so we have handle right after MFXInit and can't accept external handle - // This is a workaround which calls close-init to remove that handle - - mfxFunctionPointer *actualTable = (pHandle->impl & MFX_IMPL_AUDIO) ? pHandle->callAudioTable : pHandle->callTable; - mfxFunctionPointer pFunc; - - pFunc = actualTable[eMFXClose]; - mfxRes = (*(mfxStatus(MFX_CDECL *) (mfxSession)) pFunc) (pHandle->session); - if (mfxRes != MFX_ERR_NONE) - return mfxRes; - - pHandle->session = 0; - bool callOldInit = (pHandle->impl & MFX_IMPL_AUDIO) || !actualTable[eMFXInitEx]; - pFunc = actualTable[(callOldInit) ? eMFXInit : eMFXInitEx]; - - mfxVersion version(pHandle->apiVersion); - if (callOldInit) - { - pHandle->loadStatus = (*(mfxStatus(MFX_CDECL *) (mfxIMPL, mfxVersion *, mfxSession *)) pFunc) (pHandle->impl | pHandle->implInterface, &version, &pHandle->session); - } - else - { - mfxInitParam initPar = par; - initPar.Implementation = pHandle->impl | pHandle->implInterface; - initPar.Version = version; - pHandle->loadStatus = (*(mfxStatus(MFX_CDECL *) (mfxInitParam, mfxSession *)) pFunc) (initPar, &pHandle->session); - } - - //=================================== - - *((MFX_DISP_HANDLE_EX **) session) = pHandle; - - return pHandle->loadStatus; - -} // mfxStatus MFXInitEx(mfxIMPL impl, mfxVersion *ver, mfxSession *session) - -mfxStatus MFXClose(mfxSession session) -{ - MFX::MFXAutomaticCriticalSection guard(&dispGuard); - - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; - MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session; - - // check error(s) - if (pHandle) - { - try - { - // unload the DLL library - mfxRes = pHandle->Close(); - - // it is possible, that there is an active child session. - // can't unload library in that case. - if (MFX_ERR_UNDEFINED_BEHAVIOR != mfxRes) - { - // release the handle - delete pHandle; - } - } - catch(...) - { - mfxRes = MFX_ERR_INVALID_HANDLE; - } - } - - return mfxRes; - -} // mfxStatus MFXClose(mfxSession session) - -mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version) -{ - mfxStatus sts = MFX_ERR_NONE; - bool ErrFlag = false; - if (!session) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: session=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - MFX_DISP_HANDLE &pHandle = *(MFX_DISP_HANDLE *) session; - if (!uid) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: uid=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: uid=" MFXGUIDTYPE()" version=%d\n") - , MFXGUIDTOHEX(uid) - , version)) - size_t pluginsChecked = 0; - - for (MFX::MFXPluginStorage::iterator i = pHandle.pluginHive.begin();i != pHandle.pluginHive.end(); i++, pluginsChecked++) - { - if (i->PluginUID != *uid) - { - continue; - } - //check rest in records - if (i->PluginVersion < version) - { - DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE()" is %d, that is smaller that requested\n") - , MFXGUIDTOHEX(uid) - , i->PluginVersion)) - continue; - } - try - { - sts = pHandle.pluginFactory.Create(*i); - if( MFX_ERR_NONE != sts) - { - ErrFlag = (ErrFlag || (sts == MFX_ERR_UNDEFINED_BEHAVIOR)); - continue; - } - return MFX_ERR_NONE; - } - catch(...) - { - continue; - } - } - - // Specified UID was not found among individually registed plugins, now try load it from default sets if any - for (MFX::MFXPluginStorage::iterator i = pHandle.pluginHive.begin();i != pHandle.pluginHive.end(); i++, pluginsChecked++) - { - if (!i->Default) - continue; - - i->PluginUID = *uid; - i->PluginVersion = (mfxU16)version; - try - { - sts = pHandle.pluginFactory.Create(*i); - if( MFX_ERR_NONE != sts) - { - ErrFlag = (ErrFlag || (sts == MFX_ERR_UNDEFINED_BEHAVIOR)); - continue; - } - return MFX_ERR_NONE; - } - catch(...) - { - continue; - } - } - - DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: cannot find registered plugin with requested UID, total plugins available=%d\n"), pHandle.pluginHive.size())); - if (ErrFlag) - return MFX_ERR_UNDEFINED_BEHAVIOR; - else - return MFX_ERR_NOT_FOUND; -} - - -mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 len) -{ - if (!session) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_LoadByPath: session=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - MFX_DISP_HANDLE &pHandle = *(MFX_DISP_HANDLE *) session; - if (!uid) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_LoadByPath: uid=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - - DISPATCHER_LOG_INFO((("MFXVideoUSER_LoadByPath: %S uid=" MFXGUIDTYPE()" version=%d\n") - , path - , MFXGUIDTOHEX(uid) - , version)) - - PluginDescriptionRecord record; - record.sName[0] = 0; - - wchar_t wPath[MAX_PLUGIN_PATH]; - int res = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, len, wPath, MAX_PLUGIN_PATH-1); - - if (!res) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_LoadByPath: can't convert UTF-8 path to UTF-16\n"))); - return MFX_ERR_NOT_FOUND; - } - wPath[res]=0; - - wcscpy_s(record.sPath, MAX_PLUGIN_PATH, wPath); - - record.PluginUID = *uid; - record.PluginVersion = (mfxU16)version; - record.Default = true; - - try - { - return pHandle.pluginFactory.Create(record); - } - catch(...) - { - return MFX_ERR_NOT_FOUND; - } -} - - -mfxStatus MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid) -{ - if (!session) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad: session=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - MFX_DISP_HANDLE &rHandle = *(MFX_DISP_HANDLE *) session; - if (!uid) - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad: uid=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - - bool bDestroyed = rHandle.pluginFactory.Destroy(*uid); - if (bDestroyed) - { - DISPATCHER_LOG_INFO((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid))); - } else - { - DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid))); - } - - return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND; -} - -mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version) -{ - if (!session) - { - DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: session=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - MFX_DISP_HANDLE &pHandle = *(MFX_DISP_HANDLE *) session; - if (!uid) - { - DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: uid=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: uid=" MFXGUIDTYPE()" version=%d\n") - , MFXGUIDTOHEX(uid) - , version)) - size_t pluginsChecked = 0; - PluginDescriptionRecord defaultPluginRecord; - for (MFX::MFXPluginStorage::iterator i = pHandle.pluginHive.begin();i != pHandle.pluginHive.end(); i++, pluginsChecked++) - { - if (i->PluginUID != *uid) - { - if (i->Default) // PluginUID == 0 for default set - { - defaultPluginRecord = *i; - } - continue; - } - //check rest in records - if (i->PluginVersion < version) - { - DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE()" is %d, that is smaller that requested\n") - , MFXGUIDTOHEX(uid) - , i->PluginVersion)) - continue; - } - try { - return pHandle.pluginFactory.Create(*i); - } - catch(...) { - return MFX_ERR_UNKNOWN; - } - } - - // Specified UID was not found among individually registed plugins, now try load it from default set if any - if (defaultPluginRecord.Default) - { - defaultPluginRecord.PluginUID = *uid; - defaultPluginRecord.onlyVersionRegistered = true; - defaultPluginRecord.PluginVersion = (mfxU16)version; - try { - return pHandle.pluginFactory.Create(defaultPluginRecord); - } - catch(...) { - return MFX_ERR_UNKNOWN; - } - } - - DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: cannot find registered plugin with requested UID, total plugins available=%d\n"), pHandle.pluginHive.size())); - return MFX_ERR_NOT_FOUND; -} - -mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid) -{ - if (!session) - { - DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad: session=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - MFX_DISP_HANDLE &rHandle = *(MFX_DISP_HANDLE *) session; - if (!uid) - { - DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: uid=NULL\n"))); - return MFX_ERR_NULL_PTR; - } - - bool bDestroyed = rHandle.pluginFactory.Destroy(*uid); - if (bDestroyed) - { - DISPATCHER_LOG_INFO((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid))); - } else - { - DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid))); - } - - return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND; -} -#else // relates to !defined (MEDIASDK_UWP_DISPATCHER), i.e. #else part as if MEDIASDK_UWP_DISPATCHER defined - -static mfxModuleHandle hModule; - -// for the UWP_DISPATCHER purposes implementation of MFXinitEx is calling -// InitialiseMediaSession() implemented in intel_gfx_api.dll -mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session) -{ -#if defined(MEDIASDK_ARM_LOADER) - - return MFX_ERR_UNSUPPORTED; - -#else - - wchar_t IntelGFXAPIdllName[MFX_MAX_DLL_PATH] = { 0 }; - mfxI32 adapterNum = -1; - - switch (par.Implementation & 0xf) - { - case MFX_IMPL_SOFTWARE: -#if (MFX_VERSION >= MFX_VERSION_NEXT) - case MFX_IMPL_SINGLE_THREAD: -#endif - return MFX_ERR_UNSUPPORTED; - case MFX_IMPL_AUTO: - case MFX_IMPL_HARDWARE: - adapterNum = 0; - break; - case MFX_IMPL_HARDWARE2: - adapterNum = 1; - break; - case MFX_IMPL_HARDWARE3: - adapterNum = 2; - break; - case MFX_IMPL_HARDWARE4: - adapterNum = 3; - break; - default: - return GfxApiInitPriorityIntegrated(par, session, hModule); - } - - return GfxApiInitByAdapterNum(par, adapterNum, session, hModule); - -#endif -} - -// for the UWP_DISPATCHER purposes implementation of MFXClose is calling -// DisposeMediaSession() implemented in intel_gfx_api.dll -mfxStatus MFXClose(mfxSession session) -{ - if (NULL == session) { - return MFX_ERR_INVALID_HANDLE; - } - - mfxStatus sts = MFX_ERR_NONE; - -#if defined(MEDIASDK_ARM_LOADER) - - sts = MFX_ERR_UNSUPPORTED; - -#else - - sts = GfxApiClose(session, hModule); - -#endif - - session = (mfxSession)NULL; - return sts; -} - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - return_value func_name formal_param_list \ -{ \ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \ -\ - _mfxSession *pHandle = (_mfxSession *) session; \ -\ - /* get the function's address and make a call */ \ - if (pHandle) \ -{ \ - mfxFunctionPointer pFunc = pHandle->callPlugInsTable[e##func_name]; \ - if (pFunc) \ -{ \ - /* pass down the call */ \ - mfxRes = (*(mfxStatus (MFX_CDECL *) formal_param_list) pFunc) actual_param_list; \ -} \ -} \ - return mfxRes; \ -} - -FUNCTION(mfxStatus, MFXVideoUSER_Load, (mfxSession session, const mfxPluginUID *uid, mfxU32 version), (session, uid, version)) -FUNCTION(mfxStatus, MFXVideoUSER_LoadByPath, (mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 len), (session, uid, version, path, len)) -FUNCTION(mfxStatus, MFXVideoUSER_UnLoad, (mfxSession session, const mfxPluginUID *uid), (session, uid)) -FUNCTION(mfxStatus, MFXAudioUSER_Load, (mfxSession session, const mfxPluginUID *uid, mfxU32 version), (session, uid, version)) -FUNCTION(mfxStatus, MFXAudioUSER_UnLoad, (mfxSession session, const mfxPluginUID *uid), (session, uid)) - -#endif //!defined(MEDIASDK_UWP_DISPATCHER) - -mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session) -{ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; - MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *)session; - MFX_DISP_HANDLE *pChildHandle = (MFX_DISP_HANDLE *)child_session; - - // get the function's address and make a call - if ((pHandle) && (pChildHandle) && (pHandle->actualApiVersion == pChildHandle->actualApiVersion)) - { - /* check whether it is audio session or video */ - int tableIndex = eMFXJoinSession; - mfxFunctionPointer pFunc; - if (pHandle->impl & MFX_IMPL_AUDIO) - { - pFunc = pHandle->callAudioTable[tableIndex]; - } - else - { - pFunc = pHandle->callTable[tableIndex]; - } - - if (pFunc) - { - // pass down the call - mfxRes = (*(mfxStatus(MFX_CDECL *) (mfxSession, mfxSession)) pFunc) (pHandle->session, - pChildHandle->session); - } - } - - return mfxRes; - -} // mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session) - -mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) -{ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; - MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *)session; - mfxVersion apiVersion; - mfxIMPL impl; - - // check error(s) - if (pHandle) - { - // initialize the clone session - apiVersion = pHandle->apiVersion; - impl = pHandle->impl | pHandle->implInterface; - mfxRes = MFXInit(impl, &apiVersion, clone); - if (MFX_ERR_NONE != mfxRes) - { - return mfxRes; - } - - // join the sessions - mfxRes = MFXJoinSession(session, *clone); - if (MFX_ERR_NONE != mfxRes) - { - MFXClose(*clone); - *clone = NULL; - return mfxRes; - } - } - - return mfxRes; - -} // mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) - -mfxStatus MFXInit(mfxIMPL impl, mfxVersion *pVer, mfxSession *session) -{ - mfxInitParam par = {}; - - par.Implementation = impl; - if (pVer) - { - par.Version = *pVer; - } - else - { - par.Version.Major = DEFAULT_API_VERSION_MAJOR; - par.Version.Minor = DEFAULT_API_VERSION_MINOR; - } - par.ExternalThreads = 0; - - return MFXInitEx(par, session); -} - -// -// -// implement all other calling functions. -// They just call a procedure of DLL library from the table. -// - -// define for common functions (from mfxsession.h) -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - return_value func_name formal_param_list \ -{ \ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \ - _mfxSession *pHandle = (_mfxSession *) session; \ - /* get the function's address and make a call */ \ - if (pHandle) \ -{ \ - /* check whether it is audio session or video */ \ - int tableIndex = e##func_name; \ - mfxFunctionPointer pFunc; \ - if (pHandle->impl & MFX_IMPL_AUDIO) \ -{ \ - pFunc = pHandle->callAudioTable[tableIndex]; \ -} \ - else \ -{ \ - pFunc = pHandle->callTable[tableIndex]; \ -} \ - if (pFunc) \ -{ \ - /* get the real session pointer */ \ - session = pHandle->session; \ - /* pass down the call */ \ - mfxRes = (*(mfxStatus (MFX_CDECL *) formal_param_list) pFunc) actual_param_list; \ -} \ -} \ - return mfxRes; \ -} - -FUNCTION(mfxStatus, MFXQueryIMPL, (mfxSession session, mfxIMPL *impl), (session, impl)) -FUNCTION(mfxStatus, MFXQueryVersion, (mfxSession session, mfxVersion *version), (session, version)) - -// these functions are not necessary in LOADER part of dispatcher and -// need to be included only in in SOLID dispatcher or PROCTABLE part of dispatcher - -FUNCTION(mfxStatus, MFXDisjoinSession, (mfxSession session), (session)) -FUNCTION(mfxStatus, MFXSetPriority, (mfxSession session, mfxPriority priority), (session, priority)) -FUNCTION(mfxStatus, MFXGetPriority, (mfxSession session, mfxPriority *priority), (session, priority)) - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - return_value func_name formal_param_list \ -{ \ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \ - _mfxSession *pHandle = (_mfxSession *) session;\ - /* get the function's address and make a call */ \ - if (pHandle) \ -{ \ - mfxFunctionPointer pFunc = pHandle->callTable[e##func_name]; \ - if (pFunc) \ -{ \ - /* get the real session pointer */ \ - session = pHandle->session; \ - /* pass down the call */ \ - mfxRes = (*(mfxStatus (MFX_CDECL *) formal_param_list) pFunc) actual_param_list; \ -} \ -} \ - return mfxRes; \ -} - -#include "mfx_exposed_functions_list.h" -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - return_value func_name formal_param_list \ -{ \ - mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \ - _mfxSession *pHandle = (_mfxSession *) session; \ - /* get the function's address and make a call */ \ - if (pHandle) \ -{ \ - mfxFunctionPointer pFunc = pHandle->callAudioTable[e##func_name]; \ - if (pFunc) \ -{ \ - /* get the real session pointer */ \ - session = pHandle->session; \ - /* pass down the call */ \ - mfxRes = (*(mfxStatus (MFX_CDECL *) formal_param_list) pFunc) actual_param_list; \ -} \ -} \ - return mfxRes; \ -} - -#include "mfxaudio_exposed_functions_list.h" diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_uwp.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_uwp.cpp deleted file mode 100644 index 5f9b1815..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dispatcher_uwp.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_dispatcher.h" -#include "mfx_dispatcher_uwp.h" -#include "mfx_driver_store_loader.h" -#include "mfx_dxva2_device.h" -#include "mfx_load_dll.h" - -mfxStatus GfxApiInit(mfxInitParam par, mfxU32 deviceID, mfxSession *session, mfxModuleHandle& hModule) -{ - HRESULT hr = S_OK; - - if (hModule == NULL) - { - wchar_t IntelGFXAPIdllName[MFX_MAX_DLL_PATH] = { 0 }; - MFX::DriverStoreLoader dsLoader; - - if (!dsLoader.GetDriverStorePath(IntelGFXAPIdllName, sizeof(IntelGFXAPIdllName), deviceID)) - { - return MFX_ERR_UNSUPPORTED; - } - - size_t pathLen = wcslen(IntelGFXAPIdllName); - MFX::mfx_get_default_intel_gfx_api_dll_name(IntelGFXAPIdllName + pathLen, sizeof(IntelGFXAPIdllName) / sizeof(IntelGFXAPIdllName[0]) - pathLen); - DISPATCHER_LOG_INFO((("loading %S\n"), IntelGFXAPIdllName)); - - hModule = MFX::mfx_dll_load(IntelGFXAPIdllName); - if (!hModule) - { - DISPATCHER_LOG_ERROR("Can't load intel_gfx_api\n"); - return MFX_ERR_UNSUPPORTED; - } - } - - mfxFunctionPointer pFunc = (mfxFunctionPointer)MFX::mfx_dll_get_addr(hModule, "InitialiseMediaSession"); - if (!pFunc) - { - DISPATCHER_LOG_ERROR("Can't find required API function: InitialiseMediaSession\n"); - MFX::mfx_dll_free(hModule); - return MFX_ERR_UNSUPPORTED; - } - - typedef HRESULT(APIENTRY *InitialiseMediaSessionPtr) (HANDLE*, LPVOID, LPVOID); - InitialiseMediaSessionPtr init = (InitialiseMediaSessionPtr)pFunc; - hr = init((HANDLE*)session, &par, NULL); - - return (hr == S_OK) ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -} - -mfxStatus GfxApiClose(mfxSession& session, mfxModuleHandle& hModule) -{ - HRESULT hr = S_OK; - - if (!hModule) - { - return MFX_ERR_NULL_PTR; - } - - mfxFunctionPointer pFunc = (mfxFunctionPointer)MFX::mfx_dll_get_addr(hModule, "DisposeMediaSession"); - if (!pFunc) - { - DISPATCHER_LOG_ERROR("Can't find required API function: DisposeMediaSession\n"); - return MFX_ERR_INVALID_HANDLE; - } - - typedef HRESULT(APIENTRY *DisposeMediaSessionPtr) (HANDLE); - DisposeMediaSessionPtr dispose = (DisposeMediaSessionPtr)pFunc; - hr = dispose((HANDLE)session); - session = NULL; - - MFX::mfx_dll_free(hModule); - hModule = NULL; - - return (hr == S_OK) ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -} - -mfxStatus GfxApiInitByAdapterNum(mfxInitParam par, mfxU32 adapterNum, mfxSession *session, mfxModuleHandle& hModule) -{ - MFX::DXVA2Device dxvaDevice; - - if (!dxvaDevice.InitDXGI1(adapterNum)) - { - DISPATCHER_LOG_ERROR((("dxvaDevice.InitDXGI1(%d) Failed\n"), adapterNum)); - return MFX_ERR_UNSUPPORTED; - } - - if (dxvaDevice.GetVendorID() != INTEL_VENDOR_ID) - { - DISPATCHER_LOG_ERROR("Specified adapter is not Intel\n"); - return MFX_ERR_UNSUPPORTED; - } - - return GfxApiInit(par, dxvaDevice.GetDeviceID(), session, hModule); -} - -struct GfxApiHandle -{ - mfxModuleHandle hModule; - mfxSession session; - mfxU16 mediaAdapterType; -}; - -static int GfxApiHandleSort(const void * plhs, const void * prhs) -{ - const GfxApiHandle * lhs = *(const GfxApiHandle **)plhs; - const GfxApiHandle * rhs = *(const GfxApiHandle **)prhs; - - // prefer integrated GPU - if (lhs->mediaAdapterType != MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType == MFX_MEDIA_INTEGRATED) - { - return 1; - } - if (lhs->mediaAdapterType == MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType != MFX_MEDIA_INTEGRATED) - { - return -1; - } - - return 0; -} - -mfxStatus GfxApiInitPriorityIntegrated(mfxInitParam par, mfxSession *session, mfxModuleHandle& hModule) -{ - mfxStatus sts = MFX_ERR_UNSUPPORTED; - MFX::MFXVector gfxApiHandles; - - for (int adapterNum = 0; adapterNum < 4; ++adapterNum) - { - MFX::DXVA2Device dxvaDevice; - - if (!dxvaDevice.InitDXGI1(adapterNum) || dxvaDevice.GetVendorID() != INTEL_VENDOR_ID) - { - continue; - } - - par.Implementation &= ~(0xf); - switch (adapterNum) - { - case 0: - par.Implementation |= MFX_IMPL_HARDWARE; - break; - case 1: - par.Implementation |= MFX_IMPL_HARDWARE2; - break; - case 2: - par.Implementation |= MFX_IMPL_HARDWARE3; - break; - case 3: - par.Implementation |= MFX_IMPL_HARDWARE4; - break; - } - - mfxModuleHandle hModuleCur = NULL; - mfxSession sessionCur = NULL; - - sts = GfxApiInit(par, dxvaDevice.GetDeviceID(), &sessionCur, hModuleCur); - if (sts != MFX_ERR_NONE) - continue; - - mfxPlatform platform = { MFX_PLATFORM_UNKNOWN, 0, MFX_MEDIA_UNKNOWN }; - sts = MFXVideoCORE_QueryPlatform(sessionCur, &platform); - if (sts != MFX_ERR_NONE) - { - sts = GfxApiClose(sessionCur, hModuleCur); - if (sts != MFX_ERR_NONE) - return sts; - continue; - } - - GfxApiHandle handle = { hModuleCur, sessionCur, platform.MediaAdapterType }; - gfxApiHandles.push_back(handle); - } - - //Try to use fallback from System folder - mfxModuleHandle hFallback = NULL; - - if (gfxApiHandles.size() == 0) - { - wchar_t IntelGFXAPIdllName[MFX_MAX_DLL_PATH] = { 0 }; - MFX::mfx_get_default_intel_gfx_api_dll_name(IntelGFXAPIdllName, sizeof(IntelGFXAPIdllName) / sizeof(IntelGFXAPIdllName[0])); - DISPATCHER_LOG_INFO((("loading fallback %S\n"), IntelGFXAPIdllName)); - - hFallback = MFX::mfx_dll_load(IntelGFXAPIdllName); - if (!hFallback) - { - DISPATCHER_LOG_ERROR("Can't load intel_gfx_api\n"); - return MFX_ERR_UNSUPPORTED; - } - - for (int adapterNum = 0; adapterNum < 4; ++adapterNum) - { - MFX::DXVA2Device dxvaDevice; - - if (!dxvaDevice.InitDXGI1(adapterNum) || dxvaDevice.GetVendorID() != INTEL_VENDOR_ID) - { - continue; - } - - par.Implementation &= ~(0xf); - switch (adapterNum) - { - case 0: - par.Implementation |= MFX_IMPL_HARDWARE; - break; - case 1: - par.Implementation |= MFX_IMPL_HARDWARE2; - break; - case 2: - par.Implementation |= MFX_IMPL_HARDWARE3; - break; - case 3: - par.Implementation |= MFX_IMPL_HARDWARE4; - break; - } - - mfxSession sessionCur = NULL; - - sts = GfxApiInit(par, dxvaDevice.GetDeviceID(), &sessionCur, hFallback); - if (sts != MFX_ERR_NONE) - continue; - - mfxPlatform platform = { MFX_PLATFORM_UNKNOWN, 0, MFX_MEDIA_UNKNOWN }; - sts = MFXVideoCORE_QueryPlatform(sessionCur, &platform); - if (sts != MFX_ERR_NONE) - { - continue; - } - - GfxApiHandle handle = { NULL, sessionCur, platform.MediaAdapterType }; - gfxApiHandles.push_back(handle); - } - } - - if (gfxApiHandles.size() == 0) - { - if (hFallback != NULL) - { - MFX::mfx_dll_free(hFallback); - hFallback = NULL; - } - - return MFX_ERR_UNSUPPORTED; - } - - qsort(&(*gfxApiHandles.begin()), gfxApiHandles.size(), sizeof(GfxApiHandle), &GfxApiHandleSort); - - // When hModule == NULL and hFallback != NULL - it means dispatcher uses fallback library from System folder - hModule = ( gfxApiHandles.begin()->hModule == NULL && hFallback != NULL )? hFallback : gfxApiHandles.begin()->hModule; - *session = gfxApiHandles.begin()->session; - - MFX::MFXVector::iterator it = gfxApiHandles.begin()++; - for (; it != gfxApiHandles.end(); ++it) - { - sts = GfxApiClose(it->session, it->hModule); - - if (sts == MFX_ERR_NULL_PTR) - continue; - - if (sts != MFX_ERR_NONE) - return sts; - } - - //If dispatcher has tried a fallback, but returns something else - free loaded fallback - if (hFallback != NULL && hModule != hFallback) - { - MFX::mfx_dll_free(hFallback); - hFallback = NULL; - } - - return sts; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_driver_store_loader.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_driver_store_loader.cpp deleted file mode 100644 index 64ca1133..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_driver_store_loader.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) 2019-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include - -#include "mfx_driver_store_loader.h" -#include "mfx_dispatcher_log.h" -#include "mfx_load_dll.h" - -namespace MFX -{ - - -inline bool IsIntelDeviceInstanceID(const wchar_t * DeviceID) -{ - return wcsstr(DeviceID, L"VEN_8086") || wcsstr(DeviceID, L"ven_8086"); -} - -inline bool ExctractDeviceID(const wchar_t* descrString, mfxU32& deviceID) -{ - const wchar_t *begin = wcsstr(descrString, L"DEV_"); - - if (!begin) - { - begin = wcsstr(descrString, L"dev_"); - if (!begin) - { - DISPATCHER_LOG_WRN(("exctracting device id: failed to find device id substring\n")); - return false; - } - } - - begin += wcslen(L"DEV_"); - deviceID = wcstoul(begin, NULL, 16); - if (!deviceID) - { - DISPATCHER_LOG_WRN(("exctracting device id: failed to convert device id str to int\n")); - return false; - } - - return true; -} - -inline bool GetGuidString(const GUID guid, wchar_t * string, size_t size) -{ - return swprintf_s(string, size, - L"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid.Data1, guid.Data2, guid.Data3, - guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], - guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); -} - -DriverStoreLoader::DriverStoreLoader(void) - : m_moduleCfgMgr(NULL) - , m_pCM_Get_Device_ID_List_Size(NULL) - , m_pCM_Get_Device_ID_List(NULL) - , m_pCM_Locate_DevNode(NULL) - , m_pCM_Open_DevNode_Key(NULL) -{ -} - -DriverStoreLoader::~DriverStoreLoader(void) -{ -} - -bool DriverStoreLoader::GetDriverStorePath(wchar_t * path, DWORD dwPathSize, mfxU32 deviceID) -{ - if (path == NULL || dwPathSize == 0) - { - return false; - } - - // Obtain a PnP handle to the Intel graphics adapter - CONFIGRET result = CR_SUCCESS; - ULONG DeviceIDListSize = 0; - MFXVector DeviceIDList; - wchar_t DisplayGUID[40]; - DEVINST DeviceInst; - - DISPATCHER_LOG_INFO(("Looking for MediaSDK in DriverStore\n")); - - if (!LoadCfgMgr() || !LoadCmFuncs()) - { - return false; - } - - if (!GetGuidString(GUID_DEVCLASS_DISPLAY, DisplayGUID, sizeof(DisplayGUID) / sizeof(DisplayGUID[0]))) - { - DISPATCHER_LOG_WRN(("Couldn't prepare string from GUID\n")); - return false; - } - - do - { - result = m_pCM_Get_Device_ID_List_Size(&DeviceIDListSize, DisplayGUID, CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT); - if (result != CR_SUCCESS) - { - break; - } - - try - { - DeviceIDList.resize(DeviceIDListSize); - } - catch (...) - { - return false; - } - result = m_pCM_Get_Device_ID_List(DisplayGUID, DeviceIDList.data(), DeviceIDListSize, CM_GETIDLIST_FILTER_CLASS | CM_GETIDLIST_FILTER_PRESENT); - - } while (result == CR_BUFFER_SMALL); - - if (result != CR_SUCCESS) - { - return false; - } - - //Look for MediaSDK record - wchar_t *begin = DeviceIDList.data(); - wchar_t *end = begin + DeviceIDList.size(); - size_t len = 0; - - for (; (begin < end) && (len = wcslen(begin)) > 0; begin += len + 1) - { - if (IsIntelDeviceInstanceID(begin)) - { - mfxU32 curDeviceID = 0; - if (!ExctractDeviceID(begin, curDeviceID) || curDeviceID != deviceID) - { - continue; - } - - result = m_pCM_Locate_DevNode(&DeviceInst, begin, CM_LOCATE_DEVNODE_NORMAL); - if (result != CR_SUCCESS) - { - continue; - } - - HKEY hKey_sw; - result = m_pCM_Open_DevNode_Key(DeviceInst, KEY_READ, 0, RegDisposition_OpenExisting, &hKey_sw, CM_REGISTRY_SOFTWARE); - if (result != CR_SUCCESS) - { - continue; - } - - ULONG nError; - - DWORD pathSize = dwPathSize; - - nError = RegGetValueW(hKey_sw, NULL, L"DriverStorePathForMediaSDK", RRF_RT_REG_SZ, NULL, (LPBYTE)path, &pathSize); - - RegCloseKey(hKey_sw); - - if (ERROR_SUCCESS == nError) - { - if (path[wcslen(path) - 1] != '/' && path[wcslen(path) - 1] != '\\') - { - wcscat_s(path, dwPathSize / sizeof(path[0]), L"\\"); - } - DISPATCHER_LOG_INFO(("DriverStore path is found\n")); - return true; - } - } - } - - DISPATCHER_LOG_INFO(("DriverStore path isn't found\n")); - return false; - -} // bool DriverStoreLoader::GetDriverStorePath(wchar_t * path, DWORD dwPathSize) - -bool DriverStoreLoader::LoadCfgMgr() -{ - if (!m_moduleCfgMgr) - { - m_moduleCfgMgr = mfx_dll_load(L"cfgmgr32.dll"); - - if (!m_moduleCfgMgr) - { - DISPATCHER_LOG_WRN(("cfgmgr32.dll couldn't be loaded\n")); - return false; - } - } - - return true; - -} // bool DriverStoreLoader::LoadCfgMgr() - -bool DriverStoreLoader::LoadCmFuncs() -{ - if (!m_pCM_Get_Device_ID_List || !m_pCM_Get_Device_ID_List_Size || !m_pCM_Locate_DevNode || !m_pCM_Open_DevNode_Key) - { - m_pCM_Get_Device_ID_List = (Func_CM_Get_Device_ID_ListW) mfx_dll_get_addr((HMODULE)m_moduleCfgMgr, "CM_Get_Device_ID_ListW"); - m_pCM_Get_Device_ID_List_Size = (Func_CM_Get_Device_ID_List_SizeW) mfx_dll_get_addr((HMODULE)m_moduleCfgMgr, "CM_Get_Device_ID_List_SizeW"); - m_pCM_Locate_DevNode = (Func_CM_Locate_DevNodeW) mfx_dll_get_addr((HMODULE)m_moduleCfgMgr, "CM_Locate_DevNodeW"); - m_pCM_Open_DevNode_Key = (Func_CM_Open_DevNode_Key) mfx_dll_get_addr((HMODULE)m_moduleCfgMgr, "CM_Open_DevNode_Key"); - - if (!m_pCM_Get_Device_ID_List || !m_pCM_Get_Device_ID_List_Size || !m_pCM_Locate_DevNode || !m_pCM_Open_DevNode_Key) - { - DISPATCHER_LOG_WRN(("One of cfgmgr32.dll function isn't found\n")); - return false; - } - } - - return true; - -} // bool DriverStoreLoader::LoadCmFuncs() - -} // namespace MFX diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dxva2_device.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dxva2_device.cpp deleted file mode 100644 index 4d09545d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_dxva2_device.cpp +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#define INITGUID -#include -#include - -#include "mfx_dxva2_device.h" - - -using namespace MFX; - - -DXDevice::DXDevice(void) -{ - m_hModule = (HMODULE) 0; - - m_numAdapters = 0; - - m_vendorID = 0; - m_deviceID = 0; - m_driverVersion = 0; - m_luid = 0; - -} // DXDevice::DXDevice(void) - -DXDevice::~DXDevice(void) -{ - Close(); - - // free DX library only when device is destroyed - UnloadDLLModule(); - -} // DXDevice::~DXDevice(void) - -mfxU32 DXDevice::GetVendorID(void) const -{ - return m_vendorID; - -} // mfxU32 DXDevice::GetVendorID(void) const - -mfxU32 DXDevice::GetDeviceID(void) const -{ - return m_deviceID; - -} // mfxU32 DXDevice::GetDeviceID(void) const - -mfxU64 DXDevice::GetDriverVersion(void) const -{ - return m_driverVersion; - -}// mfxU64 DXDevice::GetDriverVersion(void) const - -mfxU64 DXDevice::GetLUID(void) const -{ - return m_luid; - -} // mfxU64 DXDevice::GetLUID(void) const - -mfxU32 DXDevice::GetAdapterCount(void) const -{ - return m_numAdapters; - -} // mfxU32 DXDevice::GetAdapterCount(void) const - -void DXDevice::Close(void) -{ - m_numAdapters = 0; - - m_vendorID = 0; - m_deviceID = 0; - m_luid = 0; - -} // void DXDevice::Close(void) - -void DXDevice::LoadDLLModule(const wchar_t *pModuleName) -{ - // unload the module if it is required - UnloadDLLModule(); - -#if !defined(MEDIASDK_UWP_DISPATCHER) - DWORD prevErrorMode = 0; - // set the silent error mode -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(SEM_FAILCRITICALERRORS, &prevErrorMode); -#else - prevErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); -#endif -#endif // !defined(MEDIASDK_UWP_DISPATCHER) - - // load specified library - m_hModule = LoadLibraryExW(pModuleName, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32 | LOAD_LIBRARY_SEARCH_USER_DIRS); - -#if !defined(MEDIASDK_UWP_DISPATCHER) - // set the previous error mode -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(prevErrorMode, NULL); -#else - SetErrorMode(prevErrorMode); -#endif -#endif // !defined(MEDIASDK_UWP_DISPATCHER) - -} // void LoadDLLModule(const wchar_t *pModuleName) - -void DXDevice::UnloadDLLModule(void) -{ - if (m_hModule) - { - FreeLibrary(m_hModule); - m_hModule = (HMODULE) 0; - } - -} // void DXDevice::UnloaDLLdModule(void) - -#ifdef MFX_D3D9_ENABLED -D3D9Device::D3D9Device(void) -{ - m_pD3D9 = (void *) 0; - m_pD3D9Ex = (void *) 0; - -} // D3D9Device::D3D9Device(void) - -D3D9Device::~D3D9Device(void) -{ - Close(); - -} // D3D9Device::~D3D9Device(void) - -void D3D9Device::Close(void) -{ - // release the interfaces - if (m_pD3D9Ex) - { - ((IDirect3D9Ex *) m_pD3D9Ex)->Release(); - } - - // release the interfaces - if (m_pD3D9) - { - ((IDirect3D9 *) m_pD3D9)->Release(); - } - - m_pD3D9 = (void *) 0; - m_pD3D9Ex = (void *) 0; - -} // void D3D9Device::Close(void) - -typedef - IDirect3D9 * (WINAPI *D3DCreateFunctionPtr_t) (UINT); - -typedef - HRESULT (WINAPI *D3DExCreateFunctionPtr_t) (UINT, IDirect3D9Ex **); - -bool D3D9Device::Init(const mfxU32 adapterNum) -{ - // close the device before initialization - Close(); - - // load the library - if (NULL == m_hModule) - { - LoadDLLModule(L"d3d9.dll"); - } - - if (m_hModule) - { - D3DCreateFunctionPtr_t pFunc; - - // load address of procedure to create D3D device - pFunc = (D3DCreateFunctionPtr_t) GetProcAddress(m_hModule, "Direct3DCreate9"); - if (pFunc) - { - D3DADAPTER_IDENTIFIER9 adapterIdent; - IDirect3D9 *pD3D9; - HRESULT hRes; - - // create D3D object - m_pD3D9 = pFunc(D3D_SDK_VERSION); - - if (NULL == m_pD3D9) - { - DXVA2DEVICE_TRACE(("FAIL: Direct3DCreate9(%d) : GetLastError()=0x%x", D3D_SDK_VERSION, GetLastError())); - return false; - } - - // cast the interface - pD3D9 = (IDirect3D9 *) m_pD3D9; - - m_numAdapters = pD3D9->GetAdapterCount(); - if (adapterNum >= m_numAdapters) - { - return false; - } - - // get the card's parameters - hRes = pD3D9->GetAdapterIdentifier(adapterNum, 0, &adapterIdent); - if (D3D_OK != hRes) - { - DXVA2DEVICE_TRACE(("FAIL: GetAdapterIdentifier(%d) = 0x%x \n", adapterNum, hRes)); - return false; - } - - m_vendorID = adapterIdent.VendorId; - m_deviceID = adapterIdent.DeviceId; - m_driverVersion = (mfxU64)adapterIdent.DriverVersion.QuadPart; - - // load LUID - IDirect3D9Ex *pD3D9Ex; - D3DExCreateFunctionPtr_t pFuncEx; - LUID d3d9LUID; - - // find the appropriate function - pFuncEx = (D3DExCreateFunctionPtr_t) GetProcAddress(m_hModule, "Direct3DCreate9Ex"); - if (NULL == pFuncEx) - { - // the extended interface is not supported - return true; - } - - // create extended interface - hRes = pFuncEx(D3D_SDK_VERSION, &pD3D9Ex); - if (FAILED(hRes)) - { - // can't create extended interface - return true; - } - m_pD3D9Ex = pD3D9Ex; - - // obtain D3D9 device LUID - hRes = pD3D9Ex->GetAdapterLUID(adapterNum, &d3d9LUID); - if (FAILED(hRes)) - { - // can't get LUID - return true; - } - // copy the LUID - *((LUID *) &m_luid) = d3d9LUID; - } - else - { - DXVA2DEVICE_TRACE_OPERATION({ - wchar_t path[1024]; - DWORD lastErr = GetLastError(); - GetModuleFileNameW(m_hModule, path, sizeof(path)/sizeof(path[0])); - DXVA2DEVICE_TRACE(("FAIL: invoking GetProcAddress(Direct3DCreate9) in %S : GetLastError()==0x%x\n", path, lastErr)); }); - return false; - } - } - else - { - DXVA2DEVICE_TRACE(("FAIL: invoking LoadLibrary(\"d3d9.dll\") : GetLastError()==0x%x\n", GetLastError())); - return false; - } - - return true; - -} // bool D3D9Device::Init(const mfxU32 adapterNum) -#endif //MFX_D3D9_ENABLED - -typedef -HRESULT (WINAPI *DXGICreateFactoryFunc) (REFIID riid, void **ppFactory); - -DXGI1Device::DXGI1Device(void) -{ - m_pDXGIFactory1 = (void *) 0; - m_pDXGIAdapter1 = (void *) 0; - -} // DXGI1Device::DXGI1Device(void) - -DXGI1Device::~DXGI1Device(void) -{ - Close(); - -} // DXGI1Device::~DXGI1Device(void) - -void DXGI1Device::Close(void) -{ - // release the interfaces - if (m_pDXGIAdapter1) - { - ((IDXGIAdapter1 *) m_pDXGIAdapter1)->Release(); - } - - if (m_pDXGIFactory1) - { - ((IDXGIFactory1 *) m_pDXGIFactory1)->Release(); - } - - m_pDXGIFactory1 = (void *) 0; - m_pDXGIAdapter1 = (void *) 0; - -} // void DXGI1Device::Close(void) - -bool DXGI1Device::Init(const mfxU32 adapterNum) -{ - // release the object before initialization - Close(); - - IDXGIFactory1 *pFactory = NULL; - IDXGIAdapter1 *pAdapter = NULL; - DXGI_ADAPTER_DESC1 desc = { 0 }; - mfxU32 curAdapter = 0; - mfxU32 maxAdapters = 0; - HRESULT hRes = E_FAIL; - - DXGICreateFactoryFunc pFunc = NULL; - - // load up the library if it is not loaded - if (NULL == m_hModule) - { - LoadDLLModule(L"dxgi.dll"); - } - - if (m_hModule) - { - // load address of procedure to create DXGI 1.1 factory - pFunc = (DXGICreateFactoryFunc)GetProcAddress(m_hModule, "CreateDXGIFactory1"); - } - - if (NULL == pFunc) - { - return false; - } - - // create the factory -#if _MSC_VER >= 1400 - hRes = pFunc(__uuidof(IDXGIFactory1), (void**)(&pFactory)); -#else - hRes = pFunc(IID_IDXGIFactory1, (void**)(&pFactory)); -#endif - - if (FAILED(hRes)) - { - return false; - } - m_pDXGIFactory1 = pFactory; - - // get the number of adapters - curAdapter = 0; - maxAdapters = 0; - do - { - // get the required adapted - hRes = pFactory->EnumAdapters1(curAdapter, &pAdapter); - if (FAILED(hRes)) - { - break; - } - - // if it is the required adapter, save the interface - if (curAdapter == adapterNum) - { - m_pDXGIAdapter1 = pAdapter; - } - else - { - pAdapter->Release(); - } - - // get the next adapter - curAdapter += 1; - - } while (SUCCEEDED(hRes)); - maxAdapters = curAdapter; - - // there is no required adapter - if (adapterNum >= maxAdapters) - { - return false; - } - pAdapter = (IDXGIAdapter1 *) m_pDXGIAdapter1; - - // get the adapter's parameters - hRes = pAdapter->GetDesc1(&desc); - if (FAILED(hRes)) - { - return false; - } - - // save the parameters - m_vendorID = desc.VendorId; - m_deviceID = desc.DeviceId; - *((LUID *) &m_luid) = desc.AdapterLuid; - - return true; - -} // bool DXGI1Device::Init(const mfxU32 adapterNum) - -DXVA2Device::DXVA2Device(void) -{ - m_numAdapters = 0; - - m_vendorID = 0; - m_deviceID = 0; - - m_driverVersion = 0; -} // DXVA2Device::DXVA2Device(void) - -DXVA2Device::~DXVA2Device(void) -{ - Close(); - -} // DXVA2Device::~DXVA2Device(void) - -void DXVA2Device::Close(void) -{ - m_numAdapters = 0; - - m_vendorID = 0; - m_deviceID = 0; - - m_driverVersion = 0; -} // void DXVA2Device::Close(void) - -#ifdef MFX_D3D9_ENABLED -bool DXVA2Device::InitD3D9(const mfxU32 adapterNum) -{ - D3D9Device d3d9Device; - bool bRes; - - // release the object before initialization - Close(); - - // create 'old fashion' device - bRes = d3d9Device.Init(adapterNum); - if (false == bRes) - { - return false; - } - - - m_numAdapters = d3d9Device.GetAdapterCount(); - - // check if the application is under Remote Desktop - if ((0 == d3d9Device.GetVendorID()) || (0 == d3d9Device.GetDeviceID())) - { - // get the required parameters alternative way and ... - UseAlternativeWay(&d3d9Device); - } - else - { - // save the parameters and ... - m_vendorID = d3d9Device.GetVendorID(); - m_deviceID = d3d9Device.GetDeviceID(); - m_driverVersion = d3d9Device.GetDriverVersion(); - } - - // ... say goodbye - return true; -} // bool InitD3D9(const mfxU32 adapterNum) -#else // MFX_D3D9_ENABLED -bool DXVA2Device::InitD3D9(const mfxU32 adapterNum) -{ - (void)adapterNum; - return false; -} -#endif // MFX_D3D9_ENABLED - -bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum) -{ - DXGI1Device dxgi1Device; - bool bRes; - - // release the object before initialization - Close(); - - // create modern DXGI device - bRes = dxgi1Device.Init(adapterNum); - if (false == bRes) - { - return false; - } - - // save the parameters and ... - m_vendorID = dxgi1Device.GetVendorID(); - m_deviceID = dxgi1Device.GetDeviceID(); - m_numAdapters = dxgi1Device.GetAdapterCount(); - - // ... say goodbye - return true; - -} // bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum) - -#ifdef MFX_D3D9_ENABLED -void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device) -{ - mfxU64 d3d9LUID = pD3D9Device->GetLUID(); - - // work only with valid LUIDs - if (0 == d3d9LUID) - { - return; - } - - DXGI1Device dxgi1Device; - mfxU32 curDevice = 0; - bool bRes = false; - - do - { - // initialize the next DXGI1 or DXGI device - bRes = dxgi1Device.Init(curDevice); - if (false == bRes) - { - // there is no more devices - break; - } - - // is it required device ? - if (d3d9LUID == dxgi1Device.GetLUID()) - { - m_vendorID = dxgi1Device.GetVendorID(); - m_deviceID = dxgi1Device.GetDeviceID(); - m_driverVersion = dxgi1Device.GetDriverVersion(); - return ; - } - - // get the next device - curDevice += 1; - - } while (bRes); - - dxgi1Device.Close(); - // we need to match a DXGI(1) device to the D3D9 device - -} // void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device) -#endif // MFX_D3D9_ENABLED - -mfxU32 DXVA2Device::GetVendorID(void) const -{ - return m_vendorID; - -} // mfxU32 DXVA2Device::GetVendorID(void) const - -mfxU32 DXVA2Device::GetDeviceID(void) const -{ - return m_deviceID; - -} // mfxU32 DXVA2Device::GetDeviceID(void) const - -mfxU64 DXVA2Device::GetDriverVersion(void) const -{ - return m_driverVersion; -}// mfxU64 DXVA2Device::GetDriverVersion(void) const - -mfxU32 DXVA2Device::GetAdapterCount(void) const -{ - return m_numAdapters; - -} // mfxU32 DXVA2Device::GetAdapterCount(void) const - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_function_table.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_function_table.cpp deleted file mode 100644 index fb56e492..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_function_table.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_dispatcher.h" - -// -// implement a table with functions names -// - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ - {#func_name, API_VERSION}, - -const -FUNCTION_DESCRIPTION APIFunc[eVideoFuncTotal] = -{ - {"MFXInit", {{0, 1}}}, - {"MFXClose", {{0, 1}}}, - {"MFXQueryIMPL", {{0, 1}}}, - {"MFXQueryVersion", {{0, 1}}}, - - {"MFXJoinSession", {{1, 1}}}, - {"MFXDisjoinSession", {{1, 1}}}, - {"MFXCloneSession", {{1, 1}}}, - {"MFXSetPriority", {{1, 1}}}, - {"MFXGetPriority", {{1, 1}}}, - - {"MFXInitEx", {{1, 14}}}, - -#include "mfx_exposed_functions_list.h" -}; - -const -FUNCTION_DESCRIPTION APIAudioFunc[eAudioFuncTotal] = -{ - {"MFXInit", {{8, 1}}}, - {"MFXClose", {{8, 1}}}, - {"MFXQueryIMPL", {{8, 1}}}, - {"MFXQueryVersion", {{8, 1}}}, - - {"MFXJoinSession", {{8, 1}}}, - {"MFXDisjoinSession", {{8, 1}}}, - {"MFXCloneSession", {{8, 1}}}, - {"MFXSetPriority", {{8, 1}}}, - {"MFXGetPriority", {{8, 1}}}, - -#include "mfxaudio_exposed_functions_list.h" -}; - -// static section of the file -namespace -{ - -// -// declare pseudo-functions. -// they are used as default values for call-tables. -// - -mfxStatus pseudoMFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session) -{ - // touch unreferenced parameters - (void) impl; - (void) ver; - (void) session; - - return MFX_ERR_UNKNOWN; - -} // mfxStatus pseudoMFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session) - -mfxStatus pseudoMFXClose(mfxSession session) -{ - // touch unreferenced parameters - (void) session; - - return MFX_ERR_UNKNOWN; - -} // mfxStatus pseudoMFXClose(mfxSession session) - -mfxStatus pseudoMFXJoinSession(mfxSession session, mfxSession child_session) -{ - // touch unreferenced parameters - (void) session; - (void) child_session; - - return MFX_ERR_UNKNOWN; - -} // mfxStatus pseudoMFXJoinSession(mfxSession session, mfxSession child_session) - -mfxStatus pseudoMFXCloneSession(mfxSession session, mfxSession *clone) -{ - // touch unreferenced parameters - (void) session; - (void) clone; - - return MFX_ERR_UNKNOWN; - -} // mfxStatus pseudoMFXCloneSession(mfxSession session, mfxSession *clone) - -void SuppressWarnings(...) -{ - // this functions is suppose to suppress warnings. - // Actually it does nothing. - -} // void SuppressWarnings(...) - -#undef FUNCTION -#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \ -return_value pseudo##func_name formal_param_list \ -{ \ - SuppressWarnings actual_param_list; \ - return MFX_ERR_UNKNOWN; \ -} - -#include "mfx_exposed_functions_list.h" - -} // namespace diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_library_iterator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_library_iterator.cpp deleted file mode 100644 index 9a2cfe2d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_library_iterator.cpp +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright (c) 2012-2020 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_library_iterator.h" - -#include "mfx_dispatcher.h" -#include "mfx_dispatcher_log.h" - -#include "mfx_dxva2_device.h" -#include "mfx_load_dll.h" - -#include -#include - -namespace MFX -{ - -enum -{ - MFX_MAX_MERIT = 0x7fffffff -}; - -// -// declare registry keys -// - -const -wchar_t rootDispPath[] = L"Software\\Intel\\MediaSDK\\Dispatch"; -const -wchar_t vendorIDKeyName[] = L"VendorID"; -const -wchar_t deviceIDKeyName[] = L"DeviceID"; -const -wchar_t meritKeyName[] = L"Merit"; -const -wchar_t pathKeyName[] = L"Path"; -const -wchar_t apiVersionName[] = L"APIVersion"; - -mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterface, mfxU32 *pVendorID, mfxU32 *pDeviceID) -{ - if (NULL == pImplInterface) - { - return MFX_ERR_NULL_PTR; - } -#if (MFX_VERSION >= MFX_VERSION_NEXT) - mfxIMPL impl_via = (*pImplInterface & ~MFX_IMPL_EXTERNAL_THREADING); -#else - mfxIMPL impl_via = *pImplInterface; -#endif - - DXVA2Device dxvaDevice; - if (MFX_IMPL_VIA_D3D9 == impl_via) - { - // try to create the Direct3D 9 device and find right adapter - if (!dxvaDevice.InitD3D9(adapterNum)) - { - DISPATCHER_LOG_INFO((("dxvaDevice.InitD3D9(%d) Failed\n"), adapterNum )); - return MFX_ERR_UNSUPPORTED; - } - } - else if (MFX_IMPL_VIA_D3D11 == impl_via) - { - // try to open DXGI 1.1 device to get hardware ID - if (!dxvaDevice.InitDXGI1(adapterNum)) - { - DISPATCHER_LOG_INFO((("dxvaDevice.InitDXGI1(%d) Failed\n"), adapterNum )); - return MFX_ERR_UNSUPPORTED; - } - } - else if (MFX_IMPL_VIA_ANY == impl_via) - { - // try the Direct3D 9 device - if (dxvaDevice.InitD3D9(adapterNum)) - { - *pImplInterface = MFX_IMPL_VIA_D3D9; // store value for GetImplementationType() call - } - // else try to open DXGI 1.1 device to get hardware ID - else if (dxvaDevice.InitDXGI1(adapterNum)) - { - *pImplInterface = MFX_IMPL_VIA_D3D11; // store value for GetImplementationType() call - } - else - { - DISPATCHER_LOG_INFO((("Unsupported adapter %d\n"), adapterNum )); - return MFX_ERR_UNSUPPORTED; - } - } - else - { - DISPATCHER_LOG_ERROR((("Unknown implementation type %d\n"), *pImplInterface )); - return MFX_ERR_UNSUPPORTED; - } - - // obtain card's parameters - if (pVendorID && pDeviceID) - { - *pVendorID = dxvaDevice.GetVendorID(); - *pDeviceID = dxvaDevice.GetDeviceID(); - } - - return MFX_ERR_NONE; -} - -MFXLibraryIterator::MFXLibraryIterator(void) -#if !defined(MEDIASDK_UWP_DISPATCHER) - : m_baseRegKey() -#endif -{ - m_implType = MFX_LIB_PSEUDO; - m_implInterface = MFX_IMPL_UNSUPPORTED; - - m_vendorID = 0; - m_deviceID = 0; - - m_lastLibIndex = 0; - m_lastLibMerit = MFX_MAX_MERIT; - - m_bIsSubKeyValid = 0; - m_StorageID = 0; - - m_SubKeyName[0] = 0; -} // MFXLibraryIterator::MFXLibraryIterator(void) - -MFXLibraryIterator::~MFXLibraryIterator(void) -{ - Release(); - -} // MFXLibraryIterator::~MFXLibraryIterator(void) - -void MFXLibraryIterator::Release(void) -{ - m_implType = MFX_LIB_PSEUDO; - m_implInterface = MFX_IMPL_UNSUPPORTED; - - m_vendorID = 0; - m_deviceID = 0; - - m_lastLibIndex = 0; - m_lastLibMerit = MFX_MAX_MERIT; - m_SubKeyName[0] = 0; - -} // void MFXLibraryIterator::Release(void) - -DECLSPEC_NOINLINE HMODULE GetThisDllModuleHandle() -{ - HMODULE hDll = NULL; - - GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | - GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(&GetThisDllModuleHandle), &hDll); - return hDll; -} - -// wchar_t* sImplPath must be allocated with size not less then msdk_disp_path_len -bool GetImplPath(int storageID, wchar_t* sImplPath) -{ - HMODULE hModule = NULL; - - sImplPath[0] = L'\0'; - - switch (storageID) { - case MFX_APP_FOLDER: - hModule = 0; - break; - case MFX_PATH_MSDK_FOLDER: - hModule = GetThisDllModuleHandle(); - HMODULE exeModule = GetModuleHandleW(NULL); - //It should works only if Dispatcher is linked with Dynamic Linked Library - if (!hModule || !exeModule || hModule == exeModule) - return false; - break; - } - - DWORD nSize = 0; - DWORD allocSize = msdk_disp_path_len; - - nSize = GetModuleFileNameW(hModule, &sImplPath[0], allocSize); - - if (nSize == 0 || nSize == allocSize) { - // nSize == 0 meanse that system can't get this info for hModule - // nSize == allocSize buffer is too small - return false; - } - - // for any case because WinXP implementation of GetModuleFileName does not add \0 to the end of string - sImplPath[nSize] = L'\0'; - - wchar_t * dirSeparator = wcsrchr(sImplPath, L'\\'); - if (dirSeparator != NULL && dirSeparator < (sImplPath + msdk_disp_path_len)) - { - *++dirSeparator = 0; - } - return true; -} - -mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID) -{ - // check error(s) - if ((MFX_LIB_SOFTWARE != implType) && - (MFX_LIB_HARDWARE != implType)) - { - return MFX_ERR_UNSUPPORTED; - } - - // release the object before initialization - Release(); - m_StorageID = storageID; - m_lastLibIndex = 0; - m_implType = implType; - m_implInterface = implInterface != 0 - ? implInterface - : MFX_IMPL_VIA_ANY; - - // for HW impl check impl interface, check adapter, obtain deviceID and vendorID - if (m_implType != MFX_LIB_SOFTWARE) - { - mfxStatus mfxRes = MFX::SelectImplementationType(adapterNum, &m_implInterface, &m_vendorID, &m_deviceID); - if (MFX_ERR_NONE != mfxRes) - { - return mfxRes; - } - } - -#if !defined(MEDIASDK_UWP_DISPATCHER) - if (storageID == MFX_CURRENT_USER_KEY || storageID == MFX_LOCAL_MACHINE_KEY) - { - return InitRegistry(storageID); - } - -#if defined(MFX_TRACER_WA_FOR_DS) - if (storageID == MFX_TRACER) - { - return InitRegistryTracer(); - } -#endif - -#endif - - wchar_t sMediaSDKPath[msdk_disp_path_len] = {}; - - if (storageID == MFX_DRIVER_STORE) - { - if (!m_driverStoreLoader.GetDriverStorePath(sMediaSDKPath, sizeof(sMediaSDKPath), m_deviceID)) - { - return MFX_ERR_UNSUPPORTED; - } - } - else if(!GetImplPath(storageID, sMediaSDKPath)) - { - return MFX_ERR_UNSUPPORTED; - } - - return InitFolder(implType, sMediaSDKPath, storageID); - -} // mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, const mfxU32 adapterNum, int storageID) - -mfxStatus MFXLibraryIterator::InitRegistry(int storageID) -{ -#if !defined(MEDIASDK_UWP_DISPATCHER) - HKEY rootHKey; - bool bRes; - - // open required registry key - rootHKey = (MFX_LOCAL_MACHINE_KEY == storageID) ? (HKEY_LOCAL_MACHINE) : (HKEY_CURRENT_USER); - bRes = m_baseRegKey.Open(rootHKey, rootDispPath, KEY_READ); - if (false == bRes) - { - DISPATCHER_LOG_WRN((("Can't open %s\\%S : RegOpenKeyExA()==0x%x\n"), - (MFX_LOCAL_MACHINE_KEY == storageID) ? ("HKEY_LOCAL_MACHINE") : ("HKEY_CURRENT_USER"), - rootDispPath, GetLastError())) - return MFX_ERR_UNKNOWN; - } - - DISPATCHER_LOG_INFO((("Inspecting %s\\%S\n"), - (MFX_LOCAL_MACHINE_KEY == storageID) ? ("HKEY_LOCAL_MACHINE") : ("HKEY_CURRENT_USER"), - rootDispPath)) - - return MFX_ERR_NONE; -#else - (void) storageID; - return MFX_ERR_UNSUPPORTED; -#endif // #if !defined(MEDIASDK_UWP_DISPATCHER) - -} // mfxStatus MFXLibraryIterator::InitRegistry(int storageID) - -#if defined(MFX_TRACER_WA_FOR_DS) -mfxStatus MFXLibraryIterator::InitRegistryTracer() -{ -#if !defined(MEDIASDK_UWP_DISPATCHER) - - const wchar_t tracerRegKeyPath[] = L"Software\\Intel\\MediaSDK\\Dispatch\\tracer"; - - if (!m_baseRegKey.Open(HKEY_LOCAL_MACHINE, tracerRegKeyPath, KEY_READ) && !m_baseRegKey.Open(HKEY_CURRENT_USER, tracerRegKeyPath, KEY_READ)) - { - DISPATCHER_LOG_WRN(("can't find tracer registry key\n")) - return MFX_ERR_UNKNOWN; - } - - DISPATCHER_LOG_INFO(("found tracer registry key\n")) - return MFX_ERR_NONE; - -#else - return MFX_ERR_UNSUPPORTED; -#endif // #if !defined(MEDIASDK_UWP_DISPATCHER) - -} // mfxStatus MFXLibraryIterator::InitRegistryTracer() -#endif - -mfxStatus MFXLibraryIterator::InitFolder(eMfxImplType implType, const wchar_t * path, const int storageID) -{ - const int maxPathLen = sizeof(m_path)/sizeof(m_path[0]); - m_path[0] = 0; - wcscpy_s(m_path, maxPathLen, path); - size_t pathLen = wcslen(m_path); - - if(storageID==MFX_APP_FOLDER) - { - // we looking for runtime in application folder, it should be named libmfxsw64 or libmfxsw32 - mfx_get_default_dll_name(m_path + pathLen, msdk_disp_path_len - pathLen, MFX_LIB_SOFTWARE); - } - else - { - mfx_get_default_dll_name(m_path + pathLen, msdk_disp_path_len - pathLen, implType); - } - - return MFX_ERR_NONE; -} // mfxStatus MFXLibraryIterator::InitFolder(eMfxImplType implType, const wchar_t * path, const int storageID) - -mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath - , size_t pathSize - , eMfxImplType *pImplType, mfxVersion minVersion) -{ - UNREFERENCED_PARAMETER(minVersion); - - if (m_StorageID == MFX_APP_FOLDER) - { - if (m_lastLibIndex != 0) - return MFX_ERR_NOT_FOUND; - if (m_vendorID != INTEL_VENDOR_ID) - return MFX_ERR_UNKNOWN; - - m_lastLibIndex = 1; - wcscpy_s(pPath, pathSize, m_path); - *pImplType = MFX_LIB_SOFTWARE; - return MFX_ERR_NONE; - } - - if (m_StorageID == MFX_PATH_MSDK_FOLDER || m_StorageID == MFX_DRIVER_STORE) - { - if (m_lastLibIndex != 0) - return MFX_ERR_NOT_FOUND; - if (m_vendorID != INTEL_VENDOR_ID) - return MFX_ERR_UNKNOWN; - - m_lastLibIndex = 1; - wcscpy_s(pPath, pathSize, m_path); - // do not change impl type - return MFX_ERR_NONE; - } - -#if !defined(MEDIASDK_UWP_DISPATCHER) - -#if defined(MFX_TRACER_WA_FOR_DS) - if (m_StorageID == MFX_TRACER) - { - if (m_lastLibIndex != 0) - return MFX_ERR_NOT_FOUND; - if (m_vendorID != INTEL_VENDOR_ID) - return MFX_ERR_UNKNOWN; - - m_lastLibIndex = 1; - - if (m_baseRegKey.Query(pathKeyName, REG_SZ, (LPBYTE)pPath, (DWORD*)&pathSize)) - { - DISPATCHER_LOG_INFO((("loaded %S : %S\n"), pathKeyName, pPath)); - } - else - { - DISPATCHER_LOG_WRN((("error querying %S : RegQueryValueExA()==0x%x\n"), pathKeyName, GetLastError())); - } - return MFX_ERR_NONE; - } -#endif - - wchar_t libPath[MFX_MAX_DLL_PATH] = L""; - DWORD libIndex = 0; - DWORD libMerit = 0; - DWORD index; - bool enumRes; - - // main query cycle - index = 0; - m_bIsSubKeyValid = false; - do - { - WinRegKey subKey; - wchar_t subKeyName[MFX_MAX_REGISTRY_KEY_NAME] = { 0 }; - DWORD subKeyNameSize = sizeof(subKeyName) / sizeof(subKeyName[0]); - - // query next value name - enumRes = m_baseRegKey.EnumKey(index, subKeyName, &subKeyNameSize); - if (!enumRes) - { - DISPATCHER_LOG_WRN((("no more subkeys : RegEnumKeyExA()==0x%x\n"), GetLastError())) - } - else - { - DISPATCHER_LOG_INFO((("found subkey: %S\n"), subKeyName)) - - bool bRes; - - // open the sub key - bRes = subKey.Open(m_baseRegKey, subKeyName, KEY_READ); - if (!bRes) - { - DISPATCHER_LOG_WRN((("error opening key %S :RegOpenKeyExA()==0x%x\n"), subKeyName, GetLastError())); - } - else - { - DISPATCHER_LOG_INFO((("opened key: %S\n"), subKeyName)); - - mfxU32 vendorID = 0, deviceID = 0, merit = 0; - DWORD size; - - // query vendor and device IDs - size = sizeof(vendorID); - bRes = subKey.Query(vendorIDKeyName, REG_DWORD, (LPBYTE) &vendorID, &size); - DISPATCHER_LOG_OPERATION({ - if (bRes) - { - DISPATCHER_LOG_INFO((("loaded %S : 0x%x\n"), vendorIDKeyName, vendorID)); - } - else - { - DISPATCHER_LOG_WRN((("querying %S : RegQueryValueExA()==0x%x\n"), vendorIDKeyName, GetLastError())); - } - }) - - if (bRes) - { - size = sizeof(deviceID); - bRes = subKey.Query(deviceIDKeyName, REG_DWORD, (LPBYTE) &deviceID, &size); - DISPATCHER_LOG_OPERATION({ - if (bRes) - { - DISPATCHER_LOG_INFO((("loaded %S : 0x%x\n"), deviceIDKeyName, deviceID)); - } - else - { - DISPATCHER_LOG_WRN((("querying %S : RegQueryValueExA()==0x%x\n"), deviceIDKeyName, GetLastError())); - } - }) - } - // query merit value - if (bRes) - { - size = sizeof(merit); - bRes = subKey.Query(meritKeyName, REG_DWORD, (LPBYTE) &merit, &size); - DISPATCHER_LOG_OPERATION({ - if (bRes) - { - DISPATCHER_LOG_INFO((("loaded %S : %d\n"), meritKeyName, merit)); - } - else - { - DISPATCHER_LOG_WRN((("querying %S : RegQueryValueExA()==0x%x\n"), meritKeyName, GetLastError())); - } - }) - } - - // if the library fits required parameters, - // query the library's path - if (bRes) - { - // compare device's and library's IDs - if (MFX_LIB_HARDWARE == m_implType) - { - if (m_vendorID != vendorID) - { - bRes = false; - DISPATCHER_LOG_WRN((("%S conflict, actual = 0x%x : required = 0x%x\n"), vendorIDKeyName, m_vendorID, vendorID)); - } - if (bRes && m_deviceID != deviceID) - { - bRes = false; - DISPATCHER_LOG_WRN((("%S conflict, actual = 0x%x : required = 0x%x\n"), deviceIDKeyName, m_deviceID, deviceID)); - } - } - - DISPATCHER_LOG_OPERATION({ - if (bRes) - { - if (!(((m_lastLibMerit > merit) || ((m_lastLibMerit == merit) && (m_lastLibIndex < index))) && - (libMerit < merit))) - { - DISPATCHER_LOG_WRN((("merit conflict: lastMerit = 0x%x, requiredMerit = 0x%x, libraryMerit = 0x%x, lastindex = %d, index = %d\n") - , m_lastLibMerit, merit, libMerit, m_lastLibIndex, index)); - } - }}) - - if ((bRes) && - ((m_lastLibMerit > merit) || ((m_lastLibMerit == merit) && (m_lastLibIndex < index))) && - (libMerit < merit)) - { - wchar_t tmpPath[MFX_MAX_DLL_PATH]; - DWORD tmpPathSize = sizeof(tmpPath); - - bRes = subKey.Query(pathKeyName, REG_SZ, (LPBYTE) tmpPath, &tmpPathSize); - if (!bRes) - { - DISPATCHER_LOG_WRN((("error querying %S : RegQueryValueExA()==0x%x\n"), pathKeyName, GetLastError())); - } - else - { - DISPATCHER_LOG_INFO((("loaded %S : %S\n"), pathKeyName, tmpPath)); - - wcscpy_s(libPath, sizeof(libPath) / sizeof(libPath[0]), tmpPath); - wcscpy_s(m_SubKeyName, sizeof(m_SubKeyName) / sizeof(m_SubKeyName[0]), subKeyName); - - libMerit = merit; - libIndex = index; - - // set the library's type - if ((0 == vendorID) || (0 == deviceID)) - { - *pImplType = MFX_LIB_SOFTWARE; - DISPATCHER_LOG_INFO((("Library type is MFX_LIB_SOFTWARE\n"))); - } - else - { - *pImplType = MFX_LIB_HARDWARE; - DISPATCHER_LOG_INFO((("Library type is MFX_LIB_HARDWARE\n"))); - } - } - } - } - } - } - - // advance key index - index += 1; - - } while (enumRes); - - // if the library's path was successfully read, - // the merit variable holds valid value - if (0 == libMerit) - { - return MFX_ERR_NOT_FOUND; - } - - wcscpy_s(pPath, pathSize, libPath); - - m_lastLibIndex = libIndex; - m_lastLibMerit = libMerit; - m_bIsSubKeyValid = true; - -#endif - - return MFX_ERR_NONE; - -} // mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize, eMfxImplType *pImplType, mfxVersion minVersion) - -mfxIMPL MFXLibraryIterator::GetImplementationType() -{ - return m_implInterface; -} // mfxIMPL MFXLibraryIterator::GetImplementationType() - -bool MFXLibraryIterator::GetSubKeyName(wchar_t *subKeyName, size_t length) const -{ - wcscpy_s(subKeyName, length, m_SubKeyName); - return m_bIsSubKeyValid; -} -} // namespace MFX diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_dll.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_dll.cpp deleted file mode 100644 index ff9ec42a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_dll.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_dispatcher.h" -#include "mfx_load_dll.h" - -#include -#include -#include - -#if defined(_WIN64) -const -wchar_t * const defaultDLLName[2] = {L"libmfxhw64.dll", - L"libmfxsw64.dll"}; -const -wchar_t * const defaultAudioDLLName[2] = {L"libmfxaudiosw64.dll", - L"libmfxaudiosw64.dll"}; - -const -wchar_t * const defaultPluginDLLName[2] = {L"mfxplugin64_hw.dll", - L"mfxplugin64_sw.dll"}; - -#if defined(MEDIASDK_UWP_DISPATCHER) -const -wchar_t * const IntelGFXAPIDLLName = {L"intel_gfx_api-x64.dll"}; -#endif - -#elif defined(_WIN32) -const -wchar_t * const defaultDLLName[2] = {L"libmfxhw32.dll", - L"libmfxsw32.dll"}; - -const -wchar_t * const defaultAudioDLLName[2] = {L"libmfxaudiosw32.dll", - L"libmfxaudiosw32.dll"}; - -const -wchar_t * const defaultPluginDLLName[2] = {L"mfxplugin32_hw.dll", - L"mfxplugin32_sw.dll"}; - -#if defined(MEDIASDK_UWP_DISPATCHER) -const -wchar_t * const IntelGFXAPIDLLName = {L"intel_gfx_api-x86.dll"}; -#endif - -#endif // (defined(_WIN64)) - -namespace MFX -{ - - -mfxStatus mfx_get_default_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType) -{ - if (!pPath) - { - return MFX_ERR_NULL_PTR; - } - - - // there are only 2 implementation with default DLL names -#if _MSC_VER >= 1400 - return 0 == wcscpy_s(pPath, pathSize, defaultDLLName[implType & 1]) - ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -#else - wcscpy(pPath, defaultDLLName[implType & 1]); - return MFX_ERR_NONE; -#endif -} // mfxStatus mfx_get_default_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType) - -#if defined(MEDIASDK_UWP_DISPATCHER) -mfxStatus mfx_get_default_intel_gfx_api_dll_name(wchar_t *pPath, size_t pathSize) -{ - if (!pPath) - { - return MFX_ERR_NULL_PTR; - } - -#if _MSC_VER >= 1400 - return 0 == wcscpy_s(pPath, pathSize, IntelGFXAPIDLLName) - ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -#else - wcscpy(pPath, IntelGFXAPIDLLName); - return MFX_ERR_NONE; -#endif -} // mfx_get_default_intel_gfx_api_dll_name(wchar_t *pPath, size_t pathSize) -#endif - -mfxStatus mfx_get_default_plugin_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType) -{ - if (!pPath) - { - return MFX_ERR_NULL_PTR; - } - - - // there are only 2 implementation with default DLL names -#if _MSC_VER >= 1400 - return 0 == wcscpy_s(pPath, pathSize, defaultPluginDLLName[implType & 1]) - ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -#else - wcscpy(pPath, defaultPluginDLLName[implType & 1]); - return MFX_ERR_NONE; -#endif -} - -mfxStatus mfx_get_default_audio_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType) -{ - if (!pPath) - { - return MFX_ERR_NULL_PTR; - } - - // there are only 2 implementation with default DLL names -#if _MSC_VER >= 1400 - return 0 == wcscpy_s(pPath, pathSize, defaultAudioDLLName[implType & 1]) - ? MFX_ERR_NONE : MFX_ERR_UNKNOWN; -#else - wcscpy(pPath, defaultAudioDLLName[implType & 1]); - return MFX_ERR_NONE; -#endif -} // mfxStatus mfx_get_default_audio_dll_name(wchar_t *pPath, size_t pathSize, eMfxImplType implType) - -// Force load library from system path to avoid DLL pre-loading attacks. -// We try to avoid loading DLLs from the application directory because we provide a portable version. -HMODULE load_library_system_path(const wchar_t *pFileName) { - const wchar_t * pDllName = wcsrchr(pFileName, L'\\'); - if (pDllName == NULL) { - pDllName = pFileName; - } else { - pDllName++; - } - return LoadLibraryExW(pDllName, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32 | LOAD_LIBRARY_SEARCH_USER_DIRS); -} - -mfxModuleHandle mfx_dll_load(const wchar_t *pFileName) -{ - mfxModuleHandle hModule = (mfxModuleHandle) 0; - - // check error(s) - if (NULL == pFileName) - { - return NULL; - } -#if !defined(MEDIASDK_UWP_DISPATCHER) - // set the silent error mode - DWORD prevErrorMode = 0; -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(SEM_FAILCRITICALERRORS, &prevErrorMode); -#else - prevErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); -#endif -#endif // !defined(MEDIASDK_UWP_DISPATCHER) - - // load the library's module -#if !defined(MEDIASDK_ARM_LOADER) - hModule = load_library_system_path(pFileName); -#endif - -#if !defined(MEDIASDK_UWP_DISPATCHER) - // set the previous error mode -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(prevErrorMode, NULL); -#else - SetErrorMode(prevErrorMode); -#endif -#endif // !defined(MEDIASDK_UWP_DISPATCHER) - - return hModule; - -} // mfxModuleHandle mfx_dll_load(const wchar_t *pFileName) - -mfxFunctionPointer mfx_dll_get_addr(mfxModuleHandle handle, const char *pFunctionName) -{ - if (NULL == handle) - { - return NULL; - } - - return (mfxFunctionPointer) GetProcAddress((HMODULE) handle, pFunctionName); -} // mfxFunctionPointer mfx_dll_get_addr(mfxModuleHandle handle, const char *pFunctionName) - -bool mfx_dll_free(mfxModuleHandle handle) -{ - if (NULL == handle) - { - return true; - } - - BOOL bRes = FreeLibrary((HMODULE)handle); - - return !!bRes; -} // bool mfx_dll_free(mfxModuleHandle handle) - -#if !defined(MEDIASDK_UWP_DISPATCHER) -mfxModuleHandle mfx_get_dll_handle(const wchar_t *pFileName) -{ - mfxModuleHandle hModule = (mfxModuleHandle) 0; - - // check error(s) - if (NULL == pFileName) - { - return NULL; - } - - // set the silent error mode - DWORD prevErrorMode = 0; -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(SEM_FAILCRITICALERRORS, &prevErrorMode); -#else - prevErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); -#endif - // load the library's module - GetModuleHandleExW(0, pFileName, (HMODULE*) &hModule); - // set the previous error mode -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - SetThreadErrorMode(prevErrorMode, NULL); -#else - SetErrorMode(prevErrorMode); -#endif - return hModule; -} -#endif //!defined(MEDIASDK_UWP_DISPATCHER) - -} // namespace MFX - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_plugin.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_plugin.cpp deleted file mode 100644 index 8b84f4c4..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_load_plugin.cpp +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_load_plugin.h" -#include "mfx_load_dll.h" -#include "mfx_dispatcher_log.h" - -#define TRACE_PLUGIN_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[PLUGIN]: " str), __VA_ARGS__)) -#define TRACE_PLUGIN_INFO(str, ...) DISPATCHER_LOG_INFO((("[PLUGIN]: " str), __VA_ARGS__)) - -#define CREATE_PLUGIN_FNC "CreatePlugin" - -MFX::PluginModule::PluginModule() - : mHmodule() - , mCreatePluginPtr() - , mPath() -{ -} - -MFX::PluginModule::PluginModule(const PluginModule & that) - : mHmodule(mfx_dll_load(that.mPath)) - , mCreatePluginPtr(that.mCreatePluginPtr) -{ - wcscpy_s(mPath, sizeof(mPath) / sizeof(*mPath), that.mPath); -} - -MFX::PluginModule & MFX::PluginModule::operator = (const MFX::PluginModule & that) -{ - if (this != &that) - { - Tidy(); - mHmodule = mfx_dll_load(that.mPath); - mCreatePluginPtr = that.mCreatePluginPtr; - wcscpy_s(mPath, sizeof(mPath) / sizeof(*mPath), that.mPath); - } - return *this; -} - -MFX::PluginModule::PluginModule(const wchar_t * path) - : mCreatePluginPtr() -{ - mHmodule = mfx_dll_load(path); - if (NULL == mHmodule) { - TRACE_PLUGIN_ERROR("Cannot load module: %S\n", path); - return ; - } - TRACE_PLUGIN_INFO("Plugin loaded at: %S\n", path); - - mCreatePluginPtr = (CreatePluginPtr_t)mfx_dll_get_addr(mHmodule, CREATE_PLUGIN_FNC); - if (NULL == mCreatePluginPtr) { - TRACE_PLUGIN_ERROR("Cannot get procedure address: %s\n", CREATE_PLUGIN_FNC); - return ; - } - - wcscpy_s(mPath, sizeof(mPath) / sizeof(*mPath), path); -} - -bool MFX::PluginModule::Create( mfxPluginUID uid, mfxPlugin& plg) -{ - bool result = false; - if (mCreatePluginPtr) - { - mfxStatus mfxResult = mCreatePluginPtr(uid, &plg); - result = (MFX_ERR_NONE == mfxResult); - if (!result) { - TRACE_PLUGIN_ERROR("\"%S::%s\" returned %d\n", mPath, CREATE_PLUGIN_FNC, mfxResult); - } else { - TRACE_PLUGIN_INFO("\"%S::%s\" SUCCEED\n", mPath, CREATE_PLUGIN_FNC); - } - } - return result; -} - -void MFX::PluginModule::Tidy() -{ - mfx_dll_free(mHmodule); - mCreatePluginPtr = NULL; - mHmodule = NULL; -} - -MFX::PluginModule::~PluginModule(void) -{ - Tidy(); -} - -#if !defined(MEDIASDK_UWP_DISPATCHER) - -bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const PluginDescriptionRecord &dsc, mfxPluginParam &pluginParams) -{ - if (plg.PluginInit == 0) - { - TRACE_PLUGIN_ERROR("plg->PluginInit = 0\n", 0); - return false; - } - if (plg.PluginClose == 0) - { - TRACE_PLUGIN_ERROR("plg->PluginClose = 0\n", 0); - return false; - } - if (plg.GetPluginParam == 0) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam = 0\n", 0); - return false; - } - - if (plg.Execute == 0) - { - TRACE_PLUGIN_ERROR("plg->Execute = 0\n", 0); - return false; - } - if (plg.FreeResources == 0) - { - TRACE_PLUGIN_ERROR("plg->FreeResources = 0\n", 0); - return false; - } - - mfxStatus sts = plg.GetPluginParam(plg.pthis, &pluginParams); - if (sts != MFX_ERR_NONE) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned %d\n", sts); - return false; - } - - if (dsc.Default) - { - // for default plugins there is no description, dsc.APIVersion, dsc.PluginVersion and dsc.PluginUID were set by dispatcher - // dsc.PluginVersion == requested plugin version (parameter of MFXVideoUSER_Load); dsc.APIVersion == loaded library API - if (dsc.PluginVersion > pluginParams.PluginVersion) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned PluginVersion=%d, but it is smaller than requested : %d\n", pluginParams.PluginVersion, dsc.PluginVersion); - return false; - } - } - else - { - if (!dsc.onlyVersionRegistered && pluginParams.CodecId != dsc.CodecId) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned CodecId=" MFXFOURCCTYPE()", but registration has CodecId=" MFXFOURCCTYPE()"\n" - , MFXU32TOFOURCC(pluginParams.CodecId), MFXU32TOFOURCC(dsc.CodecId)); - return false; - } - - if (!dsc.onlyVersionRegistered && pluginParams.Type != dsc.Type) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned Type=%d, but registration has Type=%d\n", pluginParams.Type, dsc.Type); - return false; - } - - if (pluginParams.PluginUID != dsc.PluginUID) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned UID=" MFXGUIDTYPE()", but registration has UID=" MFXGUIDTYPE()"\n" - , MFXGUIDTOHEX(&pluginParams.PluginUID), MFXGUIDTOHEX(&dsc.PluginUID)); - return false; - } - - if (pluginParams.PluginVersion != dsc.PluginVersion) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned PluginVersion=%d, but registration has PlgVer=%d\n", pluginParams.PluginVersion, dsc.PluginVersion); - return false; - } - - if (pluginParams.APIVersion.Version != dsc.APIVersion.Version) - { - TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned APIVersion=%d.%d, but registration has APIVer=%d.%d\n" - , pluginParams.APIVersion.Major, pluginParams.APIVersion.Minor - , dsc.APIVersion.Major, dsc.APIVersion.Minor); - return false; - } - } - - switch(pluginParams.Type) - { - case MFX_PLUGINTYPE_VIDEO_DECODE: - case MFX_PLUGINTYPE_VIDEO_ENCODE: - case MFX_PLUGINTYPE_VIDEO_VPP: - { - TRACE_PLUGIN_INFO("plugin type= %d\n", pluginParams.Type); - if (plg.Video == 0) - { - TRACE_PLUGIN_ERROR("plg->Video = 0\n", 0); - return false; - } - - if (!VerifyCodecCommon(*plg.Video)) - return false; - break; - } - } - - switch(pluginParams.Type) - { - case MFX_PLUGINTYPE_VIDEO_DECODE: - return VerifyDecoder(*plg.Video); - case MFX_PLUGINTYPE_AUDIO_DECODE: - return VerifyAudioDecoder(*plg.Audio); - case MFX_PLUGINTYPE_VIDEO_ENCODE: - return VerifyEncoder(*plg.Video); - case MFX_PLUGINTYPE_AUDIO_ENCODE: - return VerifyAudioEncoder(*plg.Audio); - case MFX_PLUGINTYPE_VIDEO_VPP: - return VerifyVpp(*plg.Video); - case MFX_PLUGINTYPE_VIDEO_ENC: - return VerifyEnc(*plg.Video); - default: - { - TRACE_PLUGIN_ERROR("unsupported plugin type: %d\n", pluginParams.Type); - return false; - } - } -} - -bool MFX::MFXPluginFactory::VerifyVpp( const mfxVideoCodecPlugin &vpp ) -{ - if (vpp.VPPFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->VPPFrameSubmit = 0\n", 0); - return false; - } - - return true; - -} - -bool MFX::MFXPluginFactory::VerifyEncoder( const mfxVideoCodecPlugin &encoder ) -{ - if (encoder.EncodeFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->EncodeFrameSubmit = 0\n", 0); - return false; - } - - return true; -} - -bool MFX::MFXPluginFactory::VerifyAudioEncoder( const mfxAudioCodecPlugin &encoder ) -{ - if (encoder.EncodeFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Audio->EncodeFrameSubmit = 0\n", 0); - return false; - } - - return true; -} - -bool MFX::MFXPluginFactory::VerifyEnc( const mfxVideoCodecPlugin &videoEnc ) -{ - if (videoEnc.ENCFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->EncodeFrameSubmit = 0\n", 0); - return false; - } - - return true; -} - -bool MFX::MFXPluginFactory::VerifyDecoder( const mfxVideoCodecPlugin &decoder ) -{ - if (decoder.DecodeHeader == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->DecodeHeader = 0\n", 0); - return false; - } - if (decoder.GetPayload == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->GetPayload = 0\n", 0); - return false; - } - if (decoder.DecodeFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->DecodeFrameSubmit = 0\n", 0); - return false; - } - - return true; -} - -bool MFX::MFXPluginFactory::VerifyAudioDecoder( const mfxAudioCodecPlugin &decoder ) -{ - if (decoder.DecodeHeader == 0) - { - TRACE_PLUGIN_ERROR("plg->Audio->DecodeHeader = 0\n", 0); - return false; - } -// if (decoder.GetPayload == 0) - { - // TRACE_PLUGIN_ERROR("plg->Audio->GetPayload = 0\n", 0); - // return false; - } - if (decoder.DecodeFrameSubmit == 0) - { - TRACE_PLUGIN_ERROR("plg->Audio->DecodeFrameSubmit = 0\n", 0); - return false; - } - - return true; -} - -bool MFX::MFXPluginFactory::VerifyCodecCommon( const mfxVideoCodecPlugin & videoCodec ) -{ - if (videoCodec.Query == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->Query = 0\n", 0); - return false; - } - //todo: remove - if (videoCodec.Query == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->Query = 0\n", 0); - return false; - } - if (videoCodec.QueryIOSurf == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->QueryIOSurf = 0\n", 0); - return false; - } - if (videoCodec.Init == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->Init = 0\n", 0); - return false; - } - if (videoCodec.Reset == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->Reset = 0\n", 0); - return false; - } - if (videoCodec.Close == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->Close = 0\n", 0); - return false; - } - if (videoCodec.GetVideoParam == 0) - { - TRACE_PLUGIN_ERROR("plg->Video->GetVideoParam = 0\n", 0); - return false; - } - - return true; -} - -mfxStatus MFX::MFXPluginFactory::Create(const PluginDescriptionRecord & rec) -{ - PluginModule plgModule(rec.sPath); - mfxPlugin plg = {}; - mfxPluginParam plgParams; - - if (!plgModule.Create(rec.PluginUID, plg)) - { - return MFX_ERR_UNKNOWN; - } - - if (!RunVerification(plg, rec, plgParams)) - { - //will do not call plugin close since it is not safe to do that until structure is corrected - return MFX_ERR_UNKNOWN; - } - - - if (rec.Type == MFX_PLUGINTYPE_AUDIO_DECODE || - rec.Type == MFX_PLUGINTYPE_AUDIO_ENCODE) - { - mfxStatus sts = MFXAudioUSER_Register(mSession, plgParams.Type, &plg); - if (MFX_ERR_NONE != sts) - { - TRACE_PLUGIN_ERROR(" MFXAudioUSER_Register returned %d\n", sts); - return sts; - } - } - else - { - mfxStatus sts = MFXVideoUSER_Register(mSession, plgParams.Type, &plg); - if (MFX_ERR_NONE != sts) - { - TRACE_PLUGIN_ERROR(" MFXVideoUSER_Register returned %d\n", sts); - return sts; - } - } - - mPlugins.push_back(FactoryRecord(plgParams, plgModule, plg)); - - return MFX_ERR_NONE; -} - -MFX::MFXPluginFactory::~MFXPluginFactory() -{ - Close(); -} - -MFX::MFXPluginFactory::MFXPluginFactory( mfxSession session ) : - mPlugins() -{ - mSession = session; - nPlugins = 0; -} - -bool MFX::MFXPluginFactory::Destroy( const mfxPluginUID & uidToDestroy) -{ - for (MFXVector::iterator i = mPlugins.begin(); i!= mPlugins.end(); i++) - { - if (i->plgParams.PluginUID == uidToDestroy) - { - DestroyPlugin(*i); - //dll unload should happen here - //todo: check that dll_free fail is traced - mPlugins.erase(i); - return true; - } - } - return false; -} - -void MFX::MFXPluginFactory::Close() -{ - for (MFXVector::iterator i = mPlugins.begin(); i!= mPlugins.end(); i++) - { - DestroyPlugin(*i); - } - mPlugins.clear(); -} - -void MFX::MFXPluginFactory::DestroyPlugin( FactoryRecord & record) -{ - mfxStatus sts; - if (record.plgParams.Type == MFX_PLUGINTYPE_AUDIO_DECODE || - record.plgParams.Type == MFX_PLUGINTYPE_AUDIO_ENCODE) - { - sts = MFXAudioUSER_Unregister(mSession, record.plgParams.Type); - TRACE_PLUGIN_INFO(" MFXAudioUSER_Unregister for Type=%d, returned %d\n", record.plgParams.Type, sts); - } - else - { - sts = MFXVideoUSER_Unregister(mSession, record.plgParams.Type); - TRACE_PLUGIN_INFO(" MFXVideoUSER_Unregister for Type=%d, returned %d\n", record.plgParams.Type, sts); - } -} - -#endif //!defined(MEDIASDK_UWP_DISPATCHER) \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_plugin_hive.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_plugin_hive.cpp deleted file mode 100644 index e7b47d46..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_plugin_hive.cpp +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) 2013-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "mfx_plugin_hive.h" -#include "mfx_library_iterator.h" -#include "mfx_dispatcher.h" -#include "mfx_dispatcher_log.h" -#include "mfx_load_dll.h" - -#define TRACE_HIVE_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[HIVE]: " str), __VA_ARGS__)) -#define TRACE_HIVE_INFO(str, ...) DISPATCHER_LOG_INFO((("[HIVE]: " str), __VA_ARGS__)) -#define TRACE_HIVE_WRN(str, ...) DISPATCHER_LOG_WRN((("[HIVE]: " str), __VA_ARGS__)) - -namespace -{ - const wchar_t rootPluginPath[] = L"Software\\Intel\\MediaSDK\\Plugin"; - const wchar_t rootDispatchPath[] = L"Software\\Intel\\MediaSDK\\Dispatch"; - const wchar_t pluginSubkey[] = L"Plugin"; - const wchar_t TypeKeyName[] = L"Type"; - const wchar_t CodecIDKeyName[] = L"CodecID"; - const wchar_t GUIDKeyName[] = L"GUID"; - const wchar_t PathKeyName[] = L"Path"; - const wchar_t DefaultKeyName[] = L"Default"; - const wchar_t PlgVerKeyName[] = L"PluginVersion"; - const wchar_t APIVerKeyName[] = L"APIVersion"; -} - -namespace -{ -#ifdef _WIN64 - const wchar_t pluginFileName[] = L"FileName64"; -#else - const wchar_t pluginFileName[] = L"FileName32"; -#endif // _WIN64 - - //do not allow store plugin in different hierarchy - const wchar_t pluginFileNameRestrictedCharacters[] = L"\\/"; - const wchar_t pluginCfgFileName[] = L"plugin.cfg"; - const wchar_t pluginSearchPattern[] = L"????????????????????????????????"; - const mfxU32 pluginCfgFileNameLen = 10; - const mfxU32 pluginDirNameLen = 32; - const mfxU32 defaultPluginNameLen = 25; - const mfxU32 charsPermfxU8 = 2; - const mfxU32 slashLen = 1; - enum - { - MAX_PLUGIN_FILE_LINE = 4096 - }; - - #define alignStr() "%-14S" -} - -#if !defined(MEDIASDK_UWP_DISPATCHER) - -MFX::MFXPluginsInHive::MFXPluginsInHive(int mfxStorageID, const wchar_t *msdkLibSubKey, mfxVersion currentAPIVersion) - : MFXPluginStorageBase(currentAPIVersion) -{ - HKEY rootHKey; - bool bRes; - WinRegKey regKey; - - if (MFX_LOCAL_MACHINE_KEY != mfxStorageID && MFX_CURRENT_USER_KEY != mfxStorageID) - return; - - // open required registry key - rootHKey = (MFX_LOCAL_MACHINE_KEY == mfxStorageID) ? (HKEY_LOCAL_MACHINE) : (HKEY_CURRENT_USER); - if (msdkLibSubKey) { - //dispatch/subkey/plugin - bRes = regKey.Open(rootHKey, rootDispatchPath, KEY_READ); - if (bRes) - { - bRes = regKey.Open(regKey, msdkLibSubKey, KEY_READ); - } - if (bRes) - { - bRes = regKey.Open(regKey, pluginSubkey, KEY_READ); - } - } - else - { - bRes = regKey.Open(rootHKey, rootPluginPath, KEY_READ); - } - - if (false == bRes) { - return; - } - DWORD index = 0; - if (!regKey.QueryInfo(&index)) { - return; - } - try - { - resize(index); - } - catch (...) { - TRACE_HIVE_ERROR("new PluginDescriptionRecord[%d] threw an exception: \n", index); - return; - } - - for(index = 0; ; index++) - { - wchar_t subKeyName[MFX_MAX_REGISTRY_KEY_NAME]; - DWORD subKeyNameSize = sizeof(subKeyName) / sizeof(subKeyName[0]); - WinRegKey subKey; - - // query next value name - bool enumRes = regKey.EnumKey(index, subKeyName, &subKeyNameSize); - if (!enumRes) { - break; - } - - // open the sub key - bRes = subKey.Open(regKey, subKeyName, KEY_READ); - if (!bRes) { - continue; - } - - if (msdkLibSubKey) - { - TRACE_HIVE_INFO("Found Plugin: %s\\%S\\%S\\%S\\%S\n", (MFX_LOCAL_MACHINE_KEY == mfxStorageID) ? ("HKEY_LOCAL_MACHINE") : ("HKEY_CURRENT_USER"), - rootDispatchPath, msdkLibSubKey, pluginSubkey, subKeyName); - } - else - { - TRACE_HIVE_INFO("Found Plugin: %s\\%S\\%S\n", (MFX_LOCAL_MACHINE_KEY == mfxStorageID) ? ("HKEY_LOCAL_MACHINE") : ("HKEY_CURRENT_USER"), - rootPluginPath, subKeyName); - } - - PluginDescriptionRecord descriptionRecord; - - if (!QueryKey(subKey, TypeKeyName, descriptionRecord.Type)) - { - continue; - } - TRACE_HIVE_INFO(alignStr()" : %d\n", TypeKeyName, descriptionRecord.Type); - - if (QueryKey(subKey, CodecIDKeyName, descriptionRecord.CodecId)) - { - TRACE_HIVE_INFO(alignStr()" : " MFXFOURCCTYPE()" \n", CodecIDKeyName, MFXU32TOFOURCC(descriptionRecord.CodecId)); - } - else - { - TRACE_HIVE_INFO(alignStr()" : \n", CodecIDKeyName, "NOT REGISTERED"); - } - - if (!QueryKey(subKey, GUIDKeyName, descriptionRecord.PluginUID)) - { - continue; - } - TRACE_HIVE_INFO(alignStr()" : " MFXGUIDTYPE()"\n", GUIDKeyName, MFXGUIDTOHEX(&descriptionRecord.PluginUID)); - - mfxU32 nSize = sizeof(descriptionRecord.sPath)/sizeof(*descriptionRecord.sPath); - if (!subKey.Query(PathKeyName, descriptionRecord.sPath, nSize)) - { - TRACE_HIVE_WRN("no value for : %S\n", PathKeyName); - continue; - } - TRACE_HIVE_INFO(alignStr()" : %S\n", PathKeyName, descriptionRecord.sPath); - - if (!QueryKey(subKey, DefaultKeyName, descriptionRecord.Default)) - { - continue; - } - TRACE_HIVE_INFO(alignStr()" : %s\n", DefaultKeyName, descriptionRecord.Default ? "true" : "false"); - - mfxU32 version = 0; - if (!QueryKey(subKey, PlgVerKeyName, version)) - { - continue; - } - descriptionRecord.PluginVersion = static_cast(version); - if (0 == version) - { - TRACE_HIVE_ERROR(alignStr()" : %d, which is invalid\n", PlgVerKeyName, descriptionRecord.PluginVersion); - continue; - } - else - { - TRACE_HIVE_INFO(alignStr()" : %d\n", PlgVerKeyName, descriptionRecord.PluginVersion); - } - - mfxU32 APIVersion = 0; - if (!QueryKey(subKey, APIVerKeyName, APIVersion)) - { - continue; - } - ConvertAPIVersion(APIVersion, descriptionRecord); - TRACE_HIVE_INFO(alignStr()" : %d.%d \n", APIVerKeyName, descriptionRecord.APIVersion.Major, descriptionRecord.APIVersion.Minor); - - try - { - operator[](index) = descriptionRecord; - } - catch (...) { - TRACE_HIVE_ERROR("operator[](%d) = descriptionRecord; - threw exception \n", index); - } - } -} - -MFX::MFXPluginsInFS::MFXPluginsInFS( mfxVersion currentAPIVersion ) - : MFXPluginStorageBase(currentAPIVersion) - , mIsVersionParsed() - , mIsAPIVersionParsed() -{ - WIN32_FIND_DATAW find_data; - wchar_t currentModuleName[MAX_PLUGIN_PATH]; - - GetModuleFileNameW(NULL, currentModuleName, MAX_PLUGIN_PATH); - if (GetLastError() != 0) - { - TRACE_HIVE_ERROR("GetModuleFileName() reported an error: %d\n", GetLastError()); - return; - } - wchar_t *lastSlashPos = wcsrchr(currentModuleName, L'\\'); - if (!lastSlashPos) { - lastSlashPos = currentModuleName; - } - mfxU32 executableDirLen = (mfxU32)(lastSlashPos - currentModuleName) + slashLen; - if (executableDirLen + pluginDirNameLen + pluginCfgFileNameLen >= MAX_PLUGIN_PATH) - { - TRACE_HIVE_ERROR("MAX_PLUGIN_PATH which is %d, not enough to locate plugin path\n", MAX_PLUGIN_PATH); - return; - } - wcscpy_s(lastSlashPos + slashLen - , MAX_PLUGIN_PATH - executableDirLen, pluginSearchPattern); - - HANDLE fileFirst = FindFirstFileW(currentModuleName, &find_data); - if (INVALID_HANDLE_VALUE == fileFirst) - { - TRACE_HIVE_ERROR("FindFirstFileW() unable to locate any plugins folders\n", 0); - return; - } - do - { - if (!(find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - continue; - } - if (pluginDirNameLen != wcslen(find_data.cFileName)) - { - continue; - } - //converting dirname into guid - PluginDescriptionRecord descriptionRecord; - descriptionRecord.APIVersion = currentAPIVersion; - descriptionRecord.onlyVersionRegistered = true; - - mfxU32 i = 0; - for(i = 0; i != pluginDirNameLen / charsPermfxU8; i++) - { - mfxU32 hexNum = 0; - if (1 != swscanf_s(find_data.cFileName + charsPermfxU8 * i, L"%2x", &hexNum)) - { - // it is ok to have non-plugin subdirs with length 32 - //TRACE_HIVE_INFO("folder name \"%S\" is not a valid GUID string\n", find_data.cFileName); - break; - } - if (hexNum == 0 && find_data.cFileName + charsPermfxU8 * i != wcsstr(find_data.cFileName + 2*i, L"00")) - { - // it is ok to have non-plugin subdirs with length 32 - //TRACE_HIVE_INFO("folder name \"%S\" is not a valid GUID string\n", find_data.cFileName); - break; - } - descriptionRecord.PluginUID.Data[i] = (mfxU8)hexNum; - } - if (i != pluginDirNameLen / charsPermfxU8) { - continue; - } - - wcscpy_s(currentModuleName + executableDirLen - , MAX_PLUGIN_PATH - executableDirLen, find_data.cFileName); - - wcscpy_s(currentModuleName + executableDirLen + pluginDirNameLen - , MAX_PLUGIN_PATH - executableDirLen - pluginDirNameLen, L"\\"); - - //this is path to plugin directory - wcscpy_s(descriptionRecord.sPath - , sizeof(descriptionRecord.sPath) / sizeof(*descriptionRecord.sPath), currentModuleName); - - wcscpy_s(currentModuleName + executableDirLen + pluginDirNameLen + slashLen - , MAX_PLUGIN_PATH - executableDirLen - pluginDirNameLen - slashLen, pluginCfgFileName); - - FILE *pluginCfgFile = 0; - _wfopen_s(&pluginCfgFile, currentModuleName, L"r"); - if (!pluginCfgFile) - { - TRACE_HIVE_INFO("in directory \"%S\" no mandatory \"%S\"\n" - , find_data.cFileName, pluginCfgFileName); - continue; - } - - if (ParseFile(pluginCfgFile, descriptionRecord)) - { - try - { - push_back(descriptionRecord); - } - catch (...) { - TRACE_HIVE_ERROR("mRecords.push_back(descriptionRecord); - threw exception \n", 0); - } - } - - fclose(pluginCfgFile); - }while (FindNextFileW(fileFirst, &find_data)); - FindClose(fileFirst); -} - -bool MFX::MFXPluginsInFS::ParseFile(FILE * f, PluginDescriptionRecord & descriptionRecord) -{ - wchar_t line[MAX_PLUGIN_FILE_LINE]; - - while(NULL != fgetws(line, sizeof(line) / sizeof(*line), f)) - { - wchar_t *delimiter = wcschr(line, L'='); - if (0 == delimiter) - { - TRACE_HIVE_INFO("plugin.cfg contains line \"%S\" which is not in K=V format, skipping \n", line); - continue; - } - *delimiter = 0; - if (!ParseKVPair(line, delimiter + 1, descriptionRecord)) - { - return false; - } - } - - if (!mIsVersionParsed) - { - TRACE_HIVE_ERROR("%S : Mandatory key %S not found\n", pluginCfgFileName, PlgVerKeyName); - return false; - } - - if (!mIsAPIVersionParsed) - { - TRACE_HIVE_ERROR("%S : Mandatory key %S not found\n", pluginCfgFileName, APIVerKeyName); - return false; - } - - if (!wcslen(descriptionRecord.sPath)) - { - TRACE_HIVE_ERROR("%S : Mandatory key %S not found\n", pluginCfgFileName, pluginFileName); - return false; - } - - return true; -} - -bool MFX::MFXPluginsInFS::ParseKVPair( wchar_t * key, wchar_t* value, PluginDescriptionRecord & descriptionRecord) -{ - if (0 != wcsstr(key, PlgVerKeyName)) - { - mfxU32 version ; - if (0 == swscanf_s(value, L"%d", &version)) - { - return false; - } - descriptionRecord.PluginVersion = (mfxU16)version; - - if (0 == descriptionRecord.PluginVersion) - { - TRACE_HIVE_ERROR("%S: %S = %d, which is invalid\n", pluginCfgFileName, PlgVerKeyName, descriptionRecord.PluginVersion); - return false; - } - - TRACE_HIVE_INFO("%S: %S = %d \n", pluginCfgFileName, PlgVerKeyName, descriptionRecord.PluginVersion); - mIsVersionParsed = true; - return true; - } - - if (0 != wcsstr(key, APIVerKeyName)) - { - mfxU32 APIversion; - if (0 == swscanf_s(value, L"%d", &APIversion)) - { - return false; - } - - ConvertAPIVersion(APIversion, descriptionRecord); - TRACE_HIVE_INFO("%S: %S = %d.%d \n", pluginCfgFileName, APIVerKeyName, descriptionRecord.APIVersion.Major, descriptionRecord.APIVersion.Minor); - - mIsAPIVersionParsed = true; - return true; - } - - - if (0!=wcsstr(key, pluginFileName)) - { - wchar_t *startQuoteMark = wcschr(value, L'\"'); - if (!startQuoteMark) - { - TRACE_HIVE_ERROR("plugin filename not in quotes : %S\n", value); - return false; - } - wchar_t *endQuoteMark = wcschr(startQuoteMark + 1, L'\"'); - - if (!endQuoteMark) - { - TRACE_HIVE_ERROR("plugin filename not in quotes : %S\n", value); - return false; - } - *endQuoteMark = 0; - - mfxU32 currentPathLen = (mfxU32)wcslen(descriptionRecord.sPath); - if (currentPathLen + wcslen(startQuoteMark + 1) > sizeof(descriptionRecord.sPath) / sizeof(*descriptionRecord.sPath)) - { - TRACE_HIVE_ERROR("buffer of MAX_PLUGIN_PATH characters which is %d, not enough lo store plugin path: %S%S\n" - , MAX_PLUGIN_PATH, descriptionRecord.sPath, startQuoteMark + 1); - return false; - } - - size_t restrictedCharIdx = wcscspn(startQuoteMark + 1, pluginFileNameRestrictedCharacters); - if (restrictedCharIdx != wcslen(startQuoteMark + 1)) - { - TRACE_HIVE_ERROR("plugin filename :%S, contains one of restricted characters: %S\n", startQuoteMark + 1, pluginFileNameRestrictedCharacters); - return false; - } - - wcscpy_s(descriptionRecord.sPath + currentPathLen - , sizeof(descriptionRecord.sPath) / sizeof(*descriptionRecord.sPath) - currentPathLen, startQuoteMark + 1); - - TRACE_HIVE_INFO("%S: %S = \"%S\" \n", pluginCfgFileName, pluginFileName, startQuoteMark + 1); - - return true; - } - - - return true; -} - -#endif //#if !defined(MEDIASDK_UWP_DISPATCHER) - -MFX::MFXDefaultPlugins::MFXDefaultPlugins(mfxVersion currentAPIVersion, MFX_DISP_HANDLE * hdl, int implType) - : MFXPluginStorageBase(currentAPIVersion) -{ - wchar_t libModuleName[MAX_PLUGIN_PATH]; - - GetModuleFileNameW((HMODULE)hdl->hModule, libModuleName, MAX_PLUGIN_PATH); - if (GetLastError() != 0) - { - TRACE_HIVE_ERROR("GetModuleFileName() reported an error: %d\n", GetLastError()); - return; - } - wchar_t *lastSlashPos = wcsrchr(libModuleName, L'\\'); - if (!lastSlashPos) { - lastSlashPos = libModuleName; - } - mfxU32 executableDirLen = (mfxU32)(lastSlashPos - libModuleName) + slashLen; - if (executableDirLen + defaultPluginNameLen >= MAX_PLUGIN_PATH) - { - TRACE_HIVE_ERROR("MAX_PLUGIN_PATH which is %d, not enough to locate default plugin path\n", MAX_PLUGIN_PATH); - return; - } - - mfx_get_default_plugin_name(lastSlashPos + slashLen, MAX_PLUGIN_PATH - executableDirLen, (eMfxImplType)implType); - - if (-1 != GetFileAttributesW(libModuleName)) - { - // add single default plugin description - PluginDescriptionRecord descriptionRecord; - descriptionRecord.APIVersion = currentAPIVersion; - descriptionRecord.Default = true; - - wcscpy_s(descriptionRecord.sPath - , sizeof(descriptionRecord.sPath) / sizeof(*descriptionRecord.sPath), libModuleName); - - push_back(descriptionRecord); - } - else - { - TRACE_HIVE_INFO("GetFileAttributesW() unable to locate default plugin dll named %S\n", libModuleName); - } -} - - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_win_reg_key.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_win_reg_key.cpp deleted file mode 100644 index b9df8895..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/windows/src/mfx_win_reg_key.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) 2012-2019 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if !defined(MEDIASDK_UWP_DISPATCHER) -#include "mfx_win_reg_key.h" -#include "mfx_dispatcher_log.h" - -#define TRACE_WINREG_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[WINREG]: " str), __VA_ARGS__)) - -namespace MFX -{ - -WinRegKey::WinRegKey(void) -{ - m_hKey = (HKEY) 0; - -} // WinRegKey::WinRegKey(void) - -WinRegKey::~WinRegKey(void) -{ - Release(); - -} // WinRegKey::~WinRegKey(void) - -void WinRegKey::Release(void) -{ - // close the opened key - if (m_hKey) - { - RegCloseKey(m_hKey); - } - - m_hKey = (HKEY) 0; - -} // void WinRegKey::Release(void) - -bool WinRegKey::Open(HKEY hRootKey, const wchar_t *pSubKey, REGSAM samDesired) -{ - LONG lRes; - HKEY hTemp; - - // - // All operation are performed in this order by intention. - // It makes possible to reopen the keys, using itself as a base. - // - - // try to the open registry key - lRes = RegOpenKeyExW(hRootKey, pSubKey, 0, samDesired, &hTemp); - if (ERROR_SUCCESS != lRes) - { - DISPATCHER_LOG_OPERATION(SetLastError(lRes)); - TRACE_WINREG_ERROR("Opening key \"%s\\%S\" : RegOpenKeyExW()==0x%x\n" - , (HKEY_LOCAL_MACHINE == hRootKey) ? ("HKEY_LOCAL_MACHINE") - : (HKEY_CURRENT_USER == hRootKey) ? ("HKEY_CURRENT_USER") - : "UNSUPPORTED_KEY", pSubKey, GetLastError()); - return false; - } - - // release the object before initialization - Release(); - - // save the handle - m_hKey = hTemp; - - return true; - -} // bool WinRegKey::Open(HKEY hRootKey, const wchar_t *pSubKey, REGSAM samDesired) - -bool WinRegKey::Open(WinRegKey &rootKey, const wchar_t *pSubKey, REGSAM samDesired) -{ - return Open(rootKey.m_hKey, pSubKey, samDesired); - -} // bool WinRegKey::Open(WinRegKey &rootKey, const wchar_t *pSubKey, REGSAM samDesired) - -bool WinRegKey::QueryValueSize(const wchar_t *pValueName, DWORD type, LPDWORD pcbData) { - DWORD keyType = type; - LONG lRes; - - // query the value - lRes = RegQueryValueExW(m_hKey, pValueName, NULL, &keyType, 0, pcbData); - if (ERROR_SUCCESS != lRes) - { - DISPATCHER_LOG_OPERATION(SetLastError(lRes)); - TRACE_WINREG_ERROR("Querying \"%S\" : RegQueryValueExA()==0x%x\n", pValueName, GetLastError()); - return false; - } - - return true; -} - -bool WinRegKey::Query(const wchar_t *pValueName, DWORD type, LPBYTE pData, LPDWORD pcbData) -{ - DWORD keyType = type; - LONG lRes; - DWORD dstSize = (pcbData) ? (*pcbData) : (0); - - // query the value - lRes = RegQueryValueExW(m_hKey, pValueName, NULL, &keyType, pData, pcbData); - if (ERROR_SUCCESS != lRes) - { - DISPATCHER_LOG_OPERATION(SetLastError(lRes)); - TRACE_WINREG_ERROR("Querying \"%S\" : RegQueryValueExA()==0x%x\n", pValueName, GetLastError()); - return false; - } - - // check the type - if (keyType != type) - { - TRACE_WINREG_ERROR("Querying \"%S\" : expectedType=%d, returned=%d\n", pValueName, type, keyType); - return false; - } - - // terminate the string only if pointers not NULL - if ((REG_SZ == type || REG_EXPAND_SZ == type) && NULL != pData && NULL != pcbData) - { - wchar_t *pString = (wchar_t *) pData; - size_t NullEndingSizeBytes = sizeof(wchar_t); // size of string termination null character - if (dstSize < NullEndingSizeBytes) - { - TRACE_WINREG_ERROR("Querying \"%S\" : buffer is too small for null-terminated string", pValueName); - return false; - } - size_t maxStringLengthBytes = dstSize - NullEndingSizeBytes; - size_t maxStringIndex = dstSize / sizeof(wchar_t) - 1; - - size_t lastIndex = (maxStringLengthBytes < *pcbData) ? (maxStringIndex) : (*pcbData) / sizeof(wchar_t); - - pString[lastIndex] = (wchar_t) 0; - } - else if(REG_MULTI_SZ == type && NULL != pData && NULL != pcbData) - { - wchar_t *pString = (wchar_t *) pData; - size_t NullEndingSizeBytes = sizeof(wchar_t)*2; // size of string termination null characters - if (dstSize < NullEndingSizeBytes) - { - TRACE_WINREG_ERROR("Querying \"%S\" : buffer is too small for multi-line null-terminated string", pValueName); - return false; - } - size_t maxStringLengthBytes = dstSize - NullEndingSizeBytes; - size_t maxStringIndex = dstSize / sizeof(wchar_t) - 1; - - size_t lastIndex = (maxStringLengthBytes < *pcbData) ? (maxStringIndex) : (*pcbData) / sizeof(wchar_t) + 1; - - // last 2 bytes should be 0 in case of REG_MULTI_SZ - pString[lastIndex] = pString[lastIndex - 1] = (wchar_t) 0; - } - - return true; - -} // bool WinRegKey::Query(const wchar_t *pValueName, DWORD type, LPBYTE pData, LPDWORD pcbData) - -bool WinRegKey::EnumValue(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName, LPDWORD pType) -{ - LONG lRes; - - // enum the values - lRes = RegEnumValueW(m_hKey, index, pValueName, pcchValueName, 0, pType, NULL, NULL); - if (ERROR_SUCCESS != lRes) - { - DISPATCHER_LOG_OPERATION(SetLastError(lRes)); - return false; - } - - return true; - -} // bool WinRegKey::EnumValue(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName, LPDWORD pType) - -bool WinRegKey::EnumKey(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName) -{ - LONG lRes; - - // enum the keys - lRes = RegEnumKeyExW(m_hKey, index, pValueName, pcchValueName, NULL, NULL, NULL, NULL); - if (ERROR_SUCCESS != lRes) - { - DISPATCHER_LOG_OPERATION(SetLastError(lRes)); - TRACE_WINREG_ERROR("EnumKey with index=%d: RegEnumKeyExW()==0x%x\n", index, GetLastError()); - return false; - } - - return true; - -} // bool WinRegKey::EnumKey(DWORD index, wchar_t *pValueName, LPDWORD pcchValueName) - -bool WinRegKey::QueryInfo(LPDWORD lpcSubkeys) -{ - LONG lRes; - - lRes = RegQueryInfoKeyW(m_hKey, NULL, 0, 0, lpcSubkeys, 0, 0, 0, 0, 0, 0, 0); - if (ERROR_SUCCESS != lRes) { - TRACE_WINREG_ERROR("RegQueryInfoKeyW()==0x%x\n", lRes); - return false; - } - return true; - -} //bool QueryInfo(LPDWORD lpcSubkeys); - -} // namespace MFX - -#endif // #if !defined(MEDIASDK_UWP_DISPATCHER) \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/abstract_splitter.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/abstract_splitter.h deleted file mode 100644 index f410de98..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/abstract_splitter.h +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef _ABSTRACT_SPL_H__ -#define _ABSTRACT_SPL_H__ - -#include "mfxstructures.h" -#include "vm/strings_defs.h" - -enum SliceTypeCode { - TYPE_I = 0, - TYPE_P = 1, - TYPE_B = 2, - TYPE_SKIP=3, - TYPE_UNKNOWN=4 -}; - -struct SliceSplitterInfo -{ - mfxU32 DataOffset; - mfxU32 DataLength; - mfxU32 HeaderLength; - SliceTypeCode SliceType; -}; - -struct FrameSplitterInfo -{ - SliceSplitterInfo * Slice; // array - mfxU32 SliceNum; - mfxU32 FirstFieldSliceNum; - - mfxU8 * Data; // including data of slices - mfxU32 DataLength; - mfxU64 TimeStamp; -}; - -class AbstractSplitter -{ -public: - - AbstractSplitter() - {} - - virtual ~AbstractSplitter() - {} - - virtual mfxStatus Reset() = 0; - - virtual mfxStatus GetFrame(mfxBitstream * bs_in, FrameSplitterInfo ** frame) = 0; - - virtual mfxStatus PostProcessing(FrameSplitterInfo *frame, mfxU32 sliceNum) = 0; - - virtual void ResetCurrentState() = 0; -}; - -#endif // _ABSTRACT_SPL_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_bitstream.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_bitstream.h deleted file mode 100644 index 628e3057..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_bitstream.h +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ -#ifndef __AVC_BITSTREAM_H_ -#define __AVC_BITSTREAM_H_ - -#include "mfxstructures.h" -#include "avc_structures.h" -#include "avc_headers.h" - -namespace ProtectedLibrary -{ - -#define AVCPeek1Bit(current_data, offset) \ - ((current_data[0] >> (offset)) & 1) - -#define AVCDrop1Bit(current_data, offset) \ -{ \ - offset -= 1; \ - if (offset < 0) \ - { \ - offset = 31; \ - current_data += 1; \ - } \ -} - -// NAL unit definitions -enum -{ - NAL_STORAGE_IDC_BITS = 0x60, - NAL_UNITTYPE_BITS = 0x1f -}; - -class AVCBaseBitstream -{ -public: - - AVCBaseBitstream(); - AVCBaseBitstream(mfxU8 * const pb, const mfxU32 maxsize); - virtual ~AVCBaseBitstream(); - - // Reset the bitstream with new data pointer - void Reset(mfxU8 * const pb, mfxU32 maxsize); - void Reset(mfxU8 * const pb, mfxI32 offset, mfxU32 maxsize); - - inline mfxU32 GetBits(mfxU32 nbits); - - // Read one VLC mfxI32 or mfxU32 value from bitstream - mfxI32 GetVLCElement(bool bIsSigned); - - // Reads one bit from the buffer. - inline mfxU32 Get1Bit(); - - // Check amount of data - bool More_RBSP_Data(); - - inline mfxU32 BytesDecoded(); - - inline mfxU32 BitsDecoded(); - - inline mfxU32 BytesLeft(); - - mfxStatus GetNALUnitType(NAL_Unit_Type &uNALUnitType, mfxU8 &uNALStorageIDC); - void AlignPointerRight(void); - -protected: - mfxU32 *m_pbs; // pointer to the current position of the buffer. - mfxI32 m_bitOffset; // the bit position (0 to 31) in the dword pointed by m_pbs. - mfxU32 *m_pbsBase; // pointer to the first byte of the buffer. - mfxU32 m_maxBsSize; // maximum buffer size in bytes. -}; - -class AVCHeadersBitstream : public AVCBaseBitstream -{ -public: - - AVCHeadersBitstream(); - AVCHeadersBitstream(mfxU8 * const pb, const mfxU32 maxsize); - - - // Decode sequence parameter set - mfxStatus GetSequenceParamSet(AVCSeqParamSet *sps); - // Decode sequence parameter set extension - mfxStatus GetSequenceParamSetExtension(AVCSeqParamSetExtension *sps_ex); - - // Decoding picture's parameter set functions - mfxStatus GetPictureParamSetPart1(AVCPicParamSet *pps); - mfxStatus GetPictureParamSetPart2(AVCPicParamSet *pps, const AVCSeqParamSet *sps); - - mfxStatus GetSliceHeaderPart1(AVCSliceHeader *pSliceHeader); - // Decoding slice header functions - mfxStatus GetSliceHeaderPart2(AVCSliceHeader *hdr, // slice header read goes here - const AVCPicParamSet *pps, - const AVCSeqParamSet *sps); // from slice header NAL unit - - mfxStatus GetSliceHeaderPart3(AVCSliceHeader *hdr, // slice header read goes here - PredWeightTable *pPredWeight_L0, // L0 weight table goes here - PredWeightTable *pPredWeight_L1, // L1 weight table goes here - RefPicListReorderInfo *pReorderInfo_L0, - RefPicListReorderInfo *pReorderInfo_L1, - AdaptiveMarkingInfo *pAdaptiveMarkingInfo, - const AVCPicParamSet *pps, - const AVCSeqParamSet *sps, - mfxU8 NALRef_idc); // from slice header NAL unit - - - mfxStatus GetNalUnitPrefix(AVCNalExtension *pExt, mfxU32 NALRef_idc); - - mfxI32 GetSEI(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl); - -private: - - mfxStatus GetNalUnitExtension(AVCNalExtension *pExt); - - void GetScalingList4x4(AVCScalingList4x4 *scl, mfxU8 *def, mfxU8 *scl_type); - void GetScalingList8x8(AVCScalingList8x8 *scl, mfxU8 *def, mfxU8 *scl_type); - - mfxI32 GetSEIPayload(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl); - mfxI32 recovery_point(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl); - mfxI32 reserved_sei_message(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl); - - mfxStatus GetVUIParam(AVCSeqParamSet *sps); - mfxStatus GetHRDParam(AVCSeqParamSet *sps); -}; - - -void SetDefaultScalingLists(AVCSeqParamSet * sps); - -extern const mfxU32 bits_data[]; - - -#define _avcGetBits(current_data, offset, nbits, data) \ -{ \ - mfxU32 x; \ - \ - SAMPLE_ASSERT((nbits) > 0 && (nbits) <= 32); \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - \ - offset -= (nbits); \ - \ - if (offset >= 0) \ - { \ - x = current_data[0] >> (offset + 1); \ - } \ - else \ - { \ - offset += 32; \ - \ - x = current_data[1] >> (offset); \ - x >>= 1; \ - x += current_data[0] << (31 - offset); \ - current_data++; \ - } \ - \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - \ - (data) = x & bits_data[nbits]; \ -} - -#define avcGetBits1(current_data, offset, data) \ -{ \ - data = ((current_data[0] >> (offset)) & 1); \ - offset -= 1; \ - if (offset < 0) \ - { \ - offset = 31; \ - current_data += 1; \ - } \ -} - -#define avcUngetNBits(current_data, offset, nbits) \ -{ \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - \ - offset += (nbits); \ - if (offset > 31) \ - { \ - offset -= 32; \ - current_data--; \ - } \ - \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ -} - -#define avcGetNBits( current_data, offset, nbits, data) \ - _avcGetBits(current_data, offset, nbits, data); - -inline mfxU32 AVCBaseBitstream::GetBits(mfxU32 nbits) -{ - mfxU32 w, n = nbits; - - avcGetNBits(m_pbs, m_bitOffset, n, w); - return w; -} - -inline mfxU32 AVCBaseBitstream::Get1Bit() -{ - mfxU32 w; - avcGetBits1(m_pbs, m_bitOffset, w); - return w; - -} // AVCBitstream::Get1Bit() - -inline mfxU32 AVCBaseBitstream::BytesDecoded() -{ - return static_cast((mfxU8*)m_pbs - (mfxU8*)m_pbsBase) + - ((31 - m_bitOffset) >> 3); -} - -inline mfxU32 AVCBaseBitstream::BytesLeft() -{ - return ((mfxI32)m_maxBsSize - (mfxI32) BytesDecoded()); -} - -} // namespace ProtectedLibrary - -#endif // __AVC_BITSTREAM_H_ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_headers.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_headers.h deleted file mode 100644 index bad94a6a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_headers.h +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __AVC_HEADERS_H -#define __AVC_HEADERS_H - -#include "avc_structures.h" -#include - -namespace ProtectedLibrary -{ - -template -class HeaderSet -{ -public: - - HeaderSet() - : m_currentID(-1) - { - } - - ~HeaderSet() - { - Reset(); - } - - void AddHeader(T* hdr) - { - mfxU32 id = hdr->GetID(); - if (id >= m_header.size()) - { - m_header.resize(id + 1); - } - - delete m_header[id]; - - m_header[id] = new T(); - *(m_header[id]) = *hdr; - } - - T * GetHeader(mfxU32 id) - { - if (id >= m_header.size()) - return 0; - - return m_header[id]; - } - - void RemoveHeader(mfxU32 id) - { - if (id >= m_header.size()) - return; - - delete m_header[id]; - m_header[id] = 0; - } - - void RemoveHeader(T * hdr) - { - if (!hdr) - return; - - RemoveHeader(hdr->GetID()); - } - - const T * GetHeader(mfxU32 id) const - { - if (id >= m_header.size()) - return 0; - - return m_header[id]; - } - - void Reset() - { - for (mfxU32 i = 0; i < m_header.size(); i++) - { - delete m_header[i]; - m_header[i]=0; - } - } - - void SetCurrentID(mfxU32 id) - { - m_currentID = id; - } - - mfxI32 GetCurrrentID() const - { - return m_currentID; - } - - T * GetCurrentHeader() - { - if (m_currentID == -1) - return 0; - - return GetHeader(m_currentID); - } - - const T * GetCurrentHeader() const - { - if (m_currentID == -1) - return 0; - - return GetHeader(m_currentID); - } - -private: - std::vector m_header; - mfxI32 m_currentID; -}; - -/****************************************************************************************************/ -// Headers stuff -/****************************************************************************************************/ -class AVCHeaders -{ -public: - - void Reset() - { - m_SeqParams.Reset(); - m_SeqExParams.Reset(); - m_SeqParamsMvcExt.Reset(); - m_PicParams.Reset(); - m_SEIParams.Reset(); - } - - HeaderSet m_SeqParams; - HeaderSet m_SeqExParams; - HeaderSet m_SeqParamsMvcExt; - HeaderSet m_PicParams; - HeaderSet m_SEIParams; - AVCNalExtension m_nalExtension; -}; - -} //namespace ProtectedLibrary - -#endif // __AVC_HEADERS_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_nal_spl.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_nal_spl.h deleted file mode 100644 index edb3e424..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_nal_spl.h +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ -#ifndef __AVC_NAL_SPL_H -#define __AVC_NAL_SPL_H - -#include -#include "mfxstructures.h" - -namespace ProtectedLibrary -{ - -class BytesSwapper -{ -public: - static void SwapMemory(mfxU8 *pDestination, mfxU32 &nDstSize, mfxU8 *pSource, mfxU32 nSrcSize); -}; - - -class StartCodeIterator -{ -public: - - StartCodeIterator(); - - void Reset(); - - mfxI32 Init(mfxBitstream * source); - - void SetSuggestedSize(mfxU32 size); - - mfxI32 CheckNalUnitType(mfxBitstream * source); - - mfxI32 GetNALUnit(mfxBitstream * source, mfxBitstream * destination); - - mfxI32 EndOfStream(mfxBitstream * destination); - -private: - std::vector m_prev; - mfxU32 m_code; - mfxU64 m_pts; - - mfxU8 * m_pSource; - mfxU32 m_nSourceSize; - - mfxU8 * m_pSourceBase; - mfxU32 m_nSourceBaseSize; - - mfxU32 m_suggestedSize; - - mfxI32 FindStartCode(mfxU8 * (&pb), mfxU32 & size, mfxI32 & startCodeSize); -}; - -class NALUnitSplitter -{ -public: - - NALUnitSplitter(); - - virtual ~NALUnitSplitter(); - - virtual void Init(); - virtual void Release(); - - virtual mfxI32 CheckNalUnitType(mfxBitstream * source); - virtual mfxI32 GetNalUnits(mfxBitstream * source, mfxBitstream * &destination); - - virtual void Reset(); - - virtual void SetSuggestedSize(mfxU32 size) - { - m_pStartCodeIter.SetSuggestedSize(size); - } - -protected: - - StartCodeIterator m_pStartCodeIter; - - mfxBitstream m_bitstream; -}; - -void SwapMemoryAndRemovePreventingBytes(mfxU8 *pDestination, mfxU32 &nDstSize, mfxU8 *pSource, mfxU32 nSrcSize); - -} //namespace ProtectedLibrary - -#endif // __AVC_NAL_SPL_H diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_spl.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_spl.h deleted file mode 100644 index 4947c403..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_spl.h +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef _AVC_SPL_H__ -#define _AVC_SPL_H__ - -#include -#include -#include - -#include "abstract_splitter.h" - -#include "avc_bitstream.h" -#include "avc_headers.h" -#include "avc_nal_spl.h" - -namespace ProtectedLibrary -{ - -class AVCSlice : public SliceSplitterInfo -{ -public: - - AVCSlice(); - - AVCSliceHeader * GetSliceHeader(); - - bool IsField() const {return m_sliceHeader.field_pic_flag != 0;} - - mfxI32 RetrievePicParamSetNumber(mfxU8 *pSource, mfxU32 nSourceSize); - - bool DecodeHeader(mfxU8 *pSource, mfxU32 nSourceSize); - - AVCHeadersBitstream *GetBitStream(void){return &m_bitStream;} - - AVCPicParamSet* m_picParamSet; - AVCSeqParamSet* m_seqParamSet; - AVCSeqParamSet* m_seqParamSetMvcEx; - AVCSeqParamSetExtension* m_seqParamSetEx; - - mfxU64 m_dTime; - -protected: - AVCSliceHeader m_sliceHeader; - AVCHeadersBitstream m_bitStream; - - void Reset(); -}; - -class AVCFrameInfo -{ -public: - - AVCFrameInfo(); - - void Reset(); - - AVCSlice * m_slice; - mfxU32 m_index; -}; - -class AVC_Spl : public AbstractSplitter -{ -public: - - AVC_Spl(); - - virtual ~AVC_Spl(); - - virtual mfxStatus Reset(); - - virtual mfxStatus GetFrame(mfxBitstream * bs_in, FrameSplitterInfo ** frame); - - virtual mfxStatus PostProcessing(FrameSplitterInfo *frame, mfxU32 sliceNum); - - void ResetCurrentState(); - -protected: - std::unique_ptr m_pNALSplitter; - - mfxStatus Init(); - - void Close(); - - mfxStatus ProcessNalUnit(mfxI32 nalType, mfxBitstream * destination); - - mfxStatus DecodeHeader(mfxBitstream * nalUnit); - mfxStatus DecodeSEI(mfxBitstream * nalUnit); - AVCSlice * DecodeSliceHeader(mfxBitstream * nalUnit); - mfxStatus AddSlice(AVCSlice * pSlice); - - AVCFrameInfo * GetFreeFrame(); - - mfxU8 * GetMemoryForSwapping(mfxU32 size); - - mfxStatus AddNalUnit(mfxBitstream * nalUnit); - mfxStatus AddSliceNalUnit(mfxBitstream * nalUnit, AVCSlice * pSlice); - bool IsFieldOfOneFrame(AVCFrameInfo * frame, const AVCSliceHeader * slice1, const AVCSliceHeader *slice2); - - bool m_WaitForIDR; - - AVCHeaders m_headers; - std::unique_ptr m_AUInfo; - AVCFrameInfo * m_currentInfo; - AVCSlice * m_pLastSlice; - - mfxBitstream * m_lastNalUnit; - - enum - { - BUFFER_SIZE = 1024 * 1024 - }; - - std::vector m_currentFrame; - std::vector m_swappingMemory; - std::list m_slicesStorage; - - std::vector m_slices; - FrameSplitterInfo m_frame; -}; - -} // namespace ProtectedLibrary - -#endif // _AVC_SPL_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_structures.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_structures.h deleted file mode 100644 index da123c04..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/avc_structures.h +++ /dev/null @@ -1,1107 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __AVC_STRUCTURES_H__ -#define __AVC_STRUCTURES_H__ - -#if defined(_WIN32) || defined(_WIN64) -#include -#endif -#include -#include -#include -#include "mfxstructures.h" - -namespace ProtectedLibrary -{ - -enum -{ - AVC_PROFILE_BASELINE = 66, - AVC_PROFILE_MAIN = 77, - AVC_PROFILE_SCALABLE_BASELINE = 83, - AVC_PROFILE_SCALABLE_HIGH = 86, - AVC_PROFILE_EXTENDED = 88, - AVC_PROFILE_HIGH = 100, - AVC_PROFILE_HIGH10 = 110, - AVC_PROFILE_MULTIVIEW_HIGH = 118, - AVC_PROFILE_HIGH422 = 122, - AVC_PROFILE_STEREO_HIGH = 128, - AVC_PROFILE_HIGH444 = 144, - AVC_PROFILE_ADVANCED444_INTRA = 166, - AVC_PROFILE_ADVANCED444 = 188 -}; - -enum -{ - AVC_LEVEL_1 = 10, - AVC_LEVEL_11 = 11, - AVC_LEVEL_1b = 11, - AVC_LEVEL_12 = 12, - AVC_LEVEL_13 = 13, - - AVC_LEVEL_2 = 20, - AVC_LEVEL_21 = 21, - AVC_LEVEL_22 = 22, - - AVC_LEVEL_3 = 30, - AVC_LEVEL_31 = 31, - AVC_LEVEL_32 = 32, - - AVC_LEVEL_4 = 40, - AVC_LEVEL_41 = 41, - AVC_LEVEL_42 = 42, - - AVC_LEVEL_5 = 50, - AVC_LEVEL_51 = 51, - AVC_LEVEL_MAX = 51, - - AVC_LEVEL_9 = 9 // for SVC profiles -}; - -// Although the standard allows for a minimum width or height of 4, this -// implementation restricts the minimum value to 32. - -enum // Valid QP range -{ - AVC_QP_MAX = 51, - AVC_QP_MIN = 0 -}; - -enum { - FLD_STRUCTURE = 0, - TOP_FLD_STRUCTURE = 0, - BOTTOM_FLD_STRUCTURE = 1, - FRM_STRUCTURE = 2, - AFRM_STRUCTURE = 3 -}; - -enum DisplayPictureStruct { - DPS_FRAME = 0, - DPS_TOP, // one field - DPS_BOTTOM, // one field - DPS_TOP_BOTTOM, - DPS_BOTTOM_TOP, - DPS_TOP_BOTTOM_TOP, - DPS_BOTTOM_TOP_BOTTOM, - DPS_FRAME_DOUBLING, - DPS_FRAME_TRIPLING -}; - -typedef enum { - NAL_UT_UNSPECIFIED = 0, // Unspecified - NAL_UT_SLICE = 1, // Coded Slice - slice_layer_no_partioning_rbsp - NAL_UT_DPA = 2, // Coded Data partition A - dpa_layer_rbsp - NAL_UT_DPB = 3, // Coded Data partition A - dpa_layer_rbsp - NAL_UT_DPC = 4, // Coded Data partition A - dpa_layer_rbsp - NAL_UT_IDR_SLICE = 5, // Coded Slice of a IDR Picture - slice_layer_no_partioning_rbsp - NAL_UT_SEI = 6, // Supplemental Enhancement Information - sei_rbsp - NAL_UT_SPS = 7, // Sequence Parameter Set - seq_parameter_set_rbsp - NAL_UT_PPS = 8, // Picture Parameter Set - pic_parameter_set_rbsp - NAL_UT_AUD = 9, // Access Unit Delimiter - access_unit_delimiter_rbsp - NAL_END_OF_SEQ = 10, // End of sequence end_of_seq_rbsp() - NAL_END_OF_STREAM = 11, // End of stream end_of_stream_rbsp - NAL_UT_FD = 12, // Filler Data - filler_data_rbsp - NAL_UT_SPS_EX = 13, // Sequence Parameter Set Extension - seq_parameter_set_extension_rbsp - NAL_UNIT_PREFIX = 14, // Prefix NAL unit in scalable extension - prefix_nal_unit_rbsp - NAL_UNIT_SUBSET_SPS = 15, // Subset Sequence Parameter Set - subset_seq_parameter_set_rbsp - NAL_UT_AUXILIARY = 19, // Auxiliary coded picture - NAL_UT_CODED_SLICE_EXTENSION = 20 // Coded slice in scalable extension - slice_layer_in_scalable_extension_rbsp -} NAL_Unit_Type; - -// Note! The Picture Code Type values below are no longer used in the -// core encoder. It only knows about slice types, and whether or not -// the frame is IDR, Reference or Disposable. See enum above. - -enum EnumSliceCodType // Permitted MB Prediction Types -{ // ------------------------------------ - PREDSLICE = 0, // I (Intra), P (Pred) - BPREDSLICE = 1, // I, P, B (BiPred) - INTRASLICE = 2, // I - S_PREDSLICE = 3, // SP (SPred), I - S_INTRASLICE = 4 // SI (SIntra), I -}; - -typedef enum -{ - SEI_BUFFERING_PERIOD_TYPE = 0, - SEI_PIC_TIMING_TYPE = 1, - SEI_PAN_SCAN_RECT_TYPE = 2, - SEI_FILLER_TYPE = 3, - SEI_USER_DATA_REGISTERED_TYPE = 4, - SEI_USER_DATA_UNREGISTERED_TYPE = 5, - SEI_RECOVERY_POINT_TYPE = 6, - SEI_DEC_REF_PIC_MARKING_TYPE = 7, - SEI_SPARE_PIC_TYPE = 8, - SEI_SCENE_INFO_TYPE = 9, - SEI_SUB_SEQ_INFO_TYPE = 10, - SEI_SUB_SEQ_LAYER_TYPE = 11, - SEI_SUB_SEQ_TYPE = 12, - SEI_FULL_FRAME_FREEZE_TYPE = 13, - SEI_FULL_FRAME_FREEZE_RELEASE_TYPE = 14, - SEI_FULL_FRAME_SNAPSHOT_TYPE = 15, - SEI_PROGRESSIVE_REF_SEGMENT_START_TYPE = 16, - SEI_PROGRESSIVE_REF_SEGMENT_END_TYPE = 17, - SEI_MOTION_CONSTRAINED_SG_SET_TYPE = 18, - SEI_RESERVED = 19 -} SEI_TYPE; - - -#define IS_I_SLICE(SliceType) ((SliceType) == INTRASLICE) -#define IS_P_SLICE(SliceType) ((SliceType) == PREDSLICE || (SliceType) == S_PREDSLICE) -#define IS_B_SLICE(SliceType) ((SliceType) == BPREDSLICE) - -enum -{ - MAX_NUM_SEQ_PARAM_SETS = 32, - MAX_NUM_PIC_PARAM_SETS = 256, - - MAX_SLICE_NUM = 128, //INCREASE IF NEEDED OR SET to -1 for adaptive counting (increases memory usage) - MAX_NUM_REF_FRAMES = 32, - - MAX_REF_FRAMES_IN_POC_CYCLE = 256, - - MAX_NUM_SLICE_GROUPS = 8, - MAX_SLICE_GROUP_MAP_TYPE = 6, - - NUM_INTRA_TYPE_ELEMENTS = 16, - - COEFFICIENTS_BUFFER_SIZE = 16 * 51, - - MINIMAL_DATA_SIZE = 4 -}; - -// Possible values for disable_deblocking_filter_idc: -enum DeblockingModes_t -{ - DEBLOCK_FILTER_ON = 0, - DEBLOCK_FILTER_OFF = 1, - DEBLOCK_FILTER_ON_NO_SLICE_EDGES = 2 -}; - -#pragma pack(1) - -struct AVCScalingList4x4 -{ - mfxU8 ScalingListCoeffs[16]; -}; - -struct AVCScalingList8x8 -{ - mfxU8 ScalingListCoeffs[64]; -}; - -struct AVCWholeQPLevelScale4x4 -{ - mfxI16 LevelScaleCoeffs[88]/*since we do not support 422 and 444*/[16]; -}; -struct AVCWholeQPLevelScale8x8 -{ - mfxI16 LevelScaleCoeffs[88]/*since we do not support 422 and 444*/[64]; -}; - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Memory class -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -class RefCounter -{ -public: - - RefCounter() : m_refCounter(0) - { - } - - virtual ~RefCounter() - { - } - - void IncrementReference() const - { - m_refCounter++; - } - - void DecrementReference() - { - m_refCounter--; - - if (!m_refCounter) - { - Free(); - } - } - - void ResetRefCounter() {m_refCounter = 0;} - - mfxU32 GetRefCounter() {return m_refCounter;} - -protected: - mutable mfxI32 m_refCounter; - - virtual void Free() - { - } -}; - -class HeapObject : public RefCounter -{ -public: - - virtual ~HeapObject() {} - - virtual void Reset() - { - } - - virtual void Free(); -}; - -#pragma pack() - -#pragma pack(16) - -typedef mfxU32 IntraType; - -// Sequence parameter set structure, corresponding to the H.264 bitstream definition. -struct AVCSeqParamSetBase -{ - mfxU8 profile_idc; // baseline, main, etc. - mfxU8 level_idc; - mfxU8 constrained_set0_flag; - mfxU8 constrained_set1_flag; - mfxU8 constrained_set2_flag; - mfxU8 constrained_set3_flag; - mfxU8 chroma_format_idc; - mfxU8 residual_colour_transform_flag; - mfxU8 bit_depth_luma; - mfxU8 bit_depth_chroma; - mfxU8 qpprime_y_zero_transform_bypass_flag; - mfxU8 type_of_scaling_list_used[8]; - mfxU8 seq_scaling_matrix_present_flag; - AVCScalingList4x4 ScalingLists4x4[6]; - AVCScalingList8x8 ScalingLists8x8[2]; - mfxU8 gaps_in_frame_num_value_allowed_flag; - mfxU8 frame_cropping_flag; - mfxU32 frame_cropping_rect_left_offset; - mfxU32 frame_cropping_rect_right_offset; - mfxU32 frame_cropping_rect_top_offset; - mfxU32 frame_cropping_rect_bottom_offset; - mfxU8 more_than_one_slice_group_allowed_flag; - mfxU8 arbitrary_slice_order_allowed_flag; // If zero, slice order in pictures must - // be in increasing MB address order. - mfxU8 redundant_pictures_allowed_flag; - mfxU8 seq_parameter_set_id; // id of this sequence parameter set - mfxU8 log2_max_frame_num; // Number of bits to hold the frame_num - mfxU8 pic_order_cnt_type; // Picture order counting method - - mfxU8 delta_pic_order_always_zero_flag; // If zero, delta_pic_order_cnt fields are - // present in slice header. - mfxU8 frame_mbs_only_flag; // Nonzero indicates all pictures in sequence - // are coded as frames (not fields). - mfxU8 required_frame_num_update_behavior_flag; - - mfxU8 mb_adaptive_frame_field_flag; // Nonzero indicates frame/field switch - // at macroblock level - mfxU8 direct_8x8_inference_flag; // Direct motion vector derivation method - mfxU8 vui_parameters_present_flag; // Zero indicates default VUI parameters - mfxU32 log2_max_pic_order_cnt_lsb; // Value of MaxPicOrderCntLsb. - mfxI32 offset_for_non_ref_pic; - - mfxI32 offset_for_top_to_bottom_field; // Expected pic order count difference from - // top field to bottom field. - - mfxU32 num_ref_frames_in_pic_order_cnt_cycle; - mfxU32 num_ref_frames; // total number of pics in decoded pic buffer - mfxU32 frame_width_in_mbs; - mfxU32 frame_height_in_mbs; - - // These fields are calculated from values above. They are not written to the bitstream - mfxU32 MaxMbAddress; - mfxU32 MaxPicOrderCntLsb; - // vui part - mfxU8 aspect_ratio_info_present_flag; - mfxU8 aspect_ratio_idc; - mfxU16 sar_width; - mfxU16 sar_height; - mfxU8 overscan_info_present_flag; - mfxU8 overscan_appropriate_flag; - mfxU8 video_signal_type_present_flag; - mfxU8 video_format; - mfxU8 video_full_range_flag; - mfxU8 colour_description_present_flag; - mfxU8 colour_primaries; - mfxU8 transfer_characteristics; - mfxU8 matrix_coefficients; - mfxU8 chroma_loc_info_present_flag; - mfxU8 chroma_sample_loc_type_top_field; - mfxU8 chroma_sample_loc_type_bottom_field; - mfxU8 timing_info_present_flag; - mfxU32 num_units_in_tick; - mfxU32 time_scale; - mfxU8 fixed_frame_rate_flag; - mfxU8 nal_hrd_parameters_present_flag; - mfxU8 vcl_hrd_parameters_present_flag; - mfxU8 low_delay_hrd_flag; - mfxU8 pic_struct_present_flag; - mfxU8 bitstream_restriction_flag; - mfxU8 motion_vectors_over_pic_boundaries_flag; - mfxU8 max_bytes_per_pic_denom; - mfxU8 max_bits_per_mb_denom; - mfxU8 log2_max_mv_length_horizontal; - mfxU8 log2_max_mv_length_vertical; - mfxU8 num_reorder_frames; - mfxU8 max_dec_frame_buffering; - //hrd_parameters - mfxU8 cpb_cnt; - mfxU8 bit_rate_scale; - mfxU8 cpb_size_scale; - mfxU32 bit_rate_value[32]; - mfxU32 cpb_size_value[32]; - mfxU8 cbr_flag[32]; - mfxU8 initial_cpb_removal_delay_length; - mfxU8 cpb_removal_delay_length; - mfxU8 dpb_output_delay_length; - mfxU8 time_offset_length; - - mfxI32 poffset_for_ref_frame[MAX_REF_FRAMES_IN_POC_CYCLE]; // for pic order cnt type 1 - // length num_stored_frames_in_pic_order_cnt_cycle, - void Reset() - { - AVCSeqParamSetBase sps = {0}; - *this = sps; - } - -}; // AVCSeqParamSetBase - -// Sequence parameter set structure, corresponding to the H.264 bitstream definition. -struct AVCSeqParamSet : public HeapObject, public AVCSeqParamSetBase -{ - AVCSeqParamSet() - : HeapObject() - , AVCSeqParamSetBase() - { - Reset(); - } - - ~AVCSeqParamSet() - { - } - - mfxI32 GetID() const - { - return seq_parameter_set_id; - } - - virtual void Reset() - { - AVCSeqParamSetBase::Reset(); - - seq_parameter_set_id = MAX_NUM_SEQ_PARAM_SETS; - - // set some parameters by default - video_format = 5; // unspecified - video_full_range_flag = 0; - colour_primaries = 2; // unspecified - transfer_characteristics = 2; // unspecified - matrix_coefficients = 2; // unspecified - } -}; // AVCSeqParamSet - -// Sequence parameter set extension structure, corresponding to the H.264 bitstream definition. -struct AVCSeqParamSetExtension -{ - mfxU8 seq_parameter_set_id; - mfxU8 aux_format_idc; - mfxU8 bit_depth_aux; - mfxU8 alpha_incr_flag; - mfxU8 alpha_opaque_value; - mfxU8 alpha_transparent_value; - mfxU8 additional_extension_flag; - - AVCSeqParamSetExtension() - { - Reset(); - } - - virtual void Reset() - { - aux_format_idc = 0; - seq_parameter_set_id = MAX_NUM_SEQ_PARAM_SETS; // illegal id - bit_depth_aux = 0; - alpha_incr_flag = 0; - alpha_opaque_value = 0; - alpha_transparent_value = 0; - additional_extension_flag = 0; - } - - mfxI32 GetID() const - { - return seq_parameter_set_id; - } - - virtual ~AVCSeqParamSetExtension(){} - -}; // AVCSeqParamSetExtension - -// Picture parameter set structure, corresponding to the H.264 bitstream definition. -struct AVCPicParamSetBase -{ -// Flexible macroblock order structure, defining the FMO map for a picture -// paramter set. - - struct SliceGroupInfoStruct - { - mfxU8 slice_group_map_type; // 0..6 - - // The additional slice group data depends upon map type - union - { - // type 0 - mfxU32 run_length[MAX_NUM_SLICE_GROUPS]; - - // type 2 - struct - { - mfxU32 top_left[MAX_NUM_SLICE_GROUPS-1]; - mfxU32 bottom_right[MAX_NUM_SLICE_GROUPS-1]; - }t1; - - // types 3-5 - struct - { - mfxU8 slice_group_change_direction_flag; - mfxU32 slice_group_change_rate; - }t2; - - // type 6 - struct - { - mfxU32 pic_size_in_map_units; // number of macroblocks if no field coding - }t3; - }; - - std::vector pSliceGroupIDMap; // Id for each slice group map unit (for t3 struct of) - }; // SliceGroupInfoStruct - - mfxU16 pic_parameter_set_id; // of this picture parameter set - mfxU8 seq_parameter_set_id; // of seq param set used for this pic param set - mfxU8 entropy_coding_mode; // zero: CAVLC, else CABAC - - mfxU8 pic_order_present_flag; // Zero indicates only delta_pic_order_cnt[0] is - // present in slice header; nonzero indicates - // delta_pic_order_cnt[1] is also present. - - mfxU8 weighted_pred_flag; // Nonzero indicates weighted prediction applied to - // P and SP slices - mfxU8 weighted_bipred_idc; // 0: no weighted prediction in B slices - // 1: explicit weighted prediction - // 2: implicit weighted prediction - mfxI8 pic_init_qp; // default QP for I,P,B slices - mfxI8 pic_init_qs; // default QP for SP, SI slices - - mfxI8 chroma_qp_index_offset[2]; // offset to add to QP for chroma - - mfxU8 deblocking_filter_variables_present_flag; // If nonzero, deblock filter params are - // present in the slice header. - mfxU8 constrained_intra_pred_flag; // Nonzero indicates constrained intra mode - - mfxU8 redundant_pic_cnt_present_flag; // Nonzero indicates presence of redundant_pic_cnt - // in slice header - mfxU32 num_slice_groups; // One: no FMO - mfxU32 num_ref_idx_l0_active; // num of ref pics in list 0 used to decode the picture - mfxU32 num_ref_idx_l1_active; // num of ref pics in list 1 used to decode the picture - mfxU8 transform_8x8_mode_flag; - mfxU8 type_of_scaling_list_used[8]; - - AVCScalingList4x4 ScalingLists4x4[6]; - AVCScalingList8x8 ScalingLists8x8[2]; - - // Level Scale addition - AVCWholeQPLevelScale4x4 m_LevelScale4x4[6]; - AVCWholeQPLevelScale8x8 m_LevelScale8x8[2]; - - SliceGroupInfoStruct SliceGroupInfo; // Used only when num_slice_groups > 1 - - void Reset() - { - AVCPicParamSetBase pps = {0}; - *this = pps; - } -}; // AVCPicParamSet - -// Picture parameter set structure, corresponding to the H.264 bitstream definition. -struct AVCPicParamSet : public HeapObject, public AVCPicParamSetBase -{ - AVCPicParamSet() - : AVCPicParamSetBase() - { - Reset(); - } - - void Reset() - { - AVCPicParamSetBase::Reset(); - - pic_parameter_set_id = MAX_NUM_PIC_PARAM_SETS; - seq_parameter_set_id = MAX_NUM_SEQ_PARAM_SETS; - num_slice_groups = 0; - SliceGroupInfo.pSliceGroupIDMap.clear(); - } - - ~AVCPicParamSet() - { - } - - mfxI32 GetID() const - { - return pic_parameter_set_id; - } - -}; // H264PicParamSet - -struct RefPicListReorderInfo -{ - mfxU32 num_entries; // number of currently valid idc,value pairs - mfxU8 reordering_of_pic_nums_idc[MAX_NUM_REF_FRAMES]; - mfxU32 reorder_value[MAX_NUM_REF_FRAMES]; // abs_diff_pic_num or long_term_pic_num -}; - -struct AdaptiveMarkingInfo -{ - mfxU32 num_entries; // number of currently valid mmco,value pairs - mfxU8 mmco[MAX_NUM_REF_FRAMES]; // memory management control operation id - mfxU32 value[MAX_NUM_REF_FRAMES*2]; // operation-dependent data, max 2 per operation -}; - -struct PredWeightTable -{ - mfxU8 luma_weight_flag; // nonzero: luma weight and offset in bitstream - mfxU8 chroma_weight_flag; // nonzero: chroma weight and offset in bitstream - mfxI8 luma_weight; // luma weighting factor - mfxI8 luma_offset; // luma weighting offset - mfxI8 chroma_weight[2]; // chroma weighting factor (Cb,Cr) - mfxI8 chroma_offset[2]; // chroma weighting offset (Cb,Cr) -}; // PredWeightTable - -typedef mfxI32 AVCDecoderMBAddr; -// NAL unit SVC extension structure -struct AVCNalSvcExtension -{ - mfxU8 idr_flag; - mfxU8 priority_id; - mfxU8 no_inter_layer_pred_flag; - mfxU8 dependency_id; - mfxU8 quality_id; - mfxU8 temporal_id; - mfxU8 use_ref_base_pic_flag; - mfxU8 discardable_flag; - mfxU8 output_flag; - - mfxU8 store_ref_base_pic_flag; - mfxU8 adaptive_ref_base_pic_marking_mode_flag; - AdaptiveMarkingInfo adaptiveMarkingInfo; -}; - -// NAL unit SVC extension structure -struct AVCNalMvcExtension -{ - mfxU8 non_idr_flag; - mfxU16 priority_id; - // view_id variable is duplicated to the slice header itself - mfxU16 view_id; - mfxU8 temporal_id; - mfxU8 anchor_pic_flag; - mfxU8 inter_view_flag; - - mfxU8 padding[3]; -}; - -// NAL unit extension structure -struct AVCNalExtension -{ - mfxU8 extension_present; - - // equal to 1 specifies that NAL extension contains SVC related parameters - mfxU8 svc_extension_flag; - - union - { - AVCNalSvcExtension svc; - AVCNalMvcExtension mvc; - }; -}; - -// Slice header structure, corresponding to the H.264 bitstream definition. -struct AVCSliceHeader -{ - // flag equal 1 means that the slice belong to IDR or anchor access unit - mfxU32 IdrPicFlag; - - // specified that NAL unit contains any information accessed from - // the decoding process of other NAL units. - mfxU8 nal_ref_idc; - // specifies the type of RBSP data structure contained in the NAL unit as - // specified in Table 7-1 of h264 standard - NAL_Unit_Type nal_unit_type; - - // NAL unit extension parameters - AVCNalExtension nal_ext; - mfxU32 view_id; - - mfxU16 pic_parameter_set_id; // of pic param set used for this slice - mfxU8 field_pic_flag; // zero: frame picture, else field picture - mfxU8 MbaffFrameFlag; - mfxU8 bottom_field_flag; // zero: top field, else bottom field - mfxU8 direct_spatial_mv_pred_flag; // zero: temporal direct, else spatial direct - mfxU8 num_ref_idx_active_override_flag; // nonzero: use ref_idx_active from slice header - // instead of those from pic param set - mfxU8 no_output_of_prior_pics_flag; // nonzero: remove previously decoded pictures - // from decoded picture buffer - mfxU8 long_term_reference_flag; // How to set MaxLongTermFrameIdx - mfxU32 cabac_init_idc; // CABAC initialization table index (0..2) - mfxU8 adaptive_ref_pic_marking_mode_flag; // Ref pic marking mode of current picture - mfxI32 slice_qp_delta; // to calculate default slice QP - mfxU8 sp_for_switch_flag; // SP slice decoding control - mfxI32 slice_qs_delta; // to calculate default SP,SI slice QS - mfxU32 disable_deblocking_filter_idc; // deblock filter control, 0=filter all edges - mfxI32 slice_alpha_c0_offset; // deblock filter c0, alpha table offset - mfxI32 slice_beta_offset; // deblock filter beta table offset - AVCDecoderMBAddr first_mb_in_slice; - mfxI32 frame_num; - EnumSliceCodType slice_type; - mfxU32 idr_pic_id; // ID of an IDR picture - mfxI32 pic_order_cnt_lsb; // picture order count (mod MaxPicOrderCntLsb) - mfxI32 delta_pic_order_cnt_bottom; // Pic order count difference, top & bottom fields - mfxU32 difference_of_pic_nums; // Ref pic memory mgmt - mfxU32 long_term_pic_num; // Ref pic memory mgmt - mfxU32 long_term_frame_idx; // Ref pic memory mgmt - mfxU32 max_long_term_frame_idx; // Ref pic memory mgmt - mfxI32 delta_pic_order_cnt[2]; // picture order count differences - mfxU32 redundant_pic_cnt; // for redundant slices - mfxI32 num_ref_idx_l0_active; // num of ref pics in list 0 used to decode the slice, - // see num_ref_idx_active_override_flag - mfxI32 num_ref_idx_l1_active; // num of ref pics in list 1 used to decode the slice - // see num_ref_idx_active_override_flag - mfxU32 slice_group_change_cycle; // for FMO - mfxU8 luma_log2_weight_denom; // luma weighting denominator - mfxU8 chroma_log2_weight_denom; // chroma weighting denominator - - bool is_auxiliary; -}; // AVCSliceHeader - - -struct AVCSEIPayLoadBase -{ - SEI_TYPE payLoadType; - mfxU32 payLoadSize; - - union SEIMessages - { - struct BufferingPeriod - { - mfxU32 initial_cbp_removal_delay[2][16]; - mfxU32 initial_cbp_removal_delay_offset[2][16]; - }buffering_period; - - struct PicTiming - { - mfxU32 cbp_removal_delay; - mfxU32 dpb_ouput_delay; - DisplayPictureStruct pic_struct; - mfxU8 clock_timestamp_flag[16]; - struct ClockTimestamps - { - mfxU8 ct_type; - mfxU8 nunit_field_based_flag; - mfxU8 counting_type; - mfxU8 full_timestamp_flag; - mfxU8 discontinuity_flag; - mfxU8 cnt_dropped_flag; - mfxU8 n_frames; - mfxU8 seconds_value; - mfxU8 minutes_value; - mfxU8 hours_value; - mfxU8 time_offset; - }clock_timestamps[16]; - }pic_timing; - - struct PanScanRect - { - mfxU8 pan_scan_rect_id; - mfxU8 pan_scan_rect_cancel_flag; - mfxU8 pan_scan_cnt; - mfxU32 pan_scan_rect_left_offset[32]; - mfxU32 pan_scan_rect_right_offset[32]; - mfxU32 pan_scan_rect_top_offset[32]; - mfxU32 pan_scan_rect_bottom_offset[32]; - mfxU8 pan_scan_rect_repetition_period; - }pan_scan_rect; - - struct UserDataRegistered - { - mfxU8 itu_t_t35_country_code; - mfxU8 itu_t_t35_country_code_extension_byte; - } user_data_registered; - - struct RecoveryPoint - { - mfxU8 recovery_frame_cnt; - mfxU8 exact_match_flag; - mfxU8 broken_link_flag; - mfxU8 changing_slice_group_idc; - }recovery_point; - - struct DecRefPicMarkingRepetition - { - mfxU8 original_idr_flag; - mfxU8 original_frame_num; - mfxU8 original_field_pic_flag; - mfxU8 original_bottom_field_flag; - mfxU8 long_term_reference_flag; - AdaptiveMarkingInfo adaptiveMarkingInfo; - }dec_ref_pic_marking_repetition; - - struct SparePic - { - mfxU32 target_frame_num; - mfxU8 spare_field_flag; - mfxU8 target_bottom_field_flag; - mfxU8 num_spare_pics; - mfxU8 delta_spare_frame_num[16]; - mfxU8 spare_bottom_field_flag[16]; - mfxU8 spare_area_idc[16]; - mfxU8 *spare_unit_flag[16]; - mfxU8 *zero_run_length[16]; - }spare_pic; - - struct SceneInfo - { - mfxU8 scene_info_present_flag; - mfxU8 scene_id; - mfxU8 scene_transition_type; - mfxU8 second_scene_id; - }scene_info; - - struct SubSeqInfo - { - mfxU8 sub_seq_layer_num; - mfxU8 sub_seq_id; - mfxU8 first_ref_pic_flag; - mfxU8 leading_non_ref_pic_flag; - mfxU8 last_pic_flag; - mfxU8 sub_seq_frame_num_flag; - mfxU8 sub_seq_frame_num; - }sub_seq_info; - - struct SubSeqLayerCharacteristics - { - mfxU8 num_sub_seq_layers; - mfxU8 accurate_statistics_flag[16]; - mfxU16 average_bit_rate[16]; - mfxU16 average_frame_rate[16]; - }sub_seq_layer_characteristics; - - struct SubSeqCharacteristics - { - mfxU8 sub_seq_layer_num; - mfxU8 sub_seq_id; - mfxU8 duration_flag; - mfxU8 sub_seq_duration; - mfxU8 average_rate_flag; - mfxU8 accurate_statistics_flag; - mfxU16 average_bit_rate; - mfxU16 average_frame_rate; - mfxU8 num_referenced_subseqs; - mfxU8 ref_sub_seq_layer_num[16]; - mfxU8 ref_sub_seq_id[16]; - mfxU8 ref_sub_seq_direction[16]; - }sub_seq_characteristics; - - struct FullFrameFreeze - { - mfxU32 full_frame_freeze_repetition_period; - }full_frame_freeze; - - struct FullFrameSnapshot - { - mfxU8 snapshot_id; - }full_frame_snapshot; - - struct ProgressiveRefinementSegmentStart - { - mfxU8 progressive_refinement_id; - mfxU8 num_refinement_steps; - }progressive_refinement_segment_start; - - struct MotionConstrainedSliceGroupSet - { - mfxU8 num_slice_groups_in_set; - mfxU8 slice_group_id[8]; - mfxU8 exact_sample_value_match_flag; - mfxU8 pan_scan_rect_flag; - mfxU8 pan_scan_rect_id; - }motion_constrained_slice_group_set; - - struct FilmGrainCharacteristics - { - mfxU8 film_grain_characteristics_cancel_flag; - mfxU8 model_id; - mfxU8 separate_colour_description_present_flag; - mfxU8 film_grain_bit_depth_luma; - mfxU8 film_grain_bit_depth_chroma; - mfxU8 film_grain_full_range_flag; - mfxU8 film_grain_colour_primaries; - mfxU8 film_grain_transfer_characteristics; - mfxU8 film_grain_matrix_coefficients; - mfxU8 blending_mode_id; - mfxU8 log2_scale_factor; - mfxU8 comp_model_present_flag[3]; - mfxU8 num_intensity_intervals[3]; - mfxU8 num_model_values[3]; - mfxU8 intensity_interval_lower_bound[3][256]; - mfxU8 intensity_interval_upper_bound[3][256]; - mfxU8 comp_model_value[3][3][256]; - mfxU8 film_grain_characteristics_repetition_period; - }film_grain_characteristics; - - struct DeblockingFilterDisplayPreference - { - mfxU8 deblocking_display_preference_cancel_flag; - mfxU8 display_prior_to_deblocking_preferred_flag; - mfxU8 dec_frame_buffering_constraint_flag; - mfxU8 deblocking_display_preference_repetition_period; - }deblocking_filter_display_preference; - - struct StereoVideoInfo - { - mfxU8 field_views_flag; - mfxU8 top_field_is_left_view_flag; - mfxU8 current_frame_is_left_view_flag; - mfxU8 next_frame_is_second_view_flag; - mfxU8 left_view_self_contained_flag; - mfxU8 right_view_self_contained_flag; - }stereo_video_info; - - }SEI_messages; - - void Reset() - { - memset(this, 0, sizeof(AVCSEIPayLoadBase)); - - payLoadType = SEI_RESERVED; - payLoadSize = 0; - } -}; - -struct AVCSEIPayLoad : public HeapObject, public AVCSEIPayLoadBase -{ - std::vector user_data; // for UserDataRegistered or UserDataUnRegistered - - AVCSEIPayLoad() - : AVCSEIPayLoadBase() - { - } - - virtual void Reset() - { - AVCSEIPayLoadBase::Reset(); - user_data.clear(); - } - - mfxI32 GetID() const - { - return payLoadType; - } -}; - -#pragma pack() - -// This file defines some data structures and constants used by the decoder, -// that are also needed by other classes, such as post filters and -// error concealment. - -#define INTERP_FACTOR 4 -#define INTERP_SHIFT 2 - -#define CHROMA_INTERP_FACTOR 8 -#define CHROMA_INTERP_SHIFT 3 - -// at picture edge, clip motion vectors to only this far beyond the edge, -// in pixel units. -#define D_MV_CLIP_LIMIT 19 - -enum Direction_t{ - D_DIR_FWD = 0, - D_DIR_BWD = 1, - D_DIR_BIDIR = 2, - D_DIR_DIRECT = 3, - D_DIR_DIRECT_SPATIAL_FWD = 4, - D_DIR_DIRECT_SPATIAL_BWD = 5, - D_DIR_DIRECT_SPATIAL_BIDIR = 6 -}; - -inline bool IsForwardOnly(mfxI32 direction) -{ - return (direction == D_DIR_FWD) || (direction == D_DIR_DIRECT_SPATIAL_FWD); -} - -inline bool IsHaveForward(mfxI32 direction) -{ - return (direction == D_DIR_FWD) || (direction == D_DIR_BIDIR) || - (direction == D_DIR_DIRECT_SPATIAL_FWD) || (direction == D_DIR_DIRECT_SPATIAL_BIDIR) || - (direction == D_DIR_DIRECT); -} - -inline bool IsBackwardOnly(mfxI32 direction) -{ - return (direction == D_DIR_BWD) || (direction == D_DIR_DIRECT_SPATIAL_BWD); -} - -inline bool IsHaveBackward(mfxI32 direction) -{ - return (direction == D_DIR_BWD) || (direction == D_DIR_BIDIR) || - (direction == D_DIR_DIRECT_SPATIAL_BWD) || (direction == D_DIR_DIRECT_SPATIAL_BIDIR) || - (direction == D_DIR_DIRECT); -} - -inline bool IsBidirOnly(mfxI32 direction) -{ - return (direction == D_DIR_BIDIR) || (direction == D_DIR_DIRECT_SPATIAL_BIDIR) || - (direction == D_DIR_DIRECT); -} - -// Warning: If these bit defines change, also need to change same -// defines and related code in sresidual.s. -enum CBP -{ - D_CBP_LUMA_DC = 0x00001, - D_CBP_LUMA_AC = 0x1fffe, - - D_CBP_CHROMA_DC = 0x00001, - D_CBP_CHROMA_AC = 0x1fffe, - D_CBP_CHROMA_AC_420 = 0x0001e, - D_CBP_CHROMA_AC_422 = 0x001fe, - D_CBP_CHROMA_AC_444 = 0x1fffe, - - D_CBP_1ST_LUMA_AC_BITPOS = 1, - D_CBP_1ST_CHROMA_DC_BITPOS = 17, - D_CBP_1ST_CHROMA_AC_BITPOS = 19 -}; - -enum -{ - FIRST_DC_LUMA = 0, - FIRST_AC_LUMA = 1, - FIRST_DC_CHROMA = 17, - FIRST_AC_CHROMA = 19 -}; - -enum -{ - CHROMA_FORMAT_400 = 0, - CHROMA_FORMAT_420 = 1, - CHROMA_FORMAT_422 = 2, - CHROMA_FORMAT_444 = 3 -}; - -class AVC_exception -{ -public: - AVC_exception(mfxI32 status = -1) - : m_Status(status) - { - } - - virtual ~AVC_exception() - { - } - - mfxI32 GetStatus() const - { - return m_Status; - } - -private: - mfxI32 m_Status; -}; - - -#pragma pack(1) - -extern mfxI32 lock_failed; - -#pragma pack() - -template -inline T * AVC_new_array_throw(mfxI32 size) -{ - T * t = new T[size]; - if (!t) - throw AVC_exception(MFX_ERR_MEMORY_ALLOC); - return t; -} - -template -inline T * AVC_new_throw() -{ - T * t = new T(); - if (!t) - throw AVC_exception(MFX_ERR_MEMORY_ALLOC); - return t; -} - -template -inline T * AVC_new_throw_1(T1 t1) -{ - T * t = new T(t1); - if (!t) - throw AVC_exception(MFX_ERR_MEMORY_ALLOC); - return t; -} - -inline mfxU32 CalculateSuggestedSize(const AVCSeqParamSet * sps) -{ - mfxU32 base_size = sps->frame_width_in_mbs * sps->frame_height_in_mbs * 256; - mfxU32 size = 0; - - switch (sps->chroma_format_idc) - { - case 0: // YUV400 - size = base_size; - break; - case 1: // YUV420 - size = (base_size * 3) / 2; - break; - case 2: // YUV422 - size = base_size + base_size; - break; - case 3: // YUV444 - size = base_size + base_size + base_size; - break; - }; - - return size; -} - -#define SAMPLE_ASSERT(x) - -} // namespace ProtectedLibrary - - -#endif // __AVC_STRUCTURES_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/base_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/base_allocator.h deleted file mode 100644 index f01388e6..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/base_allocator.h +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __BASE_ALLOCATOR_H__ -#define __BASE_ALLOCATOR_H__ - -#include -#include -#include -#include "mfxvideo.h" -#include -#include - -struct mfxAllocatorParams -{ - virtual ~mfxAllocatorParams(){}; -}; - -// this class implements methods declared in mfxFrameAllocator structure -// simply redirecting them to virtual methods which should be overridden in derived classes -class MFXFrameAllocator : public mfxFrameAllocator -{ -public: - MFXFrameAllocator(); - virtual ~MFXFrameAllocator(); - - // optional method, override if need to pass some parameters to allocator from application - virtual mfxStatus Init(mfxAllocatorParams *pParams) = 0; - virtual mfxStatus Close() = 0; - - virtual mfxStatus AllocFrames(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) = 0; - virtual mfxStatus ReallocFrame(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut) = 0; - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr) = 0; - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr) = 0; - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle) = 0; - virtual mfxStatus FreeFrames(mfxFrameAllocResponse *response) = 0; - -private: - static mfxStatus MFX_CDECL Alloc_(mfxHDL pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - static mfxStatus MFX_CDECL Lock_(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr); - static mfxStatus MFX_CDECL Unlock_(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr); - static mfxStatus MFX_CDECL GetHDL_(mfxHDL pthis, mfxMemId mid, mfxHDL *handle); - static mfxStatus MFX_CDECL Free_(mfxHDL pthis, mfxFrameAllocResponse *response); -}; - -// This class implements basic logic of memory allocator -// Manages responses for different components according to allocation request type -// External frames of a particular component-related type are allocated in one call -// Further calls return previously allocated response. -// Ex. Preallocated frame chain with type=FROM_ENCODE | FROM_VPPIN will be returned when -// request type contains either FROM_ENCODE or FROM_VPPIN - -// This class does not allocate any actual memory - -class BaseFrameAllocator: public MFXFrameAllocator -{ -public: - BaseFrameAllocator(); - virtual ~BaseFrameAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams) = 0; - virtual mfxStatus Close(); - virtual mfxStatus AllocFrames(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocFrame(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - virtual mfxStatus FreeFrames(mfxFrameAllocResponse *response); - -protected: - std::mutex mtx; - typedef std::list::iterator Iter; - static const mfxU32 MEMTYPE_FROM_MASK = MFX_MEMTYPE_FROM_ENCODE | MFX_MEMTYPE_FROM_DECODE | \ - MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT | \ - MFX_MEMTYPE_FROM_ENC | MFX_MEMTYPE_FROM_PAK; - - static const mfxU32 MEMTYPE_FROM_MASK_INT_EXT = MEMTYPE_FROM_MASK | MFX_MEMTYPE_INTERNAL_FRAME | MFX_MEMTYPE_EXTERNAL_FRAME; - - struct UniqueResponse - : mfxFrameAllocResponse - { - mfxU16 m_width; - mfxU16 m_height; - mfxU32 m_refCount; - mfxU16 m_type; - - UniqueResponse() - : m_width(0) - , m_height(0) - , m_refCount(0) - , m_type(0) - { - memset(static_cast(this), 0, sizeof(mfxFrameAllocResponse)); - } - - // compare responses by actual frame size, alignment (w and h) is up to application - UniqueResponse(const mfxFrameAllocResponse & response, mfxU16 width, mfxU16 height, mfxU16 type) - : mfxFrameAllocResponse(response) - , m_width(width) - , m_height(height) - , m_refCount(1) - , m_type(type) - { - } - - //compare by resolution (and memory type for FEI ENC / PAK) - bool operator () (const UniqueResponse &response)const - { - if (m_width <= response.m_width && m_height <= response.m_height) - { - // For FEI ENC and PAK we need to distinguish between INTERNAL and EXTERNAL frames - - if (m_type & response.m_type & (MFX_MEMTYPE_FROM_ENC | MFX_MEMTYPE_FROM_PAK)) - { - return !!((m_type & response.m_type) & 0x000f); - } - else - { - return !!(m_type & response.m_type & MFX_MEMTYPE_FROM_DECODE); - } - } - else - { - return false; - } - } - - static mfxU16 CropMemoryTypeToStore(mfxU16 type) - { - // Remain INTERNAL / EXTERNAL flag for FEI ENC / PAK - switch (type & 0xf000) - { - case MFX_MEMTYPE_FROM_ENC: - case MFX_MEMTYPE_FROM_PAK: - case (MFX_MEMTYPE_FROM_ENC | MFX_MEMTYPE_FROM_PAK): - return type & MEMTYPE_FROM_MASK_INT_EXT; - break; - default: - return type & MEMTYPE_FROM_MASK; - break; - } - } - }; - - std::list m_responses; - std::list m_ExtResponses; - - struct IsSame - : public std::binary_function - { - bool operator () (const mfxFrameAllocResponse & l, const mfxFrameAllocResponse &r)const - { - return r.mids != 0 && l.mids != 0 && - r.mids[0] == l.mids[0] && - r.NumFrameActual == l.NumFrameActual; - } - }; - - // checks if request is supported - virtual mfxStatus CheckRequestType(mfxFrameAllocRequest *request); - - // frees memory attached to response - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response) = 0; - // allocates memory - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) = 0; - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut) = 0; -}; - -class MFXBufferAllocator : public mfxBufferAllocator -{ -public: - MFXBufferAllocator(); - virtual ~MFXBufferAllocator(); - - virtual mfxStatus AllocBuffer(mfxU32 nbytes, mfxU16 type, mfxMemId *mid) = 0; - virtual mfxStatus LockBuffer(mfxMemId mid, mfxU8 **ptr) = 0; - virtual mfxStatus UnlockBuffer(mfxMemId mid) = 0; - virtual mfxStatus FreeBuffer(mfxMemId mid) = 0; - -private: - static mfxStatus MFX_CDECL Alloc_(mfxHDL pthis, mfxU32 nbytes, mfxU16 type, mfxMemId *mid); - static mfxStatus MFX_CDECL Lock_(mfxHDL pthis, mfxMemId mid, mfxU8 **ptr); - static mfxStatus MFX_CDECL Unlock_(mfxHDL pthis, mfxMemId mid); - static mfxStatus MFX_CDECL Free_(mfxHDL pthis, mfxMemId mid); -}; - - -#endif // __BASE_ALLOCATOR_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/brc_routines.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/brc_routines.h deleted file mode 100644 index e0192375..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/brc_routines.h +++ /dev/null @@ -1,425 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ -#include "sample_defs.h" -#include "algorithm" - -#ifndef MFX_VERSION -#error MFX_VERSION not defined -#endif - -#if (MFX_VERSION >= 1024) -#include "mfxbrc.h" - -#ifndef __PIPELINE_ENCODE_BRC_H__ -#define __PIPELINE_ENCODE_BRC_H__ - -#define MFX_CHECK_NULL_PTR1(pointer) MSDK_CHECK_POINTER(pointer, MFX_ERR_NULL_PTR); - -#define MFX_CHECK_NULL_PTR2(pointer1,pointer2 )\ - MFX_CHECK_NULL_PTR1(pointer1);\ - MFX_CHECK_NULL_PTR1(pointer2); - -#define MFX_CHECK_NULL_PTR3(pointer1,pointer2, pointer3 )\ - MFX_CHECK_NULL_PTR2(pointer1,pointer2);\ - MFX_CHECK_NULL_PTR1(pointer3); - -#define MFX_CHECK(cond, error) MSDK_CHECK_NOT_EQUAL(cond, true, error) -#define MFX_CHECK_STS(sts) MFX_CHECK(sts == MFX_ERR_NONE, sts) - - -/* -NalHrdConformance | VuiNalHrdParameters | Result --------------------------------------------------------------- - off any => MFX_BRC_NO_HRD - default off => MFX_BRC_NO_HRD - on off => MFX_BRC_HRD_WEAK - on (or default) on (or default) => MFX_BRC_HRD_STRONG --------------------------------------------------------------- -*/ -enum : mfxU16 -{ - MFX_BRC_NO_HRD = 0, - MFX_BRC_HRD_WEAK, // IF HRD CALCULATION IS REQUIRED, BUT NOT WRITTEN TO THE STREAM - MFX_BRC_HRD_STRONG -}; - -class cBRCParams -{ -public: - mfxU16 rateControlMethod; // CBR or VBR - - mfxU16 HRDConformance; // is HRD compliance needed - mfxU16 bRec; // is Recoding possible - mfxU16 bPanic; // is Panic mode possible - - // HRD params - mfxU32 bufferSizeInBytes; - mfxU32 initialDelayInBytes; - - // Sliding window parameters - mfxU16 WinBRCMaxAvgKbps; - mfxU16 WinBRCSize; - - // RC params - mfxU32 targetbps; - mfxU32 maxbps; - mfxF64 frameRate; - mfxF64 inputBitsPerFrame; - mfxF64 maxInputBitsPerFrame; - mfxU32 maxFrameSizeInBits; - - // Frame size params - mfxU16 width; - mfxU16 height; - mfxU16 chromaFormat; - mfxU16 bitDepthLuma; - - // GOP params - mfxU16 gopPicSize; - mfxU16 gopRefDist; - bool bPyr; - - //BRC accurancy params - mfxF64 fAbPeriodLong; // number on frames to calculate abberation from target frame - mfxF64 fAbPeriodShort; // number on frames to calculate abberation from target frame - mfxF64 dqAbPeriod; // number on frames to calculate abberation from dequant - mfxF64 bAbPeriod; // number of frames to calculate abberation from target bitrate - - //QP parameters - mfxI32 quantOffset; - mfxI32 quantMaxI; - mfxI32 quantMinI; - mfxI32 quantMaxP; - mfxI32 quantMinP; - mfxI32 quantMaxB; - mfxI32 quantMinB; - -public: - cBRCParams(): - rateControlMethod(0), - HRDConformance(MFX_BRC_NO_HRD), - bRec(0), - bPanic(0), - bufferSizeInBytes(0), - initialDelayInBytes(0), - WinBRCMaxAvgKbps(0), - WinBRCSize(0), - targetbps(0), - maxbps(0), - frameRate(0), - inputBitsPerFrame(0), - maxInputBitsPerFrame(0), - maxFrameSizeInBits(0), - width(0), - height(0), - chromaFormat(0), - bitDepthLuma(0), - gopPicSize(0), - gopRefDist(0), - bPyr(0), - fAbPeriodLong(0), - fAbPeriodShort(0), - dqAbPeriod(0), - bAbPeriod(0), - quantOffset(0), - quantMaxI(0), - quantMinI(0), - quantMaxP(0), - quantMinP(0), - quantMaxB(0), - quantMinB(0) - {} - - mfxStatus Init(mfxVideoParam* par, bool bFieldMode = false); - mfxStatus GetBRCResetType(mfxVideoParam* par, bool bNewSequence, bool &bReset, bool &bSlidingWindowReset ); -}; -class cHRD -{ -public: - cHRD(): - m_bufFullness(0), - m_prevBufFullness(0), - m_frameNum(0), - m_minFrameSize(0), - m_maxFrameSize(0), - m_underflowQuant(0), - m_overflowQuant(0), - m_buffSizeInBits(0), - m_delayInBits(0), - m_inputBitsPerFrame(0), - m_bCBR (false) - {} - - void Init(mfxU32 buffSizeInBytes, mfxU32 delayInBytes, mfxF64 inputBitsPerFrame, bool cbr); - mfxU16 UpdateAndCheckHRD(mfxI32 frameBits, mfxI32 recode, mfxI32 minQuant, mfxI32 maxQuant); - mfxStatus UpdateMinMaxQPForRec(mfxU32 brcSts, mfxI32 qp); - mfxI32 GetTargetSize(mfxU32 brcSts); - mfxI32 GetMaxFrameSize() { return m_maxFrameSize;} - mfxI32 GetMinFrameSize() { return m_minFrameSize;} - mfxI32 GetMaxQuant() { return m_overflowQuant - 1;} - mfxI32 GetMinQuant() { return m_underflowQuant + 1;} - mfxF64 GetBufferDiviation(mfxU32 targetBitrate); - - - -private: - mfxF64 m_bufFullness; - mfxF64 m_prevBufFullness; - mfxI32 m_frameNum; - mfxI32 m_minFrameSize; - mfxI32 m_maxFrameSize; - mfxI32 m_underflowQuant; - mfxI32 m_overflowQuant; - -private: - mfxI32 m_buffSizeInBits; - mfxI32 m_delayInBits; - mfxF64 m_inputBitsPerFrame; - bool m_bCBR; - -}; - -struct BRC_Ctx -{ - mfxI32 QuantI; //currect qp for intra frames - mfxI32 QuantP; //currect qp for P frames - mfxI32 QuantB; //currect qp for B frames - - mfxI32 Quant; // qp for last encoded frame - mfxI32 QuantMin; // qp Min for last encoded frame (is used for recoding) - mfxI32 QuantMax; // qp Max for last encoded frame (is used for recoding) - - bool bToRecode; // last frame is needed in recoding - bool bPanic; // last frame is needed in panic - mfxU32 encOrder; // encoding order of last encoded frame - mfxU32 poc; // poc of last encoded frame - mfxI32 SceneChange; // scene change parameter of last encoded frame - mfxU32 SChPoc; // poc of frame with scene change - mfxU32 LastIEncOrder; // encoded order if last intra frame - mfxU32 LastNonBFrameSize; // encoded frame size of last non B frame (is used for sceneChange) - - mfxF64 fAbLong; // avarage frame size (long period) - mfxF64 fAbShort; // avarage frame size (short period) - mfxF64 dQuantAb; // avarage dequant - mfxF64 totalDiviation; // divation from target bitrate (total) - - mfxF64 eRate; // eRate of last encoded frame, this parameter is used for scene change calculation - mfxF64 eRateSH; // eRate of last encoded scene change frame, this parameter is used for scene change calculation -}; -class AVGBitrate -{ -public: - AVGBitrate(mfxU32 windowSize, mfxU32 maxBitPerFrame, mfxU32 avgBitPerFrame) : - m_maxWinBits(maxBitPerFrame*windowSize), - m_maxWinBitsLim(0), - m_avgBitPerFrame(std::min(avgBitPerFrame, maxBitPerFrame)), - m_currPosInWindow(windowSize-1), - m_lastFrameOrder(mfxU32(-1)) - - { - windowSize = windowSize > 0 ? windowSize : 1; // kw - m_slidingWindow.resize(windowSize); - for (mfxU32 i = 0; i < windowSize; i++) - { - m_slidingWindow[i] = maxBitPerFrame / 3; //initial value to prevent big first frames - } - m_maxWinBitsLim = GetMaxWinBitsLim(); - } - virtual ~AVGBitrate() - { - - } - void UpdateSlidingWindow(mfxU32 sizeInBits, mfxU32 FrameOrder, bool bPanic, bool bSH, mfxU32 recode) - { - mfxU32 windowSize = (mfxU32)m_slidingWindow.size(); - bool bNextFrame = FrameOrder != m_lastFrameOrder; - - if (bNextFrame) - { - m_lastFrameOrder = FrameOrder; - m_currPosInWindow = (m_currPosInWindow + 1) % windowSize; - } - m_slidingWindow[m_currPosInWindow] = sizeInBits; - - if (bNextFrame) - { - if (bPanic || bSH) - { - m_maxWinBitsLim = mfx::clamp((GetLastFrameBits(windowSize, false) + m_maxWinBits)/2, GetMaxWinBitsLim(), m_maxWinBits); - } - else - { - if (recode) - { - m_maxWinBitsLim = mfx::clamp(GetLastFrameBits(windowSize, false) + GetStep()/2, m_maxWinBitsLim, m_maxWinBits); - } - else if ((m_maxWinBitsLim > GetMaxWinBitsLim() + GetStep()) && - (m_maxWinBitsLim - GetStep() > (GetLastFrameBits(windowSize - 1, false) + sizeInBits))) - m_maxWinBitsLim -= GetStep(); - } - - } - - } - mfxU32 GetMaxFrameSize(bool bPanic, bool bSH, mfxU32 recode) - { - mfxU32 winBits = GetLastFrameBits(GetWindowSize() - 1, !bPanic); - - mfxU32 maxWinBitsLim = m_maxWinBitsLim; - if (bSH) - maxWinBitsLim = (m_maxWinBits + m_maxWinBitsLim)/2; - if (bPanic) - maxWinBitsLim = m_maxWinBits; - maxWinBitsLim = std::min(maxWinBitsLim + recode*GetStep()/2, m_maxWinBits); - - mfxU32 maxFrameSize = winBits >= m_maxWinBitsLim ? - mfxU32(std::max((mfxI32)m_maxWinBits - (mfxI32)winBits, 1)): - maxWinBitsLim - winBits; - - - - return maxFrameSize; - } - mfxU32 GetWindowSize() - { - return (mfxU32)m_slidingWindow.size(); - } - -protected: - - mfxU32 m_maxWinBits; - mfxU32 m_maxWinBitsLim; - mfxU32 m_avgBitPerFrame; - - mfxU32 m_currPosInWindow; - mfxU32 m_lastFrameOrder; - std::vector m_slidingWindow; - - - - mfxU32 GetLastFrameBits(mfxU32 numFrames, bool bCheckSkip) - { - mfxU32 size = 0; - numFrames = numFrames < m_slidingWindow.size() ? numFrames : (mfxU32)m_slidingWindow.size(); - for (mfxU32 i = 0; i < numFrames; i++) - { - mfxU32 frame_size = m_slidingWindow[(m_currPosInWindow + m_slidingWindow.size() - i) % m_slidingWindow.size()]; - if (bCheckSkip && (frame_size < m_avgBitPerFrame / 3)) - frame_size = m_avgBitPerFrame / 3; - size += frame_size; - //printf("GetLastFrames: %d) %d sum %d\n",i,m_slidingWindow[(m_currPosInWindow + m_slidingWindow.size() - i) % m_slidingWindow.size() ], size); - } - return size; - } - mfxU32 GetStep() - { - return (m_maxWinBits / GetWindowSize() - m_avgBitPerFrame) / 2; - } - - mfxU32 GetMaxWinBitsLim() - { - return m_maxWinBits - GetStep() * GetWindowSize(); - } - - -}; - -class ExtBRC -{ -private: - cBRCParams m_par; - cHRD m_hrd; - bool m_bInit; - BRC_Ctx m_ctx; - std::unique_ptr m_avg; - -public: - ExtBRC(): - m_par(), - m_hrd(), - m_bInit(false) - { - memset(&m_ctx, 0, sizeof(m_ctx)); - - } - mfxStatus Init (mfxVideoParam* par); - mfxStatus Reset(mfxVideoParam* par); - mfxStatus Close () {m_bInit = false; return MFX_ERR_NONE;} - mfxStatus GetFrameCtrl (mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl); - mfxStatus Update (mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl, mfxBRCFrameStatus* status); -protected: - mfxI32 GetCurQP (mfxU32 type, mfxI32 layer); -}; - -namespace HEVCExtBRC -{ - inline mfxStatus Init (mfxHDL pthis, mfxVideoParam* par) - { - MFX_CHECK_NULL_PTR1(pthis); - return ((ExtBRC*)pthis)->Init(par) ; - } - inline mfxStatus Reset (mfxHDL pthis, mfxVideoParam* par) - { - MFX_CHECK_NULL_PTR1(pthis); - return ((ExtBRC*)pthis)->Reset(par) ; - } - inline mfxStatus Close (mfxHDL pthis) - { - MFX_CHECK_NULL_PTR1(pthis); - return ((ExtBRC*)pthis)->Close() ; - } - inline mfxStatus GetFrameCtrl (mfxHDL pthis, mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl) - { - MFX_CHECK_NULL_PTR1(pthis); - return ((ExtBRC*)pthis)->GetFrameCtrl(par,ctrl) ; - } - inline mfxStatus Update (mfxHDL pthis, mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl, mfxBRCFrameStatus* status) - { - MFX_CHECK_NULL_PTR1(pthis); - return ((ExtBRC*)pthis)->Update(par,ctrl, status) ; - } - inline mfxStatus Create(mfxExtBRC & m_BRC) - { - MFX_CHECK(m_BRC.pthis == NULL, MFX_ERR_UNDEFINED_BEHAVIOR); - m_BRC.pthis = new ExtBRC; - m_BRC.Init = Init; - m_BRC.Reset = Reset; - m_BRC.Close = Close; - m_BRC.GetFrameCtrl = GetFrameCtrl; - m_BRC.Update = Update; - return MFX_ERR_NONE; - } - inline mfxStatus Destroy(mfxExtBRC & m_BRC) - { - if(m_BRC.pthis != NULL) - { - delete (ExtBRC*)m_BRC.pthis; - m_BRC.pthis = 0; - m_BRC.Init = 0; - m_BRC.Reset = 0; - m_BRC.Close = 0; - m_BRC.GetFrameCtrl = 0; - m_BRC.Update = 0; - } - return MFX_ERR_NONE; - } -} -#endif - -#endif \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/current_date.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/current_date.h deleted file mode 100644 index 681a4fb7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/current_date.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#define PRODUCT_NAME "Intel\xae Media SDK" -#define FILE_VERSION 1,0,0,0 -#define FILE_VERSION_STRING "1,0,0,0" -#define FILTER_NAME_PREFIX "" -#define FILTER_NAME_SUFFIX "" -#define PRODUCT_COPYRIGHT "Copyright\xa9 2003-2019 Intel Corporation" -#define PRODUCT_VERSION 1,0,0,0 -#define PRODUCT_VERSION_STRING "1,0,0,0" diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_allocator.h deleted file mode 100644 index d7af7b03..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_allocator.h +++ /dev/null @@ -1,263 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __D3D11_ALLOCATOR_H__ -#define __D3D11_ALLOCATOR_H__ - -#include "base_allocator.h" -#include - -#ifdef __gnu_linux__ -#include // for uintptr_t on Linux -#endif - -//application can provide either generic mid from surface or this wrapper -//wrapper distinguishes from generic mid by highest 1 bit -//if it set then remained pointer points to extended structure of memid -//64 bits system layout -/*----+-----------------------------------------------------------+ -|b63=1|63 bits remained for pointer to extended structure of memid| -|b63=0|63 bits from original mfxMemId | -+-----+----------------------------------------------------------*/ -//32 bits system layout -/*--+---+--------------------------------------------+ -|b31=1|31 bits remained for pointer to extended memid| -|b31=0|31 bits remained for surface pointer | -+---+---+-------------------------------------------*/ -//#pragma warning (disable:4293) -class MFXReadWriteMid -{ - static const uintptr_t bits_offset = std::numeric_limits::digits - 1; - static const uintptr_t clear_mask = ~((uintptr_t)1 << bits_offset); -public: - enum - { - //if flag not set it means that read and write - not_set = 0, - reuse = 1, - read = 2, - write = 4, - }; - //here mfxmemid might be as MFXReadWriteMid or mfxMemId memid - MFXReadWriteMid(mfxMemId mid, mfxU8 flag = not_set) - { - //setup mid - m_mid_to_report = (mfxMemId)((uintptr_t)&m_mid | ((uintptr_t)1 << bits_offset)); - if (0 != ((uintptr_t)mid >> bits_offset)) - { - //it points to extended structure - mfxMedIdEx * pMemIdExt = reinterpret_cast((uintptr_t)mid & clear_mask); - m_mid.pId = pMemIdExt->pId; - if (reuse == flag) - { - m_mid.read_write = pMemIdExt->read_write; - } - else - { - m_mid.read_write = flag; - } - } - else - { - m_mid.pId = mid; - if (reuse == flag) - m_mid.read_write = not_set; - else - m_mid.read_write = flag; - } - - } - bool isRead() const - { - return 0 != (m_mid.read_write & read) || !m_mid.read_write; - } - bool isWrite() const - { - return 0 != (m_mid.read_write & write) || !m_mid.read_write; - } - /// returns original memid without read write flags - mfxMemId raw() const - { - return m_mid.pId; - } - operator mfxMemId() const - { - return m_mid_to_report; - } - -private: - struct mfxMedIdEx - { - mfxMemId pId; - mfxU8 read_write; - }; - - mfxMedIdEx m_mid; - mfxMemId m_mid_to_report; -}; - -#if (defined(_WIN32) || defined(_WIN64)) - -#include -#include -#include - -struct ID3D11VideoDevice; -struct ID3D11VideoContext; - -struct D3D11AllocatorParams : mfxAllocatorParams -{ - ID3D11Device *pDevice; - bool bUseSingleTexture; - DWORD uncompressedResourceMiscFlags; - - D3D11AllocatorParams() - : pDevice() - , bUseSingleTexture() - , uncompressedResourceMiscFlags() - { - } -}; - -class D3D11FrameAllocator: public BaseFrameAllocator -{ -public: - - D3D11FrameAllocator(); - virtual ~D3D11FrameAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams); - virtual mfxStatus Close(); - virtual ID3D11Device * GetD3D11Device() - { - return m_initParams.pDevice; - }; - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle); - -protected: - static DXGI_FORMAT ConverColortFormat(mfxU32 fourcc); - virtual mfxStatus CheckRequestType(mfxFrameAllocRequest *request); - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response); - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - - D3D11AllocatorParams m_initParams; - ID3D11DeviceContext *m_pDeviceContext; - - struct TextureResource - { - std::vector outerMids; - std::vector textures; - std::vector stagingTexture; - bool bAlloc; - - TextureResource() - : bAlloc(true) - { - } - - static bool isAllocated (TextureResource & that) - { - return that.bAlloc; - } - ID3D11Texture2D* GetTexture(mfxMemId id) - { - if (outerMids.empty()) - return NULL; - - return textures[((uintptr_t)id - (uintptr_t)outerMids.front()) % textures.size()]; - } - UINT GetSubResource(mfxMemId id) - { - if (outerMids.empty()) - return NULL; - - return (UINT)(((uintptr_t)id - (uintptr_t)outerMids.front()) / textures.size()); - } - void Release() - { - size_t i = 0; - for(i = 0; i < textures.size(); i++) - { - textures[i]->Release(); - } - textures.clear(); - - for(i = 0; i < stagingTexture.size(); i++) - { - stagingTexture[i]->Release(); - } - stagingTexture.clear(); - - //marking texture as deallocated - bAlloc = false; - } - }; - class TextureSubResource - { - TextureResource * m_pTarget; - ID3D11Texture2D * m_pTexture; - ID3D11Texture2D * m_pStaging; - UINT m_subResource; - public: - TextureSubResource(TextureResource * pTarget = NULL, mfxMemId id = 0) - : m_pTarget(pTarget) - , m_pTexture() - , m_subResource() - , m_pStaging(NULL) - { - if (NULL != m_pTarget && !m_pTarget->outerMids.empty()) - { - ptrdiff_t idx = (uintptr_t)MFXReadWriteMid(id).raw() - (uintptr_t)m_pTarget->outerMids.front(); - m_pTexture = m_pTarget->textures[idx % m_pTarget->textures.size()]; - m_subResource = (UINT)(idx / m_pTarget->textures.size()); - m_pStaging = m_pTarget->stagingTexture.empty() ? NULL : m_pTarget->stagingTexture[idx]; - } - } - ID3D11Texture2D* GetStaging()const - { - return m_pStaging; - } - ID3D11Texture2D* GetTexture()const - { - return m_pTexture; - } - UINT GetSubResource()const - { - return m_subResource; - } - void Release() - { - if (NULL != m_pTarget) - m_pTarget->Release(); - } - }; - - TextureSubResource GetResourceFromMid(mfxMemId); - - std::list m_resourcesByRequest;//each alloc request generates new item in list - - typedef std::list ::iterator referenceType; - std::vector m_memIdMap; -}; - -#endif // #if defined(_WIN32) || defined(_WIN64) -#endif // __D3D11_ALLOCATOR_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_device.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_device.h deleted file mode 100644 index fba405a3..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d11_device.h +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#if defined( _WIN32 ) || defined ( _WIN64 ) - -#include "sample_defs.h" // defines MFX_D3D11_SUPPORT - -#if MFX_D3D11_SUPPORT -#include "hw_device.h" -#include -#include -#include - -#include - -class CD3D11Device: public CHWDevice -{ -public: - CD3D11Device(); - virtual ~CD3D11Device(); - virtual mfxStatus Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum); - virtual mfxStatus Reset(); - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl); - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl); - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc); - virtual void UpdateTitle(double /*fps*/) { } - virtual void Close(); - void DefineFormat(bool isA2rgb10) { m_bIsA2rgb10 = (isA2rgb10) ? TRUE : FALSE; } - virtual void SetMondelloInput(bool /*isMondelloInputEnabled*/ ) { } -protected: - virtual mfxStatus FillSCD(mfxHDL hWindow, DXGI_SWAP_CHAIN_DESC& scd); - virtual mfxStatus FillSCD1(DXGI_SWAP_CHAIN_DESC1& scd); - mfxStatus CreateVideoProcessor(mfxFrameSurface1 * pSrf); - - CComPtr m_pD3D11Device; - CComPtr m_pD3D11Ctx; - CComQIPtr m_pDX11VideoDevice; - CComQIPtr m_pVideoContext; - CComPtr m_VideoProcessorEnum; - - CComQIPtr m_pDXGIDev; - CComQIPtr m_pAdapter; - - CComPtr m_pDXGIFactory; - - CComPtr m_pSwapChain; - CComPtr m_pVideoProcessor; - -private: - CComPtr m_pInputViewLeft; - CComPtr m_pInputViewRight; - CComPtr m_pOutputView; - - CComPtr m_pDXGIBackBuffer; - CComPtr m_pTempTexture; - CComPtr m_pDisplayControl; - CComPtr m_pDXGIOutput; - mfxU16 m_nViews; - BOOL m_bDefaultStereoEnabled; - BOOL m_bIsA2rgb10; - HWND m_HandleWindow; -}; - -#endif //#if defined( _WIN32 ) || defined ( _WIN64 ) -#endif //#if MFX_D3D11_SUPPORT diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_allocator.h deleted file mode 100644 index a52c5e17..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_allocator.h +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __D3D_ALLOCATOR_H__ -#define __D3D_ALLOCATOR_H__ - -#if defined( _WIN32 ) || defined ( _WIN64 ) - -#include -#include -#include -#include "base_allocator.h" -#include - -enum eTypeHandle -{ - DXVA2_PROCESSOR = 0x00, - DXVA2_DECODER = 0x01 -}; - -struct D3DAllocatorParams : mfxAllocatorParams -{ - IDirect3DDeviceManager9 *pManager; - DWORD surfaceUsage; - - D3DAllocatorParams() - : pManager() - , surfaceUsage() - { - } -}; - -class D3DFrameAllocator: public BaseFrameAllocator -{ -public: - D3DFrameAllocator(); - virtual ~D3DFrameAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams); - virtual mfxStatus Close(); - - virtual IDirect3DDeviceManager9* GetDeviceManager() - { - return m_manager; - }; - - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle); - -protected: - virtual mfxStatus CheckRequestType(mfxFrameAllocRequest *request); - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response); - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - - void DeallocateMids(mfxHDLPair** pairs, int n); - - std::vector m_midsAllocated; - - CComPtr m_manager; - CComPtr m_decoderService; - CComPtr m_processorService; - HANDLE m_hDecoder; - HANDLE m_hProcessor; - DWORD m_surfaceUsage; -}; - -#endif // #if defined( _WIN32 ) || defined ( _WIN64 ) -#endif // __D3D_ALLOCATOR_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_device.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_device.h deleted file mode 100644 index a9b23627..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/d3d_device.h +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#if defined( _WIN32 ) || defined ( _WIN64 ) - -#include "hw_device.h" - -#pragma warning(disable : 4201) -#include -#include -#include -#include - -#define VIDEO_MAIN_FORMAT D3DFMT_YUY2 - -/** Direct3D 9 device implementation. -@note Device always set D3DPRESENT_PARAMETERS::Windowed to TRUE. -*/ -class CD3D9Device : public CHWDevice -{ -public: - CD3D9Device(); - virtual ~CD3D9Device(); - - virtual mfxStatus Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum); - virtual mfxStatus Reset(); - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl); - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl); - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc); - virtual void UpdateTitle(double /*fps*/) { } - virtual void Close() ; - void DefineFormat(bool isA2rgb10) { m_bIsA2rgb10 = (isA2rgb10) ? TRUE : FALSE; } - virtual void SetMondelloInput(bool /*isMondelloInputEnabled*/) { } -protected: - mfxStatus CreateVideoProcessors(); - bool CheckOverlaySupport(); - virtual mfxStatus FillD3DPP(mfxHDL hWindow, mfxU16 nViews, D3DPRESENT_PARAMETERS &D3DPP); -private: - IDirect3D9Ex* m_pD3D9; - IDirect3DDevice9Ex* m_pD3DD9; - IDirect3DDeviceManager9* m_pDeviceManager9; - D3DPRESENT_PARAMETERS m_D3DPP; - UINT m_resetToken; - - mfxU16 m_nViews; - - D3DSURFACE_DESC m_backBufferDesc; - - // service required to create video processors - IDirectXVideoProcessorService* m_pDXVAVPS; - //left channel processor - IDirectXVideoProcessor* m_pDXVAVP_Left; - // right channel processor - IDirectXVideoProcessor* m_pDXVAVP_Right; - - // target rectangle - RECT m_targetRect; - - // various structures for DXVA2 calls - DXVA2_VideoDesc m_VideoDesc; - DXVA2_VideoProcessBltParams m_BltParams; - DXVA2_VideoSample m_Sample; - - BOOL m_bIsA2rgb10; -}; - -#endif // #if defined( _WIN32 ) || defined ( _WIN64 ) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/decode_render.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/decode_render.h deleted file mode 100644 index ccd6e95a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/decode_render.h +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - - -#ifndef __DECODE_D3D_RENDER_H__ -#define __DECODE_D3D_RENDER_H__ - -#if defined(_WIN32) || defined(_WIN64) - -#pragma warning(disable : 4201) -#include -#include -#include -#include -#endif - -#include "mfxstructures.h" -#include "mfxvideo.h" - -#include "hw_device.h" - -typedef void* WindowHandle; -typedef void* Handle; - -#if defined(_WIN32) || defined(_WIN64) - -struct sWindowParams -{ - LPCTSTR lpClassName; - LPCTSTR lpWindowName; - DWORD dwStyle; - int nx; - int ny; - int ncell; - int nAdapter; - int nWidth; - int nHeight; - HWND hWndParent; - HMENU hMenu; - HINSTANCE hInstance; - LPVOID lpParam; - bool bFullScreen; // Stretch window to full screen -}; - -class CDecodeD3DRender -{ -public: - - CDecodeD3DRender(); - virtual ~CDecodeD3DRender(); - - virtual mfxStatus Init(sWindowParams pWParams); - virtual mfxStatus RenderFrame(mfxFrameSurface1 *pSurface, mfxFrameAllocator *pmfxAlloc); - virtual VOID UpdateTitle(double fps); - void Close(); - - HWND GetWindowHandle(); - - VOID OnDestroy(HWND hwnd); - VOID OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); - VOID ChangeWindowSize(bool bFullScreen); - - void SetHWDevice(CHWDevice *dev) - { - m_hwdev = dev; - } -protected: - void AdjustWindowRect(RECT *rect); - - mfxStatus AllocateShiftedSurfaceIfNeeded(const mfxFrameSurface1* refSurface,mfxFrameAllocator* allocator); - mfxFrameAllocResponse shiftSurfaceResponse; - mfxFrameSurface1 shiftedSurface; - mfxFrameAllocator* pAllocator; - - CHWDevice *m_hwdev; - - - sWindowParams m_sWindowParams; - HWND m_Hwnd; - RECT m_rect; - DWORD m_style; - - bool EnableDwmQueuing(); - static BOOL CALLBACK MonitorEnumProc(HMONITOR ,HDC ,LPRECT lprcMonitor,LPARAM dwData); - static bool m_bIsMonitorFound; - - bool m_bDwmEnabled; - int m_nMonitorCurrent; - ::RECT m_RectWindow; -}; -#endif // #if defined(_WIN32) || defined(_WIN64) - -#endif // __DECODE_D3D_RENDER_H__ \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/general_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/general_allocator.h deleted file mode 100644 index c2c2324f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/general_allocator.h +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __GENERAL_ALLOCATOR_H__ -#define __GENERAL_ALLOCATOR_H__ - -#include "sample_utils.h" -#include "base_allocator.h" - -#include -#include - -class SysMemFrameAllocator; - -// Wrapper on standard allocator for concurrent allocation of -// D3D and system surfaces -class GeneralAllocator : public BaseFrameAllocator -{ -public: - GeneralAllocator(); - virtual ~GeneralAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams); - virtual mfxStatus Close(); - -protected: - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle); - - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response); - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - - void StoreFrameMids(bool isD3DFrames, mfxFrameAllocResponse *response); - bool isD3DMid(mfxHDL mid); - - std::map m_Mids; - std::unique_ptr m_D3DAllocator; - std::unique_ptr m_SYSAllocator; -private: - DISALLOW_COPY_AND_ASSIGN(GeneralAllocator); - -}; - -#endif //__GENERAL_ALLOCATOR_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/hw_device.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/hw_device.h deleted file mode 100644 index 6787736d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/hw_device.h +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#include "mfxvideo++.h" - -/// Base class for hw device -class CHWDevice -{ -public: - virtual ~CHWDevice(){} - /** Initializes device for requested processing. - @param[in] hWindow Window handle to bundle device to. - @param[in] nViews Number of views to process. - @param[in] nAdapterNum Number of adapter to use - */ - virtual mfxStatus Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum) = 0; - /// Reset device. - virtual mfxStatus Reset() = 0; - /// Get handle can be used for MFX session SetHandle calls - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl) = 0; - /** Set handle. - Particular device implementation may require other objects to operate. - */ - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) = 0; - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc) = 0; - virtual void UpdateTitle(double fps) = 0; - virtual void SetMondelloInput(bool isMondelloInputEnabled) = 0; - virtual void Close() = 0; -}; diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/intrusive_ptr.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/intrusive_ptr.h deleted file mode 100644 index 0b6725af..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/intrusive_ptr.h +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -//intrusive ptr concept -//usage examples same as smart pointers except user has to define addref and release routine for that class - -//inline void intrusive_ptr_addref(UserClassA * pResource); -//inline void intrusive_ptr_release(UserClassA * pResource); - -template -class intrusive_ptr -{ - T * m_pResource; -public: - intrusive_ptr(T* pResource = NULL) - : m_pResource(pResource) { - intrusive_ptr_addref(m_pResource); - } - intrusive_ptr(const intrusive_ptr & rhs) - : m_pResource(rhs.m_pResource) { - intrusive_ptr_addref(m_pResource); - } - void reset(T* pResource) { - if (m_pResource){ - intrusive_ptr_release(m_pResource); - } - m_pResource = pResource; - intrusive_ptr_addref(m_pResource); - } - T* operator *() { - return m_pResource; - } - T* operator ->() { - return m_pResource; - } - T* get(){ - return m_pResource; - } - ~intrusive_ptr(){ - if (m_pResource) { - intrusive_ptr_release(m_pResource); - } - } -}; diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_buffering.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_buffering.h deleted file mode 100644 index 47df4612..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_buffering.h +++ /dev/null @@ -1,399 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __MFX_BUFFERING_H__ -#define __MFX_BUFFERING_H__ - -#include -#include - -#include "mfxstructures.h" - -#include "vm/strings_defs.h" -#include "vm/thread_defs.h" -#include "vm/time_defs.h" -#include "vm/atomic_defs.h" - -struct msdkFrameSurface -{ - mfxFrameSurface1 frame; // NOTE: this _should_ be the first item (see CBuffering::FindUsedSurface()) - msdk_tick submit; // tick when frame was submitted for processing - mfxU16 render_lock; // signifies that frame is locked for rendering - msdkFrameSurface* prev; - msdkFrameSurface* next; -}; - -struct msdkOutputSurface -{ - msdkFrameSurface* surface; - mfxSyncPoint syncp; - msdkOutputSurface* next; -}; - -/** \brief Debug purpose macro to terminate execution if buggy situation happenned. - * - * Use this macro to check impossible, buggy condition which should not occur under - * normal circumstances. Macro should be used where check in release mode is not - * desirable and atually needed. - */ -#define MSDK_SELF_CHECK(C) - -class CBuffering; - -// LIFO list of frame surfaces -class msdkFreeSurfacesPool -{ - friend class CBuffering; -public: - msdkFreeSurfacesPool(std::mutex & mutex): - m_pSurfaces(NULL), - m_rMutex(mutex) {} - - ~msdkFreeSurfacesPool() { - m_pSurfaces = NULL; - } - /** \brief The function adds free surface to the free surfaces array. - * - * @note That's caller responsibility to pass valid surface. - * @note We always add and get free surface from the array head. In case not all surfaces - * will be actually used we have good chance to avoid actual allocation of the surface memory. - */ - inline void AddSurface(msdkFrameSurface* surface) { - std::lock_guard lock(m_rMutex); - AddSurfaceUnsafe(surface); - } - /** \brief The function gets the next free surface from the free surfaces array. - * - * @note Surface is detached from the free surfaces array. - */ - inline msdkFrameSurface* GetSurface() { - std::lock_guard lock(m_rMutex); - return GetSurfaceUnsafe(); - } - -private: - inline void AddSurfaceUnsafe(msdkFrameSurface* surface) { - msdkFrameSurface* head; - - MSDK_SELF_CHECK(surface); - MSDK_SELF_CHECK(!surface->prev); - MSDK_SELF_CHECK(!surface->next); - - head = m_pSurfaces; - m_pSurfaces = surface; - m_pSurfaces->next = head; - } - inline msdkFrameSurface* GetSurfaceUnsafe() { - - msdkFrameSurface* surface = NULL; - - if (m_pSurfaces) { - surface = m_pSurfaces; - m_pSurfaces = m_pSurfaces->next; - surface->prev = surface->next = NULL; - MSDK_SELF_CHECK(!surface->prev); - MSDK_SELF_CHECK(!surface->next); - } - return surface; - } - -protected: - msdkFrameSurface* m_pSurfaces; - std::mutex & m_rMutex; - -private: - msdkFreeSurfacesPool(const msdkFreeSurfacesPool&); - void operator=(const msdkFreeSurfacesPool&); -}; - -// random access, predicted as FIFO -class msdkUsedSurfacesPool -{ - friend class CBuffering; -public: - msdkUsedSurfacesPool(std::mutex & mutex): - m_pSurfacesHead(NULL), - m_pSurfacesTail(NULL), - m_rMutex(mutex) {} - - ~msdkUsedSurfacesPool() { - m_pSurfacesHead = NULL; - m_pSurfacesTail = NULL; - } - - /** \brief The function adds surface to the used surfaces array (m_pUsedSurfaces). - * - * @note That's caller responsibility to pass valid surface. - * @note We can't actually know which surface will be returned by the decoder or unlocked. However, - * we can make prediction that it will be the oldest surface. Thus, here the function adds new - * surface (youngest) to the tail of the least. Check operations for the list will run starting from - * head. - */ - inline void AddSurface(msdkFrameSurface* surface) { - std::lock_guard lock(m_rMutex); - AddSurfaceUnsafe(surface); - } - - /** \brief The function detaches surface from the used surfaces array. - * - * @note That's caller responsibility to pass valid surface. - */ - - inline void DetachSurface(msdkFrameSurface* surface) { - std::lock_guard lock(m_rMutex); - DetachSurfaceUnsafe(surface); - } - -private: - inline void DetachSurfaceUnsafe(msdkFrameSurface* surface) - { - MSDK_SELF_CHECK(surface); - - msdkFrameSurface *prev = surface->prev; - msdkFrameSurface *next = surface->next; - - if (prev) { - prev->next = next; - } - else { - MSDK_SELF_CHECK(surface == m_pSurfacesHead); - m_pSurfacesHead = next; - } - if (next) { - next->prev = prev; - } else { - MSDK_SELF_CHECK(surface == m_pSurfacesTail); - m_pSurfacesTail = prev; - } - - surface->prev = surface->next = NULL; - MSDK_SELF_CHECK(!surface->prev); - MSDK_SELF_CHECK(!surface->next); - } - inline void AddSurfaceUnsafe(msdkFrameSurface* surface) - { - MSDK_SELF_CHECK(surface); - MSDK_SELF_CHECK(!surface->prev); - MSDK_SELF_CHECK(!surface->next); - - surface->prev = m_pSurfacesTail; - surface->next = NULL; - if (m_pSurfacesTail) { - m_pSurfacesTail->next = surface; - m_pSurfacesTail = m_pSurfacesTail->next; - } else { - m_pSurfacesHead = m_pSurfacesTail = surface; - } - } - -protected: - msdkFrameSurface* m_pSurfacesHead; // oldest surface - msdkFrameSurface* m_pSurfacesTail; // youngest surface - std::mutex & m_rMutex; - -private: - msdkUsedSurfacesPool(const msdkUsedSurfacesPool&); - void operator=(const msdkUsedSurfacesPool&); -}; - -// FIFO list of surfaces -class msdkOutputSurfacesPool -{ - friend class CBuffering; -public: - msdkOutputSurfacesPool(std::mutex & mutex): - m_pSurfacesHead(NULL), - m_pSurfacesTail(NULL), - m_SurfacesCount(0), - m_rMutex(mutex) {} - - ~msdkOutputSurfacesPool() { - m_pSurfacesHead = NULL; - m_pSurfacesTail = NULL; - } - - inline void AddSurface(msdkOutputSurface* surface) { - std::lock_guard lock(m_rMutex); - AddSurfaceUnsafe(surface); - } - inline msdkOutputSurface* GetSurface() { - std::lock_guard lock(m_rMutex); - return GetSurfaceUnsafe(); - } - - inline mfxU32 GetSurfaceCount() { - return m_SurfacesCount; - } -private: - inline void AddSurfaceUnsafe(msdkOutputSurface* surface) - { - MSDK_SELF_CHECK(surface); - MSDK_SELF_CHECK(!surface->next); - surface->next = NULL; - - if (m_pSurfacesTail) { - m_pSurfacesTail->next = surface; - m_pSurfacesTail = m_pSurfacesTail->next; - } else { - m_pSurfacesHead = m_pSurfacesTail = surface; - } - ++m_SurfacesCount; - } - inline msdkOutputSurface* GetSurfaceUnsafe() - { - msdkOutputSurface* surface = NULL; - - if (m_pSurfacesHead) { - surface = m_pSurfacesHead; - m_pSurfacesHead = m_pSurfacesHead->next; - if (!m_pSurfacesHead) { - // there was only one surface in the array... - m_pSurfacesTail = NULL; - } - --m_SurfacesCount; - surface->next = NULL; - MSDK_SELF_CHECK(!surface->next); - } - return surface; - } - -protected: - msdkOutputSurface* m_pSurfacesHead; // oldest surface - msdkOutputSurface* m_pSurfacesTail; // youngest surface - mfxU32 m_SurfacesCount; - std::mutex & m_rMutex; - -private: - msdkOutputSurfacesPool(const msdkOutputSurfacesPool&); - void operator=(const msdkOutputSurfacesPool&); -}; - -/** \brief Helper class defining optimal buffering operations for the Media SDK decoder. - */ -class CBuffering -{ -public: - CBuffering(); - virtual ~CBuffering(); - -protected: // functions - mfxStatus AllocBuffers(mfxU32 SurfaceNumber); - mfxStatus AllocVppBuffers(mfxU32 VppSurfaceNumber); - void AllocOutputBuffer(); - void FreeBuffers(); - void ResetBuffers(); - void ResetVppBuffers(); - - /** \brief The function syncs arrays of free and used surfaces. - * - * If Media SDK used surface for internal needs and unlocked it, the function moves such a surface - * back to the free surfaces array. - */ - void SyncFrameSurfaces(); - void SyncVppFrameSurfaces(); - - /** \brief Returns surface which corresponds to the given one in Media SDK format (mfxFrameSurface1). - * - * @note This function will not detach the surface from the array, perform this explicitly. - */ - inline msdkFrameSurface* FindUsedSurface(mfxFrameSurface1* frame) - { - return (msdkFrameSurface*)(frame); - } - - inline void AddFreeOutputSurfaceUnsafe(msdkOutputSurface* surface) - { - msdkOutputSurface* head = m_pFreeOutputSurfaces; - - MSDK_SELF_CHECK(surface); - MSDK_SELF_CHECK(!surface->next); - m_pFreeOutputSurfaces = surface; - m_pFreeOutputSurfaces->next = head; - } - inline void AddFreeOutputSurface(msdkOutputSurface* surface) { - std::lock_guard lock(m_Mutex); - AddFreeOutputSurfaceUnsafe(surface); - } - - inline msdkOutputSurface* GetFreeOutputSurfaceUnsafe(std::unique_lock & lock) - { - msdkOutputSurface* surface = NULL; - - if (!m_pFreeOutputSurfaces) { - lock.unlock(); - AllocOutputBuffer(); - lock.lock(); - } - if (m_pFreeOutputSurfaces) { - surface = m_pFreeOutputSurfaces; - m_pFreeOutputSurfaces = m_pFreeOutputSurfaces->next; - surface->next = NULL; - MSDK_SELF_CHECK(!surface->next); - } - return surface; - } - inline msdkOutputSurface* GetFreeOutputSurface() { - std::unique_lock lock(m_Mutex); - return GetFreeOutputSurfaceUnsafe(lock); - } - - /** \brief Function returns surface data to the corresponding buffers. - */ - inline void ReturnSurfaceToBuffers(msdkOutputSurface* output_surface) - { - MSDK_SELF_CHECK(output_surface); - MSDK_SELF_CHECK(output_surface->surface); - MSDK_SELF_CHECK(output_surface->syncp); - - msdk_atomic_dec16(&(output_surface->surface->render_lock)); - - output_surface->surface = NULL; - output_surface->syncp = NULL; - - AddFreeOutputSurface(output_surface); - } - -protected: // variables - mfxU32 m_SurfacesNumber; - mfxU32 m_OutputSurfacesNumber; - msdkFrameSurface* m_pSurfaces; - msdkFrameSurface* m_pVppSurfaces; - std::mutex m_Mutex; - - // LIFO list of frame surfaces - msdkFreeSurfacesPool m_FreeSurfacesPool; - msdkFreeSurfacesPool m_FreeVppSurfacesPool; - - // random access, predicted as FIFO - msdkUsedSurfacesPool m_UsedSurfacesPool; - msdkUsedSurfacesPool m_UsedVppSurfacesPool; - - // LIFO list of output surfaces - msdkOutputSurface* m_pFreeOutputSurfaces; - - // FIFO list of surfaces - msdkOutputSurfacesPool m_OutputSurfacesPool; - msdkOutputSurfacesPool m_DeliveredSurfacesPool; - -private: - CBuffering(const CBuffering&); - void operator=(const CBuffering&); -}; - -#endif // __MFX_BUFFERING_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_itt_trace.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_itt_trace.h deleted file mode 100644 index a50291a6..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_itt_trace.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __MFX_ITT_TRACE_H__ -#define __MFX_ITT_TRACE_H__ - -#ifdef ITT_SUPPORT -#include -#endif - - -#ifdef ITT_SUPPORT - -static inline __itt_domain* mfx_itt_get_domain() { - static __itt_domain *domain = NULL; - - if (!domain) domain = __itt_domain_create("MFX_SAMPLES"); - return domain; -} - -class MFX_ITT_Tracer -{ -public: - MFX_ITT_Tracer(const char* trace_name) - { - m_domain = mfx_itt_get_domain(); - if (m_domain) - __itt_task_begin(m_domain, __itt_null, __itt_null, __itt_string_handle_create(trace_name)); - } - ~MFX_ITT_Tracer() - { - if (m_domain) __itt_task_end(m_domain); - } -private: - __itt_domain* m_domain; -}; -#define MFX_ITT_TASK(x) MFX_ITT_Tracer __mfx_itt_tracer(x); - -#else -#define MFX_ITT_TASK(x) -#endif - -#endif //__MFX_ITT_TRACE_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_base.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_base.h deleted file mode 100644 index 1a2440e9..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_base.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - - -#include - -typedef MFXDecoderPlugin* (*mfxCreateDecoderPlugin)(); -typedef MFXEncoderPlugin* (*mfxCreateEncoderPlugin)(); -typedef MFXGenericPlugin* (*mfxCreateGenericPlugin)(); diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_module.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_module.h deleted file mode 100644 index 2a0de069..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_plugin_module.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#include "mfxplugin++.h" - -struct PluginModuleTemplate { - typedef MFXDecoderPlugin* (*fncCreateDecoderPlugin)(); - typedef MFXEncoderPlugin* (*fncCreateEncoderPlugin)(); - typedef MFXAudioDecoderPlugin* (*fncCreateAudioDecoderPlugin)(); - typedef MFXAudioEncoderPlugin* (*fncCreateAudioEncoderPlugin)(); - typedef MFXGenericPlugin* (*fncCreateGenericPlugin)(); - typedef mfxStatus (MFX_CDECL *CreatePluginPtr_t)(mfxPluginUID uid, mfxPlugin* plugin); - - fncCreateDecoderPlugin CreateDecoderPlugin; - fncCreateEncoderPlugin CreateEncoderPlugin; - fncCreateGenericPlugin CreateGenericPlugin; - CreatePluginPtr_t CreatePlugin; - fncCreateAudioDecoderPlugin CreateAudioDecoderPlugin; - fncCreateAudioEncoderPlugin CreateAudioEncoderPlugin; -}; - -extern PluginModuleTemplate g_PluginModule; diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_samples_config.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_samples_config.h deleted file mode 100644 index 3653b7c7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/mfx_samples_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __MFX_SAMPLES_CONFIG__ -#define __MFX_SAMPLES_CONFIG__ - -#endif //__MFX_SAMPLES_CONFIG__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/parameters_dumper.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/parameters_dumper.h deleted file mode 100644 index 729f4f5e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/parameters_dumper.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __PARAMETERS_DUMPER_H__ -#define __PARAMETERS_DUMPER_H__ -#include "sample_defs.h" - -class CParametersDumper -{ -protected: - static void SerializeFrameInfoStruct(msdk_ostream& sstr,msdk_string prefix,mfxFrameInfo& info); - static void SerializeMfxInfoMFXStruct(msdk_ostream& sstr,msdk_string prefix,mfxInfoMFX& info); - static void SerializeExtensionBuffer(msdk_ostream& sstr,msdk_string prefix,mfxExtBuffer* pExtBuffer); - static void SerializeVPPCompInputStream(msdk_ostream& sstr, msdk_string prefix, mfxVPPCompInputStream& info); - - template - static mfxStatus GetUnitParams(T* pMfxUnit, const mfxVideoParam* pPresetParams, mfxVideoParam* pOutParams) - { - memset(pOutParams,0, sizeof(mfxVideoParam)); - mfxExtBuffer** paramsArray = new mfxExtBuffer*[pPresetParams->NumExtParam]; - for (int paramNum = 0; paramNum < pPresetParams->NumExtParam; paramNum++) - { - mfxExtBuffer* buf = pPresetParams->ExtParam[paramNum]; - mfxExtBuffer* newBuf = (mfxExtBuffer*)new mfxU8[buf->BufferSz]; - memset(newBuf, 0, buf->BufferSz); - newBuf->BufferId = buf->BufferId; - newBuf->BufferSz = buf->BufferSz; - paramsArray[paramNum]=newBuf; - } - pOutParams->NumExtParam = pPresetParams->NumExtParam; - pOutParams->ExtParam = paramsArray; - - mfxStatus sts = pMfxUnit->GetVideoParam(pOutParams); - MSDK_CHECK_STATUS_SAFE(sts, "Cannot read configuration from encoder: GetVideoParam failed", ClearExtBuffs(pOutParams)); - - return MFX_ERR_NONE; - } - - static void ClearExtBuffs(mfxVideoParam* params) - { - // Cleaning params array - for (int paramNum = 0; paramNum < params->NumExtParam; paramNum++) - { - delete[] params->ExtParam[paramNum]; - } - delete[] params->ExtParam; - params->ExtParam = NULL; - params->NumExtParam = 0; - } - -public: - static void SerializeVideoParamStruct(msdk_ostream& sstr,msdk_string sectionName,mfxVideoParam& info,bool shouldUseVPPSection=false); - static mfxStatus DumpLibraryConfiguration(msdk_string fileName, MFXVideoDECODE* pMfxDec, MFXVideoVPP* pMfxVPP, MFXVideoENCODE* pMfxEnc, - const mfxVideoParam* pDecoderPresetParams, const mfxVideoParam* pVPPPresetParams, const mfxVideoParam* pEncoderPresetParams); - static void ShowConfigurationDiff(msdk_ostream& sstr1, msdk_ostream& sstr2); -}; -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_loader.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_loader.h deleted file mode 100644 index 71a5b845..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_loader.h +++ /dev/null @@ -1,261 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#ifndef __PLUGIN_LOADER_H__ -#define __PLUGIN_LOADER_H__ - -#include "vm/so_defs.h" -#include "sample_utils.h" -#include "plugin_utils.h" -//#include "mfx_plugin_module.h" -#include -#include // for std::setfill, std::setw -#include // for std::unique_ptr - -class MsdkSoModule -{ -protected: - msdk_so_handle m_module; -public: - MsdkSoModule() - : m_module(NULL) - { - } - MsdkSoModule(const msdk_string & pluginName) - : m_module(NULL) - { - m_module = msdk_so_load(pluginName.c_str()); - if (NULL == m_module) - { - MSDK_TRACE_ERROR(msdk_tstring(MSDK_CHAR("Failed to load shared module: ")) + pluginName); - } - } - template - T GetAddr(const std::string & fncName) - { - T pCreateFunc = reinterpret_cast(msdk_so_get_addr(m_module, fncName.c_str())); - if (NULL == pCreateFunc) { - MSDK_TRACE_ERROR(msdk_tstring("Failed to get function addres: ") + fncName.c_str()); - } - return pCreateFunc; - } - - virtual ~MsdkSoModule() - { - if (m_module) - { - msdk_so_free(m_module); - m_module = NULL; - } - } -}; - -/* -* Rationale: class to load+register any mediasdk plugin decoder/encoder/generic by given name -*/ -class PluginLoader : public MFXPlugin -{ -protected: - mfxPluginType ePluginType; - - mfxSession m_session; - mfxPluginUID m_uid; - -private: - const msdk_char* msdkGetPluginName(const mfxPluginUID& guid) - { - if (AreGuidsEqual(guid, MFX_PLUGINID_HEVCD_SW)) - return MSDK_STRING("Intel (R) Media SDK plugin for HEVC DECODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_HEVCD_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for HEVC DECODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_HEVCE_SW)) - return MSDK_STRING("Intel (R) Media SDK plugin for HEVC ENCODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_HEVCE_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for HEVC ENCODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_VP8E_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for VP8 ENCODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_VP8D_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for VP8 DECODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_VP9E_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for VP9 ENCODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_VP9D_HW)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for VP9 DECODE"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_H264LA_HW)) - return MSDK_STRING("Intel (R) Media SDK plugin for LA ENC"); - else if(AreGuidsEqual(guid, MFX_PLUGINID_ITELECINE_HW)) - return MSDK_STRING("Intel (R) Media SDK PTIR plugin (HW)"); - else if (AreGuidsEqual(guid, MFX_PLUGINID_HEVCE_GACC)) - return MSDK_STRING("Intel (R) Media SDK GPU-Accelerated plugin for HEVC ENCODE"); - else -#if (MFX_VERSION >= 1027) && !defined(_WIN32) && !defined(_WIN64) - if (AreGuidsEqual(guid, MFX_PLUGINID_HEVC_FEI_ENCODE)) - return MSDK_STRING("Intel (R) Media SDK HW plugin for HEVC FEI ENCODE"); - else -#endif - return MSDK_STRING("Unknown plugin"); - } - -public: - PluginLoader(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version, const mfxChar *pluginName, mfxU32 len) - : ePluginType(type) - , m_session() - , m_uid() - { - mfxStatus sts = MFX_ERR_NONE; - msdk_stringstream strStream; - - MSDK_MEMCPY(&m_uid, &uid, sizeof(mfxPluginUID)); - for (size_t i = 0; i != sizeof(mfxPluginUID); i++) - { - strStream << MSDK_STRING("0x") << std::setfill(MSDK_CHAR('0')) << std::setw(2) << std::hex << (int)m_uid.Data[i]; - if (i != (sizeof(mfxPluginUID)-1)) strStream << MSDK_STRING(", "); - } - - if ((ePluginType == MFX_PLUGINTYPE_AUDIO_DECODE) || - (ePluginType == MFX_PLUGINTYPE_AUDIO_ENCODE)) - { - // Audio plugins are not loaded by path - sts = MFX_ERR_UNSUPPORTED; - } - else - { - sts = MFXVideoUSER_LoadByPath(session, &m_uid, version, pluginName, len); - } - - if (MFX_ERR_NONE != sts) - { - MSDK_TRACE_ERROR(MSDK_STRING("Failed to load plugin from GUID, sts=") << sts << MSDK_STRING(": { ") << strStream.str().c_str() << MSDK_STRING(" } (") << msdkGetPluginName(m_uid) << MSDK_STRING(")")); - } - else - { - MSDK_TRACE_INFO(MSDK_STRING("Plugin was loaded from GUID")); - m_session = session; - } - } - - PluginLoader(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version) - : ePluginType(type) - , m_session() - , m_uid() - { - mfxStatus sts = MFX_ERR_NONE; - msdk_stringstream strStream; - - MSDK_MEMCPY(&m_uid, &uid, sizeof(mfxPluginUID)); - for (size_t i = 0; i != sizeof(mfxPluginUID); i++) - { - strStream << MSDK_STRING("0x") << std::setfill(MSDK_CHAR('0')) << std::setw(2) << std::hex << (int)m_uid.Data[i]; - if (i != (sizeof(mfxPluginUID)-1)) strStream << MSDK_STRING(", "); - } - - if ((ePluginType == MFX_PLUGINTYPE_AUDIO_DECODE) || - (ePluginType == MFX_PLUGINTYPE_AUDIO_ENCODE)) - { - sts = MFXAudioUSER_Load(session, &m_uid, version); - } - else - { - sts = MFXVideoUSER_Load(session, &m_uid, version); - } - - if (MFX_ERR_NONE != sts) - { - MSDK_TRACE_ERROR(MSDK_STRING("Failed to load plugin from GUID, sts=") << sts << MSDK_STRING(": { ") << strStream.str().c_str() << MSDK_STRING(" } (") << msdkGetPluginName(m_uid) << MSDK_STRING(")")); - } - else - { - MSDK_TRACE_INFO(MSDK_STRING("Plugin was loaded from GUID")<< MSDK_STRING(": { ") << strStream.str().c_str() << MSDK_STRING(" } (") << msdkGetPluginName(m_uid) << MSDK_STRING(")")); - m_session = session; - } - } - - virtual ~PluginLoader() - { - mfxStatus sts = MFX_ERR_NONE; - if (m_session) - { - if ((ePluginType == MFX_PLUGINTYPE_AUDIO_DECODE) || - (ePluginType == MFX_PLUGINTYPE_AUDIO_ENCODE)) - { - sts = MFXAudioUSER_UnLoad(m_session, &m_uid); - } - else - { - sts = MFXVideoUSER_UnLoad(m_session, &m_uid); - } - - if (sts != MFX_ERR_NONE) - { - MSDK_TRACE_ERROR(MSDK_STRING("Failed to unload plugin from GUID, sts=") << sts); - } - else - { - MSDK_TRACE_INFO(MSDK_STRING("MFXBaseUSER_UnLoad(session=0x") << m_session << MSDK_STRING("), sts=") << sts); - } - } - } - - bool IsOk() { - return m_session != 0; - } - virtual mfxStatus PluginInit( mfxCoreInterface * /*core*/ ) { - return MFX_ERR_NULL_PTR; - } - virtual mfxStatus PluginClose() { - return MFX_ERR_NULL_PTR; - } - virtual mfxStatus GetPluginParam( mfxPluginParam * /*par*/ ) { - return MFX_ERR_NULL_PTR; - } - virtual mfxStatus Execute( mfxThreadTask /*task*/, mfxU32 /*uid_p*/, mfxU32 /*uid_a*/ ) { - return MFX_ERR_NULL_PTR; - } - virtual mfxStatus FreeResources( mfxThreadTask /*task*/, mfxStatus /*sts*/ ) { - return MFX_ERR_NULL_PTR; - } - virtual void Release() { - } - virtual mfxStatus Close() { - return MFX_ERR_NULL_PTR; - } - virtual mfxStatus SetAuxParams( void* /*auxParam*/, int /*auxParamSize*/ ) { - return MFX_ERR_NULL_PTR; - } -}; - -inline MFXPlugin * LoadPluginByType(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version, const mfxChar *pluginName, mfxU32 len) { - std::unique_ptr plg(new PluginLoader (type, session, uid, version, pluginName, len)); - return plg->IsOk() ? plg.release() : NULL; -} - -inline MFXPlugin * LoadPluginByGUID(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version) { - std::unique_ptr plg(new PluginLoader (type, session, uid, version)); - return plg->IsOk() ? plg.release() : NULL; -} - -inline MFXPlugin * LoadPlugin(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version, const mfxChar *pluginName, mfxU32 len) { - return LoadPluginByType(type, session, uid, version, pluginName, len); -} - -inline MFXPlugin * LoadPlugin(mfxPluginType type, mfxSession session, const mfxPluginUID & uid, mfxU32 version) { - return LoadPluginByGUID(type, session, uid, version); -} -#endif // PLUGIN_LOADER \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_utils.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_utils.h deleted file mode 100644 index 655cd33c..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/plugin_utils.h +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __PLUGIN_UTILS_H__ -#define __PLUGIN_UTILS_H__ - -#include "sample_defs.h" -#include "sample_types.h" - -#if defined(_WIN32) || defined(_WIN64) - #define MSDK_CPU_ROTATE_PLUGIN MSDK_STRING("sample_rotate_plugin.dll") - #define MSDK_OCL_ROTATE_PLUGIN MSDK_STRING("sample_plugin_opencl.dll") -#else - #define MSDK_CPU_ROTATE_PLUGIN MSDK_STRING("libsample_rotate_plugin.so") - #define MSDK_OCL_ROTATE_PLUGIN MSDK_STRING("libsample_plugin_opencl.so") -#endif - -typedef mfxI32 msdkComponentType; -enum -{ - MSDK_VDECODE = 0x0001, - MSDK_VENCODE = 0x0002, - MSDK_VPP = 0x0004, - MSDK_VENC = 0x0008, -#if (MFX_VERSION >= 1027) - MSDK_FEI = 0x1000, -#endif -}; - -typedef enum { - MFX_PLUGINLOAD_TYPE_GUID = 1, - MFX_PLUGINLOAD_TYPE_FILE = 2 -} MfxPluginLoadType; - -struct sPluginParams -{ - mfxPluginUID pluginGuid; - mfxChar strPluginPath[MSDK_MAX_FILENAME_LEN]; - MfxPluginLoadType type; - sPluginParams() - { - MSDK_ZERO_MEMORY(*this); - } -}; - -static const mfxPluginUID MSDK_PLUGINGUID_NULL = {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; - -bool AreGuidsEqual(const mfxPluginUID& guid1, const mfxPluginUID& guid2); - -const mfxPluginUID & msdkGetPluginUID(mfxIMPL impl, msdkComponentType type, mfxU32 uCodecid); - -sPluginParams ParsePluginGuid(msdk_char* ); -sPluginParams ParsePluginPath(msdk_char* ); -mfxStatus ConvertStringToGuid(const msdk_string & strGuid, mfxPluginUID & mfxGuid); - -#endif //__PLUGIN_UTILS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/preset_manager.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/preset_manager.h deleted file mode 100644 index d1e820e3..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/preset_manager.h +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "sample_defs.h" - -#pragma once -enum EPresetModes -{ - PRESET_DEFAULT, - PRESET_DSS, - PRESET_CONF, - PRESET_GAMING, - PRESET_MAX_MODES -}; - -enum EPresetCodecs -{ - PRESET_AVC, - PRESET_HEVC, - PRESET_MAX_CODECS -}; - -struct CPresetParameters -{ - mfxU16 GopRefDist; - - mfxU16 TargetUsage; - - mfxU16 RateControlMethod; - mfxU16 ExtBRCUsage; - mfxU16 AsyncDepth; - mfxU16 BRefType; - mfxU16 AdaptiveMaxFrameSize; - mfxU16 LowDelayBRC; - - mfxU16 IntRefType; - mfxU16 IntRefCycleSize; - mfxU16 IntRefQPDelta; - mfxU16 IntRefCycleDist; - - mfxU16 WeightedPred; - mfxU16 WeightedBiPred; - - bool EnableBPyramid; - bool EnablePPyramid; -// bool EnableLTR; -}; - -struct CDependentPresetParameters -{ - mfxU16 TargetKbps; - mfxU16 MaxKbps; - mfxU16 GopPicSize; - mfxU16 BufferSizeInKB; - mfxU16 LookAheadDepth; - mfxU32 MaxFrameSize; -}; - -struct COutputPresetParameters : public CPresetParameters,CDependentPresetParameters -{ - - msdk_string PresetName; - - void Clear() - { - memset(dynamic_cast(this), 0, sizeof(CPresetParameters)); - memset(dynamic_cast(this), 0, sizeof(CDependentPresetParameters)); - } - - COutputPresetParameters() - { - Clear(); - } - - COutputPresetParameters(CPresetParameters src) - { - Clear(); - *(CPresetParameters*)this = src; - } -}; - -class CPresetManager -{ -public: - ~CPresetManager(); - COutputPresetParameters GetPreset(EPresetModes mode, mfxU32 codecFourCC, mfxF64 fps, mfxU32 width, mfxU32 height, bool isHWLib); - COutputPresetParameters GetBasicPreset(EPresetModes mode, mfxU32 codecFourCC); - CDependentPresetParameters GetDependentPresetParameters(EPresetModes mode, mfxU32 codecFourCC, mfxF64 fps, mfxU32 width, mfxU32 height, mfxU16 targetUsage); - - static CPresetManager Inst; - static EPresetModes PresetNameToMode(const msdk_char* name); -protected: - CPresetManager(); - static CPresetParameters presets[PRESET_MAX_MODES][PRESET_MAX_CODECS]; - static msdk_string modesName[PRESET_MAX_MODES]; -}; - -#define MODIFY_AND_PRINT_PARAM(paramName,presetName,shouldPrintPresetInfo) \ -if (!paramName){ \ - paramName = presetParams.presetName; \ - if(shouldPrintPresetInfo){msdk_printf(MSDK_STRING(#presetName) MSDK_STRING(": %d\n"), (int)paramName);} \ -}else{ \ - if(shouldPrintPresetInfo){msdk_printf(MSDK_STRING(#presetName) MSDK_STRING(": %d (original preset value: %d)\n"), (int)paramName, (int)presetParams.presetName);}} - -#define MODIFY_AND_PRINT_PARAM_EXT(paramName,presetName,value,shouldPrintPresetInfo) \ -if (!paramName){ \ - paramName = (value); \ - if(shouldPrintPresetInfo){msdk_printf(MSDK_STRING(#presetName) MSDK_STRING(": %d\n"), (int)paramName);} \ -}else{ \ - if(shouldPrintPresetInfo){msdk_printf(MSDK_STRING(#presetName) MSDK_STRING(": %d (original preset value: %d)\n"), (int)paramName, (int)(value));}} - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_defs.h deleted file mode 100644 index a134bc6b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_defs.h +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2020, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __SAMPLE_DEFS_H__ -#define __SAMPLE_DEFS_H__ - -#include -#include - -#include "mfxdefs.h" -#include "vm/strings_defs.h" -#include "vm/file_defs.h" -#include "vm/time_defs.h" - -// Run-time HSBC -// the condition below must be changed to MFX_VERSION >= 1027 after API is promoted to 1.27 -#if (MFX_VERSION >= MFX_VERSION_NEXT) -#define ENABLE_VPP_RUNTIME_HSBC -#endif - -#if (MFX_VERSION >= 1026) -#define ENABLE_MCTF -#if defined(MFX_VERSION_NEXT) && (MFX_VERSION >= MFX_VERSION_NEXT) -//---MCTF, extended interface -#undef ENABLE_MCTF_EXT -#endif -enum {MCTF_BITRATE_MULTIPLIER = 100000}; -#endif - - -#if defined(WIN32) || defined(WIN64) - -enum { - MFX_HANDLE_DEVICEWINDOW = 0x101 /* A handle to the render window */ -}; //mfxHandleType - -#ifndef D3D_SURFACES_SUPPORT -#define D3D_SURFACES_SUPPORT 1 -#endif - -#if defined(_WIN32) && !defined(MFX_D3D11_SUPPORT) -#include -#if (NTDDI_VERSION >= NTDDI_VERSION_FROM_WIN32_WINNT2(0x0602)) // >= _WIN32_WINNT_WIN8 - #define MFX_D3D11_SUPPORT 1 // Enable D3D11 support if SDK allows -#else - #define MFX_D3D11_SUPPORT 0 -#endif -#endif // #if defined(WIN32) && !defined(MFX_D3D11_SUPPORT) -#endif // #if defined(WIN32) || defined(WIN64) - -enum -{ -#define __DECLARE(type) MFX_MONITOR_ ## type - __DECLARE(Unknown) = 0, - __DECLARE(AUTO) = __DECLARE(Unknown), - __DECLARE(VGA), - __DECLARE(DVII), - __DECLARE(DVID), - __DECLARE(DVIA), - __DECLARE(Composite), - __DECLARE(SVIDEO), - __DECLARE(LVDS), - __DECLARE(Component), - __DECLARE(9PinDIN), - __DECLARE(HDMIA), - __DECLARE(HDMIB), - __DECLARE(eDP), - __DECLARE(TV), - __DECLARE(DisplayPort), -#if defined(DRM_MODE_CONNECTOR_VIRTUAL) // from libdrm 2.4.59 - __DECLARE(VIRTUAL), -#endif -#if defined(DRM_MODE_CONNECTOR_DSI) // from libdrm 2.4.59 - __DECLARE(DSI), -#endif - __DECLARE(MAXNUMBER) -#undef __DECLARE -}; - -#if defined(LIBVA_SUPPORT) - -enum LibVABackend -{ - MFX_LIBVA_AUTO, - MFX_LIBVA_DRM, - MFX_LIBVA_DRM_RENDERNODE = MFX_LIBVA_DRM, - MFX_LIBVA_DRM_MODESET, - MFX_LIBVA_X11, - MFX_LIBVA_WAYLAND -}; - -#endif - -//affects win32 winnt version macro -#include "vm/time_defs.h" -#include "sample_utils.h" - - -#define MSDK_DEC_WAIT_INTERVAL 300000 -#define MSDK_ENC_WAIT_INTERVAL 300000 -#define MSDK_VPP_WAIT_INTERVAL 300000 -#define MSDK_SURFACE_WAIT_INTERVAL 300000 -#define MSDK_WAIT_INTERVAL (MSDK_DEC_WAIT_INTERVAL+3*MSDK_VPP_WAIT_INTERVAL+MSDK_ENC_WAIT_INTERVAL) // an estimate for the longest pipeline we have in samples - -#define MSDK_INVALID_SURF_IDX 0xFFFF - -#define MSDK_MAX_FILENAME_LEN 1024 -#define MSDK_MAX_USER_DATA_UNREG_SEI_LEN 80 - -#define MSDK_PRINT_RET_MSG(ERR,MSG) {msdk_stringstream tmpStr1;tmpStr1< MFX_ERR_NONE) {MSDK_PRINT_WRN_MSG(X, MSG); }} -#define MSDK_CHECK_ERR_NONE_STATUS(X, ERR, MSG) {if ((X) != MFX_ERR_NONE) {MSDK_PRINT_RET_MSG(X, MSG); return ERR;}} -#define MSDK_CHECK_PARSE_RESULT(P, X, ERR) {if ((X) > (P)) {return ERR;}} - -#define MSDK_CHECK_STATUS_SAFE(X, FUNC, ADD) {if ((X) < MFX_ERR_NONE) {ADD; MSDK_PRINT_RET_MSG(X, FUNC); return X;}} -#define MSDK_IGNORE_MFX_STS(P, X) {if ((X) == (P)) {P = MFX_ERR_NONE;}} -#define MSDK_CHECK_POINTER(P, ...) {if (!(P)) {msdk_stringstream tmpStr4;tmpStr4<Release(); X = NULL; }} -#define MSDK_SAFE_FREE(X) {if (X) { free(X); X = NULL; }} - -#ifndef MSDK_SAFE_DELETE -#define MSDK_SAFE_DELETE(P) {if (P) {delete P; P = NULL;}} -#endif // MSDK_SAFE_DELETE - -#define MSDK_ZERO_MEMORY(VAR) {memset(&VAR, 0, sizeof(VAR));} -#define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16 -#define MSDK_ALIGN32(value) (((value + 31) >> 5) << 5) // round up to a multiple of 32 -#define MSDK_ALIGN(value, alignment) (alignment) * ( (value) / (alignment) + (((value) % (alignment)) ? 1 : 0)) -#define MSDK_ARRAY_LEN(value) (sizeof(value) / sizeof(value[0])) - -#ifndef UNREFERENCED_PARAMETER -#define UNREFERENCED_PARAMETER(par) (par) -#endif - -#define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x)) - -// Deprecated -#define MSDK_PRINT_RET_MSG_(ERR) {msdk_printf(MSDK_STRING("\nReturn on error: error code %d,\t%s\t%d\n\n"), (int)ERR, MSDK_STRING(__FILE__), __LINE__);} -#define MSDK_CHECK_RESULT(P, X, ERR) {if ((X) > (P)) {MSDK_PRINT_RET_MSG_(ERR); return ERR;}} -#define MSDK_CHECK_RESULT_SAFE(P, X, ERR, ADD) {if ((X) > (P)) {ADD; MSDK_PRINT_RET_MSG_(ERR); return ERR;}} - -namespace mfx -{ -// TODO: switch to std::clamp when C++17 support will be enabled - -// Clip value v to range [lo, hi] -template -constexpr const T& clamp( const T& v, const T& lo, const T& hi ) -{ - return std::min(hi, std::max(v, lo)); -} - -// Comp is comparison function object with meaning of 'less' operator (i.e. std::less<> or operator<) -template -constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ) -{ - return comp(v, lo) ? lo : comp(hi, v) ? hi : v; -} -} - -#endif //__SAMPLE_DEFS_H__ - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_types.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_types.h deleted file mode 100644 index 5cb274d2..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_types.h +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __SAMPLE_TYPES_H__ -#define __SAMPLE_TYPES_H__ - -#ifdef UNICODE - #define msdk_cout std::wcout - #define msdk_err std::wcerr -#else - #define msdk_cout std::cout - #define msdk_err std::cerr -#endif - -typedef std::basic_string msdk_string; -typedef std::basic_stringstream msdk_stringstream; -typedef std::basic_ostream > msdk_ostream; -typedef std::basic_istream > msdk_istream; -typedef std::basic_fstream > msdk_fstream; - -#if defined(_UNICODE) -#define MSDK_MAKE_BYTE_STRING(src,dest) \ - {\ - std::wstring wstr(src);\ - std::string str(wstr.length(), 0);\ - std::transform(wstr.begin(), wstr.end(), str.begin(), [](wchar_t c) {\ - return (char)c;\ - });\ - strcpy_s(dest, str.c_str());\ - } -#else -#define MSDK_MAKE_BYTE_STRING(src,dest) msdk_strcopy(dest, src); -#endif - - -#endif //__SAMPLE_TYPES_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_utils.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_utils.h deleted file mode 100644 index 0bcf02e7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sample_utils.h +++ /dev/null @@ -1,1495 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2020, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __SAMPLE_UTILS_H__ -#define __SAMPLE_UTILS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mfxstructures.h" -#include "mfxvideo.h" -#include "mfxvideo++.h" -#include "mfxjpeg.h" -#include "mfxplugin.h" -#include "mfxbrc.h" -#include "mfxfei.h" -#include "mfxfeihevc.h" -#include "mfxmvc.h" -#include "mfxla.h" - -#include "vm/strings_defs.h" -#include "vm/file_defs.h" -#include "vm/time_defs.h" -#include "vm/atomic_defs.h" -#include "vm/thread_defs.h" - -#include "sample_types.h" - -#include "abstract_splitter.h" -#include "avc_bitstream.h" -#include "avc_spl.h" -#include "avc_headers.h" -#include "avc_nal_spl.h" - - -// A macro to disallow the copy constructor and operator= functions -// This should be used in the private: declarations for a class -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - void operator=(const TypeName&) - -//! Base class for types that should not be assigned. -class no_assign { - // Deny assignment - void operator=( const no_assign& ); -public: -#if __GNUC__ - //! Explicitly define default construction, because otherwise gcc issues gratuitous warning. - no_assign() {} -#endif /* __GNUC__ */ -}; - -//! Base class for types that should not be copied or assigned. -class no_copy: no_assign { - //! Deny copy construction - no_copy( const no_copy& ); -public: - //! Allow default construction - no_copy() {} -}; - -enum { - CODEC_VP8 = MFX_MAKEFOURCC('V','P','8',' '), - CODEC_MVC = MFX_MAKEFOURCC('M','V','C',' '), -}; - -#define MFX_CODEC_DUMP MFX_MAKEFOURCC('D','U','M','P') -#define MFX_CODEC_RGB4 MFX_FOURCC_RGB4 -#define MFX_CODEC_NV12 MFX_FOURCC_NV12 -#define MFX_CODEC_I420 MFX_FOURCC_I420 -#define MFX_CODEC_P010 MFX_FOURCC_P010 - -enum -{ - MFX_FOURCC_IMC3 = MFX_MAKEFOURCC('I','M','C','3'), - MFX_FOURCC_YUV400 = MFX_MAKEFOURCC('4','0','0','P'), - MFX_FOURCC_YUV411 = MFX_MAKEFOURCC('4','1','1','P'), - MFX_FOURCC_YUV422H = MFX_MAKEFOURCC('4','2','2','H'), - MFX_FOURCC_YUV422V = MFX_MAKEFOURCC('4','2','2','V'), - MFX_FOURCC_YUV444 = MFX_MAKEFOURCC('4','4','4','P'), -#if (MFX_VERSION <= 1027) - MFX_FOURCC_RGBP = MFX_MAKEFOURCC('R','G','B','P'), -#endif - MFX_FOURCC_I420 = MFX_MAKEFOURCC('I','4','2','0') -}; - -enum ExtBRCType { - EXTBRC_DEFAULT, - EXTBRC_OFF, - EXTBRC_ON, - EXTBRC_IMPLICIT -}; - -namespace QPFile { - - enum ReaderStatus - { - READER_ERR_NONE, - READER_ERR_NOT_INITIALIZED, - READER_ERR_CODEC_UNSUPPORTED, - READER_ERR_FILE_NOT_OPEN, - READER_ERR_INCORRECT_FILE - }; - - struct FrameInfo - { - mfxU32 displayOrder; - mfxU16 QP; - mfxU16 frameType; - }; - - // QPFile::Reader reads QP and frame type per frame in encoding order - // from external text file (for encoding in qpfile mode) - class Reader - { - public: - mfxStatus Read(const msdk_string& strFileName, mfxU32 codecid); - void ResetState(); - - mfxU32 GetCurrentEncodedOrder() const; - mfxU32 GetCurrentDisplayOrder() const; - mfxU16 GetCurrentQP() const; - mfxU16 GetCurrentFrameType() const; - mfxU32 GetFramesNum() const; - void NextFrame(); - std::string GetErrorMessage() const; - - private: - void ResetState(ReaderStatus set_sts); - - ReaderStatus m_ReaderSts = READER_ERR_NOT_INITIALIZED; - mfxU32 m_nFrames = std::numeric_limits::max(); - mfxU32 m_CurFrameNum = std::numeric_limits::max(); - std::vector m_FrameVals {}; - }; - - inline bool get_line(std::ifstream& ifs, std::string& line) - { - std::getline(ifs, line, '\n'); - if (!line.empty() && line.back() == '\r') - line.pop_back(); - return !ifs.fail(); - } - inline size_t find_nth(const std::string& str, size_t pos, const std::string& needle, mfxU32 nth) - { - size_t found_pos = str.find(needle, pos); - for(; nth != 0 && std::string::npos != found_pos; --nth) - found_pos = str.find(needle, found_pos + 1); - return found_pos; - } - inline mfxU16 StringToFrameType(std::string str) - { - if ("IDR_REF" == str) return MFX_FRAMETYPE_I | MFX_FRAMETYPE_IDR | MFX_FRAMETYPE_REF; - else if ("I_REF" == str) return MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF; - else if ("P_REF" == str) return MFX_FRAMETYPE_P | MFX_FRAMETYPE_REF; - else if ("P" == str) return MFX_FRAMETYPE_P; - else if ("B_REF" == str) return MFX_FRAMETYPE_B | MFX_FRAMETYPE_REF; - else if ("B" == str) return MFX_FRAMETYPE_B; - else return MFX_FRAMETYPE_UNKNOWN; - } - inline std::string ReaderStatusToString(ReaderStatus sts) - { - switch (sts) - { - case READER_ERR_NOT_INITIALIZED: - return std::string("reader not initialized (qpfile has not yet read the file)\n"); - case READER_ERR_FILE_NOT_OPEN: - return std::string("failed to open file contains frame parameters (check provided path in -qpfile )\n"); - case READER_ERR_INCORRECT_FILE: - return std::string("incorrect file with frame parameters\n"); - case READER_ERR_CODEC_UNSUPPORTED: - return std::string("codecs, except h264 and h265, are not supported\n"); - default: - return std::string(); - } - } - inline mfxU32 ReadDisplayOrder(const std::string& line) - { - return std::stoi(line.substr(0, find_nth(line, 0, ",", 0))); - } - inline mfxU16 ReadQP(const std::string& line) - { - size_t pos = find_nth(line, 0, ",", 0) + 1; - return static_cast(std::stoi(line.substr(pos, find_nth(line, 0, ",", 1) - pos))); - } - inline mfxU16 ReadFrameType(const std::string& line) - { - size_t pos = find_nth(line, 0, ",", 1) + 1; - return StringToFrameType(line.substr(pos, line.length() - pos)); - } -} - -namespace TCBRCTestFile { - - enum ReaderStatus - { - READER_ERR_NONE, - READER_ERR_NOT_INITIALIZED, - READER_ERR_CODEC_UNSUPPORTED, - READER_ERR_FILE_NOT_OPEN, - READER_ERR_INCORRECT_FILE - }; - - struct FrameInfo - { - mfxU32 displayOrder; - mfxU32 targetFrameSize; - }; - - // TCBRCTestFile reads target frame size in display order - // from external text file (for encoding in Low delay BRC mode) - - class Reader - { - public: - mfxStatus Read(const msdk_string& strFileName, mfxU32 codecid); - void ResetState(); - - mfxU32 GetTargetFrameSize(mfxU32 frameOrder) const; - mfxU32 GetFramesNum() const; - void NextFrame(); - std::string GetErrorMessage() const; - - private: - void ResetState(ReaderStatus set_sts); - - ReaderStatus m_ReaderSts = READER_ERR_NOT_INITIALIZED; - mfxU32 m_CurFrameNum = std::numeric_limits::max(); - std::vector m_FrameVals{}; - }; - - inline bool get_line(std::ifstream& ifs, std::string& line) - { - std::getline(ifs, line, '\n'); - if (!line.empty() && line.back() == '\r') - line.pop_back(); - return !ifs.fail(); - } - inline size_t find_nth(const std::string& str, size_t pos, const std::string& needle, mfxU32 nth) - { - size_t found_pos = str.find(needle, pos); - for (; nth != 0 && std::string::npos != found_pos; --nth) - found_pos = str.find(needle, found_pos + 1); - return found_pos; - } - - inline std::string ReaderStatusToString(ReaderStatus sts) - { - switch (sts) - { - case READER_ERR_NOT_INITIALIZED: - return std::string("reader not initialized (TCBRCTestfile has not yet read the file)\n"); - case READER_ERR_FILE_NOT_OPEN: - return std::string("failed to open file with TargetFrameSize parameters (check provided path in -tcbrcfile )\n"); - case READER_ERR_INCORRECT_FILE: - return std::string("incorrect file with frame parameters\n"); - case READER_ERR_CODEC_UNSUPPORTED: - return std::string("h264 and h265 are supported now\n"); - default: - return std::string(); - } - } - inline mfxU32 ReadDisplayOrder(const std::string& line) - { - size_t pos = find_nth(line, 0, ":", 0); - if (pos != std::string::npos) - return std::stoi(line.substr(0, pos)); - else - return 0; - } - inline mfxU16 ReadTargetFrameSize(const std::string& line) - { - size_t pos = find_nth(line, 0, ":", 0); - pos = (pos != std::string::npos) ? pos + 1 : 0; - return static_cast(std::stoi(line.substr(pos, line.size() - pos))); - } -} -mfxStatus GetFrameLength(mfxU16 width, mfxU16 height, mfxU32 ColorFormat, mfxU32 &length); - -bool IsDecodeCodecSupported(mfxU32 codecFormat); -bool IsEncodeCodecSupported(mfxU32 codecFormat); -bool IsPluginCodecSupported(mfxU32 codecFormat); - -// class is used as custom exception -class mfxError : public std::runtime_error -{ -public: - mfxError(mfxStatus status = MFX_ERR_UNKNOWN, std::string msg = "") - : runtime_error(msg) - , m_Status(status) - {} - - mfxStatus GetStatus() const - { return m_Status; } - -private: - mfxStatus m_Status; -}; - -//declare used extension buffers -template -struct mfx_ext_buffer_id{}; - -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_CODING_OPTION}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_CODING_OPTION2}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_CODING_OPTION3}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_AVC_TEMPORAL_LAYERS}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_AVC_REFLIST_CTRL}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_THREADS_PARAM}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_PARAM}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_PREENC_CTRL}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_FEI_PREENC_MV}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_FEI_PREENC_MB}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_ENC_CTRL}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_ENC_MV_PRED}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_ENC_QP}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_ENC_CTU_CTRL}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVC_REFLISTS}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_REPACK_CTRL}; -}; -template<>struct mfx_ext_buffer_id{ - enum {id = MFX_EXTBUFF_HEVCFEI_REPACK_STAT}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_BRC}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_HEVC_PARAM}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_DEC_VIDEO_PROCESSING}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_DECODE_ERROR_REPORT}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_MVC_SEQ_DESC}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_DONOTUSE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_DOUSE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_DEINTERLACING}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_CODING_OPTION_SPSPPS}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_MCTF}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_COMPOSITE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_FIELD_PROCESSING}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_DETAIL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_LOOKAHEAD_CTRL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_MULTI_FRAME_CONTROL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_MULTI_FRAME_PARAM}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_HEVC_TILES}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VP9_PARAM}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VIDEO_SIGNAL_INFO}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_HEVC_REGION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_AVC_ROUNDING_OFFSET}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_DENOISE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_PROCAMP}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_IMAGE_STABILIZATION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_VIDEO_SIGNAL_INFO}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_MIRRORING}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_COLORFILL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_ROTATION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_SCALING}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_VPP_COLOR_CONVERSION}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_PRED_WEIGHT_TABLE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_DEC_STREAM_OUT}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_SLICE}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_CTRL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_MV_PRED}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_REPACK_CTRL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_MB}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_QP}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_MB_STAT}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_ENC_MV}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_PAK_CTRL}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_REPACK_STAT}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_SPS}; -}; -template<>struct mfx_ext_buffer_id { - enum {id = MFX_EXTBUFF_FEI_PPS}; -}; - -constexpr uint16_t max_num_ext_buffers = 63 * 2; // '*2' is for max estimation if all extBuffer were 'paired' - -//helper function to initialize mfx ext buffer structure -template -void init_ext_buffer(T & ext_buffer) -{ - memset(&ext_buffer, 0, sizeof(ext_buffer)); - reinterpret_cast(&ext_buffer)->BufferId = mfx_ext_buffer_id::id; - reinterpret_cast(&ext_buffer)->BufferSz = sizeof(ext_buffer); -} - -template struct IsPairedMfxExtBuffer : std::false_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; -template <> struct IsPairedMfxExtBuffer : std::true_type {}; - -template -struct ExtParamAccessor -{ -private: - using mfxExtBufferDoublePtr = mfxExtBuffer**; -public: - mfxU16& NumExtParam; - mfxExtBufferDoublePtr& ExtParam; - ExtParamAccessor(const R& r): - NumExtParam(const_cast(r.NumExtParam)), - ExtParam(const_cast(r.ExtParam)) {} -}; - -template <> -struct ExtParamAccessor -{ -private: - using mfxExtBufferDoublePtr = mfxExtBuffer**; -public: - mfxU16& NumExtParam; - mfxExtBufferDoublePtr& ExtParam; - ExtParamAccessor(const mfxFrameSurface1& r): - NumExtParam(const_cast(r.Data.NumExtParam)), - ExtParam(const_cast(r.Data.ExtParam)) {} -}; - -/** ExtBufHolder is an utility class which - * provide interface for mfxExtBuffer objects management in any mfx structure (e.g. mfxVideoParam) - */ -template -class ExtBufHolder : public T -{ -public: - ExtBufHolder() : T() - { - m_ext_buf.reserve(max_num_ext_buffers); - } - - ~ExtBufHolder() // only buffers allocated by wrapper can be released - { - for (auto it = m_ext_buf.begin(); it != m_ext_buf.end(); it++ ) - { - delete [] (mfxU8*)(*it); - } - } - - ExtBufHolder(const ExtBufHolder& ref) - { - m_ext_buf.reserve(max_num_ext_buffers); - *this = ref; // call to operator= - } - - ExtBufHolder& operator=(const ExtBufHolder& ref) - { - const T* src_base = &ref; - return operator=(*src_base); - } - - ExtBufHolder(const T& ref) - { - *this = ref; // call to operator= - } - - ExtBufHolder& operator=(const T& ref) - { - // copy content of main structure type T - T* dst_base = this; - const T* src_base = &ref; - *dst_base = *src_base; - - //remove all existing extension buffers - ClearBuffers(); - - const auto ref_ = ExtParamAccessor(ref); - - //reproduce list of extension buffers and copy its content - for (size_t i = 0; i < ref_.NumExtParam; ++i) - { - const auto src_buf = ref_.ExtParam[i]; - if (!src_buf) throw mfxError(MFX_ERR_NULL_PTR, "Null pointer attached to source ExtParam"); - if (!IsCopyAllowed(src_buf->BufferId)) - { - auto msg = "Deep copy of '" + Fourcc2Str(src_buf->BufferId) + "' extBuffer is not allowed"; - throw mfxError(MFX_ERR_UNDEFINED_BEHAVIOR, msg); - } - - // 'false' below is because here we just copy extBuffer's one by one - auto dst_buf = AddExtBuffer(src_buf->BufferId, src_buf->BufferSz, false); - // copy buffer content w/o restoring its type - memcpy((void*)dst_buf, (void*)src_buf, src_buf->BufferSz); - } - - return *this; - } - - ExtBufHolder(ExtBufHolder &&) = default; - ExtBufHolder & operator= (ExtBufHolder&&) = default; - - // Always returns a valid pointer or throws an exception - template - TB* AddExtBuffer() - { - mfxExtBuffer* b = AddExtBuffer(mfx_ext_buffer_id::id, sizeof(TB), IsPairedMfxExtBuffer::value); - return (TB*)b; - } - - template - void RemoveExtBuffer() - { - auto it = std::find_if(m_ext_buf.begin(), m_ext_buf.end(), CmpExtBufById(mfx_ext_buffer_id::id)); - if (it != m_ext_buf.end()) - { - delete [] (mfxU8*)(*it); - it = m_ext_buf.erase(it); - - if (IsPairedMfxExtBuffer::value) - { - if (it == m_ext_buf.end() || (*it)->BufferId != mfx_ext_buffer_id::id) - throw mfxError(MFX_ERR_NULL_PTR, "RemoveExtBuffer: ExtBuffer's parity has been broken"); - - delete [] (mfxU8*)(*it); - m_ext_buf.erase(it); - } - - RefreshBuffers(); - } - } - - template - TB* GetExtBuffer(uint32_t fieldId = 0) const - { - return (TB*)FindExtBuffer(mfx_ext_buffer_id::id, fieldId); - } - - template - operator TB*() - { - return (TB*)FindExtBuffer(mfx_ext_buffer_id::id, 0); - } - - template - operator TB*() const - { - return (TB*)FindExtBuffer(mfx_ext_buffer_id::id, 0); - } - -private: - - mfxExtBuffer* AddExtBuffer(mfxU32 id, mfxU32 size, bool isPairedExtBuffer) - { - if (!size || !id) - throw mfxError(MFX_ERR_NULL_PTR, "AddExtBuffer: wrong size or id!"); - - auto it = std::find_if(m_ext_buf.begin(), m_ext_buf.end(), CmpExtBufById(id)); - if (it == m_ext_buf.end()) - { - auto buf = (mfxExtBuffer*)new mfxU8[size]; - memset(buf, 0, size); - m_ext_buf.push_back(buf); - - buf->BufferId = id; - buf->BufferSz = size; - - if (isPairedExtBuffer) - { - // Allocate the other mfxExtBuffer _right_after_ the first one ... - buf = (mfxExtBuffer*)new mfxU8[size]; - memset(buf, 0, size); - m_ext_buf.push_back(buf); - - buf->BufferId = id; - buf->BufferSz = size; - - RefreshBuffers(); - return m_ext_buf[m_ext_buf.size() - 2]; // ... and return a pointer to the first one - } - - RefreshBuffers(); - return m_ext_buf.back(); - } - - return *it; - } - - mfxExtBuffer* FindExtBuffer(mfxU32 id, uint32_t fieldId) const - { - auto it = std::find_if(m_ext_buf.begin(), m_ext_buf.end(), CmpExtBufById(id)); - if (fieldId && it != m_ext_buf.end()) - { - ++it; - return it != m_ext_buf.end() ? *it : nullptr; - } - return it != m_ext_buf.end() ? *it : nullptr; - } - - void RefreshBuffers() - { - auto this_ = ExtParamAccessor(*this); - this_.NumExtParam = static_cast(m_ext_buf.size()); - this_.ExtParam = this_.NumExtParam ? m_ext_buf.data() : nullptr; - } - - void ClearBuffers() - { - if (m_ext_buf.size()) - { - for (auto it = m_ext_buf.begin(); it != m_ext_buf.end(); it++ ) - { - delete [] (mfxU8*)(*it); - } - m_ext_buf.clear(); - } - RefreshBuffers(); - } - - bool IsCopyAllowed(mfxU32 id) - { - static const mfxU32 allowed[] = { - MFX_EXTBUFF_CODING_OPTION, - MFX_EXTBUFF_CODING_OPTION2, - MFX_EXTBUFF_CODING_OPTION3, - MFX_EXTBUFF_FEI_PARAM, - MFX_EXTBUFF_BRC, - MFX_EXTBUFF_HEVC_PARAM, - MFX_EXTBUFF_VP9_PARAM, - MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION, - MFX_EXTBUFF_FEI_PPS, - MFX_EXTBUFF_FEI_SPS, - MFX_EXTBUFF_LOOKAHEAD_CTRL, - MFX_EXTBUFF_LOOKAHEAD_STAT, - MFX_EXTBUFF_DEC_VIDEO_PROCESSING - }; - - auto it = std::find_if(std::begin(allowed), std::end(allowed), - [&id](const mfxU32 allowed_id) - { - return allowed_id == id; - }); - return it != std::end(allowed); - } - - struct CmpExtBufById - { - mfxU32 id; - - CmpExtBufById(mfxU32 _id) - : id(_id) - { }; - - bool operator () (mfxExtBuffer* b) - { - return (b && b->BufferId == id); - }; - }; - - static std::string Fourcc2Str(mfxU32 fourcc) - { - std::string s; - for (size_t i = 0; i < 4; i++) - { - s.push_back(*(i + (char*)&fourcc)); - } - return s; - } - - std::vector m_ext_buf; -}; - -using MfxVideoParamsWrapper = ExtBufHolder; -using mfxEncodeCtrlWrap = ExtBufHolder; -using mfxInitParamlWrap = ExtBufHolder; -using mfxFrameSurfaceWrap = ExtBufHolder; - -class mfxBitstreamWrapper : public ExtBufHolder -{ - typedef ExtBufHolder base; -public: - mfxBitstreamWrapper() - : base() - {} - - mfxBitstreamWrapper(mfxU32 n_bytes) - : base() - { - Extend(n_bytes); - } - - mfxBitstreamWrapper(const mfxBitstreamWrapper & bs_wrapper) - : base(bs_wrapper) - , m_data(bs_wrapper.m_data) - { - Data = m_data.data(); - } - - mfxBitstreamWrapper& operator=(mfxBitstreamWrapper const& bs_wrapper) - { - mfxBitstreamWrapper tmp(bs_wrapper); - - *this = std::move(tmp); - - return *this; - } - - mfxBitstreamWrapper(mfxBitstreamWrapper && bs_wrapper) = default; - mfxBitstreamWrapper & operator= (mfxBitstreamWrapper&& bs_wrapper) = default; - ~mfxBitstreamWrapper() = default; - - void Extend(mfxU32 n_bytes) - { - if (MaxLength >= n_bytes) - return; - - m_data.resize(n_bytes); - - Data = m_data.data(); - MaxLength = n_bytes; - } -private: - std::vector m_data; -}; - -class CSmplYUVReader -{ -public : - typedef std::list::iterator ls_iterator; - CSmplYUVReader(); - virtual ~CSmplYUVReader(); - - virtual void Close(); - virtual mfxStatus Init(std::list inputs, mfxU32 ColorFormat, bool shouldShiftP010=false); - virtual mfxStatus SkipNframesFromBeginning(mfxU16 w, mfxU16 h, mfxU32 viewId, mfxU32 nframes); - virtual mfxStatus LoadNextFrame(mfxFrameSurface1* pSurface); - virtual void Reset(); - mfxU32 m_ColorFormat; // color format of input YUV data, YUV420 or NV12 - -protected: - - std::vector m_files; - - bool shouldShift10BitsHigh; - bool m_bInited; -}; - -class CSmplBitstreamWriter -{ -public : - - CSmplBitstreamWriter(); - virtual ~CSmplBitstreamWriter(); - - virtual mfxStatus Init(const msdk_char *strFileName); - virtual mfxStatus WriteNextFrame(mfxBitstream *pMfxBitstream, bool isPrint = true); - virtual mfxStatus Reset(); - virtual void Close(); - mfxU32 m_nProcessedFramesNum; - -protected: - FILE* m_fSource; - bool m_bInited; - msdk_string m_sFile; -}; - -class CSmplYUVWriter -{ -public : - - CSmplYUVWriter(); - virtual ~CSmplYUVWriter(); - - virtual void Close(); - virtual mfxStatus Init(const msdk_char *strFileName, const mfxU32 numViews); - virtual mfxStatus Reset(); - virtual mfxStatus WriteNextFrame(mfxFrameSurface1 *pSurface); - virtual mfxStatus WriteNextFrameI420(mfxFrameSurface1 *pSurface); - - void SetMultiView() { m_bIsMultiView = true; } - -protected: - FILE *m_fDest, **m_fDestMVC; - bool m_bInited, m_bIsMultiView; - mfxU32 m_numCreatedFiles; - msdk_string m_sFile; - mfxU32 m_nViews; -}; - -class CSmplBitstreamReader -{ -public : - - CSmplBitstreamReader(); - virtual ~CSmplBitstreamReader(); - - //resets position to file begin - virtual void Reset(); - virtual void Close(); - virtual mfxStatus Init(const msdk_char *strFileName); - virtual mfxStatus ReadNextFrame(mfxBitstream *pBS); - -protected: - FILE* m_fSource; - bool m_bInited; -}; - -class CH264FrameReader : public CSmplBitstreamReader -{ -public: - CH264FrameReader(); - virtual ~CH264FrameReader(); - - /** Free resources.*/ - virtual void Close(); - virtual mfxStatus Init(const msdk_char *strFileName); - virtual mfxStatus ReadNextFrame(mfxBitstream *pBS); - -private: - mfxBitstream *m_processedBS; - // input bit stream - mfxBitstreamWrapper m_originalBS; - - mfxStatus PrepareNextFrame(mfxBitstream *in, mfxBitstream **out); - - // is stream ended - bool m_isEndOfStream; - - std::unique_ptr m_pNALSplitter; - FrameSplitterInfo *m_frame; - mfxU8 *m_plainBuffer; - mfxU32 m_plainBufferSize; - mfxBitstream m_outBS; -}; - -//provides output bistream with at least 1 frame, reports about error -class CJPEGFrameReader : public CSmplBitstreamReader -{ - enum JPEGMarker - { - SOI=0xD8FF, - EOI=0xD9FF - }; -public: - virtual mfxStatus ReadNextFrame(mfxBitstream *pBS); -protected: - mfxU32 FindMarker(mfxBitstream *pBS,mfxU32 startOffset,JPEGMarker marker); -}; - -//appends output bistream with exactly 1 frame, reports about error -class CIVFFrameReader : public CSmplBitstreamReader -{ -public: - CIVFFrameReader(); - virtual void Reset(); - virtual mfxStatus Init(const msdk_char *strFileName); - virtual mfxStatus ReadNextFrame(mfxBitstream *pBS); - -protected: - - /*bytes 0-3 signature: 'DKIF' - bytes 4-5 version (should be 0) - bytes 6-7 length of header in bytes - bytes 8-11 codec FourCC (e.g., 'VP80') - bytes 12-13 width in pixels - bytes 14-15 height in pixels - bytes 16-19 frame rate - bytes 20-23 time scale - bytes 24-27 number of frames in file - bytes 28-31 unused*/ - - struct DKIFHrd - { - mfxU32 dkif; - mfxU16 version; - mfxU16 header_len; - mfxU32 codec_FourCC; - mfxU16 width; - mfxU16 height; - mfxU32 frame_rate; - mfxU32 time_scale; - mfxU32 num_frames; - mfxU32 unused; - }m_hdr; - mfxStatus ReadHeader(); -}; - -// writes bitstream to duplicate-file & supports joining -// (for ViewOutput encoder mode) -class CSmplBitstreamDuplicateWriter : public CSmplBitstreamWriter -{ -public: - CSmplBitstreamDuplicateWriter(); - - virtual mfxStatus InitDuplicate(const msdk_char *strFileName); - virtual mfxStatus JoinDuplicate(CSmplBitstreamDuplicateWriter *pJoinee); - virtual mfxStatus WriteNextFrame(mfxBitstream *pMfxBitstream, bool isPrint = true); - virtual void Close(); -protected: - FILE* m_fSourceDuplicate; - bool m_bJoined; -}; - -//timeinterval calculation helper - -template -class CTimeInterval : private no_copy -{ - static double g_Freq; - double &m_start; - double m_own;//reference to this if external counter not required - //since QPC functions are quite slow it makes sense to optionally enable them - bool m_bEnable; - msdk_tick m_StartTick; - -public: - CTimeInterval(double &dRef , bool bEnable = true) - : m_start(dRef) - , m_bEnable(bEnable) - , m_StartTick(0) - { - if (!m_bEnable) - return; - Initialize(); - } - CTimeInterval(bool bEnable = true) - : m_start(m_own) - , m_own() - , m_bEnable(bEnable) - , m_StartTick(0) - { - if (!m_bEnable) - return; - Initialize(); - } - - //updates external value with current time - double Commit() - { - if (!m_bEnable) - return 0.0; - - if (0.0 != g_Freq) - { - m_start = MSDK_GET_TIME(msdk_time_get_tick(), m_StartTick, g_Freq); - } - return m_start; - } - //last comitted value - double Last() - { - return m_start; - } - ~CTimeInterval() - { - Commit(); - } -private: - void Initialize() - { - if (0.0 == g_Freq) - { - g_Freq = (double)msdk_time_get_frequency(); - } - m_StartTick = msdk_time_get_tick(); - } -}; - -template double CTimeInterval::g_Freq = 0.0f; - -/** Helper class to measure execution time of some code. Use this class - * if you need manual measurements. - * - * Usage example: - * { - * CTimer timer; - * msdk_tick summary_tick; - * - * timer.Start() - * function_to_measure(); - * summary_tick = timer.GetDelta(); - * printf("Elapsed time 1: %f\n", timer.GetTime()); - * ... - * if (condition) timer.Start(); - function_to_measure(); - * if (condition) { - * summary_tick += timer.GetDelta(); - * printf("Elapsed time 2: %f\n", timer.GetTime(); - * } - * printf("Overall time: %f\n", CTimer::ConvertToSeconds(summary_tick); - * } - */ -class CTimer -{ -public: - CTimer(): - start(0) - { - } - static msdk_tick GetFrequency() - { - if (!frequency) frequency = msdk_time_get_frequency(); - return frequency; - } - static mfxF64 ConvertToSeconds(msdk_tick elapsed) - { - return MSDK_GET_TIME(elapsed, 0, GetFrequency()); - } - - inline void Start() - { - start = msdk_time_get_tick(); - } - inline msdk_tick GetDelta() - { - return msdk_time_get_tick() - start; - } - inline mfxF64 GetTime() - { - return MSDK_GET_TIME(msdk_time_get_tick(), start, GetFrequency()); - } - -protected: - static msdk_tick frequency; - msdk_tick start; -private: - CTimer(const CTimer&); - void operator=(const CTimer&); -}; - -/** Helper class to measure overall execution time of some code. Use this - * class if you want to measure execution time of the repeatedly executed - * code. - * - * Usage example 1: - * - * msdk_tick summary_tick = 0; - * - * void function() { - * - * { - * CAutoTimer timer(&summary_tick); - * ... - * } - * ... - * int main() { - * for (;condition;) { - * function(); - * } - * printf("Elapsed time: %f\n", CTimer::ConvertToSeconds(summary_tick); - * return 0; - * } - * - * Usage example 2: - * { - * msdk_tick summary_tick = 0; - * - * { - * CAutoTimer timer(&summary_tick); - * - * for (;condition;) { - * ... - * { - * function_to_measure(); - * timer.Sync(); - * printf("Progress: %f\n", CTimer::ConvertToSeconds(summary_tick); - * } - * ... - * } - * } - * printf("Elapsed time: %f\n", CTimer::ConvertToSeconds(summary_tick); - * } - * - */ -class CAutoTimer -{ -public: - CAutoTimer(msdk_tick& _elapsed): - elapsed(_elapsed), - start(0) - { - elapsed = _elapsed; - start = msdk_time_get_tick(); - } - ~CAutoTimer() - { - elapsed += msdk_time_get_tick() - start; - } - msdk_tick Sync() - { - msdk_tick cur = msdk_time_get_tick(); - elapsed += cur - start; - start = cur; - return elapsed; - } -protected: - msdk_tick& elapsed; - msdk_tick start; -private: - CAutoTimer(const CAutoTimer&); - void operator=(const CAutoTimer&); -}; - -mfxStatus ConvertFrameRate(mfxF64 dFrameRate, mfxU32* pnFrameRateExtN, mfxU32* pnFrameRateExtD); -mfxF64 CalculateFrameRate(mfxU32 nFrameRateExtN, mfxU32 nFrameRateExtD); - -template -mfxU16 GetFreeSurfaceIndex(T* pSurfacesPool, mfxU16 nPoolSize) -{ - constexpr mfxU16 MSDK_INVALID_SURF_IDX = 0xffff; - - if (pSurfacesPool) - { - for (mfxU16 i = 0; i < nPoolSize; i++) - { - if (0 == pSurfacesPool[i].Data.Locked) - { - return i; - } - } - } - return MSDK_INVALID_SURF_IDX; -} - -mfxU16 GetFreeSurface(mfxFrameSurface1* pSurfacesPool, mfxU16 nPoolSize); -void FreeSurfacePool(mfxFrameSurface1* pSurfacesPool, mfxU16 nPoolSize); - -mfxU16 CalculateDefaultBitrate(mfxU32 nCodecId, mfxU32 nTargetUsage, mfxU32 nWidth, mfxU32 nHeight, mfxF64 dFrameRate); - -//serialization fnc set -std::basic_string CodecIdToStr(mfxU32 nFourCC); -mfxU16 StrToTargetUsage(msdk_string strInput); -const msdk_char* TargetUsageToStr(mfxU16 tu); -const msdk_char* ColorFormatToStr(mfxU32 format); -const msdk_char* MfxStatusToStr(mfxStatus sts); - -// sets bitstream->PicStruct parsing first APP0 marker in bitstream -mfxStatus MJPEG_AVI_ParsePicStruct(mfxBitstream *bitstream); - -// For MVC encoding/decoding purposes -std::basic_string FormMVCFileName(const msdk_char *strFileName, const mfxU32 numView); - -//piecewise linear function for bitrate approximation -class PartiallyLinearFNC -{ - mfxF64 *m_pX; - mfxF64 *m_pY; - mfxU32 m_nPoints; - mfxU32 m_nAllocated; - -public: - PartiallyLinearFNC(); - ~PartiallyLinearFNC(); - - void AddPair(mfxF64 x, mfxF64 y); - mfxF64 at(mfxF64); -private: - DISALLOW_COPY_AND_ASSIGN(PartiallyLinearFNC); -}; - -// function for getting a pointer to a specific external buffer from the array -mfxExtBuffer* GetExtBuffer(mfxExtBuffer** ebuffers, mfxU32 nbuffers, mfxU32 BufferId); - -// returns false if buf length is insufficient, otherwise -// skips step bytes in buf with specified length and returns true -template -bool skip(const Buf_t *&buf, Length_t &length, Length_t step) -{ - if (length < step) - return false; - - buf += step; - length -= step; - - return true; -} - -//do not link MediaSDK dispatched if class not used -struct MSDKAdapter { - // returns the number of adapter associated with MSDK session, 0 for SW session - static mfxU32 GetNumber(mfxSession session, mfxIMPL implVia = 0) { - mfxU32 adapterNum = 0; // default - mfxIMPL impl = MFX_IMPL_SOFTWARE; // default in case no HW IMPL is found - - // we don't care for error codes in further code; if something goes wrong we fall back to the default adapter - if (session) - { - MFXQueryIMPL(session, &impl); - } - else - { - // an auxiliary session, internal for this function - mfxSession auxSession; - memset(&auxSession, 0, sizeof(auxSession)); - - mfxVersion ver = { {1, 1 }}; // minimum API version which supports multiple devices - MFXInit(MFX_IMPL_HARDWARE_ANY | implVia, &ver, &auxSession); - MFXQueryIMPL(auxSession, &impl); - MFXClose(auxSession); - } - - // extract the base implementation type - mfxIMPL baseImpl = MFX_IMPL_BASETYPE(impl); - - const struct - { - // actual implementation - mfxIMPL impl; - // adapter's number - mfxU32 adapterID; - - } implTypes[] = { - {MFX_IMPL_HARDWARE, 0}, - {MFX_IMPL_SOFTWARE, 0}, - {MFX_IMPL_HARDWARE2, 1}, - {MFX_IMPL_HARDWARE3, 2}, - {MFX_IMPL_HARDWARE4, 3} - }; - - - // get corresponding adapter number - for (mfxU8 i = 0; i < sizeof(implTypes)/sizeof(*implTypes); i++) - { - if (implTypes[i].impl == baseImpl) - { - adapterNum = implTypes[i].adapterID; - break; - } - } - - return adapterNum; - } -}; - -struct APIChangeFeatures { - bool JpegDecode; - bool JpegEncode; - bool MVCDecode; - bool MVCEncode; - bool IntraRefresh; - bool LowLatency; - bool ViewOutput; - bool LookAheadBRC; - bool AudioDecode; - bool SupportCodecPluginAPI; -}; - -inline -mfxU32 MakeVersion(mfxU16 major, mfxU16 minor) -{ - return major * 1000 + minor; -} - -mfxVersion getMinimalRequiredVersion(const APIChangeFeatures &features); - -enum msdkAPIFeature { - MSDK_FEATURE_NONE, - MSDK_FEATURE_MVC, - MSDK_FEATURE_JPEG_DECODE, - MSDK_FEATURE_LOW_LATENCY, - MSDK_FEATURE_MVC_VIEWOUTPUT, - MSDK_FEATURE_JPEG_ENCODE, - MSDK_FEATURE_LOOK_AHEAD, - MSDK_FEATURE_PLUGIN_API -}; - -/* Returns true if feature is supported in the given API version */ -bool CheckVersion(mfxVersion* version, msdkAPIFeature feature); - -void ConfigureAspectRatioConversion(mfxInfoVPP* pVppInfo); - -void SEICalcSizeType(std::vector& data, mfxU16 type, mfxU32 size); - -mfxU8 Char2Hex(msdk_char ch); - -enum MsdkTraceLevel { - MSDK_TRACE_LEVEL_SILENT = -1, - MSDK_TRACE_LEVEL_CRITICAL = 0, - MSDK_TRACE_LEVEL_ERROR = 1, - MSDK_TRACE_LEVEL_WARNING = 2, - MSDK_TRACE_LEVEL_INFO = 3, - MSDK_TRACE_LEVEL_DEBUG = 4, -}; - -msdk_string NoFullPath(const msdk_string &); -int msdk_trace_get_level(); -void msdk_trace_set_level(int); -bool msdk_trace_is_printable(int); - -msdk_ostream & operator <<(msdk_ostream & os, MsdkTraceLevel tt); - -template - mfxStatus msdk_opt_read(const msdk_char* string, T& value); - -template - mfxStatus msdk_opt_read(const msdk_char* string, msdk_char (&value)[S]) - { - if (!S) - { - return MFX_ERR_UNKNOWN; - } - value[0]=0; - #if defined(_WIN32) || defined(_WIN64) - value[S - 1] = 0; - return (0 == _tcsncpy_s(value, string,S-1))? MFX_ERR_NONE: MFX_ERR_UNKNOWN; - #else - if (strlen(string) < S) { - strncpy(value, string, S-1); - value[S - 1] = 0; - return MFX_ERR_NONE; - } - return MFX_ERR_UNKNOWN; - #endif - } - -template - inline mfxStatus msdk_opt_read(const msdk_string& string, T& value) - { - return msdk_opt_read(string.c_str(), value); - } - -mfxStatus StrFormatToCodecFormatFourCC(msdk_char* strInput, mfxU32 &codecFormat); -msdk_string StatusToString(mfxStatus sts); -mfxI32 getMonitorType(msdk_char* str); - -void WaitForDeviceToBecomeFree(MFXVideoSession& session, mfxSyncPoint& syncPoint, mfxStatus& currentStatus); - -mfxU16 FourCCToChroma(mfxU32 fourCC); - -class FPSLimiter -{ -public: - FPSLimiter() = default; - ~FPSLimiter() = default; - void Reset(mfxU32 fps) - { - m_delayTicks = fps ? msdk_time_get_frequency() / fps : 0; - } - void Work() - { - msdk_tick current_tick = msdk_time_get_tick(); - while( m_delayTicks && (m_startTick + m_delayTicks > current_tick) ) - { - msdk_tick left_tick = m_startTick + m_delayTicks - current_tick; - uint32_t sleepTime = (uint32_t)(left_tick * 1000 / msdk_time_get_frequency()); - MSDK_SLEEP(sleepTime); - current_tick = msdk_time_get_tick(); - }; - m_startTick = msdk_time_get_tick(); - } - -protected: - msdk_tick m_startTick = 0; - msdk_tick m_delayTicks = 0; -}; - -#endif //__SAMPLE_UTILS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/surface_auto_lock.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/surface_auto_lock.h deleted file mode 100644 index 50183553..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/surface_auto_lock.h +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#include "mfxstructures.h" -#include "sample_utils.h" - -/* - Rationale: locks allocator if necessary to get RAW pointers, unlock it at the end -*/ -class SurfaceAutoLock : private no_copy -{ -public: - SurfaceAutoLock(mfxFrameAllocator & alloc, mfxFrameSurface1 &srf) - : m_alloc(alloc) , m_srf(srf), m_lockRes(MFX_ERR_NONE), m_bLocked() { - LockFrame(); - } - operator mfxStatus () { - return m_lockRes; - } - ~SurfaceAutoLock() { - UnlockFrame(); - } - -protected: - - mfxFrameAllocator & m_alloc; - mfxFrameSurface1 & m_srf; - mfxStatus m_lockRes; - bool m_bLocked; - - void LockFrame() - { - //no allocator used, no need to do lock - if (m_srf.Data.Y != 0) - return ; - //lock required - m_lockRes = m_alloc.Lock(m_alloc.pthis, m_srf.Data.MemId, &m_srf.Data); - if (m_lockRes == MFX_ERR_NONE) { - m_bLocked = true; - } - } - - void UnlockFrame() - { - if (m_lockRes != MFX_ERR_NONE || !m_bLocked) { - return; - } - //unlock required - m_alloc.Unlock(m_alloc.pthis, m_srf.Data.MemId, &m_srf.Data); - } -}; \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sysmem_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sysmem_allocator.h deleted file mode 100644 index 0d796bbe..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/sysmem_allocator.h +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __SYSMEM_ALLOCATOR_H__ -#define __SYSMEM_ALLOCATOR_H__ - -#include -#include "base_allocator.h" -#include - -struct sBuffer -{ - mfxU32 id; - mfxU32 nbytes; - mfxU16 type; -}; - -struct sFrame -{ - mfxU32 id; - mfxFrameInfo info; -}; - -struct SysMemAllocatorParams : mfxAllocatorParams -{ - SysMemAllocatorParams() - : mfxAllocatorParams(), pBufferAllocator(NULL) { } - MFXBufferAllocator *pBufferAllocator; -}; - -class SysMemFrameAllocator: public BaseFrameAllocator -{ -public: - SysMemFrameAllocator(); - virtual ~SysMemFrameAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams); - virtual mfxStatus Close(); - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle); - -protected: - virtual mfxStatus CheckRequestType(mfxFrameAllocRequest *request); - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response); - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - - MFXBufferAllocator *m_pBufferAllocator; - bool m_bOwnBufferAllocator; - - std::vector m_vResp; - - mfxMemId *GetMidHolder(mfxMemId mid); -}; - -class SysMemBufferAllocator : public MFXBufferAllocator -{ -public: - SysMemBufferAllocator(); - virtual ~SysMemBufferAllocator(); - virtual mfxStatus AllocBuffer(mfxU32 nbytes, mfxU16 type, mfxMemId *mid); - virtual mfxStatus LockBuffer(mfxMemId mid, mfxU8 **ptr); - virtual mfxStatus UnlockBuffer(mfxMemId mid); - virtual mfxStatus FreeBuffer(mfxMemId mid); -}; - -#endif // __SYSMEM_ALLOCATOR_H__ \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/time_statistics.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/time_statistics.h deleted file mode 100644 index ce7de120..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/time_statistics.h +++ /dev/null @@ -1,263 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#include "mfxstructures.h" -#include "vm/time_defs.h" -#include "vm/strings_defs.h" -#include "math.h" -#include -#include - - -class CTimeStatisticsReal -{ -public: - CTimeStatisticsReal() - { - ResetStatistics(); - start=0; - m_bNeedDumping = false; - } - - static msdk_tick GetFrequency() - { - if (!frequency) - { - frequency = msdk_time_get_frequency(); - } - return frequency; - } - - static mfxF64 ConvertToSeconds(msdk_tick elapsed) - { - return MSDK_GET_TIME(elapsed, 0, GetFrequency()); - } - - inline void StartTimeMeasurement() - { - start = msdk_time_get_tick(); - } - - inline void StopTimeMeasurement() - { - mfxF64 delta=GetDeltaTime(); - totalTime+=delta; - totalTimeSquares+=delta*delta; - // dump in ms: - if(m_bNeedDumping) - m_time_deltas.push_back(delta * 1000); - - if(deltamaxTime) - { - maxTime=delta; - } - numMeasurements++; - } - - inline void StopTimeMeasurementWithCheck() - { - if(start) - { - StopTimeMeasurement(); - } - } - - inline mfxF64 GetDeltaTime() - { - return MSDK_GET_TIME(msdk_time_get_tick(), start, GetFrequency()); - } - - inline mfxF64 GetDeltaTimeInMiliSeconds() - { - return GetDeltaTime() * 1000; - } - - inline void TurnOnDumping(){m_bNeedDumping = true; } - - inline void TurnOffDumping(){m_bNeedDumping = false; } - - inline void PrintStatistics(const msdk_char* prefix) - { - msdk_printf(MSDK_STRING("%s Total:%.3lfms(%lld smpls),Avg %.3lfms,StdDev:%.3lfms,Min:%.3lfms,Max:%.3lfms\n"), - prefix,totalTime,numMeasurements, - GetAvgTime(false),GetTimeStdDev(false), - GetMinTime(false),GetMaxTime(false)); - } - - inline mfxU64 GetNumMeasurements() - { - return numMeasurements; - } - - inline mfxF64 GetAvgTime(bool inSeconds=true) - { - if (inSeconds) - { - return (numMeasurements ? totalTime / numMeasurements : 0); - } - else - { - return (numMeasurements ? totalTime / numMeasurements : 0) * 1000; - } - } - - inline mfxF64 GetTimeStdDev(bool inSeconds=true) - { - mfxF64 avg = GetAvgTime(); - mfxF64 ftmp = (numMeasurements ? sqrt(totalTimeSquares/numMeasurements-avg*avg) : 0.0); - return inSeconds ? ftmp : ftmp * 1000; - } - - inline mfxF64 GetMinTime(bool inSeconds=true) - { - return inSeconds ? minTime : minTime * 1000; - } - - inline mfxF64 GetMaxTime(bool inSeconds=true) - { - return inSeconds ? maxTime : maxTime * 1000; - } - - inline mfxF64 GetTotalTime(bool inSeconds=true) - { - return inSeconds ? totalTime : totalTime * 1000; - } - - inline void ResetStatistics() - { - totalTime=0; - totalTimeSquares=0; - minTime=1E100; - maxTime=-1; - numMeasurements=0; - m_time_deltas.clear(); - TurnOffDumping(); - } - -protected: - static msdk_tick frequency; - - msdk_tick start; - mfxF64 totalTime; - mfxF64 totalTimeSquares; - mfxF64 minTime; - mfxF64 maxTime; - mfxU64 numMeasurements; - std::vector m_time_deltas; - bool m_bNeedDumping; - -}; - -class CTimeStatisticsDummy -{ -public: - static msdk_tick GetFrequency() - { - if (!frequency) - { - frequency = msdk_time_get_frequency(); - } - return frequency; - } - - static mfxF64 ConvertToSeconds(msdk_tick /*elapsed*/) - { - return 0; - } - - inline void StartTimeMeasurement() - { - } - - inline void StopTimeMeasurement() - { - } - - inline void StopTimeMeasurementWithCheck() - { - } - - inline mfxF64 GetDeltaTime() - { - return 0; - } - - inline mfxF64 GetDeltaTimeInMiliSeconds() - { - return 0; - } - - inline void TurnOnDumping() {} - - inline void TurnOffDumping() {} - - inline void PrintStatistics(const msdk_char* /*prefix*/) - { - } - - inline mfxU64 GetNumMeasurements() - { - return 0; - } - - inline mfxF64 GetAvgTime(bool) - { - return 0; - } - - inline mfxF64 GetTimeStdDev(bool) - { - return 0; - } - - inline mfxF64 GetMinTime(bool) - { - return 0; - } - - inline mfxF64 GetMaxTime(bool) - { - return 0; - } - - inline mfxF64 GetTotalTime(bool) - { - return 0; - } - - inline void ResetStatistics() - { - } - -protected: - static msdk_tick frequency; -}; - -#ifdef TIME_STATS - typedef CTimeStatisticsReal CTimeStatistics; -#else - typedef CTimeStatisticsDummy CTimeStatistics; -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/v4l2_util.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/v4l2_util.h deleted file mode 100644 index 9c21609d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/v4l2_util.h +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __V4L2_UTIL_H__ -#define __V4L2_UTIL_H__ - -#include -#include -#include -#include -#include -#include -#include -#include "sample_defs.h" - -/* MIPI DRIVER Configurations*/ -#define _ISP_MODE_NONE 0x0000 -#define _ISP_MODE_CONTINUOUS 0x1000 -#define _ISP_MODE_STILL 0x2000 -#define _ISP_MODE_VIDEO 0x4000 -#define _ISP_MODE_PREVIEW 0x8000 - -#define CLEAR(x) memset(&(x), 0, sizeof(x)) -#define ERRSTR strerror(errno) - -#define BYE_ON(cond, ...) \ - do { \ - if (cond) { \ - int errsv = errno; \ - fprintf(stderr, "ERROR(%s:%d) : ", \ - __FILE__, __LINE__); \ - errno = errsv; \ - fprintf(stderr, __VA_ARGS__); \ - abort(); \ - } \ - } while(0) - -enum AtomISPMode -{ - NONE = 0, PREVIEW, STILL, VIDEO, CONTINUOUS -}; - -enum V4L2PixelFormat -{ - NO_FORMAT = 0, UYVY, YUY2 -}; - -typedef struct _Buffer -{ - int fd, index; -} Buffer; - -extern Buffer *buffers; -void *PollingThread(void *data); - -class v4l2Device -{ -public: - v4l2Device(const char *devname = "/dev/video0", - uint32_t width = 1920, - uint32_t height = 1080, - uint32_t num_buffer = 4, - enum AtomISPMode MipiMode = NONE, - enum V4L2PixelFormat m_v4l2Format = NO_FORMAT); - - ~v4l2Device(); - - void Init(const char *devname, - uint32_t width, - uint32_t height, - uint32_t num_buffer, - enum V4L2PixelFormat v4l2Format, - enum AtomISPMode MipiMode, - int m_MipiPort); - - void V4L2Init(); - void V4L2Alloc(); - int blockIOCTL(int handle, int request, void *args); - int GetAtomISPModes(enum AtomISPMode mode); - void V4L2QueueBuffer(Buffer *buffer); - Buffer *V4L2DeQueueBuffer(Buffer *buffer); - void V4L2StartCapture(); - void V4L2StopCapture(); - int GetV4L2TerminationSignal(); - void PutOnQ(int x); - int GetOffQ(); - int ConvertToMFXFourCC(enum V4L2PixelFormat v4l2Format); - int ConvertToV4L2FourCC(); - int GetV4L2DisplayID() { return m_fd; } - bool ISV4L2Enabled() { return (m_fd > 0)? true : false; } - -protected: - const char *m_devname; - uint32_t m_height; - uint32_t m_width; - uint32_t m_num_buffers; - struct v4l2_pix_format m_format; - int m_MipiPort; - enum AtomISPMode m_MipiMode; - enum V4L2PixelFormat m_v4l2Format; - int m_fd; -}; - -#endif // ifdef __V4L2_UTIL_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_allocator.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_allocator.h deleted file mode 100644 index 385d280d..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_allocator.h +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VAAPI_ALLOCATOR_H__ -#define __VAAPI_ALLOCATOR_H__ - -#if defined(LIBVA_SUPPORT) - -#include -#include -#include - -#include "base_allocator.h" -#include "vaapi_utils.h" - -// VAAPI Allocator internal Mem ID -struct vaapiMemId -{ - VASurfaceID* m_surface; - VAImage m_image; - // variables for VAAPI Allocator internal color conversion - unsigned int m_fourcc; - mfxU8* m_sys_buffer; - mfxU8* m_va_buffer; - // buffer info to support surface export - VABufferInfo m_buffer_info; - // pointer to private export data - void* m_custom; -}; - -namespace MfxLoader -{ - class VA_Proxy; -} - -struct vaapiAllocatorParams : mfxAllocatorParams -{ - enum { - DONOT_EXPORT = 0, - FLINK = 0x01, - PRIME = 0x02, - NATIVE_EXPORT_MASK = FLINK | PRIME, - CUSTOM = 0x100, - CUSTOM_FLINK = CUSTOM | FLINK, - CUSTOM_PRIME = CUSTOM | PRIME - }; - class Exporter - { - public: - virtual ~Exporter(){} - virtual void* acquire(mfxMemId mid) = 0; - virtual void release(mfxMemId mid, void * hdl) = 0; - }; - - vaapiAllocatorParams() - : m_dpy(NULL) - , m_export_mode(DONOT_EXPORT) - , m_exporter(NULL) - {} - - VADisplay m_dpy; - mfxU32 m_export_mode; - Exporter* m_exporter; -}; - -class vaapiFrameAllocator: public BaseFrameAllocator -{ -public: - vaapiFrameAllocator(); - virtual ~vaapiFrameAllocator(); - - virtual mfxStatus Init(mfxAllocatorParams *pParams); - virtual mfxStatus Close(); - -protected: - DISALLOW_COPY_AND_ASSIGN(vaapiFrameAllocator); - - virtual mfxStatus LockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus UnlockFrame(mfxMemId mid, mfxFrameData *ptr); - virtual mfxStatus GetFrameHDL(mfxMemId mid, mfxHDL *handle); - - virtual mfxStatus CheckRequestType(mfxFrameAllocRequest *request); - virtual mfxStatus ReleaseResponse(mfxFrameAllocResponse *response); - virtual mfxStatus AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response); - virtual mfxStatus ReallocImpl(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut); - - VADisplay m_dpy; - MfxLoader::VA_Proxy * m_libva; - mfxU32 m_export_mode; - vaapiAllocatorParams::Exporter* m_exporter; -}; - -#endif //#if defined(LIBVA_SUPPORT) - -#endif // __VAAPI_ALLOCATOR_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_device.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_device.h deleted file mode 100644 index 38740946..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_device.h +++ /dev/null @@ -1,231 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) || defined(LIBVA_ANDROID_SUPPORT) || defined(LIBVA_WAYLAND_SUPPORT) - -#include "hw_device.h" -#include "vaapi_utils_drm.h" -#include "vaapi_utils_x11.h" -#if defined(LIBVA_ANDROID_SUPPORT) -#include "vaapi_utils_android.h" -#endif - -CHWDevice* CreateVAAPIDevice(const std::string& devicePath = "", int type = MFX_LIBVA_DRM); - -#if defined(LIBVA_DRM_SUPPORT) -/** VAAPI DRM implementation. */ -class CVAAPIDeviceDRM : public CHWDevice -{ -public: - CVAAPIDeviceDRM(const std::string& devicePath, int type); - virtual ~CVAAPIDeviceDRM(void); - - virtual mfxStatus Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum); - virtual mfxStatus Reset(void) { return MFX_ERR_NONE; } - virtual void Close(void) { } - - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { return MFX_ERR_UNSUPPORTED; } - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl) - { - if ((MFX_HANDLE_VA_DISPLAY == type) && (NULL != pHdl)) - { - *pHdl = m_DRMLibVA.GetVADisplay(); - - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; - } - - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc); - virtual void UpdateTitle(double fps) { } - virtual void SetMondelloInput(bool isMondelloInputEnabled) { } - - inline drmRenderer* getRenderer() { return m_rndr; } -protected: - DRMLibVA m_DRMLibVA; - drmRenderer * m_rndr; -private: - // no copies allowed - CVAAPIDeviceDRM(const CVAAPIDeviceDRM &); - void operator=(const CVAAPIDeviceDRM &); -}; - -#endif - -#if defined(LIBVA_X11_SUPPORT) - -/** VAAPI X11 implementation. */ -class CVAAPIDeviceX11 : public CHWDevice -{ -public: - CVAAPIDeviceX11() - { - m_window = NULL; - m_nRenderWinX=0; - m_nRenderWinY=0; - m_nRenderWinW=0; - m_nRenderWinH=0; - m_bRenderWin=false; -#if defined(X11_DRI3_SUPPORT) - m_dri_fd = 0; - m_bufmgr = NULL; - m_xcbconn = NULL; -#endif - } - virtual ~CVAAPIDeviceX11(void); - - virtual mfxStatus Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum); - virtual mfxStatus Reset(void); - virtual void Close(void); - - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl); - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl); - - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc); - virtual void UpdateTitle(double fps) { } - virtual void SetMondelloInput(bool isMondelloInputEnabled) { } - -protected: - mfxHDL m_window; - X11LibVA m_X11LibVA; -private: - - bool m_bRenderWin; - mfxU32 m_nRenderWinX; - mfxU32 m_nRenderWinY; - mfxU32 m_nRenderWinW; - mfxU32 m_nRenderWinH; -#if defined(X11_DRI3_SUPPORT) - int m_dri_fd; - drm_intel_bufmgr* m_bufmgr; - xcb_connection_t *m_xcbconn; -#endif - // no copies allowed - CVAAPIDeviceX11(const CVAAPIDeviceX11 &); - void operator=(const CVAAPIDeviceX11 &); -}; - -#endif - -#if defined(LIBVA_WAYLAND_SUPPORT) - -class Wayland; - -class CVAAPIDeviceWayland : public CHWDevice -{ -public: - CVAAPIDeviceWayland(){ - m_nRenderWinX = 0; - m_nRenderWinY = 0; - m_nRenderWinW = 0; - m_nRenderWinH = 0; - m_isMondelloInputEnabled = false; - m_Wayland = NULL; - } - virtual ~CVAAPIDeviceWayland(void); - - virtual mfxStatus Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum); - virtual mfxStatus Reset(void) { return MFX_ERR_NONE; } - virtual void Close(void); - - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { return MFX_ERR_UNSUPPORTED; } - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl) - { - if((MFX_HANDLE_VA_DISPLAY == type) && (NULL != pHdl)) { - *pHdl = m_DRMLibVA.GetVADisplay(); - return MFX_ERR_NONE; - } - - return MFX_ERR_UNSUPPORTED; - } - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc); - virtual void UpdateTitle(double fps) { } - - virtual void SetMondelloInput(bool isMondelloInputEnabled) - { - m_isMondelloInputEnabled = isMondelloInputEnabled; - } - - Wayland * GetWaylandHandle() - { - return m_Wayland; - } -protected: - DRMLibVA m_DRMLibVA; - MfxLoader::VA_WaylandClientProxy m_WaylandClient; - Wayland *m_Wayland; -private: - mfxU32 m_nRenderWinX; - mfxU32 m_nRenderWinY; - mfxU32 m_nRenderWinW; - mfxU32 m_nRenderWinH; - - bool m_isMondelloInputEnabled; - - // no copies allowed - CVAAPIDeviceWayland(const CVAAPIDeviceWayland &); - void operator=(const CVAAPIDeviceWayland &); -}; - -#endif - -#if defined(LIBVA_ANDROID_SUPPORT) - -/** VAAPI Android implementation. */ -class CVAAPIDeviceAndroid : public CHWDevice -{ -public: - CVAAPIDeviceAndroid(AndroidLibVA *pAndroidLibVA): - m_pAndroidLibVA(pAndroidLibVA) - { - if (!m_pAndroidLibVA) - { - throw std::bad_alloc(); - } - }; - virtual ~CVAAPIDeviceAndroid(void) { Close();} - - virtual mfxStatus Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum) { return MFX_ERR_NONE;} - virtual mfxStatus Reset(void) { return MFX_ERR_NONE; } - virtual void Close(void) { } - - virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { return MFX_ERR_UNSUPPORTED; } - virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *pHdl) - { - if ((MFX_HANDLE_VA_DISPLAY == type) && (NULL != pHdl)) - { - if(m_pAndroidLibVA)*pHdl = m_pAndroidLibVA->GetVADisplay(); - return MFX_ERR_NONE; - } - - return MFX_ERR_UNSUPPORTED; - } - - virtual mfxStatus RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc) { return MFX_ERR_NONE; } - virtual void UpdateTitle(double fps) { } - virtual void SetMondelloInput(bool isMondelloInputEnabled) { } - -protected: - AndroidLibVA* m_pAndroidLibVA; -}; -#endif -#endif //#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) || defined(LIBVA_ANDROID_SUPPORT) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils.h deleted file mode 100644 index 39f77b93..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils.h +++ /dev/null @@ -1,481 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VAAPI_UTILS_H__ -#define __VAAPI_UTILS_H__ - -#ifdef LIBVA_SUPPORT - -#include -#include - -#if defined(LIBVA_DRM_SUPPORT) -#include -#include -#include -#include -#endif -#if defined(LIBVA_X11_SUPPORT) -#include -#if defined(X11_DRI3_SUPPORT) -#include -#include -#endif // X11_DRI3_SUPPORT -#endif -#include "sample_defs.h" -#include "sample_utils.h" -#include "vm/thread_defs.h" - -namespace MfxLoader -{ - - class SimpleLoader - { - public: - SimpleLoader(const char * name); - - void * GetFunction(const char * name); - - ~SimpleLoader(); - - private: - SimpleLoader(SimpleLoader&); - void operator=(SimpleLoader&); - - void * so_handle; - }; - -#ifdef LIBVA_SUPPORT - class VA_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef VAStatus (*vaInitialize_type)(VADisplay, int *, int *); - typedef VAStatus (*vaTerminate_type)(VADisplay); - typedef VAStatus (*vaCreateSurfaces_type)(VADisplay, unsigned int, - unsigned int, unsigned int, VASurfaceID *, unsigned int, - VASurfaceAttrib *, unsigned int); - typedef VAStatus (*vaDestroySurfaces_type)(VADisplay, VASurfaceID *, int); - typedef VAStatus (*vaCreateBuffer_type)(VADisplay, VAContextID, - VABufferType, unsigned int, unsigned int, void *, VABufferID *); - typedef VAStatus (*vaDestroyBuffer_type)(VADisplay, VABufferID); - typedef VAStatus (*vaMapBuffer_type)(VADisplay, VABufferID, void **pbuf); - typedef VAStatus (*vaUnmapBuffer_type)(VADisplay, VABufferID); - typedef VAStatus (*vaSyncSurface_type)(VADisplay, VASurfaceID); - typedef VAStatus (*vaDeriveImage_type)(VADisplay, VASurfaceID, VAImage *); - typedef VAStatus (*vaDestroyImage_type)(VADisplay, VAImageID); - typedef VAStatus (*vaGetLibFunc_type)(VADisplay, const char *func); - typedef VAStatus (*vaAcquireBufferHandle_type)(VADisplay, VABufferID, VABufferInfo *); - typedef VAStatus (*vaReleaseBufferHandle_type)(VADisplay, VABufferID); - typedef VAStatus (*vaMaxNumEntrypoints_type)(VADisplay dpy); - typedef VAStatus (*vaQueryConfigEntrypoints_type)(VADisplay dpy, - VAProfile profile, - VAEntrypoint *entrypoint_list, - int *num_entrypoints); - typedef VAStatus (*vaGetConfigAttributes_type)(VADisplay dpy, - VAProfile profile, - VAEntrypoint entrypoint, - VAConfigAttrib *attrib_list, - int num_attribs); - typedef VAStatus (*vaCreateConfig_type)(VADisplay dpy, - VAProfile profile, - VAEntrypoint entrypoint, - VAConfigAttrib *attrib_list, - int num_attribs, - VAConfigID *config_id); - - typedef VAStatus (*vaCreateContext_type)(VADisplay dpy, - VAConfigID config_id, - int picture_width, - int picture_height, - int flag, - VASurfaceID *render_targets, - int num_render_targets, - VAContextID *context); - typedef VAStatus (*vaDestroyConfig_type) (VADisplay dpy, - VAConfigID config_id); - typedef VAStatus (*vaDestroyContext_type) (VADisplay dpy, - VAContextID context); - - VA_Proxy(); - ~VA_Proxy(); - - const vaInitialize_type vaInitialize; - const vaTerminate_type vaTerminate; - const vaCreateSurfaces_type vaCreateSurfaces; - const vaDestroySurfaces_type vaDestroySurfaces; - const vaCreateBuffer_type vaCreateBuffer; - const vaDestroyBuffer_type vaDestroyBuffer; - const vaMapBuffer_type vaMapBuffer; - const vaUnmapBuffer_type vaUnmapBuffer; - const vaSyncSurface_type vaSyncSurface; - const vaDeriveImage_type vaDeriveImage; - const vaDestroyImage_type vaDestroyImage; - const vaGetLibFunc_type vaGetLibFunc; - const vaAcquireBufferHandle_type vaAcquireBufferHandle; - const vaReleaseBufferHandle_type vaReleaseBufferHandle; - const vaMaxNumEntrypoints_type vaMaxNumEntrypoints; - const vaQueryConfigEntrypoints_type vaQueryConfigEntrypoints; - const vaGetConfigAttributes_type vaGetConfigAttributes; - const vaCreateConfig_type vaCreateConfig; - const vaCreateContext_type vaCreateContext; - const vaDestroyConfig_type vaDestroyConfig; - const vaDestroyContext_type vaDestroyContext; - }; -#endif - -#if defined(LIBVA_DRM_SUPPORT) - class DRM_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef int (*drmIoctl_type)(int fd, unsigned long request, void *arg); - typedef int (*drmModeAddFB_type)( - int fd, uint32_t width, uint32_t height, uint8_t depth, - uint8_t bpp, uint32_t pitch, uint32_t bo_handle, - uint32_t *buf_id); - typedef int (*drmModeAddFB2WithModifiers_type)(int fd, uint32_t width, uint32_t height, uint32_t pixel_format, - uint32_t bo_handles[4], uint32_t pitches[4], uint32_t offsets[4], uint64_t modifier[4], - uint32_t *buf_id, uint32_t flags); - typedef void (*drmModeFreeConnector_type)( drmModeConnectorPtr ptr ); - typedef void (*drmModeFreeCrtc_type)( drmModeCrtcPtr ptr ); - typedef void (*drmModeFreeEncoder_type)( drmModeEncoderPtr ptr ); - typedef void (*drmModeFreePlane_type)( drmModePlanePtr ptr ); - typedef void (*drmModeFreePlaneResources_type)(drmModePlaneResPtr ptr); - typedef void (*drmModeFreeResources_type)( drmModeResPtr ptr ); - typedef drmModeConnectorPtr (*drmModeGetConnector_type)( - int fd, uint32_t connectorId); - typedef drmModeCrtcPtr (*drmModeGetCrtc_type)(int fd, uint32_t crtcId); - typedef drmModeEncoderPtr (*drmModeGetEncoder_type)(int fd, uint32_t encoder_id); - typedef drmModePlanePtr (*drmModeGetPlane_type)(int fd, uint32_t plane_id); - typedef drmModePlaneResPtr (*drmModeGetPlaneResources_type)(int fd); - typedef drmModeResPtr (*drmModeGetResources_type)(int fd); - typedef int (*drmModeRmFB_type)(int fd, uint32_t bufferId); - typedef int (*drmModeSetCrtc_type)( - int fd, uint32_t crtcId, uint32_t bufferId, - uint32_t x, uint32_t y, uint32_t *connectors, int count, - drmModeModeInfoPtr mode); - typedef int (*drmSetMaster_type)(int fd); - typedef int (*drmDropMaster_type)(int fd); - typedef int (*drmModeSetPlane_type)( - int fd, uint32_t plane_id, uint32_t crtc_id, - uint32_t fb_id, uint32_t flags, - int32_t crtc_x, int32_t crtc_y, - uint32_t crtc_w, uint32_t crtc_h, - uint32_t src_x, uint32_t src_y, - uint32_t src_w, uint32_t src_h); - - DRM_Proxy(); - ~DRM_Proxy(); - -#define __DECLARE(name) const name ## _type name - __DECLARE(drmIoctl); - __DECLARE(drmModeAddFB); - __DECLARE(drmModeAddFB2WithModifiers); - __DECLARE(drmModeFreeConnector); - __DECLARE(drmModeFreeCrtc); - __DECLARE(drmModeFreeEncoder); - __DECLARE(drmModeFreePlane); - __DECLARE(drmModeFreePlaneResources); - __DECLARE(drmModeFreeResources); - __DECLARE(drmModeGetConnector); - __DECLARE(drmModeGetCrtc); - __DECLARE(drmModeGetEncoder); - __DECLARE(drmModeGetPlane); - __DECLARE(drmModeGetPlaneResources); - __DECLARE(drmModeGetResources); - __DECLARE(drmModeRmFB); - __DECLARE(drmModeSetCrtc); - __DECLARE(drmSetMaster); - __DECLARE(drmDropMaster); - __DECLARE(drmModeSetPlane); -#undef __DECLARE - }; - - class DrmIntel_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef drm_intel_bo* (*drm_intel_bo_gem_create_from_prime_type)( - drm_intel_bufmgr *bufmgr, int prime_fd, int size); - typedef void (*drm_intel_bo_unreference_type)(drm_intel_bo *bo); - typedef drm_intel_bufmgr* (*drm_intel_bufmgr_gem_init_type)(int fd, int batch_size); - typedef int (*drm_intel_bo_gem_export_to_prime_type) (drm_intel_bo *, int *); - typedef void (*drm_intel_bufmgr_destroy_type)(drm_intel_bufmgr*); - - DrmIntel_Proxy(); - ~DrmIntel_Proxy(); - -#define __DECLARE(name) const name ## _type name - __DECLARE(drm_intel_bo_gem_create_from_prime); - __DECLARE(drm_intel_bo_unreference); - __DECLARE(drm_intel_bufmgr_gem_init); - __DECLARE(drm_intel_bufmgr_destroy); -#if defined(X11_DRI3_SUPPORT) - __DECLARE(drm_intel_bo_gem_export_to_prime); -#endif - -#undef __DECLARE - }; - - class VA_DRMProxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef VADisplay (*vaGetDisplayDRM_type)(int); - - - VA_DRMProxy(); - ~VA_DRMProxy(); - - const vaGetDisplayDRM_type vaGetDisplayDRM; - }; -#endif - -#if defined (LIBVA_WAYLAND_SUPPORT) - - class Wayland; - - class VA_WaylandClientProxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef Wayland* (*WaylandCreate_type)(void); - - VA_WaylandClientProxy(); - ~VA_WaylandClientProxy(); - - const WaylandCreate_type WaylandCreate; - }; - -#endif // LIBVA_WAYLAND_SUPPORT - -#if defined(LIBVA_X11_SUPPORT) - class VA_X11Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef VADisplay (*vaGetDisplay_type)(Display*); - typedef VAStatus (*vaPutSurface_type)( - VADisplay, VASurfaceID, - Drawable, - short, short, - unsigned short, unsigned short, - short, short, - unsigned short, unsigned short, - VARectangle *, - unsigned int, unsigned int); - - VA_X11Proxy(); - ~VA_X11Proxy(); - - const vaGetDisplay_type vaGetDisplay; - const vaPutSurface_type vaPutSurface; - }; - - class XLib_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef Display* (*XOpenDisplay_type) (const char*); - typedef int (*XCloseDisplay_type)(Display*); - typedef Window (*XCreateSimpleWindow_type)(Display *, - Window, int, int, - unsigned int, unsigned int, - unsigned int, unsigned long, - unsigned long); - typedef int (*XMapWindow_type)(Display*, Window); - typedef int (*XSync_type)(Display*, Bool); - typedef int (*XDestroyWindow_type)(Display*, Window); - typedef int (*XResizeWindow_type)(Display *, Window, unsigned int, unsigned int); -#if defined(X11_DRI3_SUPPORT) - typedef Status (*XGetGeometry_type)(Display *, Drawable, Window *, - int *, int *, unsigned int *, unsigned int *, - unsigned int *, unsigned int *); -#endif // X11_DRI3_SUPPORT - XLib_Proxy(); - ~XLib_Proxy(); - - const XOpenDisplay_type XOpenDisplay; - const XCloseDisplay_type XCloseDisplay; - const XCreateSimpleWindow_type XCreateSimpleWindow; - const XMapWindow_type XMapWindow; - const XSync_type XSync; - const XDestroyWindow_type XDestroyWindow; - const XResizeWindow_type XResizeWindow; -#if defined(X11_DRI3_SUPPORT) - const XGetGeometry_type XGetGeometry; -#endif // X11_DRI3_SUPPORT - }; - -#if defined(X11_DRI3_SUPPORT) - - class XCB_Dri3_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef xcb_void_cookie_t (*xcb_dri3_pixmap_from_buffer_type) (xcb_connection_t *, - xcb_pixmap_t, - xcb_drawable_t, - uint32_t, - uint16_t, - uint16_t, - uint16_t, - uint8_t, - uint8_t, - int32_t); - typedef xcb_dri3_pixmap_from_buffer_type xcb_dri3_pixmap_from_buffer_checked_type; - - XCB_Dri3_Proxy(); - ~XCB_Dri3_Proxy(); - - const xcb_dri3_pixmap_from_buffer_checked_type xcb_dri3_pixmap_from_buffer_checked; - }; - - class Xcb_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef uint32_t (*xcb_generate_id_type) (xcb_connection_t *); - typedef xcb_void_cookie_t (*xcb_free_pixmap_type) (xcb_connection_t *, xcb_pixmap_t); - typedef int (*xcb_flush_type)(xcb_connection_t *); - typedef xcb_generic_error_t* (*xcb_request_check_type)(xcb_connection_t *c, xcb_void_cookie_t cookie); - - Xcb_Proxy(); - ~Xcb_Proxy(); - - const xcb_generate_id_type xcb_generate_id; - const xcb_free_pixmap_type xcb_free_pixmap; - const xcb_flush_type xcb_flush; - const xcb_request_check_type xcb_request_check; - }; - - class X11_Xcb_Proxy - { - private: - SimpleLoader lib; // should appear first in member list - - public: - typedef xcb_connection_t * (*XGetXCBConnection_type) (Display *dpy); - - X11_Xcb_Proxy(); - ~X11_Xcb_Proxy(); - - const XGetXCBConnection_type XGetXCBConnection; - }; - - class Xcbpresent_Proxy - { - private: - SimpleLoader lib; - - public: - typedef xcb_void_cookie_t (*xcb_present_pixmap_type) (xcb_connection_t *, - xcb_window_t, - xcb_pixmap_t, - uint32_t, - xcb_xfixes_region_t, - xcb_xfixes_region_t, - int16_t, - int16_t, - xcb_randr_crtc_t, - xcb_sync_fence_t, - xcb_sync_fence_t, - uint32_t, - uint64_t, - uint64_t, - uint64_t, - uint32_t, - const xcb_present_notify_t *); - typedef xcb_present_pixmap_type xcb_present_pixmap_checked_type; - - Xcbpresent_Proxy(); - ~Xcbpresent_Proxy(); - - const xcb_present_pixmap_checked_type xcb_present_pixmap_checked; - }; - -#endif // X11_DRI3_SUPPORT -#endif - -} // namespace MfxLoader - - -class CLibVA -{ -public: - virtual ~CLibVA(void) {}; - - VAStatus AcquireVASurface( - void** pctx, - VADisplay dpy1, - VASurfaceID srf1, - VADisplay dpy2, - VASurfaceID* srf2); - void ReleaseVASurface( - void* actx, - VADisplay dpy1, - VASurfaceID /*srf1*/, - VADisplay dpy2, - VASurfaceID srf2); - - inline int getBackendType() { return m_type; } - VADisplay GetVADisplay() { return m_va_dpy; } - const MfxLoader::VA_Proxy m_libva; - -protected: - CLibVA(int type) - : m_type(type) - , m_va_dpy(NULL) - {} - int m_type; - VADisplay m_va_dpy; - -private: - DISALLOW_COPY_AND_ASSIGN(CLibVA); -}; - -CLibVA* CreateLibVA(const std::string& devicePath = "", int type = MFX_LIBVA_DRM); - -VAStatus AcquireVASurface(void** ctx, VADisplay dpy1, VASurfaceID srf1, VADisplay dpy2, VASurfaceID* srf2); -void ReleaseVASurface(void* actx, VADisplay dpy1, VASurfaceID srf1, VADisplay dpy2, VASurfaceID srf2); - -mfxStatus va_to_mfx_status(VAStatus va_res); - -#endif // #ifdef LIBVA_SUPPORT - -#endif // #ifndef __VAAPI_UTILS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_android.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_android.h deleted file mode 100644 index ee4d9fc6..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_android.h +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VAAPI_UTILS_ANDROID_H__ -#define __VAAPI_UTILS_ANDROID_H__ - -#if defined(LIBVA_ANDROID_SUPPORT) - -#include -#include "vaapi_utils.h" - -class AndroidLibVA : public CLibVA -{ -public: - AndroidLibVA(void); - virtual ~AndroidLibVA(void); - -protected: - void *m_display; - -private: - DISALLOW_COPY_AND_ASSIGN(AndroidLibVA); -}; - -#endif // #if defined(LIBVA_ANDROID_SUPPORT) - -#endif // #ifndef __VAAPI_UTILS_ANDROID_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_drm.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_drm.h deleted file mode 100644 index 35839505..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_drm.h +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VAAPI_UTILS_DRM_H__ -#define __VAAPI_UTILS_DRM_H__ - -#if defined(LIBVA_DRM_SUPPORT) - -#include -#include -#include "vaapi_utils.h" -#include "vaapi_allocator.h" - -class drmRenderer; - -class DRMLibVA : public CLibVA -{ -public: - DRMLibVA(const std::string& devicePath = "", int type = MFX_LIBVA_DRM); - virtual ~DRMLibVA(void); - - inline int getFD() { return m_fd; } - -protected: - int m_fd; - MfxLoader::VA_DRMProxy m_vadrmlib; - -private: - DISALLOW_COPY_AND_ASSIGN(DRMLibVA); -}; - -class drmRenderer : public vaapiAllocatorParams::Exporter -{ -public: - drmRenderer(int fd, mfxI32 monitorType); - virtual ~drmRenderer(); - - virtual mfxStatus render(mfxFrameSurface1 * pSurface); - - // vaapiAllocatorParams::Exporter methods - virtual void* acquire(mfxMemId mid); - virtual void release(mfxMemId mid, void * mem); - - static uint32_t getConnectorType(mfxI32 monitor_type); - static const msdk_char* getConnectorName(uint32_t connector_type); - -private: - bool getConnector(drmModeRes *resource, uint32_t connector_type); - bool setupConnection(drmModeRes *resource, drmModeConnector* connector); - bool getPlane(); - - bool setMaster(); - void dropMaster(); - bool restore(); - - const MfxLoader::DRM_Proxy m_drmlib; - const MfxLoader::DrmIntel_Proxy m_drmintellib; - - int m_fd; - uint32_t m_connector_type; - uint32_t m_connectorID; - uint32_t m_encoderID; - uint32_t m_crtcID; - uint32_t m_crtcIndex; - uint32_t m_planeID; - drmModeModeInfo m_mode; - drmModeCrtcPtr m_crtc; - drm_intel_bufmgr* m_bufmgr; - bool m_overlay_wrn; - mfxFrameSurface1 * m_pCurrentRenderTargetSurface; - -private: - DISALLOW_COPY_AND_ASSIGN(drmRenderer); -}; - -#endif // #if defined(LIBVA_DRM_SUPPORT) - -#endif // #ifndef __VAAPI_UTILS_DRM_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_x11.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_x11.h deleted file mode 100644 index ca824a33..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vaapi_utils_x11.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VAAPI_UTILS_X11_H__ -#define __VAAPI_UTILS_X11_H__ - -#if defined(LIBVA_X11_SUPPORT) - -#include -#include "vaapi_utils.h" - -class X11LibVA : public CLibVA -{ -public: - X11LibVA(void); - virtual ~X11LibVA(void); - - void *GetXDisplay(void) { return m_display;} - - - MfxLoader::XLib_Proxy & GetX11() { return m_x11lib; } - MfxLoader::VA_X11Proxy & GetVAX11() { return m_vax11lib; } -#if defined(X11_DRI3_SUPPORT) - MfxLoader::Xcb_Proxy & GetXcbX11() { return m_xcblib; } - MfxLoader::X11_Xcb_Proxy & GetX11XcbX11() { return m_x11xcblib; } - MfxLoader::XCB_Dri3_Proxy & GetXCBDri3X11() { return m_xcbdri3lib; } - MfxLoader::Xcbpresent_Proxy & GetXcbpresentX11() { return m_xcbpresentlib; } - MfxLoader::DrmIntel_Proxy & GetDrmIntelX11() { return m_drmintellib; } -#endif // X11_DRI3_SUPPORT - -protected: - Display* m_display; - VAConfigID m_configID; - VAContextID m_contextID; - MfxLoader::XLib_Proxy m_x11lib; - MfxLoader::VA_X11Proxy m_vax11lib; -#if defined(X11_DRI3_SUPPORT) - MfxLoader::VA_DRMProxy m_vadrmlib; - MfxLoader::Xcb_Proxy m_xcblib; - MfxLoader::X11_Xcb_Proxy m_x11xcblib; - MfxLoader::XCB_Dri3_Proxy m_xcbdri3lib; - MfxLoader::Xcbpresent_Proxy m_xcbpresentlib; - MfxLoader::DrmIntel_Proxy m_drmintellib; -#endif // X11_DRI3_SUPPORT - -private: - void Close(); - - DISALLOW_COPY_AND_ASSIGN(X11LibVA); -}; - -#endif // #if defined(LIBVA_X11_SUPPORT) - -#endif // #ifndef __VAAPI_UTILS_X11_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/version.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/version.h deleted file mode 100644 index 5f6cb4bb..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/version.h +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#pragma once - -#include "sample_defs.h" - -#ifndef MSDK_MAJOR -#define MSDK_MAJOR 8 -#endif - -#ifndef MSDK_MINOR -#define MSDK_MINOR 4 -#endif - -#ifndef MSDK_RELEASE -#define MSDK_TARGETAPIMINOR 27 -#endif - -#ifndef MSDK_BUILD -#define MSDK_BUILD 0 -#endif - -static msdk_string GetMSDKSampleVersion() -{ - msdk_stringstream ss; - ss << MSDK_MAJOR << "." << MSDK_MINOR << "." << MSDK_TARGETAPIMINOR << "." << MSDK_BUILD; - return ss.str(); -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/atomic_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/atomic_defs.h deleted file mode 100644 index 91907c39..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/atomic_defs.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __ATOMIC_DEFS_H__ -#define __ATOMIC_DEFS_H__ - -#include "mfxdefs.h" - -/* Thread-safe 16-bit variable incrementing */ -mfxU16 msdk_atomic_inc16(volatile mfxU16 *pVariable); - -/* Thread-safe 16-bit variable decrementing */ -mfxU16 msdk_atomic_dec16(volatile mfxU16 *pVariable); - -/* Thread-safe 32-bit variable incrementing */ -mfxU32 msdk_atomic_inc32(volatile mfxU32 *pVariable); - -/* Thread-safe 32-bit variable decrementing */ -mfxU32 msdk_atomic_dec32(volatile mfxU32 *pVariable); - -#endif // #ifndef __ATOMIC_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/file_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/file_defs.h deleted file mode 100644 index 892e6bfb..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/file_defs.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __FILE_DEFS_H__ -#define __FILE_DEFS_H__ - -#include "mfxdefs.h" - -#include - -#if defined(_WIN32) || defined(_WIN64) - -#define MSDK_FOPEN(file, name, mode) _tfopen_s(&file, name, mode) - -#define msdk_fgets _fgetts -#else // #if defined(_WIN32) || defined(_WIN64) -#include - -#define MSDK_FOPEN(file, name, mode) !(file = fopen(name, mode)) - -#define msdk_fgets fgets -#endif // #if defined(_WIN32) || defined(_WIN64) - -#endif // #ifndef __FILE_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/so_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/so_defs.h deleted file mode 100644 index c8bc8bc4..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/so_defs.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __SO_DEFS_H__ -#define __SO_DEFS_H__ - -#include "mfxdefs.h" -#include "strings_defs.h" - -/* Declare shared object handle */ -typedef void * msdk_so_handle; -typedef void (*msdk_func_pointer)(void); - -msdk_so_handle msdk_so_load(const msdk_char *file_name); -msdk_func_pointer msdk_so_get_addr(msdk_so_handle handle, const char *func_name); -void msdk_so_free(msdk_so_handle handle); - -#endif // #ifndef __SO_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/strings_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/strings_defs.h deleted file mode 100644 index 2679b89b..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/strings_defs.h +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __STRING_DEFS_H__ -#define __STRING_DEFS_H__ - -#include -#include -#include - -#ifdef __cplusplus -#include -#endif - -#if defined(_WIN32) || defined(_WIN64) - -#include - -#define MSDK_STRING(x) _T(x) -#define MSDK_CHAR(x) _T(x) - -#ifdef __cplusplus -typedef std::basic_string msdk_tstring; -#endif -typedef TCHAR msdk_char; - -#define msdk_printf _tprintf -#define msdk_fprintf _ftprintf -#define msdk_sprintf _stprintf_s // to be removed -#define msdk_vprintf _vtprintf -#define msdk_strlen _tcslen -#define msdk_strcmp _tcscmp -#define msdk_stricmp _tcsicmp -#define msdk_strncmp _tcsnicmp -#define msdk_strstr _tcsstr -#define msdk_atoi _ttoi -#define msdk_strtol _tcstol -#define msdk_strtod _tcstod -#define msdk_strchr _tcschr -#define msdk_strnlen(str,lenmax) strnlen_s(str,lenmax) -#define msdk_sscanf _stscanf_s -#define msdk_itoa_decimal(value, str) _itot_s(value,str,10) - -// msdk_strcopy is intended to be used with 2 parmeters, i.e. msdk_strcopy(dst, src) -// for _tcscpy_s that's possible if DST is declared as: TCHAR DST[n]; -#define msdk_strcopy _tcscpy_s -#define msdk_strncopy_s _tcsncpy_s - -#define MSDK_MEMCPY_BITSTREAM(bitstream, offset, src, count) memcpy_s((bitstream).Data + (offset), (bitstream).MaxLength - (offset), (src), (count)) - -#define MSDK_MEMCPY_BUF(bufptr, offset, maxsize, src, count) memcpy_s((bufptr)+ (offset), (maxsize) - (offset), (src), (count)) - -#define MSDK_MEMCPY_VAR(dstVarName, src, count) memcpy_s(&(dstVarName), sizeof(dstVarName), (src), (count)) - -#define MSDK_MEMCPY(dst, src, count) memcpy_s(dst, (count), (src), (count)) - - - -#else // #if defined(_WIN32) || defined(_WIN64) - -#define MSDK_STRING(x) x -#define MSDK_CHAR(x) x - -#ifdef __cplusplus -typedef std::string msdk_tstring; -#endif -typedef char msdk_char; - -#define msdk_printf printf -#define msdk_sprintf sprintf -#define msdk_vprintf vprintf -#define msdk_fprintf fprintf -#define msdk_strlen strlen -#define msdk_strcmp strcmp -#define msdk_stricmp strcasecmp -#define msdk_strncmp strncmp -#define msdk_strstr strstr -#define msdk_atoi atoi -#define msdk_atoll atoll -#define msdk_strtol strtol -#define msdk_strtod strtod -#define msdk_itoa_decimal(value, str) \ - snprintf(str, sizeof(str)/sizeof(str[0])-1, "%d", value) -#define msdk_strnlen(str,maxlen) strlen(str) -#define msdk_sscanf sscanf - -#define msdk_strcopy strcpy - -#define msdk_strncopy_s(dst, num_dst, src, count) strncpy(dst, src, count) - -#define MSDK_MEMCPY_BITSTREAM(bitstream, offset, src, count) memcpy((bitstream).Data + (offset), (src), (count)) - -#define MSDK_MEMCPY_BUF(bufptr, offset, maxsize, src, count) memcpy((bufptr)+ (offset), (src), (count)) - -#define MSDK_MEMCPY_VAR(dstVarName, src, count) memcpy(&(dstVarName), (src), (count)) - -#define MSDK_MEMCPY(dst, src, count) memcpy(dst, (src), (count)) - -#endif // #if defined(_WIN32) || defined(_WIN64) - -#endif //__STRING_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/thread_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/thread_defs.h deleted file mode 100644 index 44efe062..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/thread_defs.h +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __THREAD_DEFS_H__ -#define __THREAD_DEFS_H__ - -#include "mfxdefs.h" -#include "vm/strings_defs.h" - -typedef unsigned int (MFX_STDCALL * msdk_thread_callback)(void*); - -#if defined(_WIN32) || defined(_WIN64) - -#include -#include - -struct msdkSemaphoreHandle -{ - void* m_semaphore; -}; - -struct msdkEventHandle -{ - void* m_event; -}; - -struct msdkThreadHandle -{ - void* m_thread; -}; - -#else // #if defined(_WIN32) || defined(_WIN64) - -#include -#include -#include -#include - -struct msdkSemaphoreHandle -{ - msdkSemaphoreHandle(mfxU32 count): - m_count(count) - {} - - mfxU32 m_count; - pthread_cond_t m_semaphore; - pthread_mutex_t m_mutex; -}; - -struct msdkEventHandle -{ - msdkEventHandle(bool manual, bool state): - m_manual(manual), - m_state(state) - {} - - bool m_manual; - bool m_state; - pthread_cond_t m_event; - pthread_mutex_t m_mutex; -}; - -class MSDKEvent; - -struct msdkThreadHandle -{ - msdkThreadHandle( - msdk_thread_callback func, - void* arg): - m_func(func), - m_arg(arg), - m_event(0), - m_thread(0) - {} - - msdk_thread_callback m_func; - void* m_arg; - MSDKEvent* m_event; - pthread_t m_thread; -}; - -#endif // #if defined(_WIN32) || defined(_WIN64) - -class MSDKSemaphore: public msdkSemaphoreHandle -{ -public: - MSDKSemaphore(mfxStatus &sts, mfxU32 count = 0); - ~MSDKSemaphore(void); - - mfxStatus Post(void); - mfxStatus Wait(void); - -private: - MSDKSemaphore(const MSDKSemaphore&); - void operator=(const MSDKSemaphore&); -}; - -class MSDKEvent: public msdkEventHandle -{ -public: - MSDKEvent(mfxStatus &sts, bool manual, bool state); - ~MSDKEvent(void); - - mfxStatus Signal(void); - mfxStatus Reset(void); - mfxStatus Wait(void); - mfxStatus TimedWait(mfxU32 msec); - -private: - MSDKEvent(const MSDKEvent&); - void operator=(const MSDKEvent&); -}; - -class MSDKThread: public msdkThreadHandle -{ -public: - MSDKThread(mfxStatus &sts, msdk_thread_callback func, void* arg); - ~MSDKThread(void); - - mfxStatus Wait(void); - mfxStatus TimedWait(mfxU32 msec); - mfxStatus GetExitCode(); - -#if !defined(_WIN32) && !defined(_WIN64) - friend void* msdk_thread_start(void* arg); -#endif - -private: - MSDKThread(const MSDKThread&); - void operator=(const MSDKThread&); -}; - -mfxU32 msdk_get_current_pid(); -mfxStatus msdk_setrlimit_vmem(mfxU64 size); -mfxStatus msdk_thread_get_schedtype(const msdk_char*, mfxI32 &type); -void msdk_thread_printf_scheduling_help(); - -#endif //__THREAD_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/time_defs.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/time_defs.h deleted file mode 100644 index 6f31d916..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vm/time_defs.h +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __TIME_DEFS_H__ -#define __TIME_DEFS_H__ - -#include "mfxdefs.h" -#include "mfx_itt_trace.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include - -#define MSDK_SLEEP(msec) Sleep(msec) - -#define MSDK_USLEEP(usec) \ -{ \ - LARGE_INTEGER due; \ - due.QuadPart = -(10*(int)usec); \ - HANDLE t = CreateWaitableTimer(NULL, TRUE, NULL); \ - SetWaitableTimer(t, &due, 0, NULL, NULL, 0); \ - WaitForSingleObject(t, INFINITE); \ - CloseHandle(t); \ -} - -#else // #if defined(_WIN32) || defined(_WIN64) - -#include - -#define MSDK_SLEEP(msec) \ - do { \ - MFX_ITT_TASK("MSDK_SLEEP"); \ - usleep(1000*msec); \ - } while(0) - -#define MSDK_USLEEP(usec) \ - do { \ - MFX_ITT_TASK("MSDK_USLEEP"); \ - usleep(usec); \ - } while(0) - -#endif // #if defined(_WIN32) || defined(_WIN64) - -#define MSDK_GET_TIME(T,S,F) ((mfxF64)((T)-(S))/(mfxF64)(F)) - -typedef mfxI64 msdk_tick; - -msdk_tick msdk_time_get_tick(void); -msdk_tick msdk_time_get_frequency(void); -mfxU64 rdtsc(void); - -#endif // #ifndef __TIME_DEFS_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vpp_ex.h b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vpp_ex.h deleted file mode 100644 index 0fdc7dcc..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/include/vpp_ex.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifndef __VPP_EX_H__ -#define __VPP_EX_H__ - -#include "sample_utils.h" -#include "mfxvideo++.h" -#include - -/* #define USE_VPP_EX */ - -class MFXVideoVPPEx : public MFXVideoVPP -{ - -public: - MFXVideoVPPEx(mfxSession session); - -#if defined USE_VPP_EX - - mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]); - mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out); - mfxStatus Init(mfxVideoParam *par); - mfxStatus RunFrameVPPAsync(mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp); - mfxStatus GetVideoParam(mfxVideoParam *par); - mfxStatus Close(void); - -protected: - - std::vector m_LockedSurfacesList; - mfxVideoParam m_VideoParams; - - mfxU64 m_nCurrentPTS; - - mfxU64 m_nIncreaseTime; - mfxU64 m_nArraySize; - mfxU64 m_nInputTimeStamp; - -#endif - -}; - -#endif //__VPP_EX_H__ diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_bitstream.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_bitstream.cpp deleted file mode 100644 index 9e280a2a..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_bitstream.cpp +++ /dev/null @@ -1,2098 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - - -#include "avc_bitstream.h" -#include "sample_defs.h" - -namespace ProtectedLibrary -{ - -mfxStatus DecodeExpGolombOne(mfxU32 **ppBitStream, mfxI32 *pBitOffset, - mfxI32 *pDst, - mfxI32 isSigned); - -enum -{ - SCLFLAT16 = 0, - SCLDEFAULT = 1, - SCLREDEFINED = 2 -}; - -const mfxU32 bits_data[] = -{ - (((mfxU32)0x01 << (0)) - 1), - (((mfxU32)0x01 << (1)) - 1), - (((mfxU32)0x01 << (2)) - 1), - (((mfxU32)0x01 << (3)) - 1), - (((mfxU32)0x01 << (4)) - 1), - (((mfxU32)0x01 << (5)) - 1), - (((mfxU32)0x01 << (6)) - 1), - (((mfxU32)0x01 << (7)) - 1), - (((mfxU32)0x01 << (8)) - 1), - (((mfxU32)0x01 << (9)) - 1), - (((mfxU32)0x01 << (10)) - 1), - (((mfxU32)0x01 << (11)) - 1), - (((mfxU32)0x01 << (12)) - 1), - (((mfxU32)0x01 << (13)) - 1), - (((mfxU32)0x01 << (14)) - 1), - (((mfxU32)0x01 << (15)) - 1), - (((mfxU32)0x01 << (16)) - 1), - (((mfxU32)0x01 << (17)) - 1), - (((mfxU32)0x01 << (18)) - 1), - (((mfxU32)0x01 << (19)) - 1), - (((mfxU32)0x01 << (20)) - 1), - (((mfxU32)0x01 << (21)) - 1), - (((mfxU32)0x01 << (22)) - 1), - (((mfxU32)0x01 << (23)) - 1), - (((mfxU32)0x01 << (24)) - 1), - (((mfxU32)0x01 << (25)) - 1), - (((mfxU32)0x01 << (26)) - 1), - (((mfxU32)0x01 << (27)) - 1), - (((mfxU32)0x01 << (28)) - 1), - (((mfxU32)0x01 << (29)) - 1), - (((mfxU32)0x01 << (30)) - 1), - (((mfxU32)0x01 << (31)) - 1), - ((mfxU32)0xFFFFFFFF), -}; - -const mfxU8 default_intra_scaling_list4x4[16]= -{ - 6, 13, 20, 28, 13, 20, 28, 32, 20, 28, 32, 37, 28, 32, 37, 42 -}; -const mfxU8 default_inter_scaling_list4x4[16]= -{ - 10, 14, 20, 24, 14, 20, 24, 27, 20, 24, 27, 30, 24, 27, 30, 34 -}; - -const mfxU8 default_intra_scaling_list8x8[64]= -{ - 6, 10, 13, 16, 18, 23, 25, 27, 10, 11, 16, 18, 23, 25, 27, 29, - 13, 16, 18, 23, 25, 27, 29, 31, 16, 18, 23, 25, 27, 29, 31, 33, - 18, 23, 25, 27, 29, 31, 33, 36, 23, 25, 27, 29, 31, 33, 36, 38, - 25, 27, 29, 31, 33, 36, 38, 40, 27, 29, 31, 33, 36, 38, 40, 42 -}; -const mfxU8 default_inter_scaling_list8x8[64]= -{ - 9, 13, 15, 17, 19, 21, 22, 24, 13, 13, 17, 19, 21, 22, 24, 25, - 15, 17, 19, 21, 22, 24, 25, 27, 17, 19, 21, 22, 24, 25, 27, 28, - 19, 21, 22, 24, 25, 27, 28, 30, 21, 22, 24, 25, 27, 28, 30, 32, - 22, 24, 25, 27, 28, 30, 32, 33, 24, 25, 27, 28, 30, 32, 33, 35 -}; - -const mfxI32 pre_norm_adjust_index4x4[16] = -{// 0 1 2 3 - 0,2,0,2,//0 - 2,1,2,1,//1 - 0,2,0,2,//2 - 2,1,2,1 //3 -}; - -const mfxI32 pre_norm_adjust4x4[6][3] = -{ - {10,16,13}, - {11,18,14}, - {13,20,16}, - {14,23,18}, - {16,25,20}, - {18,29,23} -}; - -const mfxI32 pre_norm_adjust8x8[6][6] = -{ - {20, 18, 32, 19, 25, 24}, - {22, 19, 35, 21, 28, 26}, - {26, 23, 42, 24, 33, 31}, - {28, 25, 45, 26, 35, 33}, - {32, 28, 51, 30, 40, 38}, - {36, 32, 58, 34, 46, 43} -}; -const mfxI32 pre_norm_adjust_index8x8[64] = -{// 0 1 2 3 4 5 6 7 - 0,3,4,3,0,3,4,3,//0 - 3,1,5,1,3,1,5,1,//1 - 4,5,2,5,4,5,2,5,//2 - 3,1,5,1,3,1,5,1,//3 - 0,3,4,3,0,3,4,3,//4 - 3,1,5,1,3,1,5,1,//5 - 4,5,2,5,4,5,2,5,//6 - 3,1,5,1,3,1,5,1 //7 -}; - -const mfxI32 mp_scan4x4[2][16] = -{ - { - 0, 1, 4, 8, - 5, 2, 3, 6, - 9, 12, 13, 10, - 7, 11, 14, 15 - }, - { - 0, 4, 1, 8, - 12, 5, 9, 13, - 2, 6, 10, 14, - 3, 7, 11, 15 - } -}; - -const mfxI32 hp_scan8x8[2][64] = -{ - //8x8 zigzag scan - { - 0, 1, 8,16, 9, 2, 3,10, - 17,24,32,25,18,11, 4, 5, - 12,19,26,33,40,48,41,34, - 27,20,13, 6, 7,14,21,28, - 35,42,49,56,57,50,43,36, - 29,22,15,23,30,37,44,51, - 58,59,52,45,38,31,39,46, - 53,60,61,54,47,55,62,63 - }, - //8x8 field scan - { - 0, 8,16, 1, 9,24,32,17, - 2,25,40,48,56,33,10, 3, - 18,41,49,57,26,11, 4,19, - 34,42,50,58,27,12, 5,20, - 35,43,51,59,28,13, 6,21, - 36,44,52,60,29,14,22,37, - 45,53,61,30, 7,15,38,46, - 54,62,23,31,39,47,55,63 - } -}; - -#define avcSkipNBits(current_data, offset, nbits) \ -{ \ - /* check error(s) */ \ - SAMPLE_ASSERT((nbits) > 0 && (nbits) <= 32); \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - /* decrease number of available bits */ \ - offset -= (nbits); \ - /* normalize bitstream pointer */ \ - if (0 > offset) \ - { \ - offset += 32; \ - current_data++; \ - } \ - /* check error(s) again */ \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - } - -#define avcGetBits8( current_data, offset, data) \ - _avcGetBits(current_data, offset, 8, data); - - -#define avcUngetNBits(current_data, offset, nbits) \ -{ \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - \ - offset += (nbits); \ - if (offset > 31) \ - { \ - offset -= 32; \ - current_data--; \ - } \ - \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ -} - -#define avcUngetBits32(current_data, offset) \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - current_data--; - -#define avcAlignBSPointerRight(current_data, offset) \ -{ \ - if ((offset & 0x07) != 0x07) \ - { \ - offset = (offset | 0x07) - 8; \ - if (offset == -1) \ - { \ - offset = 31; \ - current_data++; \ - } \ - } \ -} - -#define avcNextBits(current_data, bp, nbits, data) \ -{ \ - mfxU32 x; \ - \ - SAMPLE_ASSERT((nbits) > 0 && (nbits) <= 32); \ - SAMPLE_ASSERT(nbits >= 0 && nbits <= 31); \ - \ - mfxI32 offset = bp - (nbits); \ - \ - if (offset >= 0) \ - { \ - x = current_data[0] >> (offset + 1); \ - } \ - else \ - { \ - offset += 32; \ - \ - x = current_data[1] >> (offset); \ - x >>= 1; \ - x += current_data[0] << (31 - offset); \ - } \ - \ - SAMPLE_ASSERT(offset >= 0 && offset <= 31); \ - \ - (data) = x & bits_data[nbits]; \ -} - -inline void FillFlatScalingList4x4(AVCScalingList4x4 *scl) -{ - for (mfxI32 i=0;i<16;i++) - scl->ScalingListCoeffs[i] = 16; -} - -inline void FillFlatScalingList8x8(AVCScalingList8x8 *scl) -{ - for (mfxI32 i=0;i<64;i++) - scl->ScalingListCoeffs[i] = 16; -} - -inline void FillScalingList4x4(AVCScalingList4x4 *scl_dst,mfxU8 *coefs_src) -{ - for (mfxI32 i=0;i<16;i++) - scl_dst->ScalingListCoeffs[i] = coefs_src[i]; -} - -inline void FillScalingList8x8(AVCScalingList8x8 *scl_dst,mfxU8 *coefs_src) -{ - for (mfxI32 i=0;i<64;i++) - scl_dst->ScalingListCoeffs[i] = coefs_src[i]; -} - -AVCBaseBitstream::AVCBaseBitstream() -{ - Reset(0, 0); -} - -AVCBaseBitstream::AVCBaseBitstream(mfxU8 * const pb, const mfxU32 maxsize) -{ - Reset(pb, maxsize); -} - -AVCBaseBitstream::~AVCBaseBitstream() -{ -} - -void AVCBaseBitstream::Reset(mfxU8 * const pb, const mfxU32 maxsize) -{ - m_pbs = (mfxU32*)pb; - m_pbsBase = (mfxU32*)pb; - m_bitOffset = 31; - m_maxBsSize = maxsize; - -} // void Reset(mfxU8 * const pb, const mfxU32 maxsize) - -void AVCBaseBitstream::Reset(mfxU8 * const pb, mfxI32 offset, const mfxU32 maxsize) -{ - m_pbs = (mfxU32*)pb; - m_pbsBase = (mfxU32*)pb; - m_bitOffset = offset; - m_maxBsSize = maxsize; - -} // void Reset(mfxU8 * const pb, mfxI32 offset, const mfxU32 maxsize) - -mfxStatus AVCBaseBitstream::GetNALUnitType( NAL_Unit_Type &uNALUnitType,mfxU8 &uNALStorageIDC) -{ - mfxU32 code; - avcGetBits8(m_pbs, m_bitOffset, code); - - uNALStorageIDC = (mfxU8)((code & NAL_STORAGE_IDC_BITS)>>5); - uNALUnitType = (NAL_Unit_Type)(code & NAL_UNITTYPE_BITS); - return MFX_ERR_NONE; -} // GetNALUnitType - -mfxI32 AVCBaseBitstream::GetVLCElement(bool bIsSigned) -{ - mfxI32 sval = 0; - - mfxStatus ippRes = DecodeExpGolombOne(&m_pbs, &m_bitOffset, &sval, bIsSigned); - - if (ippRes < MFX_ERR_NONE) - throw AVC_exception(MFX_ERR_UNDEFINED_BEHAVIOR); - - return sval; -} - -void AVCBaseBitstream::AlignPointerRight(void) -{ - avcAlignBSPointerRight(m_pbs, m_bitOffset); - -} // void AVCBitstream::AlignPointerRight(void) - -bool AVCBaseBitstream::More_RBSP_Data() -{ - mfxI32 code, tmp; - mfxU32* ptr_state = m_pbs; - mfxI32 bit_state = m_bitOffset; - - SAMPLE_ASSERT(m_bitOffset >= 0 && m_bitOffset <= 31); - - mfxI32 remaining_bytes = (mfxI32)BytesLeft(); - - if (remaining_bytes <= 0) - return false; - - // get top bit, it can be "rbsp stop" bit - avcGetNBits(m_pbs, m_bitOffset, 1, code); - - // get remain bits, which is less then byte - tmp = (m_bitOffset + 1) % 8; - - if(tmp) - { - avcGetNBits(m_pbs, m_bitOffset, tmp, code); - if ((code << (8 - tmp)) & 0x7f) // most sig bit could be rbsp stop bit - { - m_pbs = ptr_state; - m_bitOffset = bit_state; - // there are more data - return true; - } - } - - remaining_bytes = (mfxI32)BytesLeft(); - - // run through remain bytes - while (0 < remaining_bytes) - { - avcGetBits8(m_pbs, m_bitOffset, code); - - if (code) - { - m_pbs = ptr_state; - m_bitOffset = bit_state; - // there are more data - return true; - } - - remaining_bytes -= 1; - } - - return false; -} - -AVCHeadersBitstream::AVCHeadersBitstream() - : AVCBaseBitstream() -{ -} - -AVCHeadersBitstream::AVCHeadersBitstream(mfxU8 * const pb, const mfxU32 maxsize) - : AVCBaseBitstream(pb, maxsize) -{ -} - -// --------------------------------------------------------------------------- -// AVCBitstream::GetSequenceParamSet() -// Read sequence parameter set data from bitstream. -// --------------------------------------------------------------------------- -mfxStatus AVCHeadersBitstream::GetSequenceParamSet(AVCSeqParamSet *sps) -{ - // Not all members of the seq param set structure are contained in all - // seq param sets. So start by init all to zero. - mfxStatus ps = MFX_ERR_NONE; - sps->Reset(); - - // profile - sps->profile_idc = (mfxU8)GetBits(8); - - switch (sps->profile_idc) - { - case AVC_PROFILE_BASELINE: - case AVC_PROFILE_MAIN: - case AVC_PROFILE_SCALABLE_BASELINE: - case AVC_PROFILE_SCALABLE_HIGH: - case AVC_PROFILE_EXTENDED: - case AVC_PROFILE_HIGH: - case AVC_PROFILE_HIGH10: - case AVC_PROFILE_MULTIVIEW_HIGH: - case AVC_PROFILE_HIGH422: - case AVC_PROFILE_STEREO_HIGH: - case AVC_PROFILE_HIGH444: - case AVC_PROFILE_ADVANCED444_INTRA: - case AVC_PROFILE_ADVANCED444: - break; - default: - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps->constrained_set0_flag = (mfxU8)Get1Bit(); - - sps->constrained_set1_flag = (mfxU8)Get1Bit(); - - sps->constrained_set2_flag = (mfxU8)Get1Bit(); - - sps->constrained_set3_flag = (mfxU8)Get1Bit(); - - // skip 4 zero bits - GetBits(4); - - sps->level_idc = (mfxU8)GetBits(8); - - switch(sps->level_idc) - { - case AVC_LEVEL_1: - case AVC_LEVEL_11: - case AVC_LEVEL_12: - case AVC_LEVEL_13: - - case AVC_LEVEL_2: - case AVC_LEVEL_21: - case AVC_LEVEL_22: - - case AVC_LEVEL_3: - case AVC_LEVEL_31: - case AVC_LEVEL_32: - - case AVC_LEVEL_4: - case AVC_LEVEL_41: - case AVC_LEVEL_42: - - case AVC_LEVEL_5: - case AVC_LEVEL_51: - break; - default: - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - // id - mfxI32 sps_id = GetVLCElement(false); - if (sps_id > MAX_NUM_SEQ_PARAM_SETS - 1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps->seq_parameter_set_id = (mfxU8)sps_id; - - // see 7.3.2.1.1 "Sequence parameter set data syntax" - // chapter of H264 standard for full list of profiles with chrominance - if ((AVC_PROFILE_SCALABLE_BASELINE == sps->profile_idc) || - (AVC_PROFILE_SCALABLE_HIGH == sps->profile_idc) || - (AVC_PROFILE_HIGH == sps->profile_idc) || - (AVC_PROFILE_HIGH10 == sps->profile_idc) || - (AVC_PROFILE_MULTIVIEW_HIGH == sps->profile_idc) || - (AVC_PROFILE_HIGH422 == sps->profile_idc) || - (AVC_PROFILE_STEREO_HIGH == sps->profile_idc) || - (244 == sps->profile_idc) || - (44 == sps->profile_idc)) - { - mfxU32 chroma_format_idc = GetVLCElement(false); - - if (chroma_format_idc > 3) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - sps->chroma_format_idc = (mfxU8)chroma_format_idc; - if (sps->chroma_format_idc==3) - { - sps->residual_colour_transform_flag = (mfxU8) Get1Bit(); - } - - mfxU32 bit_depth_luma = GetVLCElement(false) + 8; - mfxU32 bit_depth_chroma = GetVLCElement(false) + 8; - - if (bit_depth_luma > 16 || bit_depth_chroma > 16) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - sps->bit_depth_luma = (mfxU8)bit_depth_luma; - sps->bit_depth_chroma = (mfxU8)bit_depth_chroma; - - if (!chroma_format_idc) - sps->bit_depth_chroma = sps->bit_depth_luma; - - SAMPLE_ASSERT(!sps->residual_colour_transform_flag); - if (sps->residual_colour_transform_flag == 1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps->qpprime_y_zero_transform_bypass_flag = (mfxU8)Get1Bit(); - sps->seq_scaling_matrix_present_flag = (mfxU8)Get1Bit(); - if(sps->seq_scaling_matrix_present_flag) - { - // 0 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[0],(mfxU8*)default_intra_scaling_list4x4,&sps->type_of_scaling_list_used[0]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[0],(mfxU8*) default_intra_scaling_list4x4); - sps->type_of_scaling_list_used[0] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[1],(mfxU8*) default_intra_scaling_list4x4,&sps->type_of_scaling_list_used[1]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[1],(mfxU8*) sps->ScalingLists4x4[0].ScalingListCoeffs); - sps->type_of_scaling_list_used[1] = SCLDEFAULT; - } - // 2 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[2],(mfxU8*) default_intra_scaling_list4x4,&sps->type_of_scaling_list_used[2]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[2],(mfxU8*) sps->ScalingLists4x4[1].ScalingListCoeffs); - sps->type_of_scaling_list_used[2] = SCLDEFAULT; - } - // 3 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[3],(mfxU8*)default_inter_scaling_list4x4,&sps->type_of_scaling_list_used[3]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[3],(mfxU8*) default_inter_scaling_list4x4); - sps->type_of_scaling_list_used[3] = SCLDEFAULT; - } - // 4 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[4],(mfxU8*) default_inter_scaling_list4x4,&sps->type_of_scaling_list_used[4]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[4],(mfxU8*) sps->ScalingLists4x4[3].ScalingListCoeffs); - sps->type_of_scaling_list_used[4] = SCLDEFAULT; - } - // 5 - if(Get1Bit()) - { - GetScalingList4x4(&sps->ScalingLists4x4[5],(mfxU8*) default_inter_scaling_list4x4,&sps->type_of_scaling_list_used[5]); - } - else - { - FillScalingList4x4(&sps->ScalingLists4x4[5],(mfxU8*) sps->ScalingLists4x4[4].ScalingListCoeffs); - sps->type_of_scaling_list_used[5] = SCLDEFAULT; - } - - // 0 - if(Get1Bit()) - { - GetScalingList8x8(&sps->ScalingLists8x8[0],(mfxU8*)default_intra_scaling_list8x8,&sps->type_of_scaling_list_used[6]); - } - else - { - FillScalingList8x8(&sps->ScalingLists8x8[0],(mfxU8*) default_intra_scaling_list8x8); - sps->type_of_scaling_list_used[6] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList8x8(&sps->ScalingLists8x8[1],(mfxU8*) default_inter_scaling_list8x8,&sps->type_of_scaling_list_used[7]); - } - else - { - FillScalingList8x8(&sps->ScalingLists8x8[1],(mfxU8*) default_inter_scaling_list8x8); - sps->type_of_scaling_list_used[7] = SCLDEFAULT; - } - - } - else - { - mfxI32 i; - - for (i = 0; i < 6; i += 1) - { - FillFlatScalingList4x4(&sps->ScalingLists4x4[i]); - } - for (i = 0; i < 2; i += 1) - { - FillFlatScalingList8x8(&sps->ScalingLists8x8[i]); - } - } - } - else - { - sps->chroma_format_idc = 1; - sps->bit_depth_luma = 8; - sps->bit_depth_chroma = 8; - - SetDefaultScalingLists(sps); - } - - // log2 max frame num (bitstream contains value - 4) - mfxU32 log2_max_frame_num = GetVLCElement(false) + 4; - sps->log2_max_frame_num = (mfxU8)log2_max_frame_num; - - if (log2_max_frame_num > 16 || log2_max_frame_num < 4) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - // pic order cnt type (0..2) - mfxU32 pic_order_cnt_type = GetVLCElement(false); - sps->pic_order_cnt_type = (mfxU8)pic_order_cnt_type; - if (pic_order_cnt_type > 2) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - if (sps->pic_order_cnt_type == 0) - { - // log2 max pic order count lsb (bitstream contains value - 4) - mfxU32 log2_max_pic_order_cnt_lsb = GetVLCElement(false) + 4; - sps->log2_max_pic_order_cnt_lsb = (mfxU8)log2_max_pic_order_cnt_lsb; - - if (log2_max_pic_order_cnt_lsb > 16 || log2_max_pic_order_cnt_lsb < 4) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - sps->MaxPicOrderCntLsb = (1 << sps->log2_max_pic_order_cnt_lsb); - } - else if (sps->pic_order_cnt_type == 1) - { - sps->delta_pic_order_always_zero_flag = (mfxU8)Get1Bit(); - sps->offset_for_non_ref_pic = GetVLCElement(true); - sps->offset_for_top_to_bottom_field = GetVLCElement(true); - sps->num_ref_frames_in_pic_order_cnt_cycle = GetVLCElement(false); - - if (sps->num_ref_frames_in_pic_order_cnt_cycle > 255) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - // get offsets - for (mfxU32 i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; i++) - { - sps->poffset_for_ref_frame[i] = GetVLCElement(true); - } - } // pic order count type 1 - - // num ref frames - sps->num_ref_frames = GetVLCElement(false); - if (sps->num_ref_frames > 16) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - sps->gaps_in_frame_num_value_allowed_flag = (mfxU8)Get1Bit(); - - // picture width in MBs (bitstream contains value - 1) - sps->frame_width_in_mbs = GetVLCElement(false) + 1; - - // picture height in MBs (bitstream contains value - 1) - sps->frame_height_in_mbs = GetVLCElement(false) + 1; - - sps->frame_mbs_only_flag = (mfxU8)Get1Bit(); - sps->frame_height_in_mbs = (2-sps->frame_mbs_only_flag)*sps->frame_height_in_mbs; - if (sps->frame_mbs_only_flag == 0) - { - sps->mb_adaptive_frame_field_flag = (mfxU8)Get1Bit(); - } - sps->direct_8x8_inference_flag = (mfxU8)Get1Bit(); - if (sps->frame_mbs_only_flag==0) - { - sps->direct_8x8_inference_flag = 1; - } - sps->frame_cropping_flag = (mfxU8)Get1Bit(); - - if (sps->frame_cropping_flag) - { - sps->frame_cropping_rect_left_offset = GetVLCElement(false); - sps->frame_cropping_rect_right_offset = GetVLCElement(false); - sps->frame_cropping_rect_top_offset = GetVLCElement(false); - sps->frame_cropping_rect_bottom_offset = GetVLCElement(false); - } // don't need else because we zeroid structure - - sps->vui_parameters_present_flag = (mfxU8)Get1Bit(); - if (sps->vui_parameters_present_flag) - { - if (ps == MFX_ERR_NONE) - ps = GetVUIParam(sps); - } - - return ps; -} // GetSequenceParamSet - -mfxStatus AVCHeadersBitstream::GetVUIParam(AVCSeqParamSet *sps) -{ - mfxStatus ps=MFX_ERR_NONE; - sps->aspect_ratio_info_present_flag = (mfxU8) Get1Bit(); - - sps->sar_width = 1; // default values - sps->sar_height = 1; - - if (sps->aspect_ratio_info_present_flag) - { - sps->aspect_ratio_idc = (mfxU8) GetBits(8); - if (sps->aspect_ratio_idc == 255) { - sps->sar_width = (mfxU16) GetBits(16); - sps->sar_height = (mfxU16) GetBits(16); - } - } - - sps->overscan_info_present_flag = (mfxU8) Get1Bit(); - if( sps->overscan_info_present_flag ) - sps->overscan_appropriate_flag = (mfxU8) Get1Bit(); - sps->video_signal_type_present_flag = (mfxU8) Get1Bit(); - if( sps->video_signal_type_present_flag ) { - sps->video_format = (mfxU8) GetBits(3); - sps->video_full_range_flag = (mfxU8) Get1Bit(); - sps->colour_description_present_flag = (mfxU8) Get1Bit(); - if( sps->colour_description_present_flag ) { - sps->colour_primaries = (mfxU8) GetBits(8); - sps->transfer_characteristics = (mfxU8) GetBits(8); - sps->matrix_coefficients = (mfxU8) GetBits(8); - } - } - sps->chroma_loc_info_present_flag = (mfxU8) Get1Bit(); - if( sps->chroma_loc_info_present_flag ) { - sps->chroma_sample_loc_type_top_field = (mfxU8) GetVLCElement(false); - sps->chroma_sample_loc_type_bottom_field = (mfxU8) GetVLCElement(false); - } - sps->timing_info_present_flag = (mfxU8) Get1Bit(); - - if (sps->timing_info_present_flag) - { - sps->num_units_in_tick = GetBits(32); - sps->time_scale = GetBits(32); - sps->fixed_frame_rate_flag = (mfxU8) Get1Bit(); - - if (!sps->num_units_in_tick || !sps->time_scale) - sps->timing_info_present_flag = 0; - } - - sps->nal_hrd_parameters_present_flag = (mfxU8) Get1Bit(); - if( sps->nal_hrd_parameters_present_flag ) - ps=GetHRDParam(sps); - sps->vcl_hrd_parameters_present_flag = (mfxU8) Get1Bit(); - if( sps->vcl_hrd_parameters_present_flag ) - ps=GetHRDParam(sps); - if( sps->nal_hrd_parameters_present_flag || sps->vcl_hrd_parameters_present_flag ) - sps->low_delay_hrd_flag = (mfxU8) Get1Bit(); - sps->pic_struct_present_flag = (mfxU8) Get1Bit(); - sps->bitstream_restriction_flag = (mfxU8) Get1Bit(); - if( sps->bitstream_restriction_flag ) { - sps->motion_vectors_over_pic_boundaries_flag = (mfxU8) Get1Bit(); - sps->max_bytes_per_pic_denom = (mfxU8) GetVLCElement(false); - sps->max_bits_per_mb_denom = (mfxU8) GetVLCElement(false); - sps->log2_max_mv_length_horizontal = (mfxU8) GetVLCElement(false); - sps->log2_max_mv_length_vertical = (mfxU8) GetVLCElement(false); - sps->num_reorder_frames = (mfxU8) GetVLCElement(false); - - mfxI32 value = GetVLCElement(false); - if (value < (mfxI32)sps->num_ref_frames || value < 0) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps->max_dec_frame_buffering = (mfxU8) GetVLCElement(false); - } - return ps; -} - -mfxStatus AVCHeadersBitstream::GetHRDParam(AVCSeqParamSet *sps) -{ - mfxStatus ps=MFX_ERR_NONE; - mfxI32 cpb_cnt = GetVLCElement(false) + 1; - - if (cpb_cnt >= 32) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps->cpb_cnt = (mfxU8)cpb_cnt; - - sps->bit_rate_scale = (mfxU8) GetBits(4); - sps->cpb_size_scale = (mfxU8) GetBits(4); - for( mfxI32 idx= 0; idx < sps->cpb_cnt; idx++ ) { - sps->bit_rate_value[ idx ] = (mfxU32) (GetVLCElement(false)+1); - sps->cpb_size_value[ idx ] = (mfxU32) ((GetVLCElement(false)+1)); - sps->cbr_flag[ idx ] = (mfxU8) Get1Bit(); - } - sps->initial_cpb_removal_delay_length = (mfxU8)(GetBits(5)+1); - sps->cpb_removal_delay_length = (mfxU8)(GetBits(5)+1); - sps->dpb_output_delay_length = (mfxU8) (GetBits(5)+1); - sps->time_offset_length = (mfxU8) GetBits(5); - return ps; - -} - -// --------------------------------------------------------------------------- -// Read sequence parameter set extension data from bitstream. -// --------------------------------------------------------------------------- -mfxStatus AVCHeadersBitstream::GetSequenceParamSetExtension(AVCSeqParamSetExtension *sps_ex) -{ - // Not all members of the seq param set structure are contained in all - // seq param sets. So start by init all to zero. - mfxStatus ps = MFX_ERR_NONE; - sps_ex->Reset(); - - mfxU32 seq_parameter_set_id = GetVLCElement(false); - sps_ex->seq_parameter_set_id = (mfxU8)seq_parameter_set_id; - if (seq_parameter_set_id > MAX_NUM_SEQ_PARAM_SETS-1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - mfxU32 aux_format_idc = GetVLCElement(false); - sps_ex->aux_format_idc = (mfxU8)aux_format_idc; - if (aux_format_idc > 3) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - if (sps_ex->aux_format_idc != 1 && sps_ex->aux_format_idc != 2) - sps_ex->aux_format_idc = 0; - - if (sps_ex->aux_format_idc) - { - mfxU32 bit_depth_aux = GetVLCElement(false) + 8; - sps_ex->bit_depth_aux = (mfxU8)bit_depth_aux; - if (bit_depth_aux > 12) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - sps_ex->alpha_incr_flag = (mfxU8)Get1Bit(); - sps_ex->alpha_opaque_value = (mfxU8)GetBits(sps_ex->bit_depth_aux + 1); - sps_ex->alpha_transparent_value = (mfxU8)GetBits(sps_ex->bit_depth_aux + 1); - } - - sps_ex->additional_extension_flag = (mfxU8)Get1Bit(); - - return ps; -} // GetSequenceParamSetExtension - -mfxStatus AVCHeadersBitstream::GetPictureParamSetPart1(AVCPicParamSet *pps) -{ - // Not all members of the pic param set structure are contained in all - // pic param sets. So start by init all to zero. - pps->Reset(); - - // id - mfxU32 pic_parameter_set_id = GetVLCElement(false); - pps->pic_parameter_set_id = (mfxU16)pic_parameter_set_id; - if (pic_parameter_set_id > MAX_NUM_PIC_PARAM_SETS-1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - // seq param set referred to by this pic param set - mfxU32 seq_parameter_set_id = GetVLCElement(false); - pps->seq_parameter_set_id = (mfxU8)seq_parameter_set_id; - if (seq_parameter_set_id > MAX_NUM_SEQ_PARAM_SETS-1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - return MFX_ERR_NONE; -} // GetPictureParamSetPart1 - -// Number of bits required to code slice group ID, index is num_slice_groups - 2 -static const mfxU8 SGIdBits[7] = {1,2,2,3,3,3,3}; - -// --------------------------------------------------------------------------- -// Read picture parameter set data from bitstream. -// --------------------------------------------------------------------------- -mfxStatus AVCHeadersBitstream::GetPictureParamSetPart2(AVCPicParamSet *pps, - const AVCSeqParamSet *sps) -{ - pps->entropy_coding_mode = (mfxU8)Get1Bit(); - - - pps->pic_order_present_flag = (mfxU8)Get1Bit(); - - // number of slice groups, bitstream has value - 1 - pps->num_slice_groups = GetVLCElement(false) + 1; - if (pps->num_slice_groups != 1) - { - mfxU32 slice_group; - mfxU32 PicSizeInMapUnits; // for range checks - - PicSizeInMapUnits = sps->frame_width_in_mbs * sps->frame_height_in_mbs; - // TBD: needs adjust for fields - - if (pps->num_slice_groups > MAX_NUM_SLICE_GROUPS) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - mfxU32 slice_group_map_type = GetVLCElement(false); - pps->SliceGroupInfo.slice_group_map_type = (mfxU8)slice_group_map_type; - - if (slice_group_map_type > 6) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - // Get additional, map type dependent slice group data - switch (pps->SliceGroupInfo.slice_group_map_type) - { - case 0: - for (slice_group=0; slice_groupnum_slice_groups; slice_group++) - { - // run length, bitstream has value - 1 - pps->SliceGroupInfo.run_length[slice_group] = GetVLCElement(false) + 1; - - if (pps->SliceGroupInfo.run_length[slice_group] > PicSizeInMapUnits) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - break; - case 1: - // no additional info - break; - case 2: - for (slice_group=0; slice_group<(mfxU32)(pps->num_slice_groups-1); slice_group++) - { - pps->SliceGroupInfo.t1.top_left[slice_group] = GetVLCElement(false); - pps->SliceGroupInfo.t1.bottom_right[slice_group] = GetVLCElement(false); - - // check for legal values - if (pps->SliceGroupInfo.t1.top_left[slice_group] > - pps->SliceGroupInfo.t1.bottom_right[slice_group]) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - if (pps->SliceGroupInfo.t1.bottom_right[slice_group] >= PicSizeInMapUnits) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - if ((pps->SliceGroupInfo.t1.top_left[slice_group] % - sps->frame_width_in_mbs) > - (pps->SliceGroupInfo.t1.bottom_right[slice_group] % - sps->frame_width_in_mbs)) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - break; - case 3: - case 4: - case 5: - // For map types 3..5, number of slice groups must be 2 - if (pps->num_slice_groups != 2) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - pps->SliceGroupInfo.t2.slice_group_change_direction_flag = (mfxU8)Get1Bit(); - pps->SliceGroupInfo.t2.slice_group_change_rate = GetVLCElement(false) + 1; - if (pps->SliceGroupInfo.t2.slice_group_change_rate > PicSizeInMapUnits) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - break; - case 6: - // mapping of slice group to map unit (macroblock if not fields) is - // per map unit, read from bitstream - { - mfxU32 map_unit; - mfxU32 num_bits; // number of bits used to code each slice group id - - // number of map units, bitstream has value - 1 - pps->SliceGroupInfo.t3.pic_size_in_map_units = GetVLCElement(false) + 1; - if (pps->SliceGroupInfo.t3.pic_size_in_map_units != PicSizeInMapUnits) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - mfxI32 len = std::max(1u, pps->SliceGroupInfo.t3.pic_size_in_map_units); - - pps->SliceGroupInfo.pSliceGroupIDMap.resize(len); - - // num_bits is Ceil(log2(num_groups)) - num_bits = SGIdBits[pps->num_slice_groups - 2]; - - for (map_unit = 0; - map_unit < pps->SliceGroupInfo.t3.pic_size_in_map_units; - map_unit++) - { - pps->SliceGroupInfo.pSliceGroupIDMap[map_unit] = (mfxU8)GetBits(num_bits); - if (pps->SliceGroupInfo.pSliceGroupIDMap[map_unit] > - pps->num_slice_groups - 1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - } - break; - default: - return MFX_ERR_UNDEFINED_BEHAVIOR; - - } // switch - } // slice group info - - // number of list 0 ref pics used to decode picture, bitstream has value - 1 - pps->num_ref_idx_l0_active = GetVLCElement(false) + 1; - - // number of list 1 ref pics used to decode picture, bitstream has value - 1 - pps->num_ref_idx_l1_active = GetVLCElement(false) + 1; - - if (pps->num_ref_idx_l1_active > MAX_NUM_REF_FRAMES || pps->num_ref_idx_l0_active > MAX_NUM_REF_FRAMES) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - // weighted pediction - pps->weighted_pred_flag = (mfxU8)Get1Bit(); - pps->weighted_bipred_idc = (mfxU8)GetBits(2); - - // default slice QP, bitstream has value - 26 - mfxI32 pic_init_qp = GetVLCElement(true) + 26; - pps->pic_init_qp = (mfxI8)pic_init_qp; - - // default SP/SI slice QP, bitstream has value - 26 - pps->pic_init_qs = (mfxU8)(GetVLCElement(true) + 26); - pps->chroma_qp_index_offset[0] = (mfxI8)GetVLCElement(true); - - pps->deblocking_filter_variables_present_flag = (mfxU8)Get1Bit(); - pps->constrained_intra_pred_flag = (mfxU8)Get1Bit(); - pps->redundant_pic_cnt_present_flag = (mfxU8)Get1Bit(); - if (More_RBSP_Data()) - { - pps->transform_8x8_mode_flag = (mfxU8) Get1Bit(); - if(sps->seq_scaling_matrix_present_flag) - { - //fall-back set rule B - if(Get1Bit()) - { - // 0 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[0],(mfxU8*)default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[0]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[0],(mfxU8*) sps->ScalingLists4x4[0].ScalingListCoeffs); - pps->type_of_scaling_list_used[0] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[1],(mfxU8*) default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[1]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[1],(mfxU8*) pps->ScalingLists4x4[0].ScalingListCoeffs); - pps->type_of_scaling_list_used[1] = SCLDEFAULT; - } - // 2 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[2],(mfxU8*) default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[2]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[2],(mfxU8*) pps->ScalingLists4x4[1].ScalingListCoeffs); - pps->type_of_scaling_list_used[2] = SCLDEFAULT; - } - // 3 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[3],(mfxU8*) default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[3]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[3],(mfxU8*) sps->ScalingLists4x4[3].ScalingListCoeffs); - pps->type_of_scaling_list_used[3] = SCLDEFAULT; - } - // 4 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[4],(mfxU8*) default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[4]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[4],(mfxU8*) pps->ScalingLists4x4[3].ScalingListCoeffs); - pps->type_of_scaling_list_used[4] = SCLDEFAULT; - } - // 5 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[5],(mfxU8*) default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[5]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[5],(mfxU8*) pps->ScalingLists4x4[4].ScalingListCoeffs); - pps->type_of_scaling_list_used[5] = SCLDEFAULT; - } - - if (pps->transform_8x8_mode_flag) - { - // 0 - if(Get1Bit()) - { - GetScalingList8x8(&pps->ScalingLists8x8[0],(mfxU8*)default_intra_scaling_list8x8,&pps->type_of_scaling_list_used[6]); - } - else - { - FillScalingList8x8(&pps->ScalingLists8x8[0],(mfxU8*) sps->ScalingLists8x8[0].ScalingListCoeffs); - pps->type_of_scaling_list_used[6] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList8x8(&pps->ScalingLists8x8[1],(mfxU8*) default_inter_scaling_list8x8,&pps->type_of_scaling_list_used[7]); - } - else - { - FillScalingList8x8(&pps->ScalingLists8x8[1],(mfxU8*) sps->ScalingLists8x8[1].ScalingListCoeffs); - pps->type_of_scaling_list_used[7] = SCLDEFAULT; - } - } - } - else - { - mfxI32 i; - for(i=0; i<6; i++) - { - FillScalingList4x4(&pps->ScalingLists4x4[i],(mfxU8 *)sps->ScalingLists4x4[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - - if (pps->transform_8x8_mode_flag) - { - for(i=0; i<2; i++) - { - FillScalingList8x8(&pps->ScalingLists8x8[i],(mfxU8 *)sps->ScalingLists8x8[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - } - } - } - else - { - //fall-back set rule A - if(Get1Bit()) - { - // 0 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[0],(mfxU8*)default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[0]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[0],(mfxU8*) default_intra_scaling_list4x4); - pps->type_of_scaling_list_used[0] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[1],(mfxU8*) default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[1]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[1],(mfxU8*) pps->ScalingLists4x4[0].ScalingListCoeffs); - pps->type_of_scaling_list_used[1] = SCLDEFAULT; - } - // 2 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[2],(mfxU8*) default_intra_scaling_list4x4,&pps->type_of_scaling_list_used[2]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[2],(mfxU8*) pps->ScalingLists4x4[1].ScalingListCoeffs); - pps->type_of_scaling_list_used[2] = SCLDEFAULT; - } - // 3 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[3],(mfxU8*)default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[3]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[3],(mfxU8*) default_inter_scaling_list4x4); - pps->type_of_scaling_list_used[3] = SCLDEFAULT; - } - // 4 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[4],(mfxU8*) default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[4]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[4],(mfxU8*) pps->ScalingLists4x4[3].ScalingListCoeffs); - pps->type_of_scaling_list_used[4] = SCLDEFAULT; - } - // 5 - if(Get1Bit()) - { - GetScalingList4x4(&pps->ScalingLists4x4[5],(mfxU8*) default_inter_scaling_list4x4,&pps->type_of_scaling_list_used[5]); - } - else - { - FillScalingList4x4(&pps->ScalingLists4x4[5],(mfxU8*) pps->ScalingLists4x4[4].ScalingListCoeffs); - pps->type_of_scaling_list_used[5] = SCLDEFAULT; - } - - if (pps->transform_8x8_mode_flag) - { - // 0 - if(Get1Bit()) - { - GetScalingList8x8(&pps->ScalingLists8x8[0],(mfxU8*)default_intra_scaling_list8x8,&pps->type_of_scaling_list_used[6]); - } - else - { - FillScalingList8x8(&pps->ScalingLists8x8[0],(mfxU8*) default_intra_scaling_list8x8); - pps->type_of_scaling_list_used[6] = SCLDEFAULT; - } - // 1 - if(Get1Bit()) - { - GetScalingList8x8(&pps->ScalingLists8x8[1],(mfxU8*) default_inter_scaling_list8x8,&pps->type_of_scaling_list_used[7]); - } - else - { - FillScalingList8x8(&pps->ScalingLists8x8[1],(mfxU8*) default_inter_scaling_list8x8); - pps->type_of_scaling_list_used[7] = SCLDEFAULT; - } - } - } - else - { - mfxI32 i; - for(i=0; i<6; i++) - { - FillScalingList4x4(&pps->ScalingLists4x4[i],(mfxU8 *)sps->ScalingLists4x4[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - - if (pps->transform_8x8_mode_flag) - { - for(i=0; i<2; i++) - { - FillScalingList8x8(&pps->ScalingLists8x8[i],(mfxU8 *)sps->ScalingLists8x8[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - } - } - } - pps->chroma_qp_index_offset[1] = (mfxI8)GetVLCElement(true); - } - else - { - pps->chroma_qp_index_offset[1] = pps->chroma_qp_index_offset[0]; - mfxI32 i; - for(i=0; i<6; i++) - { - FillScalingList4x4(&pps->ScalingLists4x4[i],(mfxU8 *)sps->ScalingLists4x4[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - - if (pps->transform_8x8_mode_flag) - { - for(i=0; i<2; i++) - { - FillScalingList8x8(&pps->ScalingLists8x8[i],(mfxU8 *)sps->ScalingLists8x8[i].ScalingListCoeffs); - pps->type_of_scaling_list_used[i] = sps->type_of_scaling_list_used[i]; - } - } - } - // calculate level scale matrices - - //start DC first - //to do: reduce the number of matrices (in fact 1 is enough) - mfxI32 i; - // now process other 4x4 matrices - for (i = 0; i < 6; i++) - { - for (mfxI32 j = 0; j < 88; j++) - for (mfxI32 k = 0; k < 16; k++) - { - mfxU32 level_scale = pps->ScalingLists4x4[i].ScalingListCoeffs[k]*pre_norm_adjust4x4[j%6][pre_norm_adjust_index4x4[k]]; - pps->m_LevelScale4x4[i].LevelScaleCoeffs[j][k] = (mfxI16) level_scale; - } - } - - // process remaining 8x8 matrices - for (i = 0; i < 2; i++) - { - for (mfxI32 j = 0; j < 88; j++) - for (mfxI32 k = 0; k < 64; k++) - { - - mfxU32 level_scale = pps->ScalingLists8x8[i].ScalingListCoeffs[k]*pre_norm_adjust8x8[j%6][pre_norm_adjust_index8x8[k]]; - pps->m_LevelScale8x8[i].LevelScaleCoeffs[j][k] = (mfxI16) level_scale; - - } - } - - return MFX_ERR_NONE; -} // GetPictureParamSet - -mfxStatus AVCHeadersBitstream::GetNalUnitPrefix(AVCNalExtension *pExt, mfxU32 ) -{ - mfxStatus ps = MFX_ERR_NONE; - - ps = GetNalUnitExtension(pExt); - - if (ps != MFX_ERR_NONE || !pExt->svc_extension_flag) - return ps; - - return ps; -} - -mfxStatus AVCHeadersBitstream::GetNalUnitExtension(AVCNalExtension *pExt) -{ - pExt->extension_present = 1; - - // decode the type of the extension - pExt->svc_extension_flag = (mfxU8) GetBits(1); - - // decode SVC extension - if (pExt->svc_extension_flag) - { - pExt->svc.idr_flag = (mfxU8) Get1Bit(); - pExt->svc.priority_id = (mfxU8) GetBits(6); - pExt->svc.no_inter_layer_pred_flag = (mfxU8) Get1Bit(); - pExt->svc.dependency_id = (mfxU8) GetBits(3); - pExt->svc.quality_id = (mfxU8) GetBits(4); - pExt->svc.temporal_id = (mfxU8) GetBits(3); - pExt->svc.use_ref_base_pic_flag = (mfxU8) Get1Bit(); - pExt->svc.discardable_flag = (mfxU8) Get1Bit(); - pExt->svc.output_flag = (mfxU8) Get1Bit(); - GetBits(2); - } - // decode MVC extension - else - { - pExt->mvc.non_idr_flag = (mfxU8) Get1Bit(); - pExt->mvc.priority_id = (mfxU16) GetBits(6); - pExt->mvc.view_id = (mfxU16) GetBits(10); - pExt->mvc.temporal_id = (mfxU8) GetBits(3); - pExt->mvc.anchor_pic_flag = (mfxU8) Get1Bit(); - pExt->mvc.inter_view_flag = (mfxU8) Get1Bit(); - GetBits(1); - } - - return MFX_ERR_NONE; - -} - -// --------------------------------------------------------------------------- -// Read H.264 first part of slice header -// -// Reading the rest of the header requires info in the picture and sequence -// parameter sets referred to by this slice header. -// -// Do not print debug messages when IsSearch is true. In that case the function -// is being used to find the next compressed frame, errors may occur and should -// not be reported. -// -// --------------------------------------------------------------------------- -mfxStatus AVCHeadersBitstream::GetSliceHeaderPart1(AVCSliceHeader *hdr) -{ - mfxU32 val; - - // decode NAL extension - if (NAL_UT_CODED_SLICE_EXTENSION == hdr->nal_unit_type) - { - GetNalUnitExtension(&hdr->nal_ext); - - // set the IDR flag - if (hdr->nal_ext.svc_extension_flag) - { - hdr->IdrPicFlag = hdr->nal_ext.svc.idr_flag; - } - else - { - hdr->view_id = hdr->nal_ext.mvc.view_id; - hdr->IdrPicFlag = hdr->nal_ext.mvc.non_idr_flag ^ 1; - } - } - else - { - hdr->IdrPicFlag = (NAL_UT_IDR_SLICE == hdr->nal_unit_type) ? (1) : (0); - hdr->nal_ext.mvc.anchor_pic_flag = (mfxU8) hdr->IdrPicFlag ? 1 : 0; - hdr->nal_ext.mvc.inter_view_flag = (mfxU8) 1; - } - - hdr->first_mb_in_slice = GetVLCElement(false); - if (0 > hdr->first_mb_in_slice) // upper bound is checked in AVCSlice - return MFX_ERR_UNDEFINED_BEHAVIOR; - - // slice type - val = GetVLCElement(false); - if (val > S_INTRASLICE) - { - if (val > S_INTRASLICE + S_INTRASLICE + 1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - else - { - // Slice type is specifying type of not only this but all remaining - // slices in the picture. Since slice type is always present, this bit - // of info is not used in our implementation. Adjust (just shift range) - // and return type without this extra info. - val -= (S_INTRASLICE + 1); - } - } - - if (val > INTRASLICE) // all other doesn't support - return MFX_ERR_UNDEFINED_BEHAVIOR; - - hdr->slice_type = (EnumSliceCodType)val; - - mfxU32 pic_parameter_set_id = GetVLCElement(false); - hdr->pic_parameter_set_id = (mfxU16)pic_parameter_set_id; - if (pic_parameter_set_id > MAX_NUM_PIC_PARAM_SETS - 1) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - return MFX_ERR_NONE; -} // mfxStatus GetSliceHeaderPart1(AVCSliceHeader *pSliceHeader) - -mfxStatus AVCHeadersBitstream::GetSliceHeaderPart2( - AVCSliceHeader *hdr, // slice header read goes here - const AVCPicParamSet *pps, - const AVCSeqParamSet *sps) // from slice header NAL unit -{ - hdr->frame_num = GetBits(sps->log2_max_frame_num); - - hdr->bottom_field_flag = 0; - if (sps->frame_mbs_only_flag == 0) - { - hdr->field_pic_flag = (mfxU8)Get1Bit(); - hdr->MbaffFrameFlag = !hdr->field_pic_flag && sps->mb_adaptive_frame_field_flag; - if (hdr->field_pic_flag != 0) - { - hdr->bottom_field_flag = (mfxU8)Get1Bit(); - } - } - - // correct frst_mb_in_slice in order to handle MBAFF - if (hdr->MbaffFrameFlag && hdr->first_mb_in_slice) - hdr->first_mb_in_slice <<= 1; - - if (hdr->IdrPicFlag) - { - mfxI32 pic_id = hdr->idr_pic_id = GetVLCElement(false); - if (pic_id < 0 || pic_id > 65535) - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - if (sps->pic_order_cnt_type == 0) - { - hdr->pic_order_cnt_lsb = GetBits(sps->log2_max_pic_order_cnt_lsb); - if (pps->pic_order_present_flag && (!hdr->field_pic_flag)) - hdr->delta_pic_order_cnt_bottom = GetVLCElement(true); - } - - if ((sps->pic_order_cnt_type == 1) && (sps->delta_pic_order_always_zero_flag == 0)) - { - hdr->delta_pic_order_cnt[0] = GetVLCElement(true); - if (pps->pic_order_present_flag && (!hdr->field_pic_flag)) - hdr->delta_pic_order_cnt[1] = GetVLCElement(true); - } - - if (pps->redundant_pic_cnt_present_flag) - { - // redundant pic count - hdr->redundant_pic_cnt = GetVLCElement(false); - if (hdr->redundant_pic_cnt > 127) - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - return MFX_ERR_NONE; -} - -// --------------------------------------------------------------------------- -// Read H.264 second part of slice header -// -// Do not print debug messages when IsSearch is true. In that case the function -// is being used to find the next compressed frame, errors may occur and should -// not be reported. -// --------------------------------------------------------------------------- - -mfxStatus AVCHeadersBitstream::GetSliceHeaderPart3( - AVCSliceHeader *hdr, // slice header read goes here - PredWeightTable *pPredWeight_L0, // L0 weight table goes here - PredWeightTable *pPredWeight_L1, // L1 weight table goes here - RefPicListReorderInfo *pReorderInfo_L0, - RefPicListReorderInfo *pReorderInfo_L1, - AdaptiveMarkingInfo *pAdaptiveMarkingInfo, - const AVCPicParamSet *pps, - const AVCSeqParamSet *sps, - mfxU8 NALRef_idc) // from slice header NAL unit -{ - mfxU8 ref_pic_list_reordering_flag_l0 = 0; - mfxU8 ref_pic_list_reordering_flag_l1 = 0; - - if (BPREDSLICE == hdr->slice_type) - { - // direct mode prediction method - hdr->direct_spatial_mv_pred_flag = (mfxU8)Get1Bit(); - } - - if (PREDSLICE == hdr->slice_type || - S_PREDSLICE == hdr->slice_type || - BPREDSLICE == hdr->slice_type) - { - hdr->num_ref_idx_active_override_flag = (mfxU8)Get1Bit(); - if (hdr->num_ref_idx_active_override_flag != 0) - // ref idx active l0 and l1 - { - hdr->num_ref_idx_l0_active = GetVLCElement(false) + 1; - if (BPREDSLICE == hdr->slice_type) - hdr->num_ref_idx_l1_active = GetVLCElement(false) + 1; - } - else - { - // no overide, use num active from pic param set - hdr->num_ref_idx_l0_active = pps->num_ref_idx_l0_active; - if (BPREDSLICE == hdr->slice_type) - hdr->num_ref_idx_l1_active = pps->num_ref_idx_l1_active; - else - hdr->num_ref_idx_l1_active = 0; - } - } // ref idx override - - if (hdr->num_ref_idx_l1_active > MAX_NUM_REF_FRAMES || hdr->num_ref_idx_l0_active > MAX_NUM_REF_FRAMES) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - if (hdr->slice_type != INTRASLICE && hdr->slice_type != S_INTRASLICE) - { - mfxU32 reordering_of_pic_nums_idc; - mfxU32 reorder_idx; - - // Reference picture list reordering - ref_pic_list_reordering_flag_l0 = (mfxU8)Get1Bit(); - if (ref_pic_list_reordering_flag_l0) - { - bool bOk = true; - - reorder_idx = 0; - reordering_of_pic_nums_idc = 0; - - // Get reorder idc,pic_num pairs until idc==3 - while (bOk) - { - reordering_of_pic_nums_idc = (mfxU8)GetVLCElement(false); - if (reordering_of_pic_nums_idc > 5) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - if (reordering_of_pic_nums_idc == 3) - break; - - if (reorder_idx >= MAX_NUM_REF_FRAMES) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - pReorderInfo_L0->reordering_of_pic_nums_idc[reorder_idx] = - (mfxU8)reordering_of_pic_nums_idc; - pReorderInfo_L0->reorder_value[reorder_idx] = - GetVLCElement(false); - if (reordering_of_pic_nums_idc != 2) - // abs_diff_pic_num is coded minus 1 - pReorderInfo_L0->reorder_value[reorder_idx]++; - reorder_idx++; - } // while - - pReorderInfo_L0->num_entries = reorder_idx; - } // L0 reordering info - else - pReorderInfo_L0->num_entries = 0; - - if (BPREDSLICE == hdr->slice_type) - { - ref_pic_list_reordering_flag_l1 = (mfxU8)Get1Bit(); - if (ref_pic_list_reordering_flag_l1) - { - bool bOk = true; - - // Get reorder idc,pic_num pairs until idc==3 - reorder_idx = 0; - reordering_of_pic_nums_idc = 0; - while (bOk) - { - reordering_of_pic_nums_idc = GetVLCElement(false); - if (reordering_of_pic_nums_idc > 5) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - if (reordering_of_pic_nums_idc == 3) - break; - - if (reorder_idx >= MAX_NUM_REF_FRAMES) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - pReorderInfo_L1->reordering_of_pic_nums_idc[reorder_idx] = - (mfxU8)reordering_of_pic_nums_idc; - pReorderInfo_L1->reorder_value[reorder_idx] = - GetVLCElement(false); - if (reordering_of_pic_nums_idc != 2) - // abs_diff_pic_num is coded minus 1 - pReorderInfo_L1->reorder_value[reorder_idx]++; - reorder_idx++; - } // while - pReorderInfo_L1->num_entries = reorder_idx; - } // L1 reordering info - else - pReorderInfo_L1->num_entries = 0; - - } // B slice - } // reordering info - - // prediction weight table - if ( (pps->weighted_pred_flag && - ((PREDSLICE == hdr->slice_type) || (S_PREDSLICE == hdr->slice_type))) || - ((pps->weighted_bipred_idc == 1) && (BPREDSLICE == hdr->slice_type))) - { - hdr->luma_log2_weight_denom = (mfxU8)GetVLCElement(false); - if (sps->chroma_format_idc != 0) - hdr->chroma_log2_weight_denom = (mfxU8)GetVLCElement(false); - - for (mfxI32 refindex = 0; refindex < hdr->num_ref_idx_l0_active; refindex++) - { - pPredWeight_L0[refindex].luma_weight_flag = (mfxU8)Get1Bit(); - if (pPredWeight_L0[refindex].luma_weight_flag) - { - pPredWeight_L0[refindex].luma_weight = (mfxI8)GetVLCElement(true); - pPredWeight_L0[refindex].luma_offset = (mfxI8)GetVLCElement(true); - } - else - { - pPredWeight_L0[refindex].luma_weight = (mfxI8)(1 << hdr->luma_log2_weight_denom); - pPredWeight_L0[refindex].luma_offset = 0; - } - - if (sps->chroma_format_idc != 0) - { - pPredWeight_L0[refindex].chroma_weight_flag = (mfxU8)Get1Bit(); - if (pPredWeight_L0[refindex].chroma_weight_flag) - { - pPredWeight_L0[refindex].chroma_weight[0] = (mfxI8)GetVLCElement(true); - pPredWeight_L0[refindex].chroma_offset[0] = (mfxI8)GetVLCElement(true); - pPredWeight_L0[refindex].chroma_weight[1] = (mfxI8)GetVLCElement(true); - pPredWeight_L0[refindex].chroma_offset[1] = (mfxI8)GetVLCElement(true); - } - else - { - pPredWeight_L0[refindex].chroma_weight[0] = (mfxI8)(1 << hdr->chroma_log2_weight_denom); - pPredWeight_L0[refindex].chroma_weight[1] = (mfxI8)(1 << hdr->chroma_log2_weight_denom); - pPredWeight_L0[refindex].chroma_offset[0] = 0; - pPredWeight_L0[refindex].chroma_offset[1] = 0; - } - } - } - - if (BPREDSLICE == hdr->slice_type) - { - for (mfxI32 refindex = 0; refindex < hdr->num_ref_idx_l1_active; refindex++) - { - pPredWeight_L1[refindex].luma_weight_flag = (mfxU8)Get1Bit(); - if (pPredWeight_L1[refindex].luma_weight_flag) - { - pPredWeight_L1[refindex].luma_weight = (mfxI8)GetVLCElement(true); - pPredWeight_L1[refindex].luma_offset = (mfxI8)GetVLCElement(true); - } - else - { - pPredWeight_L1[refindex].luma_weight = (mfxI8)(1 << hdr->luma_log2_weight_denom); - pPredWeight_L1[refindex].luma_offset = 0; - } - - if (sps->chroma_format_idc != 0) - { - pPredWeight_L1[refindex].chroma_weight_flag = (mfxU8)Get1Bit(); - if (pPredWeight_L1[refindex].chroma_weight_flag) - { - pPredWeight_L1[refindex].chroma_weight[0] = (mfxI8)GetVLCElement(true); - pPredWeight_L1[refindex].chroma_offset[0] = (mfxI8)GetVLCElement(true); - pPredWeight_L1[refindex].chroma_weight[1] = (mfxI8)GetVLCElement(true); - pPredWeight_L1[refindex].chroma_offset[1] = (mfxI8)GetVLCElement(true); - } - else - { - pPredWeight_L1[refindex].chroma_weight[0] = (mfxI8)(1 << hdr->chroma_log2_weight_denom); - pPredWeight_L1[refindex].chroma_weight[1] = (mfxI8)(1 << hdr->chroma_log2_weight_denom); - pPredWeight_L1[refindex].chroma_offset[0] = 0; - pPredWeight_L1[refindex].chroma_offset[1] = 0; - } - } - } - } // B slice - } // prediction weight table - else - { - hdr->luma_log2_weight_denom = 0; - hdr->chroma_log2_weight_denom = 0; - } - - // dec_ref_pic_marking - pAdaptiveMarkingInfo->num_entries = 0; - - if (NALRef_idc) - { - if (hdr->IdrPicFlag) - { - hdr->no_output_of_prior_pics_flag = (mfxU8)Get1Bit(); - hdr->long_term_reference_flag = (mfxU8)Get1Bit(); - } - else - { - mfxU32 memory_management_control_operation; - mfxU32 num_entries = 0; - - hdr->adaptive_ref_pic_marking_mode_flag = (mfxU8)Get1Bit(); - while (hdr->adaptive_ref_pic_marking_mode_flag != 0) - { - memory_management_control_operation = (mfxU8)GetVLCElement(false); - if (memory_management_control_operation == 0) - break; - - if (memory_management_control_operation > 6) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - pAdaptiveMarkingInfo->mmco[num_entries] = - (mfxU8)memory_management_control_operation; - if (memory_management_control_operation != 5) - pAdaptiveMarkingInfo->value[num_entries*2] = - GetVLCElement(false); - // Only mmco 3 requires 2 values - if (memory_management_control_operation == 3) - pAdaptiveMarkingInfo->value[num_entries*2+1] = - GetVLCElement(false); - num_entries++; - if (num_entries >= MAX_NUM_REF_FRAMES) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } // while - pAdaptiveMarkingInfo->num_entries = num_entries; - } - } // def_ref_pic_marking - - if (pps->entropy_coding_mode == 1 && // CABAC - (hdr->slice_type != INTRASLICE && hdr->slice_type != S_INTRASLICE)) - hdr->cabac_init_idc = GetVLCElement(false); - else - hdr->cabac_init_idc = 0; - - if (hdr->cabac_init_idc > 2) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - hdr->slice_qp_delta = GetVLCElement(true); - - if (S_PREDSLICE == hdr->slice_type || - S_INTRASLICE == hdr->slice_type) - { - if (S_PREDSLICE == hdr->slice_type) - hdr->sp_for_switch_flag = (mfxU8)Get1Bit(); - hdr->slice_qs_delta = GetVLCElement(true); - } - - if (pps->deblocking_filter_variables_present_flag != 0) - { - // deblock filter flag and offsets - hdr->disable_deblocking_filter_idc = GetVLCElement(false); - if (hdr->disable_deblocking_filter_idc > 2) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - if (hdr->disable_deblocking_filter_idc != 1) - { - hdr->slice_alpha_c0_offset = GetVLCElement(true)<<1; - hdr->slice_beta_offset = GetVLCElement(true)<<1; - - if (hdr->slice_alpha_c0_offset < -12 || hdr->slice_alpha_c0_offset > 12) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - if (hdr->slice_beta_offset < -12 || hdr->slice_beta_offset > 12) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - else - { - // set filter offsets to max values to disable filter - hdr->slice_alpha_c0_offset = (mfxI8)(0 - AVC_QP_MAX); - hdr->slice_beta_offset = (mfxI8)(0 - AVC_QP_MAX); - } - } - - if (pps->num_slice_groups > 1 && - pps->SliceGroupInfo.slice_group_map_type >= 3 && - pps->SliceGroupInfo.slice_group_map_type <= 5) - { - mfxU32 num_bits; // number of bits used to code slice_group_change_cycle - mfxU32 val; - mfxU32 pic_size_in_map_units; - mfxU32 max_slice_group_change_cycle=0; - - // num_bits is Ceil(log2(picsizeinmapunits/slicegroupchangerate + 1)) - pic_size_in_map_units = sps->frame_width_in_mbs * sps->frame_height_in_mbs; - - max_slice_group_change_cycle = pic_size_in_map_units / - pps->SliceGroupInfo.t2.slice_group_change_rate; - if (pic_size_in_map_units % - pps->SliceGroupInfo.t2.slice_group_change_rate) - max_slice_group_change_cycle++; - - val = max_slice_group_change_cycle; - num_bits = 0; - while (val) - { - num_bits++; - val >>= 1; - } - hdr->slice_group_change_cycle = GetBits(num_bits); - } - - return MFX_ERR_NONE; -} // GetSliceHeaderPart3() - -void AVCHeadersBitstream::GetScalingList4x4(AVCScalingList4x4 *scl, mfxU8 *def, mfxU8 *scl_type) -{ - mfxU32 lastScale = 8; - mfxU32 nextScale = 8; - bool DefaultMatrix = false; - mfxI32 j; - - for (j = 0; j < 16; j++ ) - { - if (nextScale != 0) - { - mfxI32 delta_scale = GetVLCElement(true); - if (delta_scale < -128 || delta_scale > 127) - throw AVC_exception(MFX_ERR_UNDEFINED_BEHAVIOR); - nextScale = ( lastScale + delta_scale + 256 ) & 0xff; - DefaultMatrix = ( j == 0 && nextScale == 0 ); - } - scl->ScalingListCoeffs[ mp_scan4x4[0][j] ] = ( nextScale == 0 ) ? (mfxU8)lastScale : (mfxU8)nextScale; - lastScale = scl->ScalingListCoeffs[ mp_scan4x4[0][j] ]; - } - if (!DefaultMatrix) - { - *scl_type = SCLREDEFINED; - return; - } - *scl_type= SCLDEFAULT; - FillScalingList4x4(scl,def); - return; -} - -void AVCHeadersBitstream::GetScalingList8x8(AVCScalingList8x8 *scl, mfxU8 *def, mfxU8 *scl_type) -{ - mfxU32 lastScale = 8; - mfxU32 nextScale = 8; - bool DefaultMatrix=false; - mfxI32 j; - - for (j = 0; j < 64; j++ ) - { - if (nextScale != 0) - { - mfxI32 delta_scale = GetVLCElement(true); - if (delta_scale < -128 || delta_scale > 127) - throw AVC_exception(MFX_ERR_UNDEFINED_BEHAVIOR); - nextScale = ( lastScale + delta_scale + 256 ) & 0xff; - DefaultMatrix = ( j == 0 && nextScale == 0 ); - } - scl->ScalingListCoeffs[ hp_scan8x8[0][j] ] = ( nextScale == 0 ) ? (mfxU8)lastScale : (mfxU8)nextScale; - lastScale = scl->ScalingListCoeffs[ hp_scan8x8[0][j] ]; - } - if (!DefaultMatrix) - { - *scl_type=SCLREDEFINED; - return; - } - *scl_type= SCLDEFAULT; - FillScalingList8x8(scl,def); - return; - -} - -void SetDefaultScalingLists(AVCSeqParamSet * sps) -{ - mfxI32 i; - - for (i = 0; i < 6; i += 1) - { - FillFlatScalingList4x4(&sps->ScalingLists4x4[i]); - } - for (i = 0; i < 2; i += 1) - { - FillFlatScalingList8x8(&sps->ScalingLists8x8[i]); - } -} - -mfxStatus DecodeExpGolombOne(mfxU32 **ppBitStream, mfxI32 *pBitOffset, - mfxI32 *pDst, - mfxI32 isSigned) -{ - mfxU32 code; - mfxU32 info = 0; - mfxI32 length = 1; /* for first bit read above*/ - mfxU32 thisChunksLength = 0; - mfxU32 sval; - - /* Fast check for element = 0 */ - avcGetNBits((*ppBitStream), (*pBitOffset), 1, code); - if (code) - { - *pDst = 0; - return MFX_ERR_NONE; - } - - avcGetNBits((*ppBitStream), (*pBitOffset), 8, code); - length += 8; - - /* find nonzero byte */ - while (code == 0) - { - avcGetNBits((*ppBitStream), (*pBitOffset), 8, code); - length += 8; - } - - /* find leading '1' */ - while ((code & 0x80) == 0) - { - code <<= 1; - thisChunksLength++; - } - length -= 8 - thisChunksLength; - - avcUngetNBits((*ppBitStream), (*pBitOffset), 8 - (thisChunksLength + 1)); - - /* Get info portion of codeword */ - if (length) - { - avcGetNBits((*ppBitStream), (*pBitOffset),length, info); - } - - sval = (1 << length) + info - 1; - if (isSigned) - { - if (sval & 1) - *pDst = (mfxI32) ((sval + 1) >> 1); - else - *pDst = -((mfxI32) (sval >> 1)); - } - else - *pDst = (mfxI32) sval; - - return MFX_ERR_NONE; -} - -mfxI32 AVCHeadersBitstream::GetSEI(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl) -{ - mfxU32 code; - mfxI32 payloadType = 0; - - avcNextBits(m_pbs, m_bitOffset, 8, code); - while (code == 0xFF) - { - /* fixed-pattern bit string using 8 bits written equal to 0xFF */ - avcGetNBits(m_pbs, m_bitOffset, 8, code); - payloadType += 255; - avcNextBits(m_pbs, m_bitOffset, 8, code); - } - - mfxI32 last_payload_type_byte; //Ipp32u integer using 8 bits - avcGetNBits(m_pbs, m_bitOffset, 8, last_payload_type_byte); - - payloadType += last_payload_type_byte; - - mfxI32 payloadSize = 0; - - avcNextBits(m_pbs, m_bitOffset, 8, code); - while( code == 0xFF ) - { - /* fixed-pattern bit string using 8 bits written equal to 0xFF */ - avcGetNBits(m_pbs, m_bitOffset, 8, code); - payloadSize += 255; - avcNextBits(m_pbs, m_bitOffset, 8, code); - } - - mfxI32 last_payload_size_byte; //Ipp32u integer using 8 bits - - avcGetNBits(m_pbs, m_bitOffset, 8, last_payload_size_byte); - payloadSize += last_payload_size_byte; - spl->Reset(); - spl->payLoadSize = payloadSize; - - if (payloadType < 0 || payloadType > SEI_RESERVED) - payloadType = SEI_RESERVED; - - spl->payLoadType = (SEI_TYPE)payloadType; - - if (spl->payLoadSize > BytesLeft()) - { - throw AVC_exception(MFX_ERR_UNDEFINED_BEHAVIOR); - } - - mfxU32 * pbs; - mfxU32 bitOffsetU; - mfxI32 bitOffset; - - pbs = m_pbs; - bitOffsetU = m_bitOffset; - bitOffset = bitOffsetU; - - mfxI32 ret = GetSEIPayload(sps, current_sps, spl); - - for (mfxU32 i = 0; i < spl->payLoadSize; i++) - { - avcSkipNBits(pbs, bitOffset, 8); - } - - m_pbs = pbs; - m_bitOffset = bitOffset; - - return ret; -} - -mfxI32 AVCHeadersBitstream::GetSEIPayload(const HeaderSet & sps, mfxI32 current_sps, AVCSEIPayLoad *spl) -{ - switch (spl->payLoadType) - { - case SEI_RECOVERY_POINT_TYPE: - return recovery_point(sps,current_sps,spl); - default: - return reserved_sei_message(sps,current_sps,spl); - } -} - -mfxI32 AVCHeadersBitstream::reserved_sei_message(const HeaderSet & , mfxI32 current_sps, AVCSEIPayLoad *spl) -{ - for (mfxU32 i = 0; i < spl->payLoadSize; i++) - avcSkipNBits(m_pbs, m_bitOffset, 8) - AlignPointerRight(); - return current_sps; -} - -mfxI32 AVCHeadersBitstream::recovery_point(const HeaderSet & , mfxI32 current_sps, AVCSEIPayLoad *spl) -{ - AVCSEIPayLoad::SEIMessages::RecoveryPoint * recPoint = &(spl->SEI_messages.recovery_point); - - recPoint->recovery_frame_cnt = (mfxU8)GetVLCElement(false); - - recPoint->exact_match_flag = (mfxU8)Get1Bit(); - recPoint->broken_link_flag = (mfxU8)Get1Bit(); - recPoint->changing_slice_group_idc = (mfxU8)GetBits(2); - - if (recPoint->changing_slice_group_idc > 2) - return -1; - - return current_sps; -} - -void HeapObject::Free() -{ -} - -} // namespace ProtectedLibrary diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_nal_spl.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_nal_spl.cpp deleted file mode 100644 index 918726f6..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_nal_spl.cpp +++ /dev/null @@ -1,533 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "sample_defs.h" -#include "avc_structures.h" -#include "avc_nal_spl.h" - -namespace ProtectedLibrary -{ - -static const mfxU32 MFX_TIME_STAMP_FREQUENCY = 90000; // will go to mfxdefs.h -static const mfxU64 MFX_TIME_STAMP_INVALID = (mfxU64)-1; // will go to mfxdefs.h - -inline -mfxF64 GetUmcTimeStamp(mfxU64 ts) -{ - return ts == MFX_TIME_STAMP_INVALID ? -1.0 : ts / (mfxF64)MFX_TIME_STAMP_FREQUENCY; -} - -inline -mfxU64 GetMfxTimeStamp(mfxF64 ts) -{ - return ts < 0.0 ? MFX_TIME_STAMP_INVALID : (mfxU64)(ts * MFX_TIME_STAMP_FREQUENCY + .5); -} - -enum -{ - AVC_NAL_UNITTYPE_BITS_MASK = 0x1f -}; - - -inline bool IsHeaderCode(mfxI32 iCode) -{ - return (NAL_UT_SPS == (iCode & AVC_NAL_UNITTYPE_BITS_MASK)) || - (NAL_UT_SPS_EX == (iCode & AVC_NAL_UNITTYPE_BITS_MASK)) || - (NAL_UT_PPS == (iCode & AVC_NAL_UNITTYPE_BITS_MASK)); -} - -inline bool IsVLCCode(mfxI32 iCode) -{ - return ((NAL_UT_SLICE <= (iCode & AVC_NAL_UNITTYPE_BITS_MASK)) && - (NAL_UT_IDR_SLICE >= (iCode & AVC_NAL_UNITTYPE_BITS_MASK))) || - (NAL_UT_AUXILIARY == (iCode & AVC_NAL_UNITTYPE_BITS_MASK)); -} - -static mfxI32 FindStartCode(mfxU8 * (&pb), mfxU32 &nSize) -{ - // there is no data - if (nSize < 4) - return 0; - - // find start code - while ((4 <= nSize) && ((0 != pb[0]) || - (0 != pb[1]) || - (1 != pb[2]))) - { - pb += 1; - nSize -= 1; - } - - if (4 <= nSize) - return ((pb[0] << 24) | (pb[1] << 16) | (pb[2] << 8) | (pb[3])); - - return 0; - -} - -mfxStatus MoveBitstream(mfxBitstream * source, mfxI32 moveSize) -{ - if (!source) - return MFX_ERR_NULL_PTR; - - if (moveSize < 0 && (mfxI32)source->DataOffset + moveSize < 0) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - if (moveSize > 0 && source->DataLength < (mfxU32)moveSize) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - source->DataOffset += moveSize; - source->DataLength -= moveSize; - - return MFX_ERR_NONE; -} - -StartCodeIterator::StartCodeIterator() - : m_code(0) - , m_pts(MFX_TIME_STAMP_INVALID) - , m_pSource(0) - , m_nSourceSize(0) - , m_pSourceBase(0) - , m_nSourceBaseSize(0) - , m_suggestedSize(10 * 1024) -{ - Reset(); -} - -void StartCodeIterator::Reset() -{ - m_code = 0; - m_pts = MFX_TIME_STAMP_INVALID; - m_prev.clear(); -} - -mfxI32 StartCodeIterator::Init(mfxBitstream * source) -{ - Reset(); - - m_pSourceBase = m_pSource = source->Data + source->DataOffset; - m_nSourceBaseSize = m_nSourceSize = source->DataLength; - - mfxI32 iCode = ProtectedLibrary::FindStartCode(m_pSource, m_nSourceSize); - return iCode; -} - -void StartCodeIterator::SetSuggestedSize(mfxU32 size) -{ - if (size > m_suggestedSize) - m_suggestedSize = size; -} - -mfxI32 StartCodeIterator::CheckNalUnitType(mfxBitstream * source) -{ - if (!source) - return 0; - - if (!m_code) - m_prev.clear(); - - mfxU8 * src = source->Data + source->DataOffset; - mfxU32 size = source->DataLength; - - mfxI32 startCodeSize; - mfxI32 iCodeNext = FindStartCode(src, size, startCodeSize); - return iCodeNext; -} - -mfxI32 StartCodeIterator::GetNALUnit(mfxBitstream * src, mfxBitstream * dst) -{ - if (!src) - return EndOfStream(dst); - - if (!m_code) - m_prev.clear(); - - mfxU8 * source = src->Data + src->DataOffset; - mfxU32 size = src->DataLength; - - if (!size) - return 0; - - mfxI32 startCodeSize; - - mfxI32 iCodeNext = FindStartCode(source, size, startCodeSize); - - if (m_prev.size()) - { - if (!iCodeNext) - { - size_t sz = source - (src->Data + src->DataOffset); - if (m_prev.size() + sz > m_suggestedSize) - { - m_prev.clear(); - sz = std::min(sz, m_suggestedSize); - } - - m_prev.insert(m_prev.end(), src->Data + src->DataOffset, src->Data + src->DataOffset + sz); - MoveBitstream(src, (mfxI32)sz); - return 0; - } - - source -= startCodeSize; - m_prev.insert(m_prev.end(), src->Data + src->DataOffset, source); - MoveBitstream(src, (mfxI32)(source - (src->Data + src->DataOffset))); - - dst->Data = &(m_prev[0]); - dst->DataLength = (mfxU32)m_prev.size(); - dst->DataOffset = 0; - dst->TimeStamp = m_pts; - mfxI32 code = m_code; - m_code = 0; - m_pts = MFX_TIME_STAMP_INVALID; - return code; - } - - if (!iCodeNext) - { - MoveBitstream(src, (mfxI32)(source - (src->Data + src->DataOffset))); - return 0; - } - - m_pts = src->TimeStamp; - m_code = iCodeNext; - - // move before start code - MoveBitstream(src, (mfxI32)(source - (src->Data + src->DataOffset) - startCodeSize)); - - mfxI32 startCodeSize1; - iCodeNext = FindStartCode(source, size, startCodeSize1); - - MoveBitstream(src, startCodeSize); - - if (!iCodeNext && (src->DataFlag & MFX_BITSTREAM_COMPLETE_FRAME)) - { - iCodeNext = 1; - startCodeSize1 = 0; - } - - if (!iCodeNext) - { - if (m_prev.size()) // assertion: it should be - return 0; - - size_t sz = source - (src->Data + src->DataOffset); - if (sz > m_suggestedSize) - { - sz = m_suggestedSize; - } - - m_prev.insert(m_prev.end(), src->Data + src->DataOffset, src->Data + src->DataOffset + sz); - MoveBitstream(src, (mfxI32)sz); - return 0; - } - - // fill - size_t nal_size = source - (src->Data + src->DataOffset) - startCodeSize1; - - dst->Data = src->Data + src->DataOffset; - dst->DataLength = (mfxU32)nal_size; - dst->DataOffset = 0; - dst->TimeStamp = m_pts; - - MoveBitstream(src, (mfxI32)nal_size); - - mfxI32 code = m_code; - m_code = 0; - - m_pts = MFX_TIME_STAMP_INVALID; - return code; -} - -mfxI32 StartCodeIterator::EndOfStream(mfxBitstream * dst) -{ - if (!m_code) - { - m_prev.clear(); - return 0; - } - - if (m_prev.size()) - { - dst->Data = &(m_prev[0]); - dst->DataLength = (mfxU32)m_prev.size(); - dst->DataOffset = 0; - dst->TimeStamp = m_pts; - mfxI32 code = m_code; - m_code = 0; - m_pts = MFX_TIME_STAMP_INVALID; - return code; - } - - m_code = 0; - return 0; -} - -mfxI32 StartCodeIterator::FindStartCode(mfxU8 * (&pb), mfxU32 & size, mfxI32 & startCodeSize) -{ - mfxU32 zeroCount = 0; - - for (mfxU32 i = 0 ; i < (mfxU32)size; i++, pb++) - { - switch(pb[0]) - { - case 0x00: - zeroCount++; - break; - case 0x01: - if (zeroCount >= 2) - { - startCodeSize = std::min(zeroCount + 1, 4u); - size -= i + 1; - pb++; // remove 0x01 symbol - zeroCount = 0; - if (size >= 1) - { - return pb[0] & AVC_NAL_UNITTYPE_BITS_MASK; - } - else - { - pb -= startCodeSize; - size += startCodeSize; - startCodeSize = 0; - return 0; - } - } - zeroCount = 0; - break; - default: - zeroCount = 0; - break; - } - } - - zeroCount = std::min(zeroCount, 3u); - pb -= zeroCount; - size += zeroCount; - zeroCount = 0; - startCodeSize = 0; - return 0; -} - -void BytesSwapper::SwapMemory(mfxU8 *pDestination, mfxU32 &nDstSize, mfxU8 *pSource, mfxU32 nSrcSize) -{ - SwapMemoryAndRemovePreventingBytes(pDestination, nDstSize, pSource, nSrcSize); -} - -NALUnitSplitter::NALUnitSplitter() -{ - memset(&m_bitstream, 0, sizeof(m_bitstream)); -} - -NALUnitSplitter::~NALUnitSplitter() -{ - Release(); -} - -void NALUnitSplitter::Init() -{ - Release(); -} - -void NALUnitSplitter::Reset() -{ - m_pStartCodeIter.Reset(); -} - -void NALUnitSplitter::Release() -{ -} - -mfxI32 NALUnitSplitter::CheckNalUnitType(mfxBitstream * source) -{ - return m_pStartCodeIter.CheckNalUnitType(source); -} - -mfxI32 NALUnitSplitter::GetNalUnits(mfxBitstream * source, mfxBitstream * &destination) -{ - mfxI32 iCode = m_pStartCodeIter.GetNALUnit(source, &m_bitstream); - - if (iCode == 0) - { - destination = 0; - return 0; - } - - destination = &m_bitstream; - return iCode; -} - -/* temporal class definition */ -class H264DwordPointer_ -{ -public: - // Default constructor - H264DwordPointer_(void) - { - m_pDest = NULL; - m_nByteNum = 0; - m_iCur = 0; - } - - H264DwordPointer_ operator = (void *pDest) - { - m_pDest = (mfxU32 *) pDest; - m_nByteNum = 0; - m_iCur = 0; - - return *this; - } - - // Increment operator - H264DwordPointer_ &operator ++ (void) - { - if (4 == ++m_nByteNum) - { - *m_pDest = m_iCur; - m_pDest += 1; - m_nByteNum = 0; - m_iCur = 0; - } - else - m_iCur <<= 8; - - return *this; - } - - mfxU8 operator = (mfxU8 nByte) - { - m_iCur = (m_iCur & ~0x0ff) | ((mfxU32) nByte); - - return nByte; - } - -protected: - mfxU32 *m_pDest; // pointer to destination buffer - mfxU32 m_nByteNum; // number of current byte in dword - mfxU32 m_iCur; // current dword -}; - -class H264SourcePointer_ -{ -public: - // Default constructor - H264SourcePointer_(void) - { - m_pSource = NULL; - m_nRemovedBytes=0; - m_nZeros=0; - } - - H264SourcePointer_ &operator = (mfxU8 *pSource) - { - m_pSource = (mfxU8 *) pSource; - - m_nZeros = 0; - m_nRemovedBytes = 0; - - return *this; - } - - H264SourcePointer_ &operator ++ (void) - { - mfxU8 bCurByte = m_pSource[0]; - - if (0 == bCurByte) - m_nZeros += 1; - else - { - if ((3 == bCurByte) && (2 <= m_nZeros)) - m_nRemovedBytes += 1; - m_nZeros = 0; - } - - m_pSource += 1; - - return *this; - } - - bool IsPrevent(void) - { - if ((3 == m_pSource[0]) && (2 <= m_nZeros)) - return true; - else - return false; - } - - operator mfxU8 (void) - { - return m_pSource[0]; - } - - mfxU32 GetRemovedBytes(void) - { - return m_nRemovedBytes; - } - -protected: - mfxU8 *m_pSource; // pointer to destination buffer - mfxU32 m_nZeros; // number of preceding zeros - mfxU32 m_nRemovedBytes; // number of removed bytes -}; - -void SwapMemoryAndRemovePreventingBytes(mfxU8 *pDestination, mfxU32 &nDstSize, mfxU8 *pSource, mfxU32 nSrcSize) -{ - H264DwordPointer_ pDst; - H264SourcePointer_ pSrc; - size_t i; - - // DwordPointer object is swapping written bytes - // H264SourcePointer_ removes preventing start-code bytes - - // reset pointer(s) - pSrc = pSource; - pDst = pDestination; - - // first two bytes - i = 0; - while (i < std::min(2u, nSrcSize)) - { - pDst = (mfxU8) pSrc; - ++pDst; - ++pSrc; - ++i; - } - - // do swapping - while (i < (mfxU32) nSrcSize) - { - if (false == pSrc.IsPrevent()) - { - pDst = (mfxU8) pSrc; - ++pDst; - } - ++pSrc; - ++i; - } - - // write padding bytes - nDstSize = nSrcSize - pSrc.GetRemovedBytes(); - while (nDstSize & 3) - { - pDst = (mfxU8) (0); - ++nDstSize; - ++pDst; - } -} - -} // namespace ProtectedLibrary diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_spl.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_spl.cpp deleted file mode 100644 index 6a9f3c60..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/avc_spl.cpp +++ /dev/null @@ -1,815 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - - -#include -#include - -#include "avc_spl.h" -#include "sample_defs.h" - -namespace ProtectedLibrary -{ - -AVCFrameInfo::AVCFrameInfo() -{ - Reset(); -} - -void AVCFrameInfo::Reset() -{ - m_slice = 0; - m_index = 0; -} - -AVC_Spl::AVC_Spl() - : m_WaitForIDR(true) - , m_currentInfo(0) - , m_pLastSlice(0) - , m_lastNalUnit(0) -{ - Init(); -} - -AVC_Spl::~AVC_Spl() -{ - Close(); -} - -mfxStatus AVC_Spl::Init() -{ - Close(); - - m_pNALSplitter.reset(new NALUnitSplitter()); - m_pNALSplitter->Init(); - - m_WaitForIDR = true; - - m_AUInfo.reset(new AVCFrameInfo()); - - m_currentFrame.resize(BUFFER_SIZE); - - m_pLastSlice = 0; - m_lastNalUnit = 0; - m_currentInfo = 0; - - m_slices.resize(128); - memset(&m_frame, 0, sizeof(m_frame)); - m_frame.Data = &m_currentFrame[0]; - m_frame.Slice = &m_slices[0]; - - return MFX_ERR_NONE; -} - -void AVC_Spl::Close() -{ - m_pLastSlice = 0; - m_lastNalUnit = 0; - m_currentInfo = 0; -} - -mfxStatus AVC_Spl::Reset() -{ - m_pNALSplitter->Reset(); - m_WaitForIDR = true; - m_lastNalUnit = 0; - m_pLastSlice = 0; - m_currentInfo = 0; - return MFX_ERR_NONE; -} - -mfxU8 * AVC_Spl::GetMemoryForSwapping(mfxU32 size) -{ - if (m_swappingMemory.size() <= size + 8) - m_swappingMemory.resize(size + 8); - - return &(m_swappingMemory[0]); -} - -mfxStatus AVC_Spl::DecodeHeader(mfxBitstream * nalUnit) -{ - mfxStatus umcRes = MFX_ERR_NONE; - - AVCHeadersBitstream bitStream; - - try - { - mfxU32 swappingSize = nalUnit->DataLength; - mfxU8 * swappingMemory = GetMemoryForSwapping(swappingSize); - - BytesSwapper::SwapMemory(swappingMemory, swappingSize, nalUnit->Data + nalUnit->DataOffset, nalUnit->DataLength); - - bitStream.Reset(swappingMemory, swappingSize); - - NAL_Unit_Type uNALUnitType; - mfxU8 uNALStorageIDC; - - bitStream.GetNALUnitType(uNALUnitType, uNALStorageIDC); - - switch(uNALUnitType) - { - // sequence parameter set - case NAL_UT_SPS: - { - AVCSeqParamSet sps; - umcRes = bitStream.GetSequenceParamSet(&sps); - if (umcRes == MFX_ERR_NONE) - { - m_headers.m_SeqParams.GetHeader(sps.seq_parameter_set_id); - m_headers.m_SeqParams.AddHeader(&sps); - - // Validate the incoming bitstream's image dimensions. - m_headers.m_SeqParams.GetHeader(sps.seq_parameter_set_id); - - m_pNALSplitter->SetSuggestedSize(CalculateSuggestedSize(&sps)); - - if (umcRes != MFX_ERR_NONE) - return umcRes; - } - else - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - break; - - case NAL_UT_SPS_EX: - { - AVCSeqParamSetExtension sps_ex; - umcRes = bitStream.GetSequenceParamSetExtension(&sps_ex); - - if (umcRes == MFX_ERR_NONE) - { - m_headers.m_SeqExParams.AddHeader(&sps_ex); - } - else - return umcRes; - } - break; - - // picture parameter set - case NAL_UT_PPS: - { - AVCPicParamSet pps; - // set illegal id - pps.pic_parameter_set_id = MAX_NUM_PIC_PARAM_SETS; - - // Get id - umcRes = bitStream.GetPictureParamSetPart1(&pps); - if (MFX_ERR_NONE == umcRes) - { - AVCSeqParamSet *pRefsps = m_headers.m_SeqParams.GetHeader(pps.seq_parameter_set_id); - - if (!pRefsps || pRefsps ->seq_parameter_set_id >= MAX_NUM_SEQ_PARAM_SETS) - { - pRefsps = m_headers.m_SeqParamsMvcExt.GetHeader(pps.seq_parameter_set_id); - if (!pRefsps || pRefsps->seq_parameter_set_id >= MAX_NUM_SEQ_PARAM_SETS) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - - // Get rest of pic param set - umcRes = bitStream.GetPictureParamSetPart2(&pps, pRefsps); - if (MFX_ERR_NONE == umcRes) - { - m_headers.m_PicParams.AddHeader(&pps); - } - - m_headers.m_SeqParams.SetCurrentID(pps.seq_parameter_set_id); - } - } - break; - - // subset sequence parameter set - case NAL_UNIT_SUBSET_SPS: - { - AVCSeqParamSet sps; - umcRes = bitStream.GetSequenceParamSet(&sps); - if (MFX_ERR_NONE != umcRes) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - // decode additional parameters - if ((AVC_PROFILE_MULTIVIEW_HIGH == sps.profile_idc) || - (AVC_PROFILE_STEREO_HIGH == sps.profile_idc)) - { - AVCSeqParamSet spsMvcExt; - AVCSeqParamSet * sps_temp = &spsMvcExt; - - *sps_temp = sps; - - m_headers.m_SeqParamsMvcExt.AddHeader(&spsMvcExt); - } - } - break; - - // decode a prefix nal unit - case NAL_UNIT_PREFIX: - { - umcRes = bitStream.GetNalUnitPrefix(&m_headers.m_nalExtension, uNALStorageIDC); - if (MFX_ERR_NONE != umcRes) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - } - break; - - default: - break; - } - } - catch(const AVC_exception & ) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - catch(...) - { - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - - return MFX_ERR_NONE; -} - -mfxStatus AVC_Spl::DecodeSEI(mfxBitstream * nalUnit) -{ - if (m_headers.m_SeqParams.GetCurrrentID() == -1) - return MFX_ERR_NONE; - - AVCHeadersBitstream bitStream; - - try - { - mfxU32 swappingSize = nalUnit->DataLength; - mfxU8 * swappingMemory = GetMemoryForSwapping(swappingSize); - - BytesSwapper::SwapMemory(swappingMemory, swappingSize, nalUnit->Data + nalUnit->DataOffset, nalUnit->DataLength); - - bitStream.Reset(swappingMemory, swappingSize); - - NAL_Unit_Type uNALUnitType; - mfxU8 uNALStorageIDC; - - bitStream.GetNALUnitType(uNALUnitType, uNALStorageIDC); - - do - { - AVCSEIPayLoad m_SEIPayLoads; - - bitStream.GetSEI(m_headers.m_SeqParams, - m_headers.m_SeqParams.GetCurrrentID(), &m_SEIPayLoads); - - if (m_SEIPayLoads.payLoadType == SEI_RESERVED) - continue; - - m_headers.m_SEIParams.AddHeader(&m_SEIPayLoads); - } while (bitStream.More_RBSP_Data()); - - } catch(...) - { - // nothing to do just catch it - } - - return MFX_ERR_NONE; -} - -AVCSlice * AVC_Spl::DecodeSliceHeader(mfxBitstream * nalUnit) -{ - m_slicesStorage.push_back(AVCSlice()); - AVCSlice *pSlice = &m_slicesStorage.back(); - - mfxU32 swappingSize = nalUnit->DataLength; - mfxU8 * swappingMemory = GetMemoryForSwapping(swappingSize); - - BytesSwapper::SwapMemory(swappingMemory, swappingSize, nalUnit->Data + nalUnit->DataOffset, nalUnit->DataLength); - - mfxI32 pps_pid = pSlice->RetrievePicParamSetNumber(swappingMemory, swappingSize); - if (pps_pid == -1) - { - return 0; - } - - AVCSEIPayLoad * spl = m_headers.m_SEIParams.GetHeader(SEI_RECOVERY_POINT_TYPE); - - if (m_WaitForIDR) - { - if (pSlice->GetSliceHeader()->slice_type != INTRASLICE && !spl) - { - return 0; - } - } - - pSlice->m_picParamSet = m_headers.m_PicParams.GetHeader(pps_pid); - if (!pSlice->m_picParamSet) - { - return 0; - } - - mfxI32 seq_parameter_set_id = pSlice->m_picParamSet->seq_parameter_set_id; - - if (NAL_UT_CODED_SLICE_EXTENSION == pSlice->GetSliceHeader()->nal_unit_type) - { - pSlice->m_seqParamSet = pSlice->m_seqParamSetMvcEx = m_headers.m_SeqParamsMvcExt.GetHeader(seq_parameter_set_id); - - if (NULL == pSlice->m_seqParamSetMvcEx) - { - return 0; - } - - m_headers.m_SeqParamsMvcExt.SetCurrentID(pSlice->m_seqParamSetMvcEx->seq_parameter_set_id); - m_headers.m_PicParams.SetCurrentID(pSlice->m_picParamSet->pic_parameter_set_id); - } - else - { - pSlice->m_seqParamSetMvcEx = m_headers.m_SeqParamsMvcExt.GetCurrentHeader(); - pSlice->m_seqParamSet = m_headers.m_SeqParams.GetHeader(seq_parameter_set_id); - - m_headers.m_SeqParams.SetCurrentID(pSlice->m_picParamSet->seq_parameter_set_id); - m_headers.m_PicParams.SetCurrentID(pSlice->m_picParamSet->pic_parameter_set_id); - } - - pSlice->m_seqParamSetEx = m_headers.m_SeqExParams.GetHeader(seq_parameter_set_id); - pSlice->m_dTime = nalUnit->TimeStamp; - - if (!pSlice->DecodeHeader(swappingMemory, swappingSize)) - { - return 0; - } - - if (spl && (pSlice->GetSliceHeader()->slice_type != INTRASLICE)) - { - m_headers.m_SEIParams.RemoveHeader(spl->GetID()); - } - - m_WaitForIDR = false; - - return pSlice; -} - - -AVCFrameInfo * AVC_Spl::GetFreeFrame() -{ - return m_AUInfo.get(); -} - -void AVC_Spl::ResetCurrentState() -{ - m_frame.DataLength = 0; - m_frame.SliceNum = 0; - m_frame.FirstFieldSliceNum = 0; - m_AUInfo->Reset(); - if (m_slicesStorage.size() > 1) - { - m_slicesStorage.erase(m_slicesStorage.begin(), --m_slicesStorage.end()); - } -} - -bool AVC_Spl::IsFieldOfOneFrame(AVCFrameInfo * frame, const AVCSliceHeader * slice1, const AVCSliceHeader *slice2) -{ - if (frame && frame->m_index) - return false; - - if ((slice1->nal_ref_idc && !slice2->nal_ref_idc) || - (!slice1->nal_ref_idc && slice2->nal_ref_idc)) - return false; - - if (slice1->field_pic_flag != slice2->field_pic_flag) - return false; - - if (slice1->bottom_field_flag == slice2->bottom_field_flag) - return false; - - return true; -} - -inline bool IsSlicesOfOneAU(const AVCSliceHeader *pOne, const AVCSliceHeader *pTwo) -{ - if (!pOne || !pTwo) - return true; - - if (pOne->view_id != pTwo->view_id) - { - if (pOne->view_id < pTwo->view_id) - { - return true; - } - - return false; - } - - // this function checks two slices are from same picture or not - // 7.4.1.2.4 part of AVC standart - - if ((pOne->frame_num != pTwo->frame_num) || - (pOne->first_mb_in_slice == pTwo->first_mb_in_slice) || - (pOne->pic_parameter_set_id != pTwo->pic_parameter_set_id) || - (pOne->field_pic_flag != pTwo->field_pic_flag) || - (pOne->bottom_field_flag != pTwo->bottom_field_flag)) - return false; - - if ((pOne->nal_ref_idc != pTwo->nal_ref_idc) && - (0 == std::min(pOne->nal_ref_idc, pTwo->nal_ref_idc))) - return false; - - if ((pOne->pic_order_cnt_lsb != pTwo->pic_order_cnt_lsb) || - (pOne->delta_pic_order_cnt_bottom != pTwo->delta_pic_order_cnt_bottom)) - return false; - - if ((pOne->delta_pic_order_cnt[0] != pTwo->delta_pic_order_cnt[0]) || - (pOne->delta_pic_order_cnt[1] != pTwo->delta_pic_order_cnt[1])) - return false; - - if (pOne->nal_unit_type != pTwo->nal_unit_type) - { - if ((NAL_UT_IDR_SLICE == pOne->nal_unit_type) || - (NAL_UT_IDR_SLICE == pTwo->nal_unit_type)) - return false; - } - else if (NAL_UT_IDR_SLICE == pOne->nal_unit_type) - { - if (pOne->idr_pic_id != pTwo->idr_pic_id) - return false; - } - - return true; -} - - -mfxStatus AVC_Spl::AddSlice(AVCSlice * pSlice) -{ - m_pLastSlice = 0; - - if (!pSlice) - { - // complete current frame info - return MFX_ERR_NONE; - } - - if (m_currentInfo) - { - AVCSlice * pFirstFrameSlice = m_currentInfo->m_slice; - - if (pFirstFrameSlice && (false == IsSlicesOfOneAU(pFirstFrameSlice->GetSliceHeader(), pSlice->GetSliceHeader()))) - { - // complete frame - if (pSlice->IsField()) - { - if (IsFieldOfOneFrame(m_currentInfo, pFirstFrameSlice->GetSliceHeader(), pSlice->GetSliceHeader())) - { - m_currentInfo->m_index = 1; - m_currentInfo->m_slice = pSlice; - } - else - { - m_currentInfo->m_index = 0; - m_pLastSlice = pSlice; - return MFX_ERR_NONE; - } - } - else - { - m_currentInfo->m_index = 0; - m_pLastSlice = pSlice; - return MFX_ERR_NONE; - } - } - } - else - { - m_currentInfo = GetFreeFrame(); - if (!m_currentInfo) - { - m_pLastSlice = pSlice; - return MFX_ERR_NOT_ENOUGH_BUFFER; - } - m_currentInfo->m_index = 0; - } - - if (!m_currentInfo->m_slice) - m_currentInfo->m_slice = pSlice; - - return MFX_ERR_MORE_DATA; -} - -mfxStatus AVC_Spl::AddNalUnit(mfxBitstream * nalUnit) -{ - static mfxU8 start_code_prefix[] = {0, 0, 1}; - - if (m_frame.DataLength + nalUnit->DataLength + sizeof(start_code_prefix) >= BUFFER_SIZE) - return MFX_ERR_NOT_ENOUGH_BUFFER; - - MSDK_MEMCPY_BUF(m_frame.Data, m_frame.DataLength, BUFFER_SIZE, start_code_prefix, sizeof(start_code_prefix)); - MSDK_MEMCPY_BUF(m_frame.Data, m_frame.DataLength + sizeof(start_code_prefix), BUFFER_SIZE, nalUnit->Data + nalUnit->DataOffset, nalUnit->DataLength); - - m_frame.DataLength += (mfxU32)(nalUnit->DataLength + sizeof(start_code_prefix)); - - return MFX_ERR_NONE; -} - -mfxStatus AVC_Spl::AddSliceNalUnit(mfxBitstream * nalUnit, AVCSlice * slice) -{ - static mfxU8 start_code_prefix[] = {0, 0, 1}; - - mfxU32 sliceLength = (mfxU32)(nalUnit->DataLength + sizeof(start_code_prefix)); - - if (m_frame.DataLength + sliceLength >= BUFFER_SIZE) - return MFX_ERR_NOT_ENOUGH_BUFFER; - - MSDK_MEMCPY_BUF(m_frame.Data, m_frame.DataLength, BUFFER_SIZE, start_code_prefix, sizeof(start_code_prefix)); - MSDK_MEMCPY_BUF(m_frame.Data, m_frame.DataLength + sizeof(start_code_prefix), BUFFER_SIZE, nalUnit->Data + nalUnit->DataOffset, nalUnit->DataLength); - - if (!m_frame.SliceNum) - { - m_frame.TimeStamp = nalUnit->TimeStamp; - } - - m_frame.SliceNum++; - - if (m_slices.size() <= m_frame.SliceNum) - { - m_slices.resize(m_frame.SliceNum + 10); - m_frame.Slice = &m_slices[0]; - } - - SliceSplitterInfo & newSlice = m_slices[m_frame.SliceNum - 1]; - - AVCHeadersBitstream * bs = slice->GetBitStream(); - - newSlice.HeaderLength = (mfxU32)bs->BytesDecoded(); - - // add number of 003 sequence to HeaderLength - for(mfxU8 *ptr = nalUnit->Data + sizeof(start_code_prefix); ptr < nalUnit->Data + sizeof(start_code_prefix) + newSlice.HeaderLength; ptr++) - { - if (ptr[0]==0 && ptr[1]==0 && ptr[2]==3) - { - newSlice.HeaderLength++; - } - } - - newSlice.HeaderLength += sizeof(start_code_prefix) + 1; - - newSlice.DataLength = sliceLength; - newSlice.DataOffset = m_frame.DataLength; - if(IS_I_SLICE(slice->GetSliceHeader()->slice_type)) - newSlice.SliceType = TYPE_I; - else if(IS_P_SLICE(slice->GetSliceHeader()->slice_type)) - newSlice.SliceType = TYPE_P; - else if(IS_B_SLICE(slice->GetSliceHeader()->slice_type)) - newSlice.SliceType = TYPE_B; - - m_frame.DataLength += sliceLength; - - if (!m_currentInfo->m_index) - m_frame.FirstFieldSliceNum++; - - return MFX_ERR_NONE; -} - -mfxStatus AVC_Spl::ProcessNalUnit(mfxI32 nalType, mfxBitstream * nalUnit) -{ - if (!nalUnit) - return MFX_ERR_MORE_DATA; - - switch (nalType) - { - case NAL_UT_IDR_SLICE: - case NAL_UT_SLICE: - case NAL_UT_CODED_SLICE_EXTENSION: - { - AVCSlice * pSlice = DecodeSliceHeader(nalUnit); - if (pSlice) - { - mfxStatus sts = AddSlice(pSlice); - if (sts == MFX_ERR_NOT_ENOUGH_BUFFER) - { - return sts; - } - - if (!m_pLastSlice) - { - AddSliceNalUnit(nalUnit, pSlice); - } - else - { - m_lastNalUnit = nalUnit; - } - - if (sts == MFX_ERR_NONE) - { - return sts; - } - } - } - break; - - case NAL_UT_SPS: - case NAL_UT_PPS: - case NAL_UT_SPS_EX: - case NAL_UNIT_SUBSET_SPS: - case NAL_UNIT_PREFIX: - DecodeHeader(nalUnit); - AddNalUnit(nalUnit); - break; - - case NAL_UT_SEI: - DecodeSEI(nalUnit); - AddNalUnit(nalUnit); - break; - case NAL_UT_AUD: - AddNalUnit(nalUnit); - break; - - case NAL_UT_DPA: - case NAL_UT_DPB: - case NAL_UT_DPC: - case NAL_UT_FD: - case NAL_UT_UNSPECIFIED: - break; - - case NAL_END_OF_STREAM: - case NAL_END_OF_SEQ: - { - AddNalUnit(nalUnit); - } - break; - - default: - break; - }; - - return MFX_ERR_MORE_DATA; -} - -mfxStatus AVC_Spl::GetFrame(mfxBitstream * bs_in, FrameSplitterInfo ** frame) -{ - *frame = 0; - - do - { - if (m_pLastSlice) - { - AVCSlice * pSlice = m_pLastSlice; - mfxStatus sts = AddSlice(pSlice); - if(!m_lastNalUnit) - { - msdk_printf(MSDK_STRING("ERROR: m_lastNalUnit=NULL\n")); - return MFX_ERR_NULL_PTR; - } - AddSliceNalUnit(m_lastNalUnit, pSlice); - m_lastNalUnit = 0; - if (sts == MFX_ERR_NONE) - return MFX_ERR_NONE; - } - - mfxBitstream * destination=NULL; - mfxI32 nalType = m_pNALSplitter->GetNalUnits(bs_in, destination); - mfxStatus sts = ProcessNalUnit(nalType, destination); - - if (sts == MFX_ERR_NONE || (!bs_in && m_frame.SliceNum)) - { - m_currentInfo = 0; - *frame = &m_frame; - return MFX_ERR_NONE; - } - - } while (bs_in && bs_in->DataLength > MINIMAL_DATA_SIZE); - - return MFX_ERR_MORE_DATA; -} - -AVCSlice::AVCSlice() -{ - Reset(); -} - -void AVCSlice::Reset() -{ - m_picParamSet = 0; - m_seqParamSet = 0; - m_seqParamSetMvcEx = 0; - m_seqParamSetEx = 0; - m_dTime=0; - memset(&m_sliceHeader, 0, sizeof(m_sliceHeader)); -} - -AVCSliceHeader * AVCSlice::GetSliceHeader() -{ - return &m_sliceHeader; -} - -mfxI32 AVCSlice::RetrievePicParamSetNumber(mfxU8 *pSource, mfxU32 nSourceSize) -{ - if (!nSourceSize) - return -1; - - m_bitStream.Reset(pSource, nSourceSize); - - mfxStatus umcRes = MFX_ERR_NONE; - - try - { - umcRes = m_bitStream.GetNALUnitType(m_sliceHeader.nal_unit_type, m_sliceHeader.nal_ref_idc); - if (MFX_ERR_NONE != umcRes) - return false; - - // decode first part of slice header - umcRes = m_bitStream.GetSliceHeaderPart1(&m_sliceHeader); - if (MFX_ERR_NONE != umcRes) - return -1; - } catch (...) - { - return -1; - } - - return m_sliceHeader.pic_parameter_set_id; -} - -bool AVCSlice::DecodeHeader(mfxU8 *pSource, mfxU32 nSourceSize) -{ - m_bitStream.Reset(pSource, nSourceSize); - - if (!nSourceSize) - return false; - - mfxStatus umcRes = MFX_ERR_NONE; - // Locals for additional slice data to be read into, the data - // was read and saved from the first slice header of the picture, - // is not supposed to change within the picture, so can be - // discarded when read again here. - try - { - memset(&m_sliceHeader, 0, sizeof(m_sliceHeader)); - - umcRes = m_bitStream.GetNALUnitType(m_sliceHeader.nal_unit_type, m_sliceHeader.nal_ref_idc); - if (MFX_ERR_NONE != umcRes) - return false; - - // decode first part of slice header - umcRes = m_bitStream.GetSliceHeaderPart1(&m_sliceHeader); - if (MFX_ERR_NONE != umcRes) - return false; - - // decode second part of slice header - umcRes = m_bitStream.GetSliceHeaderPart2(&m_sliceHeader, - m_picParamSet, - m_seqParamSet); - if (MFX_ERR_NONE != umcRes) - return false; - - PredWeightTable m_PredWeight[2][MAX_NUM_REF_FRAMES]; - RefPicListReorderInfo ReorderInfoL0; - RefPicListReorderInfo ReorderInfoL1; - AdaptiveMarkingInfo m_AdaptiveMarkingInfo; - - // decode second part of slice header - umcRes = m_bitStream.GetSliceHeaderPart3(&m_sliceHeader, - m_PredWeight[0], - m_PredWeight[1], - &ReorderInfoL0, - &ReorderInfoL1, - &m_AdaptiveMarkingInfo, - m_picParamSet, - m_seqParamSet, - m_sliceHeader.nal_ref_idc); - if (MFX_ERR_NONE != umcRes) - return false; - - if (m_picParamSet->entropy_coding_mode) - m_bitStream.AlignPointerRight(); - } - catch(const AVC_exception & ) - { - return false; - } - catch(...) - { - return false; - } - - return (MFX_ERR_NONE == umcRes); -} - - - mfxStatus AVC_Spl::PostProcessing(FrameSplitterInfo *frame, mfxU32 sliceNum) - { - UNREFERENCED_PARAMETER(frame); - UNREFERENCED_PARAMETER(sliceNum); - return MFX_ERR_NONE; - } - -} // namespace ProtectedLibrary diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/base_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/base_allocator.cpp deleted file mode 100644 index 4938cd99..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/base_allocator.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include -#include -#include "base_allocator.h" -#include "vm/thread_defs.h" - -MFXFrameAllocator::MFXFrameAllocator() -{ - pthis = this; - Alloc = Alloc_; - Lock = Lock_; - Free = Free_; - Unlock = Unlock_; - GetHDL = GetHDL_; -} - -MFXFrameAllocator::~MFXFrameAllocator() -{ -} - -mfxStatus MFXFrameAllocator::Alloc_(mfxHDL pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXFrameAllocator& self = *(MFXFrameAllocator *)pthis; - - return self.AllocFrames(request, response); -} - -mfxStatus MFXFrameAllocator::Lock_(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXFrameAllocator& self = *(MFXFrameAllocator *)pthis; - - return self.LockFrame(mid, ptr); -} - -mfxStatus MFXFrameAllocator::Unlock_(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXFrameAllocator& self = *(MFXFrameAllocator *)pthis; - - return self.UnlockFrame(mid, ptr); -} - -mfxStatus MFXFrameAllocator::Free_(mfxHDL pthis, mfxFrameAllocResponse *response) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXFrameAllocator& self = *(MFXFrameAllocator *)pthis; - - return self.FreeFrames(response); -} - -mfxStatus MFXFrameAllocator::GetHDL_(mfxHDL pthis, mfxMemId mid, mfxHDL *handle) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXFrameAllocator& self = *(MFXFrameAllocator *)pthis; - - return self.GetFrameHDL(mid, handle); -} - -BaseFrameAllocator::BaseFrameAllocator() -{ -} - -BaseFrameAllocator::~BaseFrameAllocator() -{ -} - -mfxStatus BaseFrameAllocator::CheckRequestType(mfxFrameAllocRequest *request) -{ - if (0 == request) - return MFX_ERR_NULL_PTR; - - // check that Media SDK component is specified in request - if ((request->Type & MEMTYPE_FROM_MASK) != 0) - return MFX_ERR_NONE; - else - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus BaseFrameAllocator::ReallocFrame(mfxMemId midIn, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut) -{ - return ReallocImpl(midIn, info, memType, midOut); -} - -mfxStatus BaseFrameAllocator::AllocFrames(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - if (0 == request || 0 == response || 0 == request->NumFrameSuggested) - return MFX_ERR_MEMORY_ALLOC; - - if (MFX_ERR_NONE != CheckRequestType(request)) - return MFX_ERR_UNSUPPORTED; - - mfxStatus sts = MFX_ERR_NONE; - - if ( // External Frames - ((request->Type & MFX_MEMTYPE_EXTERNAL_FRAME) && - (request->Type & (MFX_MEMTYPE_FROM_DECODE | MFX_MEMTYPE_FROM_ENC | MFX_MEMTYPE_FROM_PAK))) - // Exception: Internal Frames for FEI ENC / PAK reconstructs - || - ((request->Type & MFX_MEMTYPE_INTERNAL_FRAME) && - (request->Type & (MFX_MEMTYPE_FROM_ENC | MFX_MEMTYPE_FROM_PAK))) - ) - { - bool foundInCache = false; - // external decoder allocations - std::list::iterator - it = m_ExtResponses.begin(), - et = m_ExtResponses.end(); - UniqueResponse checker(*response, request->Info.Width, request->Info.Height, request->Type); - for (; it != et; ++it) - { - // same decoder and same size - if (request->AllocId == it->AllocId && checker(*it)) - { - // check if enough frames were allocated - if (request->NumFrameSuggested > it->NumFrameActual) - return MFX_ERR_MEMORY_ALLOC; - - it->m_refCount++; - // return existing response - *response = (mfxFrameAllocResponse&)*it; - foundInCache = true; - } - } - - if (!foundInCache) - { - sts = AllocImpl(request, response); - if (sts == MFX_ERR_NONE) - { - response->AllocId = request->AllocId; - m_ExtResponses.push_back(UniqueResponse(*response, request->Info.Width, request->Info.Height, UniqueResponse::CropMemoryTypeToStore(request->Type))); - } - } - } - else - { - // internal allocations - - // reserve space before allocation to avoid memory leak - m_responses.push_back(mfxFrameAllocResponse()); - - sts = AllocImpl(request, response); - if (sts == MFX_ERR_NONE) - { - m_responses.back() = *response; - } - else - { - m_responses.pop_back(); - } - } - - return sts; -} - -mfxStatus BaseFrameAllocator::FreeFrames(mfxFrameAllocResponse *response) -{ - std::lock_guard lock(mtx); - - if (response == 0) - return MFX_ERR_INVALID_HANDLE; - - mfxStatus sts = MFX_ERR_NONE; - - // check whether response is an external decoder response - std::list::iterator i = - std::find_if( m_ExtResponses.begin(), m_ExtResponses.end(), std::bind(IsSame(), *response, std::placeholders::_1)); - - if (i != m_ExtResponses.end()) - { - if ((--i->m_refCount) == 0) - { - sts = ReleaseResponse(response); - m_ExtResponses.erase(i); - } - return sts; - } - - // if not found so far, then search in internal responses - std::list::iterator i2 = - std::find_if(m_responses.begin(), m_responses.end(), std::bind(IsSame(), *response, std::placeholders::_1)); - - if (i2 != m_responses.end()) - { - sts = ReleaseResponse(response); - m_responses.erase(i2); - return sts; - } - - // not found anywhere, report an error - return MFX_ERR_INVALID_HANDLE; -} - -mfxStatus BaseFrameAllocator::Close() -{ - std::lock_guard lock(mtx); - - std::list ::iterator i; - for (i = m_ExtResponses.begin(); i!= m_ExtResponses.end(); i++) - { - ReleaseResponse(&*i); - } - m_ExtResponses.clear(); - - std::list ::iterator i2; - for (i2 = m_responses.begin(); i2!= m_responses.end(); i2++) - { - ReleaseResponse(&*i2); - } - - return MFX_ERR_NONE; -} - -MFXBufferAllocator::MFXBufferAllocator() -{ - pthis = this; - Alloc = Alloc_; - Lock = Lock_; - Free = Free_; - Unlock = Unlock_; -} - -MFXBufferAllocator::~MFXBufferAllocator() -{ -} - -mfxStatus MFXBufferAllocator::Alloc_(mfxHDL pthis, mfxU32 nbytes, mfxU16 type, mfxMemId *mid) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXBufferAllocator& self = *(MFXBufferAllocator *)pthis; - - return self.AllocBuffer(nbytes, type, mid); -} - -mfxStatus MFXBufferAllocator::Lock_(mfxHDL pthis, mfxMemId mid, mfxU8 **ptr) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXBufferAllocator& self = *(MFXBufferAllocator *)pthis; - - return self.LockBuffer(mid, ptr); -} - -mfxStatus MFXBufferAllocator::Unlock_(mfxHDL pthis, mfxMemId mid) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXBufferAllocator& self = *(MFXBufferAllocator *)pthis; - - return self.UnlockBuffer(mid); -} - -mfxStatus MFXBufferAllocator::Free_(mfxHDL pthis, mfxMemId mid) -{ - if (0 == pthis) - return MFX_ERR_MEMORY_ALLOC; - - MFXBufferAllocator& self = *(MFXBufferAllocator *)pthis; - - return self.FreeBuffer(mid); -} - diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/brc_routines.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/brc_routines.cpp deleted file mode 100644 index 4d79beef..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/brc_routines.cpp +++ /dev/null @@ -1,1000 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - - -#include "brc_routines.h" -#include "math.h" -#include "mfxdefs.h" -#include - -#ifndef MFX_VERSION -#error MFX_VERSION not defined -#endif - -#if (MFX_VERSION >= 1024) -#define BRC_SCENE_CHANGE_RATIO1 20.0 -#define BRC_SCENE_CHANGE_RATIO2 5.0 - -mfxExtBuffer* Hevc_GetExtBuffer(mfxExtBuffer** extBuf, mfxU32 numExtBuf, mfxU32 id) -{ - if (extBuf != 0) - { - for (mfxU16 i = 0; i < numExtBuf; i++) - { - if (extBuf[i] != 0 && extBuf[i]->BufferId == id) // assuming aligned buffers - return (extBuf[i]); - } - } - - return nullptr; -} - -mfxStatus cBRCParams::Init(mfxVideoParam* par, bool bFielMode) -{ - printf("Sample BRC is used\n"); - MFX_CHECK_NULL_PTR1(par); - MFX_CHECK(par->mfx.RateControlMethod == MFX_RATECONTROL_CBR || - par->mfx.RateControlMethod == MFX_RATECONTROL_VBR, - MFX_ERR_UNDEFINED_BEHAVIOR); - - mfxU32 k = par->mfx.BRCParamMultiplier == 0 ? 1: par->mfx.BRCParamMultiplier; - mfxU32 bpsScale = (par->mfx.CodecId == MFX_CODEC_AVC) ? 10 : 6; - - rateControlMethod = par->mfx.RateControlMethod; - targetbps = (((k*par->mfx.TargetKbps*1000) >> bpsScale) << bpsScale); - maxbps = (((k*par->mfx.MaxKbps *1000) >> bpsScale) << bpsScale); - - maxbps = (par->mfx.RateControlMethod == MFX_RATECONTROL_CBR) ? - targetbps : ((maxbps >= targetbps) ? maxbps : targetbps); - mfxExtCodingOption * pExtCO = (mfxExtCodingOption*)Hevc_GetExtBuffer(par->ExtParam, par->NumExtParam, MFX_EXTBUFF_CODING_OPTION); - - HRDConformance = MFX_BRC_NO_HRD; - if (pExtCO) - { - if ((MFX_CODINGOPTION_OFF != pExtCO->NalHrdConformance) && (MFX_CODINGOPTION_OFF != pExtCO->VuiNalHrdParameters)) - HRDConformance = MFX_BRC_HRD_STRONG; - else if ((MFX_CODINGOPTION_ON == pExtCO->NalHrdConformance) && (MFX_CODINGOPTION_OFF == pExtCO->VuiNalHrdParameters)) - HRDConformance = MFX_BRC_HRD_WEAK; - } - - if (HRDConformance != MFX_BRC_NO_HRD) - { - bufferSizeInBytes = ((k*par->mfx.BufferSizeInKB *1000) >> 3) << 3; - initialDelayInBytes = ((k*par->mfx.InitialDelayInKB*1000) >> 3) << 3; - bRec = 1; - bPanic = (HRDConformance == MFX_BRC_HRD_STRONG) ? 1 : 0; - } - MFX_CHECK (par->mfx.FrameInfo.FrameRateExtD != 0 && - par->mfx.FrameInfo.FrameRateExtN != 0, - MFX_ERR_UNDEFINED_BEHAVIOR); - - frameRate = (mfxF64)par->mfx.FrameInfo.FrameRateExtN / (mfxF64)par->mfx.FrameInfo.FrameRateExtD; - - width = par->mfx.FrameInfo.Width; - height = par->mfx.FrameInfo.Height; - - chromaFormat = par->mfx.FrameInfo.ChromaFormat == 0 ? MFX_CHROMAFORMAT_YUV420 : par->mfx.FrameInfo.ChromaFormat ; - bitDepthLuma = par->mfx.FrameInfo.BitDepthLuma == 0 ? 8 : par->mfx.FrameInfo.BitDepthLuma; - quantOffset = 6 * (bitDepthLuma - 8); - - inputBitsPerFrame = targetbps / frameRate; - maxInputBitsPerFrame = maxbps / frameRate; - gopPicSize = par->mfx.GopPicSize*(bFielMode ? 2 : 1); - gopRefDist = par->mfx.GopRefDist*(bFielMode ? 2 : 1); - - mfxExtCodingOption2 * pExtCO2 = (mfxExtCodingOption2*)Hevc_GetExtBuffer(par->ExtParam, par->NumExtParam, MFX_EXTBUFF_CODING_OPTION2); - bPyr = (pExtCO2 && pExtCO2->BRefType == MFX_B_REF_PYRAMID); - maxFrameSizeInBits = pExtCO2 ? pExtCO2->MaxFrameSize*8 : 0; - fAbPeriodLong = 100; - fAbPeriodShort = 5; - dqAbPeriod = 100; - bAbPeriod = 100; - - if (maxFrameSizeInBits) - { - bRec = 1; - bPanic = 1; - } - - if (pExtCO2 - && pExtCO2->MaxQPI <=51 && pExtCO2->MaxQPI > pExtCO2->MinQPI && pExtCO2->MinQPI >=1 - && pExtCO2->MaxQPP <=51 && pExtCO2->MaxQPP > pExtCO2->MinQPP && pExtCO2->MinQPP >=1 - && pExtCO2->MaxQPB <=51 && pExtCO2->MaxQPB > pExtCO2->MinQPB && pExtCO2->MinQPB >=1 ) - { - quantMaxI = pExtCO2->MaxQPI + quantOffset; - quantMinI = pExtCO2->MinQPI; - quantMaxP = pExtCO2->MaxQPP + quantOffset; - quantMinP = pExtCO2->MinQPP; - quantMaxB = pExtCO2->MaxQPB + quantOffset; - quantMinB = pExtCO2->MinQPB; - } - else - { - quantMaxI = quantMaxP = quantMaxB = 51 + quantOffset; - quantMinI = quantMinP = quantMinB = 1; - } - - mfxExtCodingOption3 * pExtCO3 = (mfxExtCodingOption3*)Hevc_GetExtBuffer(par->ExtParam, par->NumExtParam, MFX_EXTBUFF_CODING_OPTION3); - if (pExtCO3) - { - WinBRCMaxAvgKbps = pExtCO3->WinBRCMaxAvgKbps*par->mfx.BRCParamMultiplier; - WinBRCSize = pExtCO3->WinBRCSize; - } - return MFX_ERR_NONE; -} - -mfxStatus cBRCParams::GetBRCResetType(mfxVideoParam* par, bool bNewSequence, bool &bBRCReset, bool &bSlidingWindowReset) -{ - bBRCReset = false; - bSlidingWindowReset = false; - - if (bNewSequence) - return MFX_ERR_NONE; - - cBRCParams new_par; - mfxStatus sts = new_par.Init(par); - MFX_CHECK_STS(sts); - - MFX_CHECK(new_par.rateControlMethod == rateControlMethod, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM) ; - MFX_CHECK(new_par.HRDConformance == HRDConformance, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM) ; - MFX_CHECK(new_par.frameRate == frameRate, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.width == width, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.height == height, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.chromaFormat == chromaFormat, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.bitDepthLuma == bitDepthLuma, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - - if (HRDConformance == MFX_BRC_HRD_STRONG) - { - MFX_CHECK(new_par.bufferSizeInBytes == bufferSizeInBytes, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.initialDelayInBytes == initialDelayInBytes, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.targetbps == targetbps, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - MFX_CHECK(new_par.maxbps == maxbps, MFX_ERR_INCOMPATIBLE_VIDEO_PARAM); - } - else if (new_par.targetbps != targetbps || new_par.maxbps != maxbps) - { - bBRCReset = true; - } - - if (new_par.WinBRCMaxAvgKbps != WinBRCMaxAvgKbps) - { - bBRCReset = true; - bSlidingWindowReset = true; - } - - if (new_par.maxFrameSizeInBits != maxFrameSizeInBits) bBRCReset = true; - if (new_par.gopPicSize != gopPicSize) bBRCReset = true; - if (new_par.gopRefDist != gopRefDist) bBRCReset = true; - if (new_par.bPyr != bPyr) bBRCReset = true; - if (new_par.quantMaxI != quantMaxI) bBRCReset = true; - if (new_par.quantMinI != quantMinI) bBRCReset = true; - if (new_par.quantMaxP != quantMaxP) bBRCReset = true; - if (new_par.quantMinP != quantMinP) bBRCReset = true; - if (new_par.quantMaxB != quantMaxB) bBRCReset = true; - if (new_par.quantMinB != quantMinB) bBRCReset = true; - - return MFX_ERR_NONE; -} - - - -enum -{ - MFX_BRC_RECODE_NONE = 0, - MFX_BRC_RECODE_QP = 1, - MFX_BRC_RECODE_PANIC = 2, -}; - - mfxF64 const QSTEP[88] = { - 0.630, 0.707, 0.794, 0.891, 1.000, 1.122, 1.260, 1.414, 1.587, 1.782, 2.000, 2.245, 2.520, - 2.828, 3.175, 3.564, 4.000, 4.490, 5.040, 5.657, 6.350, 7.127, 8.000, 8.980, 10.079, 11.314, - 12.699, 14.254, 16.000, 17.959, 20.159, 22.627, 25.398, 28.509, 32.000, 35.919, 40.317, 45.255, 50.797, - 57.018, 64.000, 71.838, 80.635, 90.510, 101.594, 114.035, 128.000, 143.675, 161.270, 181.019, 203.187, 228.070, - 256.000, 287.350, 322.540, 362.039, 406.375, 456.140, 512.000, 574.701, 645.080, 724.077, 812.749, 912.280, - 1024.000, 1149.401, 1290.159, 1448.155, 1625.499, 1824.561, 2048.000, 2298.802, 2580.318, 2896.309, 3250.997, 3649.121, - 4096.000, 4597.605, 5160.637, 5792.619, 6501.995, 7298.242, 8192.000, 9195.209, 10321.273, 11585.238, 13003.989, 14596.485 - }; - - -mfxI32 QStep2QpFloor(mfxF64 qstep, mfxI32 qpoffset = 0) // QSTEP[qp] <= qstep, return 0<=qp<=51+mQuantOffset -{ - mfxU8 qp = mfxU8(std::upper_bound(QSTEP, QSTEP + 51 + qpoffset, qstep) - QSTEP); - return qp > 0 ? qp - 1 : 0; -} - -mfxI32 Qstep2QP(mfxF64 qstep, mfxI32 qpoffset = 0) // return 0<=qp<=51+mQuantOffset -{ - mfxI32 qp = QStep2QpFloor(qstep, qpoffset); - - // prevent going QSTEP index out of bounds - if (qp >= (mfxI32)(sizeof(QSTEP)/sizeof(mfxF64)) - 1) - return 0; - return (qp == 51 + qpoffset || qstep < (QSTEP[qp] + QSTEP[qp + 1]) / 2) ? qp : qp + 1; -} -mfxF64 QP2Qstep(mfxI32 qp, mfxI32 qpoffset = 0) -{ - return QSTEP[std::min(51 + qpoffset, qp)]; -} - - -mfxF64 cHRD::GetBufferDiviation(mfxU32 targetBitrate) -{ - mfxI64 targetFullness = std::min(m_delayInBits, m_buffSizeInBits / 2); - mfxI64 minTargetFullness = std::min(m_buffSizeInBits / 2, targetBitrate * 2); // half bufsize or 2 sec - targetFullness = std::max(targetFullness, minTargetFullness); - - return targetFullness - m_bufFullness; -} - -mfxU16 cHRD::UpdateAndCheckHRD(mfxI32 frameBits, mfxI32 recode, mfxI32 minQuant, mfxI32 maxQuant) -{ - mfxU16 brcStatus = MFX_BRC_OK ; - - if (recode == 0) - { - m_prevBufFullness = m_bufFullness; - m_underflowQuant = minQuant - 1; - m_overflowQuant = maxQuant + 1; - } - else - { // frame is being recoded - restore buffer state - m_bufFullness = m_prevBufFullness; - m_frameNum--; - } - - m_maxFrameSize = (mfxI32)(m_bufFullness - 1); - m_minFrameSize = (!m_bCBR)? 0 : (mfxI32)(m_bufFullness + 1 + 1 + m_inputBitsPerFrame - m_buffSizeInBits); - if (m_minFrameSize < 0) - m_minFrameSize = 0; - - mfxF64 bufFullness = m_bufFullness - frameBits; - - if (bufFullness < 2) - { - bufFullness = m_inputBitsPerFrame; - brcStatus = MFX_BRC_BIG_FRAME; - if (bufFullness > m_buffSizeInBits) - bufFullness = m_buffSizeInBits; - } - else - { - bufFullness += m_inputBitsPerFrame; - if (bufFullness > m_buffSizeInBits - 1) - { - bufFullness = m_buffSizeInBits - 1; - if (m_bCBR) - brcStatus = MFX_BRC_SMALL_FRAME; - } - } - m_frameNum++; - if ( MFX_BRC_RECODE_PANIC == recode) // no use in changing QP - { - if (brcStatus == MFX_BRC_SMALL_FRAME) - brcStatus = MFX_BRC_PANIC_SMALL_FRAME ; - if (brcStatus == MFX_BRC_BIG_FRAME) - brcStatus = MFX_BRC_PANIC_BIG_FRAME ; } - - m_bufFullness = bufFullness; - return brcStatus; -} - -mfxStatus cHRD::UpdateMinMaxQPForRec( mfxU32 brcSts, mfxI32 qp) -{ - MFX_CHECK(brcSts == MFX_BRC_BIG_FRAME || brcSts == MFX_BRC_SMALL_FRAME, MFX_ERR_UNDEFINED_BEHAVIOR); - if (brcSts == MFX_BRC_BIG_FRAME) - m_underflowQuant = qp; - else - m_overflowQuant = qp; - return MFX_ERR_NONE; -} -mfxI32 cHRD::GetTargetSize(mfxU32 brcSts) -{ - if (brcSts != MFX_BRC_BIG_FRAME && brcSts != MFX_BRC_SMALL_FRAME) return 0; - return (brcSts == MFX_BRC_BIG_FRAME) ? m_maxFrameSize * 3 / 4 : m_minFrameSize * 5 / 4; -} - -mfxI32 GetNewQP(mfxF64 totalFrameBits, mfxF64 targetFrameSizeInBits, mfxI32 minQP , mfxI32 maxQP, mfxI32 qp , mfxI32 qp_offset, mfxF64 f_pow, bool bStrict = false, bool bLim = true) -{ - mfxF64 qstep = 0, qstep_new = 0; - mfxI32 qp_new = qp; - - qstep = QP2Qstep(qp, qp_offset); - qstep_new = qstep * pow(totalFrameBits / targetFrameSizeInBits, f_pow); - qp_new = Qstep2QP(qstep_new, qp_offset); - - if (totalFrameBits < targetFrameSizeInBits) // overflow - { - if (qp <= minQP) - { - return qp; // QP change is impossible - } - if (bLim) - qp_new = std::max(qp_new , (minQP + qp + 1) >> 1); - if (bStrict) - qp_new = std::min(qp_new, qp - 1); - } - else // underflow - { - if (qp >= maxQP) - { - return qp; // QP change is impossible - } - if (bLim) - qp_new = std::min(qp_new , (maxQP + qp + 1) >> 1); - if (bStrict) - qp_new = std::max(qp_new, qp + 1); - } - return mfx::clamp(qp_new, minQP, maxQP); -} - - - - -void cHRD::Init(mfxU32 buffSizeInBytes, mfxU32 delayInBytes, mfxF64 inputBitsPerFrame, bool bCBR) -{ - m_bufFullness = m_prevBufFullness= delayInBytes << 3; - m_delayInBits = delayInBytes << 3; - m_buffSizeInBits = buffSizeInBytes << 3; - m_inputBitsPerFrame =inputBitsPerFrame; - m_bCBR = bCBR; - - m_underflowQuant = 0; - m_overflowQuant = 999; - m_frameNum = 0; - m_minFrameSize = 0; - m_maxFrameSize = 0; - -} - -void UpdateQPParams(mfxI32 qp, mfxU32 type , BRC_Ctx &ctx, mfxU32 /* rec_num */, mfxI32 minQuant, mfxI32 maxQuant, mfxU32 level) -{ - ctx.Quant = qp; - if (type == MFX_FRAMETYPE_I) - { - ctx.QuantI = qp; - ctx.QuantP = qp + 1; - ctx.QuantB = qp + 2; - } - else if (type == MFX_FRAMETYPE_P) - { - qp -= level; - ctx.QuantI = qp - 1; - ctx.QuantP = qp; - ctx.QuantB = qp + 1; - } - else if (type == MFX_FRAMETYPE_B) - { - level = level > 0 ? level - 1: 0; - qp -= level; - ctx.QuantI = qp - 2; - ctx.QuantP = qp - 1; - ctx.QuantB = qp; - } - ctx.QuantI = mfx::clamp(ctx.QuantI, minQuant, maxQuant); - ctx.QuantP = mfx::clamp(ctx.QuantP, minQuant, maxQuant); - ctx.QuantB = mfx::clamp(ctx.QuantB, minQuant, maxQuant); - //printf("ctx.QuantI %d, ctx.QuantP %d, ctx.QuantB %d, level %d\n", ctx.QuantI, ctx.QuantP, ctx.QuantB, level); -} - -mfxI32 GetRawFrameSize(mfxU32 lumaSize, mfxU16 chromaFormat, mfxU16 bitDepthLuma) -{ - mfxI32 frameSize = lumaSize; - - if (chromaFormat == MFX_CHROMAFORMAT_YUV420) - frameSize += lumaSize / 2; - else if (chromaFormat == MFX_CHROMAFORMAT_YUV422) - frameSize += lumaSize; - else if (chromaFormat == MFX_CHROMAFORMAT_YUV444) - frameSize += lumaSize * 2; - - frameSize = frameSize * bitDepthLuma / 8; - return frameSize*8; //frame size in bits -} - -mfxStatus ExtBRC::Init (mfxVideoParam* par) -{ - mfxStatus sts = MFX_ERR_NONE; - - MFX_CHECK(!m_bInit, MFX_ERR_UNDEFINED_BEHAVIOR); - sts = m_par.Init(par); - MFX_CHECK_STS(sts); - - if (m_par.HRDConformance != MFX_BRC_NO_HRD) - { - m_hrd.Init(m_par.bufferSizeInBytes, m_par.initialDelayInBytes, m_par.maxInputBitsPerFrame, m_par.rateControlMethod == MFX_RATECONTROL_CBR); - } - memset(&m_ctx, 0, sizeof(m_ctx)); - - m_ctx.fAbLong = m_par.inputBitsPerFrame; - m_ctx.fAbShort = m_par.inputBitsPerFrame; - m_ctx.encOrder = mfxU32(-1); - - mfxI32 rawSize = GetRawFrameSize(m_par.width * m_par.height ,m_par.chromaFormat, m_par.bitDepthLuma); - mfxI32 qp = GetNewQP(rawSize, m_par.inputBitsPerFrame, m_par.quantMinI, m_par.quantMaxI, 1 , m_par.quantOffset, 0.5, false, false); - - UpdateQPParams(qp,MFX_FRAMETYPE_I , m_ctx, 0, m_par.quantMinI, m_par.quantMaxI, 0); - - m_ctx.dQuantAb = qp > 0 ? 1./qp : 1.0; //kw - - if (m_par.WinBRCSize) - { - m_avg.reset(new AVGBitrate(m_par.WinBRCSize, (mfxU32)(m_par.WinBRCMaxAvgKbps*1000.0/m_par.frameRate), (mfxU32)m_par.inputBitsPerFrame) ); - MFX_CHECK_NULL_PTR1(m_avg.get()); - } - - m_bInit = true; - return sts; -} - -mfxU16 GetFrameType(mfxU16 m_frameType, mfxU16 level, mfxU16 gopRegDist) -{ - if (m_frameType & MFX_FRAMETYPE_IDR) - return MFX_FRAMETYPE_I; - else if (m_frameType & MFX_FRAMETYPE_I) - return MFX_FRAMETYPE_I; - else if (m_frameType & MFX_FRAMETYPE_P) - return MFX_FRAMETYPE_P; - else if ((m_frameType & MFX_FRAMETYPE_REF) && (level == 0 || gopRegDist == 1)) - return MFX_FRAMETYPE_P; //low delay B - else - return MFX_FRAMETYPE_B; -} - - -bool isFrameBeforeIntra (mfxU32 order, mfxU32 intraOrder, mfxU32 gopPicSize, mfxU32 gopRefDist) -{ - mfxI32 distance0 = gopPicSize*3/4; - mfxI32 distance1 = gopPicSize - gopRefDist*3; - return mfxI32(order - intraOrder) > std::max(distance0, distance1); -} - -mfxStatus SetRecodeParams(mfxU16 brcStatus, mfxI32 qp, mfxI32 qp_new, mfxI32 minQP, mfxI32 maxQP, BRC_Ctx &ctx, mfxBRCFrameStatus* status) -{ - ctx.bToRecode = 1; - - if (brcStatus == MFX_BRC_BIG_FRAME || brcStatus == MFX_BRC_PANIC_BIG_FRAME ) - { - MFX_CHECK(qp_new >= qp, MFX_ERR_UNDEFINED_BEHAVIOR); - ctx.Quant = qp_new; - ctx.QuantMax = maxQP; - if (brcStatus == MFX_BRC_BIG_FRAME && qp_new > qp) - { - ctx.QuantMin = std::max(qp + 1, minQP); //limit QP range for recoding - status->BRCStatus = MFX_BRC_BIG_FRAME; - - } - else - { - ctx.QuantMin = minQP; - ctx.bPanic = 1; - status->BRCStatus = MFX_BRC_PANIC_BIG_FRAME; - } - } - else if (brcStatus == MFX_BRC_SMALL_FRAME || brcStatus == MFX_BRC_PANIC_SMALL_FRAME) - { - MFX_CHECK(qp_new <= qp, MFX_ERR_UNDEFINED_BEHAVIOR); - - ctx.Quant = qp_new; - ctx.QuantMin = minQP; //limit QP range for recoding - - if (brcStatus == MFX_BRC_SMALL_FRAME && qp_new < qp) - { - ctx.QuantMax = std::min(qp - 1, maxQP); - status->BRCStatus = MFX_BRC_SMALL_FRAME; - } - else - { - ctx.QuantMax = maxQP; - status->BRCStatus = MFX_BRC_PANIC_SMALL_FRAME; - ctx.bPanic = 1; - } - } - //printf("recode %d , qp %d new %d, status %d\n", ctx.encOrder, qp, qp_new, status->BRCStatus); - return MFX_ERR_NONE; -} -mfxI32 GetNewQPTotal(mfxF64 bo, mfxF64 dQP, mfxI32 minQP , mfxI32 maxQP, mfxI32 qp, bool bPyr, bool bSC) -{ - mfxU8 mode = (!bPyr) ; - - bo = mfx::clamp(bo, -1.0, 1.0); - dQP = mfx::clamp(dQP, 1./maxQP, 1./minQP); - dQP = dQP + (1./maxQP - dQP) * bo; - dQP = mfx::clamp(dQP, 1./maxQP, 1./minQP); - mfxI32 quant_new = (mfxI32) (1. / dQP + 0.5); - - //printf(" GetNewQPTotal: bo %f, quant %d, quant_new %d, mode %d\n", bo, qp, quant_new, mode); - if (!bSC) - { - if (mode == 0) // low: qp_diff [-2; 2] - { - if (quant_new >= qp + 5) - quant_new = qp + 2; - else if (quant_new > qp + 3) - quant_new = qp + 1; - else if (quant_new <= qp - 5) - quant_new = qp - 2; - else if (quant_new < qp - 2) - quant_new = qp - 1; - } - else // (mode == 1) midle: qp_diff [-3; 3] - { - if (quant_new >= qp + 5) - quant_new = qp + 3; - else if (quant_new > qp + 3) - quant_new = qp + 2; - else if (quant_new <= qp - 5) - quant_new = qp - 3; - else if (quant_new < qp - 2) - quant_new = qp - 2; - } - - } - else - { - quant_new = mfx::clamp(quant_new, qp - 5, qp + 5); - } - return mfx::clamp(quant_new, minQP, maxQP); -} -// Reduce AB period before intra and increase it after intra (to avoid intra frame affect on the bottom of hrd) -mfxF64 GetAbPeriodCoeff (mfxU32 numInGop, mfxU32 gopPicSize) -{ - const mfxU32 maxForCorrection = 30; - const mfxF64 maxValue = 1.5; - const mfxF64 minValue = 1.0; - - mfxU32 numForCorrection = std::min(gopPicSize /2, maxForCorrection); - mfxF64 k[maxForCorrection] = {}; - - if (numInGop >= gopPicSize || gopPicSize < 2) - return 1.0; - - for (mfxU32 i = 0; i < numForCorrection; i ++) - { - k[i] = maxValue - (maxValue - minValue)*i/numForCorrection; - } - if (numInGop < gopPicSize/2) - { - return k [numInGop < numForCorrection ? numInGop : numForCorrection - 1]; - } - else - { - mfxU32 n = gopPicSize - 1 - numInGop; - return 1.0/ k[n < numForCorrection ? n : numForCorrection - 1]; - } - -} - -mfxI32 ExtBRC::GetCurQP (mfxU32 type, mfxI32 layer) -{ - mfxI32 qp = 0; - if (type == MFX_FRAMETYPE_I) - { - qp = m_ctx.QuantI; - qp = mfx::clamp(qp, m_par.quantMinI, m_par.quantMaxI); - } - else if (type == MFX_FRAMETYPE_P) - { - qp = m_ctx.QuantP + layer; - qp = mfx::clamp(qp, m_par.quantMinP, m_par.quantMaxP); - } - else - { - qp = m_ctx.QuantB + (layer > 0 ? layer - 1 : 0); - qp = mfx::clamp(qp, m_par.quantMinB, m_par.quantMaxB); - } - //printf("GetCurQP I %d P %d B %d, min %d max %d type %d \n", m_ctx.QuantI, m_ctx.QuantP, m_ctx.QuantB, m_par.quantMinI, m_par.quantMaxI, type); - - return qp; -} - -mfxStatus ExtBRC::Update(mfxBRCFrameParam* frame_par, mfxBRCFrameCtrl* frame_ctrl, mfxBRCFrameStatus* status) -{ - mfxStatus sts = MFX_ERR_NONE; - - MFX_CHECK_NULL_PTR3(frame_par, frame_ctrl, status); - MFX_CHECK(m_bInit, MFX_ERR_NOT_INITIALIZED); - - mfxU16 &brcSts = status->BRCStatus; - status->MinFrameSize = 0; - - //printf("ExtBRC::Update: m_ctx.encOrder %d , frame_par->EncodedOrder %d, frame_par->NumRecode %d, frame_par->CodedFrameSize %d, qp %d\n", m_ctx.encOrder , frame_par->EncodedOrder, frame_par->NumRecode, frame_par->CodedFrameSize, frame_ctrl->QpY); - - mfxI32 bitsEncoded = frame_par->CodedFrameSize*8; - mfxU32 picType = GetFrameType(frame_par->FrameType, frame_par->PyramidLayer, m_par.gopRefDist); - mfxI32 qpY = frame_ctrl->QpY + m_par.quantOffset; - mfxI32 layer = frame_par->PyramidLayer; - mfxF64 qstep = QP2Qstep(qpY, m_par.quantOffset); - - mfxF64 fAbLong = m_ctx.fAbLong + (bitsEncoded - m_ctx.fAbLong) / m_par.fAbPeriodLong; - mfxF64 fAbShort = m_ctx.fAbShort + (bitsEncoded - m_ctx.fAbShort) / m_par.fAbPeriodShort; - mfxF64 eRate = bitsEncoded * sqrt(qstep); - mfxF64 e2pe = 0; - bool bMaxFrameSizeMode = m_par.maxFrameSizeInBits != 0 && - m_par.rateControlMethod == MFX_RATECONTROL_VBR && - m_par.maxFrameSizeInBits < m_par.inputBitsPerFrame * 2 && - m_ctx.totalDiviation < (-1)*m_par.inputBitsPerFrame*m_par.frameRate; - - if (picType == MFX_FRAMETYPE_I) - e2pe = (m_ctx.eRateSH == 0) ? (BRC_SCENE_CHANGE_RATIO2 + 1) : eRate / m_ctx.eRateSH; - else - e2pe = (m_ctx.eRate == 0) ? (BRC_SCENE_CHANGE_RATIO2 + 1) : eRate / m_ctx.eRate; - - mfxU32 frameSizeLim = 0xfffffff ; // sliding window limitation or external frame size limitation - - bool bSHStart = false; - bool bNeedUpdateQP = false; - - brcSts = MFX_BRC_OK; - - if (m_par.bRec && m_ctx.bToRecode && (m_ctx.encOrder != frame_par->EncodedOrder || frame_par->NumRecode == 0)) - { - //printf("++++++++++++++++++++++++++++++++++\n"); - // Frame must be recoded, but encoder calls BR for another frame - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - if (frame_par->NumRecode == 0 || m_ctx.encOrder != frame_par->EncodedOrder) - { - // Set context for new frame - if (picType == MFX_FRAMETYPE_I) - m_ctx.LastIEncOrder = frame_par->EncodedOrder; - m_ctx.encOrder = frame_par->EncodedOrder; - m_ctx.poc = frame_par->DisplayOrder; - m_ctx.bToRecode = 0; - m_ctx.bPanic = 0; - - if (picType == MFX_FRAMETYPE_I) - { - m_ctx.QuantMin = m_par.quantMinI; - m_ctx.QuantMax = m_par.quantMaxI; - } - else if (picType == MFX_FRAMETYPE_P) - { - m_ctx.QuantMin = m_par.quantMinP; - m_ctx.QuantMax = m_par.quantMaxP; - } - else - { - m_ctx.QuantMin = m_par.quantMinB; - m_ctx.QuantMax = m_par.quantMaxB; - } - m_ctx.Quant = qpY; - - - if (m_ctx.SceneChange && ( m_ctx.poc > m_ctx.SChPoc + 1 || m_ctx.poc == 0)) - m_ctx.SceneChange &= ~16; - - bNeedUpdateQP = true; - - //printf("m_ctx.SceneChange %d, m_ctx.poc %d, m_ctx.SChPoc %d, m_ctx.poc %d \n", m_ctx.SceneChange, m_ctx.poc, m_ctx.SChPoc, m_ctx.poc); - } - if (e2pe > BRC_SCENE_CHANGE_RATIO2 ) - { - // scene change, resetting BRC statistics - fAbLong = m_ctx.fAbLong = m_par.inputBitsPerFrame; - fAbShort = m_ctx.fAbShort = m_par.inputBitsPerFrame; - m_ctx.SceneChange |= 1; - if (picType != MFX_FRAMETYPE_B) - { - bSHStart = true; - m_ctx.SceneChange |= 16; - m_ctx.eRateSH = eRate; - //if ((frame_par->DisplayOrder - m_ctx.SChPoc) >= std::min(m_par.frameRate, m_par.gopRefDist)) - { - m_ctx.dQuantAb = 1./m_ctx.Quant; - } - m_ctx.SChPoc = frame_par->DisplayOrder; - //printf("!!!!!!!!!!!!!!!!!!!!! %d m_ctx.SceneChange %d, order %d\n", frame_par->EncodedOrder, m_ctx.SceneChange, frame_par->DisplayOrder); - } - - } - if (m_par.HRDConformance != MFX_BRC_NO_HRD) - { - //check hrd - brcSts = m_hrd.UpdateAndCheckHRD(bitsEncoded,frame_par->NumRecode, m_ctx.QuantMin,m_ctx.QuantMax); - //printf("--UpdateAndCheckHRD (%d) brcSts %d, panic %d\n", frame_par->EncodedOrder,brcSts, m_ctx.bPanic); - MFX_CHECK(brcSts == MFX_BRC_OK || (!m_ctx.bPanic), MFX_ERR_NOT_ENOUGH_BUFFER); - if (brcSts == MFX_BRC_BIG_FRAME || brcSts == MFX_BRC_SMALL_FRAME) - m_hrd.UpdateMinMaxQPForRec(brcSts, qpY); - else - bNeedUpdateQP = true; - status->MinFrameSize = m_hrd.GetMinFrameSize(); - //printf("%d: poc %d, size %d QP %d (%d %d), HRD sts %d, maxFrameSize %d, type %d \n",frame_par->EncodedOrder, frame_par->DisplayOrder, bitsEncoded, m_ctx.Quant, m_ctx.QuantMin, m_ctx.QuantMax, brcSts, m_hrd.GetMaxFrameSize(), frame_par->FrameType); - } - if (m_avg.get()) - { - frameSizeLim = std::min(frameSizeLim, m_avg->GetMaxFrameSize(m_ctx.bPanic, bSHStart || picType == MFX_FRAMETYPE_I, frame_par->NumRecode)); - } - if (m_par.maxFrameSizeInBits) - { - frameSizeLim = std::min(frameSizeLim, m_par.maxFrameSizeInBits); - } - //printf("frameSizeLim %d (%d)\n", frameSizeLim, bitsEncoded); - - if (frame_par->NumRecode < 2) - // Check other condions for recoding (update qp is it is needed) - { - mfxF64 targetFrameSize = std::max(m_par.inputBitsPerFrame, fAbLong); - mfxF64 maxFrameSize = (m_ctx.encOrder == 0 ? 6.0 : (bSHStart || picType == MFX_FRAMETYPE_I) ? 8.0 : 4.0) * targetFrameSize*(m_par.bPyr ? 1.5 : 1.0) ; - mfxI32 quantMax = m_ctx.QuantMax; - mfxI32 quantMin = m_ctx.QuantMin; - mfxI32 quant = qpY; - - maxFrameSize = std::min(maxFrameSize, frameSizeLim); - - if (m_par.HRDConformance != MFX_BRC_NO_HRD) - { - if (bSHStart || picType == MFX_FRAMETYPE_I) - maxFrameSize = std::min(maxFrameSize, 3.5/9. * m_hrd.GetMaxFrameSize() + 5.5/9. * targetFrameSize); - else - maxFrameSize = std::min(maxFrameSize, 2.5/9. * m_hrd.GetMaxFrameSize() + 6.5/9. * targetFrameSize); - - quantMax = std::min(m_hrd.GetMaxQuant(), quantMax); - quantMin = std::max(m_hrd.GetMinQuant(), quantMin); - } - maxFrameSize = std::max(maxFrameSize, targetFrameSize); - - if (bitsEncoded > maxFrameSize && quant < quantMax) - { - - mfxI32 quant_new = GetNewQP(bitsEncoded, (mfxU32)maxFrameSize, quantMin , quantMax, quant ,m_par.quantOffset, 1); - if (quant_new > quant ) - { - bNeedUpdateQP = false; - //printf(" recode 1-0: %d: k %5f bitsEncoded %d maxFrameSize %d, targetSize %d, fAbLong %f, inputBitsPerFrame %f, qp %d new %d\n",frame_par->EncodedOrder, bitsEncoded/maxFrameSize, (int)bitsEncoded, (int)maxFrameSize,(int)targetFrameSize, fAbLong, m_par.inputBitsPerFrame, quant, quant_new); - if (quant_new > GetCurQP (picType, layer)) - { - UpdateQPParams(bMaxFrameSizeMode? quant_new - 1 : quant_new ,picType, m_ctx, 0, quantMin , quantMax, layer); - fAbLong = m_ctx.fAbLong = m_par.inputBitsPerFrame; - fAbShort = m_ctx.fAbShort = m_par.inputBitsPerFrame; - m_ctx.dQuantAb = 1./quant_new; - } - - if (m_par.bRec) - { - SetRecodeParams(MFX_BRC_BIG_FRAME,quant,quant_new, quantMin, quantMax, m_ctx, status); - return sts; - } - } //(quant_new > quant) - } //bitsEncoded > maxFrameSize - - if (bitsEncoded > maxFrameSize && quant == quantMax && - picType != MFX_FRAMETYPE_I && m_par.bPanic && - (!m_ctx.bPanic) && isFrameBeforeIntra(m_ctx.encOrder, m_ctx.LastIEncOrder, m_par.gopPicSize, m_par.gopRefDist)) - { - //skip frames before intra - SetRecodeParams(MFX_BRC_PANIC_BIG_FRAME,quant,quant, quantMin ,quantMax, m_ctx, status); - return sts; - } - if (m_par.HRDConformance != MFX_BRC_NO_HRD && frame_par->NumRecode == 0 && (quant < quantMax)) - { - mfxF64 FAMax = 1./9. * m_hrd.GetMaxFrameSize() + 8./9. * fAbLong; - - if (fAbShort > FAMax) - { - mfxI32 quant_new = GetNewQP(fAbShort, FAMax, quantMin , quantMax, quant ,m_par.quantOffset, 0.5); - //printf(" recode 2-0: %d: FAMax %f, fAbShort %f, quant_new %d\n",frame_par->EncodedOrder, FAMax, fAbShort, quant_new); - - if (quant_new > quant) - { - bNeedUpdateQP = false; - if (quant_new > GetCurQP (picType, layer)) - { - UpdateQPParams(quant_new ,picType, m_ctx, 0, quantMin , quantMax, layer); - fAbLong = m_ctx.fAbLong = m_par.inputBitsPerFrame; - fAbShort = m_ctx.fAbShort = m_par.inputBitsPerFrame; - m_ctx.dQuantAb = 1./quant_new; - } - if (m_par.bRec) - { - SetRecodeParams(MFX_BRC_BIG_FRAME,quant,quant_new, quantMin, quantMax, m_ctx, status); - return sts; - } - }//quant_new > quant - } - }//m_par.HRDConformance - } - if (((m_par.HRDConformance != MFX_BRC_NO_HRD && brcSts != MFX_BRC_OK) || (bitsEncoded > (mfxI32)frameSizeLim)) && m_par.bRec) - { - mfxI32 quant = m_ctx.Quant; - mfxI32 quant_new = quant; - if (bitsEncoded > (mfxI32)frameSizeLim) - { - brcSts = MFX_BRC_BIG_FRAME; - quant_new = GetNewQP(bitsEncoded, frameSizeLim, m_ctx.QuantMin , m_ctx.QuantMax,quant,m_par.quantOffset, 1, true); - } - else if (brcSts == MFX_BRC_BIG_FRAME || brcSts == MFX_BRC_SMALL_FRAME) - { - quant_new = GetNewQP(bitsEncoded, m_hrd.GetTargetSize(brcSts), m_ctx.QuantMin , m_ctx.QuantMax,quant,m_par.quantOffset, 1, true); - } - if (quant_new != quant) - { - if (brcSts == MFX_BRC_SMALL_FRAME) - { - quant_new = std::max(quant_new, quant-2); - brcSts = MFX_BRC_PANIC_SMALL_FRAME; - } - // Idea is to check a sign mismatch, 'true' if both are negative or positive - if ((quant_new - qpY) * (quant_new - GetCurQP (picType, layer)) > 0) - { - UpdateQPParams(quant_new ,picType, m_ctx, 0, m_ctx.QuantMin , m_ctx.QuantMax, layer); - } - bNeedUpdateQP = false; - } - SetRecodeParams(brcSts,quant,quant_new, m_ctx.QuantMin , m_ctx.QuantMax, m_ctx, status); - } - else - { - // no recoding are needed. Save context params - - mfxF64 k = 1./m_ctx.Quant; - mfxF64 dqAbPeriod = m_par.dqAbPeriod; - if (m_ctx.bToRecode) - dqAbPeriod = (k < m_ctx.dQuantAb)? 16:25; - - if (bNeedUpdateQP) - { - m_ctx.dQuantAb += (k - m_ctx.dQuantAb)/dqAbPeriod; - m_ctx.dQuantAb = mfx::clamp(m_ctx.dQuantAb, 1./m_ctx.QuantMax , 1./m_ctx.QuantMin); - - m_ctx.fAbLong = fAbLong; - m_ctx.fAbShort = fAbShort; - } - - bool oldScene = false; - if ((m_ctx.SceneChange & 16) && (m_ctx.poc < m_ctx.SChPoc) && (e2pe < .01) && (mfxF64)bitsEncoded < 1.5*fAbLong) - oldScene = true; - //printf("-- m_ctx.eRate %f, eRate %f, e2pe %f\n", m_ctx.eRate, eRate, e2pe ); - - if (picType != MFX_FRAMETYPE_B) - { - m_ctx.LastNonBFrameSize = bitsEncoded; - if (picType == MFX_FRAMETYPE_I) - m_ctx.eRateSH = eRate; - else - m_ctx.eRate = eRate; - - } - - if (m_avg.get()) - { - m_avg->UpdateSlidingWindow(bitsEncoded, m_ctx.encOrder, m_ctx.bPanic, bSHStart || picType == MFX_FRAMETYPE_I,frame_par->NumRecode); - } - - m_ctx.totalDiviation += ((mfxF64)bitsEncoded - m_par.inputBitsPerFrame); - - //printf("-- %d (%d)) Total deviation %f, old scene %d, bNeedUpdateQP %d, m_ctx.Quant %d, type %d\n", frame_par->EncodedOrder, frame_par->DisplayOrder,m_ctx.totalDiviation, oldScene , bNeedUpdateQP, m_ctx.Quant,picType); - - if (!m_ctx.bPanic&& (!oldScene) && bNeedUpdateQP) - { - mfxI32 quant_new = m_ctx.Quant; - //Update QP - - mfxF64 totDiv = m_ctx.totalDiviation; - mfxF64 dequant_new = m_ctx.dQuantAb*pow(m_par.inputBitsPerFrame/m_ctx.fAbLong, 1.2); - mfxF64 bAbPreriod = m_par.bAbPeriod; - - if (m_par.HRDConformance != MFX_BRC_NO_HRD && totDiv > 0 ) - { - if (m_par.rateControlMethod == MFX_RATECONTROL_VBR) - { - totDiv = std::max(totDiv, m_hrd.GetBufferDiviation(m_par.targetbps)); - } - bAbPreriod = (mfxF64)(m_par.bPyr? 4 : 3)*(mfxF64)m_hrd.GetMaxFrameSize() / m_par.inputBitsPerFrame*GetAbPeriodCoeff(m_ctx.encOrder - m_ctx.LastIEncOrder, m_par.gopPicSize) ; - bAbPreriod = mfx::clamp(bAbPreriod , m_par.bAbPeriod/10, m_par.bAbPeriod); - } - quant_new = GetNewQPTotal(totDiv / bAbPreriod / (mfxF64)m_par.inputBitsPerFrame, dequant_new, m_ctx.QuantMin, m_ctx.QuantMax, m_ctx.Quant, m_par.bPyr && m_par.bRec, bSHStart && m_ctx.bToRecode == 0); - //printf(" ===%d quant old %d quant_new %d, bitsEncoded %d m_ctx.QuantMin %d m_ctx.QuantMax %d\n", frame_par->EncodedOrder, m_ctx.Quant, quant_new, bitsEncoded, m_ctx.QuantMin, m_ctx.QuantMax); - - if (bMaxFrameSizeMode) - { - mfxF64 targetMax = ((mfxF64)m_par.maxFrameSizeInBits*((bSHStart || picType == MFX_FRAMETYPE_I) ? 0.95 : 0.9)); - mfxF64 targetMin = ((mfxF64)m_par.maxFrameSizeInBits*((bSHStart || picType == MFX_FRAMETYPE_I) ? 0.9 : 0.8 /*0.75 : 0.5*/)); - mfxI32 QuantNewMin = GetNewQP(bitsEncoded, targetMax, m_ctx.QuantMin, m_ctx.QuantMax, m_ctx.Quant, m_par.quantOffset, 1,false, false); - mfxI32 QuantNewMax = GetNewQP(bitsEncoded, targetMin, m_ctx.QuantMin, m_ctx.QuantMax, m_ctx.Quant, m_par.quantOffset, 1,false, false); - mfxI32 quant_corrected = m_ctx.Quant; - - if (quant_corrected < QuantNewMin - 3) - quant_corrected += 2; - if (quant_corrected < QuantNewMin) - quant_corrected ++; - else if (quant_corrected > QuantNewMax + 3) - quant_corrected -= 2; - else if (quant_corrected > QuantNewMax) - quant_corrected--; - - //printf(" QuantNewMin %d, QuantNewMax %d, m_ctx.Quant %d, new %d (%d)\n", QuantNewMin, QuantNewMax, m_ctx.Quant, quant_corrected, quant_new); - - quant_new = mfx::clamp(quant_corrected, m_ctx.QuantMin, m_ctx.QuantMax); - } - if ((quant_new - m_ctx.Quant)* (quant_new - GetCurQP (picType, layer)) > 0) // this check is actual for async scheme - { - //printf(" Update QP %d: totalDiviation %f, bAbPreriod %f (%f), QP %d (%d %d), qp_new %d (qpY %d), type %d, dequant_new %f (%f) , m_ctx.fAbLong %f, m_par.inputBitsPerFrame %f (%f)\n", frame_par->EncodedOrder, totDiv, bAbPreriod, GetAbPeriodCoeff(m_ctx.encOrder - m_ctx.LastIEncOrder, m_par.gopPicSize), m_ctx.Quant, m_ctx.QuantMin, m_ctx.QuantMax, quant_new, qpY, picType, 1.0/dequant_new, 1.0/m_ctx.dQuantAb, m_ctx.fAbLong, m_par.inputBitsPerFrame, m_par.inputBitsPerFrame/m_ctx.fAbLong); - UpdateQPParams(quant_new ,picType, m_ctx, 0, m_ctx.QuantMin , m_ctx.QuantMax, layer); - } - } - m_ctx.bToRecode = 0; - } - return sts; - -} - -mfxStatus ExtBRC::GetFrameCtrl (mfxBRCFrameParam* par, mfxBRCFrameCtrl* ctrl) -{ - MFX_CHECK_NULL_PTR2(par, ctrl); - MFX_CHECK(m_bInit, MFX_ERR_NOT_INITIALIZED); - - mfxI32 qp = 0; - if (par->EncodedOrder == m_ctx.encOrder) - { - qp = m_ctx.Quant; - } - else - { - mfxU16 type = GetFrameType(par->FrameType,par->PyramidLayer, m_par.gopRefDist); - qp = GetCurQP (type, par->PyramidLayer); - } - ctrl->QpY = qp - m_par.quantOffset; - //printf("ctrl->QpY %d, qp %d quantOffset %d\n", ctrl->QpY , qp , m_par.quantOffset); - return MFX_ERR_NONE; -} - -mfxStatus ExtBRC::Reset(mfxVideoParam *par ) -{ - mfxStatus sts = MFX_ERR_NONE; - MFX_CHECK_NULL_PTR1(par); - MFX_CHECK(m_bInit, MFX_ERR_NOT_INITIALIZED); - - mfxExtEncoderResetOption * pRO = (mfxExtEncoderResetOption *)Hevc_GetExtBuffer(par->ExtParam, par->NumExtParam, MFX_EXTBUFF_ENCODER_RESET_OPTION); - if (pRO && pRO->StartNewSequence == MFX_CODINGOPTION_ON) - { - Close(); - sts = Init(par); - } - else - { - bool brcReset = false; - bool slidingWindowReset = false; - - sts = m_par.GetBRCResetType(par, false, brcReset, slidingWindowReset); - MFX_CHECK_STS(sts); - - if (brcReset) - { - sts = m_par.Init(par); - MFX_CHECK_STS(sts); - - m_ctx.Quant = (mfxI32)(1. / m_ctx.dQuantAb * pow(m_ctx.fAbLong / m_par.inputBitsPerFrame, 0.32) + 0.5); - m_ctx.Quant = mfx::clamp(m_ctx.Quant, m_par.quantMinI, m_par.quantMaxI); - - UpdateQPParams(m_ctx.Quant, MFX_FRAMETYPE_I, m_ctx, 0, m_par.quantMinI, m_par.quantMaxI, 0); - - m_ctx.dQuantAb = 1. / m_ctx.Quant; - m_ctx.fAbLong = m_par.inputBitsPerFrame; - m_ctx.fAbShort = m_par.inputBitsPerFrame; - - if (slidingWindowReset) - { - m_avg.reset(new AVGBitrate(m_par.WinBRCSize, (mfxU32)(m_par.WinBRCMaxAvgKbps*1000.0 / m_par.frameRate), (mfxU32)m_par.inputBitsPerFrame)); - MFX_CHECK_NULL_PTR1(m_avg.get()); - } - } - } - return sts; -} - -#endif diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_allocator.cpp deleted file mode 100644 index afc419b6..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_allocator.cpp +++ /dev/null @@ -1,600 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include "sample_defs.h" - -#if MFX_D3D11_SUPPORT - -#include -#include -#include -#include -#include -#include -#include "d3d11_allocator.h" - -#define D3DFMT_NV12 (DXGI_FORMAT)MAKEFOURCC('N','V','1','2') -#define D3DFMT_YV12 (DXGI_FORMAT)MAKEFOURCC('Y','V','1','2') - -//for generating sequence of mfx handles -template -struct sequence { - T x; - sequence(T seed) : x(seed) { } -}; - -template <> -struct sequence { - mfxHDL x; - sequence(mfxHDL seed) : x(seed) { } - - mfxHDL operator ()() - { - mfxHDL y = x; - x = (mfxHDL)(1 + (size_t)(x)); - return y; - } -}; - - -D3D11FrameAllocator::D3D11FrameAllocator() -{ - m_pDeviceContext = NULL; -} - -D3D11FrameAllocator::~D3D11FrameAllocator() -{ - Close(); -} - -D3D11FrameAllocator::TextureSubResource D3D11FrameAllocator::GetResourceFromMid(mfxMemId mid) -{ - size_t index = (size_t)MFXReadWriteMid(mid).raw() - 1; - - if(m_memIdMap.size() <= index) - return TextureSubResource(); - - //reverse iterator dereferencing - TextureResource * p = &(*m_memIdMap[index]); - if (!p->bAlloc) - return TextureSubResource(); - - return TextureSubResource(p, mid); -} - -mfxStatus D3D11FrameAllocator::Init(mfxAllocatorParams *pParams) -{ - D3D11AllocatorParams *pd3d11Params = 0; - pd3d11Params = dynamic_cast(pParams); - - if (NULL == pd3d11Params || - NULL == pd3d11Params->pDevice) - { - return MFX_ERR_NOT_INITIALIZED; - } - - m_initParams = *pd3d11Params; - MSDK_SAFE_RELEASE(m_pDeviceContext); - pd3d11Params->pDevice->GetImmediateContext(&m_pDeviceContext); - - return MFX_ERR_NONE; -} - -mfxStatus D3D11FrameAllocator::Close() -{ - mfxStatus sts = BaseFrameAllocator::Close(); - for(referenceType i = m_resourcesByRequest.begin(); i != m_resourcesByRequest.end(); i++) - { - i->Release(); - } - m_resourcesByRequest.clear(); - m_memIdMap.clear(); - MSDK_SAFE_RELEASE(m_pDeviceContext); - return sts; -} - -mfxStatus D3D11FrameAllocator::LockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - HRESULT hRes = S_OK; - - D3D11_TEXTURE2D_DESC desc = {0}; - D3D11_MAPPED_SUBRESOURCE lockedRect = {0}; - - - //check that texture exists - TextureSubResource sr = GetResourceFromMid(mid); - if (!sr.GetTexture()) - return MFX_ERR_LOCK_MEMORY; - - D3D11_MAP mapType = D3D11_MAP_READ; - UINT mapFlags = D3D11_MAP_FLAG_DO_NOT_WAIT; - { - if (NULL == sr.GetStaging()) - { - hRes = m_pDeviceContext->Map(sr.GetTexture(), sr.GetSubResource(), D3D11_MAP_READ, D3D11_MAP_FLAG_DO_NOT_WAIT, &lockedRect); - desc.Format = DXGI_FORMAT_P8; - } - else - { - sr.GetTexture()->GetDesc(&desc); - - if (DXGI_FORMAT_NV12 != desc.Format && - DXGI_FORMAT_420_OPAQUE != desc.Format && - DXGI_FORMAT_YUY2 != desc.Format && - DXGI_FORMAT_P8 != desc.Format && - DXGI_FORMAT_B8G8R8A8_UNORM != desc.Format && - DXGI_FORMAT_R16_UINT != desc.Format && - DXGI_FORMAT_R16_UNORM != desc.Format && - DXGI_FORMAT_R10G10B10A2_UNORM != desc.Format && - DXGI_FORMAT_R16G16B16A16_UNORM != desc.Format && - DXGI_FORMAT_P010 != desc.Format && - DXGI_FORMAT_AYUV != desc.Format -#if (MFX_VERSION >= 1027) - && DXGI_FORMAT_Y210 != desc.Format - && DXGI_FORMAT_Y410 != desc.Format -#endif -#if (MFX_VERSION >= 1031) - && DXGI_FORMAT_P016 != desc.Format - && DXGI_FORMAT_Y216 != desc.Format - && DXGI_FORMAT_Y416 != desc.Format -#endif -) - { - return MFX_ERR_LOCK_MEMORY; - } - - //coping data only in case user wants to read from stored surface - { - - if (MFXReadWriteMid(mid, MFXReadWriteMid::reuse).isRead()) - { - m_pDeviceContext->CopySubresourceRegion(sr.GetStaging(), 0, 0, 0, 0, sr.GetTexture(), sr.GetSubResource(), NULL); - } - - do - { - hRes = m_pDeviceContext->Map(sr.GetStaging(), 0, mapType, mapFlags, &lockedRect); - if (S_OK != hRes && DXGI_ERROR_WAS_STILL_DRAWING != hRes) - { - msdk_printf(MSDK_STRING("ERROR: m_pDeviceContext->Map = 0x%08lx\n"), hRes); - } - } - while (DXGI_ERROR_WAS_STILL_DRAWING == hRes); - } - - } - } - - if (FAILED(hRes)) - return MFX_ERR_LOCK_MEMORY; - - switch (desc.Format) - { - case DXGI_FORMAT_P010: -#if (MFX_VERSION >= 1031) - case DXGI_FORMAT_P016: -#endif - case DXGI_FORMAT_NV12: - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->Y = (mfxU8 *)lockedRect.pData; - ptr->U = (mfxU8 *)lockedRect.pData + desc.Height * lockedRect.RowPitch; - ptr->V = (desc.Format == DXGI_FORMAT_P010) ? ptr->U + 2 : ptr->U + 1; - break; - - case DXGI_FORMAT_420_OPAQUE: // can be unsupported by standard ms guid - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->Y = (mfxU8 *)lockedRect.pData; - ptr->V = ptr->Y + desc.Height * lockedRect.RowPitch; - ptr->U = ptr->V + (desc.Height * lockedRect.RowPitch) / 4; - - break; - - case DXGI_FORMAT_YUY2: - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->Y = (mfxU8 *)lockedRect.pData; - ptr->U = ptr->Y + 1; - ptr->V = ptr->Y + 3; - - break; - - case DXGI_FORMAT_P8 : - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->Y = (mfxU8 *)lockedRect.pData; - ptr->U = 0; - ptr->V = 0; - - break; - - case DXGI_FORMAT_AYUV: - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->V = (mfxU8 *)lockedRect.pData; - ptr->U = ptr->V + 1; - ptr->Y = ptr->V + 2; - ptr->A = ptr->V + 3; - break; - - case DXGI_FORMAT_B8G8R8A8_UNORM: - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->B = (mfxU8 *)lockedRect.pData; - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->A = ptr->B + 3; - - break; - case DXGI_FORMAT_R10G10B10A2_UNORM : - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->B = (mfxU8 *)lockedRect.pData; - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->A = ptr->B + 3; - - break; - case DXGI_FORMAT_R16G16B16A16_UNORM: - ptr->V16 = (mfxU16*)lockedRect.pData; - ptr->U16 = ptr->V16 + 1; - ptr->Y16 = ptr->V16 + 2; - ptr->A = (mfxU8*)(ptr->V16 + 3); - ptr->PitchHigh = (mfxU16)((mfxU32)lockedRect.RowPitch / (1 << 16)); - ptr->PitchLow = (mfxU16)((mfxU32)lockedRect.RowPitch % (1 << 16)); - break; - case DXGI_FORMAT_R16_UNORM : - case DXGI_FORMAT_R16_UINT : - ptr->Pitch = (mfxU16)lockedRect.RowPitch; - ptr->Y16 = (mfxU16 *)lockedRect.pData; - ptr->U16 = 0; - ptr->V16 = 0; - - break; -#if (MFX_VERSION >= 1031) - case DXGI_FORMAT_Y416: - ptr->PitchHigh = (mfxU16)(lockedRect.RowPitch / (1 << 16)); - ptr->PitchLow = (mfxU16)(lockedRect.RowPitch % (1 << 16)); - ptr->U16 = (mfxU16*)lockedRect.pData; - ptr->Y16 = ptr->U16 + 1; - ptr->V16 = ptr->Y16 + 1; - ptr->A = (mfxU8 *)(ptr->V16 + 1); - break; - case DXGI_FORMAT_Y216: -#endif -#if (MFX_VERSION >= 1027) - case DXGI_FORMAT_Y210: - ptr->PitchHigh = (mfxU16)(lockedRect.RowPitch / (1 << 16)); - ptr->PitchLow = (mfxU16)(lockedRect.RowPitch % (1 << 16)); - ptr->Y16 = (mfxU16 *)lockedRect.pData; - ptr->U16 = ptr->Y16 + 1; - ptr->V16 = ptr->Y16 + 3; - - break; - - case DXGI_FORMAT_Y410: - ptr->PitchHigh = (mfxU16)(lockedRect.RowPitch / (1 << 16)); - ptr->PitchLow = (mfxU16)(lockedRect.RowPitch % (1 << 16)); - ptr->Y410 = (mfxY410 *)lockedRect.pData; - ptr->Y = 0; - ptr->V = 0; - ptr->A = 0; - - break; -#endif - - default: - - return MFX_ERR_LOCK_MEMORY; - } - - return MFX_ERR_NONE; -} - -mfxStatus D3D11FrameAllocator::UnlockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - //check that texture exists - TextureSubResource sr = GetResourceFromMid(mid); - if (!sr.GetTexture()) - return MFX_ERR_LOCK_MEMORY; - - if (NULL == sr.GetStaging()) - { - m_pDeviceContext->Unmap(sr.GetTexture(), sr.GetSubResource()); - } - else - { - m_pDeviceContext->Unmap(sr.GetStaging(), 0); - //only if user wrote something to texture - if (MFXReadWriteMid(mid, MFXReadWriteMid::reuse).isWrite()) - { - m_pDeviceContext->CopySubresourceRegion(sr.GetTexture(), sr.GetSubResource(), 0, 0, 0, sr.GetStaging(), 0, NULL); - } - } - - if (ptr) - { - ptr->Pitch=0; - ptr->U=ptr->V=ptr->Y=0; - ptr->A=ptr->R=ptr->G=ptr->B=0; - } - - return MFX_ERR_NONE; -} - - -mfxStatus D3D11FrameAllocator::GetFrameHDL(mfxMemId mid, mfxHDL *handle) -{ - if (NULL == handle) - return MFX_ERR_INVALID_HANDLE; - - TextureSubResource sr = GetResourceFromMid(mid); - - if (!sr.GetTexture()) - return MFX_ERR_INVALID_HANDLE; - - mfxHDLPair *pPair = (mfxHDLPair*)handle; - - pPair->first = sr.GetTexture(); - pPair->second = (mfxHDL)(UINT_PTR)sr.GetSubResource(); - - return MFX_ERR_NONE; -} - -mfxStatus D3D11FrameAllocator::CheckRequestType(mfxFrameAllocRequest *request) -{ - mfxStatus sts = BaseFrameAllocator::CheckRequestType(request); - if (MFX_ERR_NONE != sts) - return sts; - - if ((request->Type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) != 0) - return MFX_ERR_NONE; - else - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus D3D11FrameAllocator::ReleaseResponse(mfxFrameAllocResponse *response) -{ - if (NULL == response) - return MFX_ERR_NULL_PTR; - - if (response->mids && 0 != response->NumFrameActual) - { - //check whether texture exsist - TextureSubResource sr = GetResourceFromMid(response->mids[0]); - - if (!sr.GetTexture()) - return MFX_ERR_NULL_PTR; - - sr.Release(); - - //if texture is last it is possible to remove also all handles from map to reduce fragmentation - //search for allocated chunk - if (m_resourcesByRequest.end() == std::find_if(m_resourcesByRequest.begin(), m_resourcesByRequest.end(), TextureResource::isAllocated)) - { - m_resourcesByRequest.clear(); - m_memIdMap.clear(); - } - } - - return MFX_ERR_NONE; -} - -mfxStatus D3D11FrameAllocator::ReallocImpl(mfxMemId /*mid*/, const mfxFrameInfo *info, mfxU16 /*memType*/, mfxMemId *midOut) -{ - if (!info || !midOut) - return MFX_ERR_NULL_PTR; - - //TODO: Need add implementation in the future. - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus D3D11FrameAllocator::AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - HRESULT hRes; - - DXGI_FORMAT colorFormat = ConverColortFormat(request->Info.FourCC); - - if (DXGI_FORMAT_UNKNOWN == colorFormat) - { - msdk_printf(MSDK_STRING("D3D11 Allocator: invalid fourcc is provided (%#X), exitting\n"),request->Info.FourCC); - return MFX_ERR_UNSUPPORTED; - } - - TextureResource newTexture; - - if (request->Info.FourCC == MFX_FOURCC_P8) - { - D3D11_BUFFER_DESC desc = { 0 }; - - desc.ByteWidth = request->Info.Width * request->Info.Height; - desc.Usage = D3D11_USAGE_STAGING; - desc.BindFlags = 0; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - desc.MiscFlags = 0; - desc.StructureByteStride = 0; - - ID3D11Buffer * buffer = 0; - hRes = m_initParams.pDevice->CreateBuffer(&desc, 0, &buffer); - if (FAILED(hRes)) - return MFX_ERR_MEMORY_ALLOC; - - newTexture.textures.push_back(reinterpret_cast(buffer)); - } - else - { - D3D11_TEXTURE2D_DESC desc = {0}; - - desc.Width = request->Info.Width; - desc.Height = request->Info.Height; - - desc.MipLevels = 1; - //number of subresources is 1 in case of not single texture - desc.ArraySize = m_initParams.bUseSingleTexture ? request->NumFrameSuggested : 1; - desc.Format = ConverColortFormat(request->Info.FourCC); - desc.SampleDesc.Count = 1; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.MiscFlags = m_initParams.uncompressedResourceMiscFlags | D3D11_RESOURCE_MISC_SHARED; -#if (MFX_VERSION >= 1025) - if ((request->Type&MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET) && (request->Type & MFX_MEMTYPE_INTERNAL_FRAME)) - { - desc.BindFlags = D3D11_BIND_DECODER | D3D11_BIND_VIDEO_ENCODER; - } - else -#endif - desc.BindFlags = D3D11_BIND_DECODER; - - if ( (MFX_MEMTYPE_FROM_VPPIN & request->Type) && (DXGI_FORMAT_YUY2 == desc.Format) || - (DXGI_FORMAT_B8G8R8A8_UNORM == desc.Format) || - (DXGI_FORMAT_R10G10B10A2_UNORM == desc.Format) || - (DXGI_FORMAT_R16G16B16A16_UNORM == desc.Format) ) - { - desc.BindFlags = D3D11_BIND_RENDER_TARGET; - if (desc.ArraySize > 2) - return MFX_ERR_MEMORY_ALLOC; - } - - if ( (MFX_MEMTYPE_FROM_VPPOUT & request->Type) || - (MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET & request->Type)) - { - desc.BindFlags = D3D11_BIND_RENDER_TARGET; - if (desc.ArraySize > 2) - return MFX_ERR_MEMORY_ALLOC; - } - - if(request->Type&MFX_MEMTYPE_SHARED_RESOURCE) - { - desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE; - desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED; - } - - if( DXGI_FORMAT_P8 == desc.Format ) - { - desc.BindFlags = 0; - } - - ID3D11Texture2D* pTexture2D; - - for(size_t i = 0; i < request->NumFrameSuggested / desc.ArraySize; i++) - { - hRes = m_initParams.pDevice->CreateTexture2D(&desc, NULL, &pTexture2D); - - if (FAILED(hRes)) - { - msdk_printf(MSDK_STRING("CreateTexture2D(%lld) failed, hr = 0x%08lx\n"), (long long)i, hRes); - return MFX_ERR_MEMORY_ALLOC; - } - newTexture.textures.push_back(pTexture2D); - } - - desc.ArraySize = 1; - desc.Usage = D3D11_USAGE_STAGING; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - desc.BindFlags = 0; - desc.MiscFlags = 0; - - for(size_t i = 0; i < request->NumFrameSuggested; i++) - { - hRes = m_initParams.pDevice->CreateTexture2D(&desc, NULL, &pTexture2D); - - if (FAILED(hRes)) - { - msdk_printf(MSDK_STRING("Create staging texture(%lld) failed hr = 0x%X\n"), (long long)i, (unsigned int)hRes); - return MFX_ERR_MEMORY_ALLOC; - } - newTexture.stagingTexture.push_back(pTexture2D); - } - } - - // mapping to self created handles array, starting from zero or from last assigned handle + 1 - sequence seq_initializer(m_resourcesByRequest.empty() ? 0 : m_resourcesByRequest.back().outerMids.back()); - - //incrementing starting index - //1. 0(NULL) is invalid memid - //2. back is last index not new one - seq_initializer(); - - std::generate_n(std::back_inserter(newTexture.outerMids), request->NumFrameSuggested, seq_initializer); - - //saving texture resources - m_resourcesByRequest.push_back(newTexture); - - //providing pointer to mids externally - response->mids = &m_resourcesByRequest.back().outerMids.front(); - response->NumFrameActual = request->NumFrameSuggested; - - //iterator prior end() - std::list ::iterator it_last = m_resourcesByRequest.end(); - //fill map - std::fill_n(std::back_inserter(m_memIdMap), request->NumFrameSuggested, --it_last); - - return MFX_ERR_NONE; -} - -DXGI_FORMAT D3D11FrameAllocator::ConverColortFormat(mfxU32 fourcc) -{ - switch (fourcc) - { - case MFX_FOURCC_NV12: - return DXGI_FORMAT_NV12; - - case MFX_FOURCC_YUY2: - return DXGI_FORMAT_YUY2; - - case MFX_FOURCC_RGB4: - return DXGI_FORMAT_B8G8R8A8_UNORM; - - case MFX_FOURCC_P8: - case MFX_FOURCC_P8_TEXTURE: - return DXGI_FORMAT_P8; - - case MFX_FOURCC_ARGB16: - case MFX_FOURCC_ABGR16: - return DXGI_FORMAT_R16G16B16A16_UNORM; - - case MFX_FOURCC_P010: - return DXGI_FORMAT_P010; - - case MFX_FOURCC_A2RGB10: - return DXGI_FORMAT_R10G10B10A2_UNORM; - - case DXGI_FORMAT_AYUV: - case MFX_FOURCC_AYUV: - return DXGI_FORMAT_AYUV; - -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - return DXGI_FORMAT_Y210; - case MFX_FOURCC_Y410: - return DXGI_FORMAT_Y410; -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: - return DXGI_FORMAT_P016; - case MFX_FOURCC_Y216: - return DXGI_FORMAT_Y216; - case MFX_FOURCC_Y416: - return DXGI_FORMAT_Y416; -#endif - - default: - return DXGI_FORMAT_UNKNOWN; - } -} - -#endif // #if MFX_D3D11_SUPPORT -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_device.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_device.cpp deleted file mode 100644 index 15227b99..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d11_device.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include "sample_defs.h" - -#if MFX_D3D11_SUPPORT - -#include "d3d11_device.h" - -CD3D11Device::CD3D11Device(): - m_nViews(0), - m_bDefaultStereoEnabled(FALSE), - m_bIsA2rgb10(FALSE), - m_HandleWindow(NULL) -{ -} - -CD3D11Device::~CD3D11Device() -{ - Close(); -} - -mfxStatus CD3D11Device::FillSCD(mfxHDL hWindow, DXGI_SWAP_CHAIN_DESC& scd) -{ - scd.Windowed = TRUE; - scd.OutputWindow = (HWND)hWindow; - scd.SampleDesc.Count = 1; - scd.BufferDesc.Format = (m_bIsA2rgb10) ? DXGI_FORMAT_R10G10B10A2_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM; - scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - scd.BufferCount = 1; - - return MFX_ERR_NONE; -} - -mfxStatus CD3D11Device::FillSCD1(DXGI_SWAP_CHAIN_DESC1& scd1) -{ - scd1.Width = 0; // Use automatic sizing. - scd1.Height = 0; - scd1.Format = (m_bIsA2rgb10) ? DXGI_FORMAT_R10G10B10A2_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM; - scd1.Stereo = m_nViews == 2 ? TRUE : FALSE; - scd1.SampleDesc.Count = 1; // Don't use multi-sampling. - scd1.SampleDesc.Quality = 0; - scd1.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - scd1.BufferCount = 2; // Use double buffering to minimize latency. - scd1.Scaling = DXGI_SCALING_STRETCH; - scd1.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; - scd1.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; - - return MFX_ERR_NONE; -} - -mfxStatus CD3D11Device::Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum) -{ - m_HandleWindow = (HWND)hWindow; - mfxStatus sts = MFX_ERR_NONE; - HRESULT hres = S_OK; - m_nViews = nViews; - if (2 < nViews) - return MFX_ERR_UNSUPPORTED; - m_bDefaultStereoEnabled = FALSE; - - static D3D_FEATURE_LEVEL FeatureLevels[] = { - D3D_FEATURE_LEVEL_11_1, - D3D_FEATURE_LEVEL_11_0, - D3D_FEATURE_LEVEL_10_1, - D3D_FEATURE_LEVEL_10_0 - }; - D3D_FEATURE_LEVEL pFeatureLevelsOut; - - hres = CreateDXGIFactory(__uuidof(IDXGIFactory2), (void**)(&m_pDXGIFactory) ); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - if (m_nViews == 2) - { - hres = m_pDXGIFactory->QueryInterface(__uuidof(IDXGIDisplayControl), (void **)&m_pDisplayControl); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - m_bDefaultStereoEnabled = m_pDisplayControl->IsStereoEnabled(); - if (!m_bDefaultStereoEnabled) - m_pDisplayControl->SetStereoEnabled(TRUE); - } - - hres = m_pDXGIFactory->EnumAdapters(nAdapterNum,&m_pAdapter); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - hres = D3D11CreateDevice(m_pAdapter , - D3D_DRIVER_TYPE_UNKNOWN, - NULL, - 0, - FeatureLevels, - MSDK_ARRAY_LEN(FeatureLevels), - D3D11_SDK_VERSION, - &m_pD3D11Device, - &pFeatureLevelsOut, - &m_pD3D11Ctx); - - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - m_pDXGIDev = m_pD3D11Device; - m_pDX11VideoDevice = m_pD3D11Device; - m_pVideoContext = m_pD3D11Ctx; - - MSDK_CHECK_POINTER(m_pDXGIDev.p, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(m_pDX11VideoDevice.p, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(m_pVideoContext.p, MFX_ERR_NULL_PTR); - - // turn on multithreading for the Context - CComQIPtr p_mt(m_pVideoContext); - - if (p_mt) - p_mt->SetMultithreadProtected(true); - else - return MFX_ERR_DEVICE_FAILED; - - // create swap chain only for rendering use case (hWindow != 0) - if (hWindow) - { - MSDK_CHECK_POINTER(m_pDXGIFactory.p, MFX_ERR_NULL_PTR); - DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; - - sts = FillSCD1(swapChainDesc); - MSDK_CHECK_STATUS(sts, "FillSCD1 failed"); - - hres = m_pDXGIFactory->CreateSwapChainForHwnd(m_pD3D11Device, - (HWND)hWindow, - &swapChainDesc, - NULL, - NULL, - reinterpret_cast(&m_pSwapChain)); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - } - - return sts; -} - -mfxStatus CD3D11Device::CreateVideoProcessor(mfxFrameSurface1 * pSrf) -{ - HRESULT hres = S_OK; - - if (m_VideoProcessorEnum.p || NULL == pSrf) - return MFX_ERR_NONE; - - //create video processor - D3D11_VIDEO_PROCESSOR_CONTENT_DESC ContentDesc; - MSDK_ZERO_MEMORY( ContentDesc ); - - ContentDesc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; - ContentDesc.InputFrameRate.Numerator = 30000; - ContentDesc.InputFrameRate.Denominator = 1000; - ContentDesc.InputWidth = pSrf->Info.CropW; - ContentDesc.InputHeight = pSrf->Info.CropH; - ContentDesc.OutputWidth = pSrf->Info.CropW; - ContentDesc.OutputHeight = pSrf->Info.CropH; - ContentDesc.OutputFrameRate.Numerator = 30000; - ContentDesc.OutputFrameRate.Denominator = 1000; - - ContentDesc.Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL; - - hres = m_pDX11VideoDevice->CreateVideoProcessorEnumerator( &ContentDesc, &m_VideoProcessorEnum ); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - hres = m_pDX11VideoDevice->CreateVideoProcessor( m_VideoProcessorEnum, 0, &m_pVideoProcessor ); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - return MFX_ERR_NONE; -} - -mfxStatus CD3D11Device::Reset() -{ - // Changing video mode back to the original state - if (2 == m_nViews && !m_bDefaultStereoEnabled) - m_pDisplayControl->SetStereoEnabled(FALSE); - - MSDK_CHECK_POINTER (m_pDXGIFactory.p, MFX_ERR_NULL_PTR); - DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; - - mfxStatus sts = FillSCD1(swapChainDesc); - MSDK_CHECK_STATUS(sts, "FillSCD1 failed"); - - HRESULT hres = S_OK; - hres = m_pDXGIFactory->CreateSwapChainForHwnd(m_pD3D11Device, - (HWND)m_HandleWindow, - &swapChainDesc, - NULL, - NULL, - reinterpret_cast(&m_pSwapChain)); - - if (FAILED(hres)) - { - if (swapChainDesc.Stereo) - { - MSDK_PRINT_RET_MSG(MFX_ERR_DEVICE_FAILED,"Cannot create swap chain required for rendering. Possibly stereo mode is not supported."); - } - else - { - MSDK_PRINT_RET_MSG(MFX_ERR_DEVICE_FAILED, "Cannot create swap chain required for rendering."); - } - - return MFX_ERR_DEVICE_FAILED; - } - return MFX_ERR_NONE; -} - -mfxStatus CD3D11Device::GetHandle(mfxHandleType type, mfxHDL *pHdl) -{ - if (MFX_HANDLE_D3D11_DEVICE == type) - { - *pHdl = m_pD3D11Device.p; - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CD3D11Device::SetHandle(mfxHandleType type, mfxHDL hdl) -{ - if (MFX_HANDLE_DEVICEWINDOW == type && hdl != NULL) //for render window handle - { - m_HandleWindow = (HWND)hdl; - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CD3D11Device::RenderFrame(mfxFrameSurface1 * pSrf, mfxFrameAllocator * pAlloc) -{ - HRESULT hres = S_OK; - mfxStatus sts; - - sts = CreateVideoProcessor(pSrf); - MSDK_CHECK_STATUS(sts, "CreateVideoProcessor failed"); - - hres = m_pSwapChain->GetBuffer(0, __uuidof( ID3D11Texture2D ), (void**)&m_pDXGIBackBuffer.p); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC OutputViewDesc; - if (2 == m_nViews) - { - m_pVideoContext->VideoProcessorSetStreamStereoFormat(m_pVideoProcessor, 0, TRUE,D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_SEPARATE, - TRUE, TRUE, D3D11_VIDEO_PROCESSOR_STEREO_FLIP_NONE, NULL); - m_pVideoContext->VideoProcessorSetOutputStereoMode(m_pVideoProcessor,TRUE); - - OutputViewDesc.ViewDimension = D3D11_VPOV_DIMENSION_TEXTURE2DARRAY; - OutputViewDesc.Texture2DArray.ArraySize = 2; - OutputViewDesc.Texture2DArray.MipSlice = 0; - OutputViewDesc.Texture2DArray.FirstArraySlice = 0; - } - else - { - OutputViewDesc.ViewDimension = D3D11_VPOV_DIMENSION_TEXTURE2D; - OutputViewDesc.Texture2D.MipSlice = 0; - } - - if (1 == m_nViews || 0 == pSrf->Info.FrameId.ViewId) - { - hres = m_pDX11VideoDevice->CreateVideoProcessorOutputView( - m_pDXGIBackBuffer, - m_VideoProcessorEnum, - &OutputViewDesc, - &m_pOutputView.p ); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - } - - D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC InputViewDesc; - InputViewDesc.FourCC = 0; - InputViewDesc.ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D; - InputViewDesc.Texture2D.MipSlice = 0; - InputViewDesc.Texture2D.ArraySlice = 0; - - mfxHDLPair pair = {NULL}; - sts = pAlloc->GetHDL(pAlloc->pthis, pSrf->Data.MemId, (mfxHDL*)&pair); - MSDK_CHECK_STATUS(sts, "pAlloc->GetHDL failed"); - - ID3D11Texture2D *pRTTexture2D = reinterpret_cast(pair.first); - D3D11_TEXTURE2D_DESC RTTexture2DDesc; - - if(!m_pTempTexture && m_nViews == 2) - { - pRTTexture2D->GetDesc(&RTTexture2DDesc); - hres = m_pD3D11Device->CreateTexture2D(&RTTexture2DDesc,NULL,&m_pTempTexture.p); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - } - - // Creating input views for left and righ eyes - if (1 == m_nViews) - { - hres = m_pDX11VideoDevice->CreateVideoProcessorInputView( - pRTTexture2D, - m_VideoProcessorEnum, - &InputViewDesc, - &m_pInputViewLeft.p ); - - } - else if (2 == m_nViews && 0 == pSrf->Info.FrameId.ViewId) - { - m_pD3D11Ctx->CopyResource(m_pTempTexture,pRTTexture2D); - hres = m_pDX11VideoDevice->CreateVideoProcessorInputView( - m_pTempTexture, - m_VideoProcessorEnum, - &InputViewDesc, - &m_pInputViewLeft.p ); - } - else - { - hres = m_pDX11VideoDevice->CreateVideoProcessorInputView( - pRTTexture2D, - m_VideoProcessorEnum, - &InputViewDesc, - &m_pInputViewRight.p ); - } - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - - // NV12 surface to RGB backbuffer - RECT rect = {0}; - rect.right = pSrf->Info.CropW; - rect.bottom = pSrf->Info.CropH; - - D3D11_VIDEO_PROCESSOR_STREAM StreamData; - - if (1 == m_nViews || pSrf->Info.FrameId.ViewId == 1) - { - StreamData.Enable = TRUE; - StreamData.OutputIndex = 0; - StreamData.InputFrameOrField = 0; - StreamData.PastFrames = 0; - StreamData.FutureFrames = 0; - StreamData.ppPastSurfaces = NULL; - StreamData.ppFutureSurfaces = NULL; - StreamData.pInputSurface = m_pInputViewLeft; - StreamData.ppPastSurfacesRight = NULL; - StreamData.ppFutureSurfacesRight = NULL; - StreamData.pInputSurfaceRight = m_nViews == 2 ? m_pInputViewRight : NULL; - - m_pVideoContext->VideoProcessorSetStreamSourceRect(m_pVideoProcessor, 0, true, &rect); - m_pVideoContext->VideoProcessorSetStreamFrameFormat( m_pVideoProcessor, 0, D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE); - hres = m_pVideoContext->VideoProcessorBlt( m_pVideoProcessor, m_pOutputView, 0, 1, &StreamData ); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - } - - if (1 == m_nViews || 1 == pSrf->Info.FrameId.ViewId) - { - DXGI_PRESENT_PARAMETERS parameters = {0}; - hres = m_pSwapChain->Present1(0, 0, ¶meters); - if (FAILED(hres)) - return MFX_ERR_DEVICE_FAILED; - } - - return MFX_ERR_NONE; -} - -void CD3D11Device::Close() -{ - // Changing video mode back to the original state - if (2 == m_nViews && !m_bDefaultStereoEnabled) - m_pDisplayControl->SetStereoEnabled(FALSE); - - m_HandleWindow = NULL; -} - -#endif // #if MFX_D3D11_SUPPORT -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_allocator.cpp deleted file mode 100644 index a06e1fb7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_allocator.cpp +++ /dev/null @@ -1,475 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" -#include "sample_defs.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include -#include -#include -#include - -#include "d3d_allocator.h" - -#define D3DFMT_NV12 (D3DFORMAT)MAKEFOURCC('N','V','1','2') -#define D3DFMT_YV12 (D3DFORMAT)MAKEFOURCC('Y','V','1','2') -#define D3DFMT_NV16 (D3DFORMAT)MAKEFOURCC('N','V','1','6') -#define D3DFMT_P010 (D3DFORMAT)MAKEFOURCC('P','0','1','0') -#define D3DFMT_P210 (D3DFORMAT)MAKEFOURCC('P','2','1','0') -#define D3DFMT_IMC3 (D3DFORMAT)MAKEFOURCC('I','M','C','3') -#define D3DFMT_AYUV (D3DFORMAT)MAKEFOURCC('A','Y','U','V') -#if (MFX_VERSION >= 1027) -#define D3DFMT_Y210 (D3DFORMAT)MAKEFOURCC('Y','2','1','0') -#define D3DFMT_Y410 (D3DFORMAT)MAKEFOURCC('Y','4','1','0') -#endif -#if (MFX_VERSION >= 1031) -#define D3DFMT_P016 (D3DFORMAT)MAKEFOURCC('P','0','1','6') -#define D3DFMT_Y216 (D3DFORMAT)MAKEFOURCC('Y','2','1','6') -#define D3DFMT_Y416 (D3DFORMAT)MAKEFOURCC('Y','4','1','6') -#endif - -#define MFX_FOURCC_IMC3 (MFX_MAKEFOURCC('I','M','C','3')) // This line should be moved into mfxstructures.h in new API version - -D3DFORMAT ConvertMfxFourccToD3dFormat(mfxU32 fourcc) -{ - switch (fourcc) - { - case MFX_FOURCC_NV12: - return D3DFMT_NV12; - case MFX_FOURCC_YV12: - return D3DFMT_YV12; - case MFX_FOURCC_NV16: - return D3DFMT_NV16; - case MFX_FOURCC_YUY2: - return D3DFMT_YUY2; - case MFX_FOURCC_RGB3: - return D3DFMT_R8G8B8; - case MFX_FOURCC_RGB4: - return D3DFMT_A8R8G8B8; - case MFX_FOURCC_P8: - return D3DFMT_P8; - case MFX_FOURCC_P010: - return D3DFMT_P010; - case MFX_FOURCC_AYUV: - return D3DFMT_AYUV; - case MFX_FOURCC_P210: - return D3DFMT_P210; -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - return D3DFMT_Y210; - case MFX_FOURCC_Y410: - return D3DFMT_Y410; -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: - return D3DFMT_P016; - case MFX_FOURCC_Y216: - return D3DFMT_Y216; - case MFX_FOURCC_Y416: - return D3DFMT_Y416; -#endif - case MFX_FOURCC_A2RGB10: - return D3DFMT_A2R10G10B10; - case MFX_FOURCC_ABGR16: - case MFX_FOURCC_ARGB16: - return D3DFMT_A16B16G16R16; - case MFX_FOURCC_IMC3: - return D3DFMT_IMC3; - default: - return D3DFMT_UNKNOWN; - } -} - -D3DFrameAllocator::D3DFrameAllocator() -: m_decoderService(0), m_processorService(0), m_hDecoder(0), m_hProcessor(0), m_manager(0), m_surfaceUsage(0) -{ -} - -D3DFrameAllocator::~D3DFrameAllocator() -{ - Close(); - for (unsigned i = 0; i < m_midsAllocated.size(); i++) - MSDK_SAFE_FREE(m_midsAllocated[i]); -} - -mfxStatus D3DFrameAllocator::Init(mfxAllocatorParams *pParams) -{ - D3DAllocatorParams *pd3dParams = 0; - pd3dParams = dynamic_cast(pParams); - if (!pd3dParams) - return MFX_ERR_NOT_INITIALIZED; - - m_manager = pd3dParams->pManager; - m_surfaceUsage = pd3dParams->surfaceUsage; - - return MFX_ERR_NONE; -} - -mfxStatus D3DFrameAllocator::Close() -{ - if (m_manager && m_hDecoder) - { - m_manager->CloseDeviceHandle(m_hDecoder); - m_manager = 0; - m_hDecoder = 0; - } - - if (m_manager && m_hProcessor) - { - m_manager->CloseDeviceHandle(m_hProcessor); - m_manager = 0; - m_hProcessor = 0; - } - - return BaseFrameAllocator::Close(); -} - -mfxStatus D3DFrameAllocator::LockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (!ptr || !mid) - return MFX_ERR_NULL_PTR; - - mfxHDLPair *dxmid = (mfxHDLPair*)mid; - IDirect3DSurface9 *pSurface = static_cast(dxmid->first); - if (pSurface == 0) - return MFX_ERR_INVALID_HANDLE; - - D3DSURFACE_DESC desc; - HRESULT hr = pSurface->GetDesc(&desc); - if (FAILED(hr)) - return MFX_ERR_LOCK_MEMORY; - - if (desc.Format != D3DFMT_NV12 && - desc.Format != D3DFMT_YV12 && - desc.Format != D3DFMT_YUY2 && - desc.Format != D3DFMT_R8G8B8 && - desc.Format != D3DFMT_A8R8G8B8 && - desc.Format != D3DFMT_P8 && - desc.Format != D3DFMT_P010 && - desc.Format != D3DFMT_A2R10G10B10 && - desc.Format != D3DFMT_A16B16G16R16 && - desc.Format != D3DFMT_IMC3 && - desc.Format != D3DFMT_AYUV -#if (MFX_VERSION >= 1027) - && desc.Format != D3DFMT_Y210 -#endif -#if (MFX_VERSION >= 1031) - && desc.Format != D3DFMT_P016 - && desc.Format != D3DFMT_Y216 - && desc.Format != D3DFMT_Y410 - && desc.Format != D3DFMT_Y416 -#endif - ) - return MFX_ERR_LOCK_MEMORY; - - D3DLOCKED_RECT locked; - - hr = pSurface->LockRect(&locked, 0, D3DLOCK_NOSYSLOCK); - if (FAILED(hr)) - return MFX_ERR_LOCK_MEMORY; - - switch ((DWORD)desc.Format) - { - case D3DFMT_NV12: - case D3DFMT_P010: -#if (MFX_VERSION >= 1031) - case D3DFMT_P016: -#endif - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y = (mfxU8 *)locked.pBits; - ptr->U = (mfxU8 *)locked.pBits + desc.Height * locked.Pitch; - ptr->V = (desc.Format == D3DFMT_P010) ? ptr->U + 2 : ptr->U + 1; - break; - case D3DFMT_YV12: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y = (mfxU8 *)locked.pBits; - ptr->V = ptr->Y + desc.Height * locked.Pitch; - ptr->U = ptr->V + (desc.Height * locked.Pitch) / 4; - break; - case D3DFMT_YUY2: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y = (mfxU8 *)locked.pBits; - ptr->U = ptr->Y + 1; - ptr->V = ptr->Y + 3; - break; - case D3DFMT_R8G8B8: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->B = (mfxU8 *)locked.pBits; - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - break; - case D3DFMT_A8R8G8B8: - case D3DFMT_A2R10G10B10: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->B = (mfxU8 *)locked.pBits; - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->A = ptr->B + 3; - break; - case D3DFMT_P8: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y = (mfxU8 *)locked.pBits; - ptr->U = 0; - ptr->V = 0; - break; - case D3DFMT_A16B16G16R16: - ptr->V16 = (mfxU16*)locked.pBits; - ptr->U16 = ptr->V16 + 1; - ptr->Y16 = ptr->V16 + 2; - ptr->A = (mfxU8*)(ptr->V16 + 3); - ptr->PitchHigh = (mfxU16)((mfxU32)locked.Pitch / (1 << 16)); - ptr->PitchLow = (mfxU16)((mfxU32)locked.Pitch % (1 << 16)); - break; - case D3DFMT_IMC3: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y = (mfxU8 *)locked.pBits; - ptr->V = ptr->Y + desc.Height * locked.Pitch; - ptr->U = ptr->Y + desc.Height * locked.Pitch *2; - break; - case D3DFMT_AYUV: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->V = (mfxU8 *)locked.pBits; - ptr->U = ptr->V + 1; - ptr->Y = ptr->V + 2; - ptr->A = ptr->V + 3; - break; -#if (MFX_VERSION >= 1031) - case D3DFMT_Y416: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->U16 = (mfxU16*)locked.pBits; - ptr->Y16 = ptr->U16 + 1; - ptr->V16 = ptr->Y16 + 1; - ptr->A = (mfxU8 *)(ptr->V16 + 1); - break; - case D3DFMT_Y216: -#endif -#if (MFX_VERSION >= 1027) - case D3DFMT_Y210: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y16 = (mfxU16 *)locked.pBits; - ptr->U16 = ptr->Y16 + 1; - ptr->V16 = ptr->Y16 + 3; - break; - case D3DFMT_Y410: - ptr->Pitch = (mfxU16)locked.Pitch; - ptr->Y410 = (mfxY410 *)locked.pBits; - ptr->Y = 0; - ptr->V = 0; - ptr->A = 0; - break; -#endif - } - - return MFX_ERR_NONE; -} - -mfxStatus D3DFrameAllocator::UnlockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (!mid) - return MFX_ERR_NULL_PTR; - - mfxHDLPair *dxmid = (mfxHDLPair*)mid; - IDirect3DSurface9 *pSurface = static_cast(dxmid->first); - if (pSurface == 0) - return MFX_ERR_INVALID_HANDLE; - - pSurface->UnlockRect(); - - if (NULL != ptr) - { - ptr->Pitch = 0; - ptr->Y = 0; - ptr->U = 0; - ptr->V = 0; - } - - return MFX_ERR_NONE; -} - -mfxStatus D3DFrameAllocator::GetFrameHDL(mfxMemId mid, mfxHDL * handle) -{ - if (!mid || !handle) - return MFX_ERR_NULL_PTR; - - mfxHDLPair *dxMid = (mfxHDLPair*)mid; - *handle = dxMid->first; - return MFX_ERR_NONE; -} - -mfxStatus D3DFrameAllocator::CheckRequestType(mfxFrameAllocRequest *request) -{ - mfxStatus sts = BaseFrameAllocator::CheckRequestType(request); - if (MFX_ERR_NONE != sts) - return sts; - - if ((request->Type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) != 0) - return MFX_ERR_NONE; - else - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus D3DFrameAllocator::ReleaseResponse(mfxFrameAllocResponse *response) -{ - if (!response) - return MFX_ERR_NULL_PTR; - - mfxStatus sts = MFX_ERR_NONE; - - if (response->mids) { - for (mfxU32 i = 0; i < response->NumFrameActual; i++) { - if (response->mids[i]) { - mfxHDLPair *dxMids = (mfxHDLPair*)response->mids[i]; - if (dxMids->first) - { - static_cast(dxMids->first)->Release(); - } - MSDK_SAFE_FREE(dxMids); - } - } - } - - return sts; -} - -mfxStatus D3DFrameAllocator::ReallocImpl(mfxMemId /*mid*/, const mfxFrameInfo *info, mfxU16 /*memType*/, mfxMemId *midOut) -{ - if (!info || !midOut) - return MFX_ERR_NULL_PTR; - - //TODO: Need add implementation in the future. - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus D3DFrameAllocator::AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - HRESULT hr; - - MSDK_CHECK_POINTER(request, MFX_ERR_NULL_PTR); - if (request->NumFrameSuggested == 0) - return MFX_ERR_UNKNOWN; - - D3DFORMAT format = ConvertMfxFourccToD3dFormat(request->Info.FourCC); - - if (format == D3DFMT_UNKNOWN) - { - msdk_printf(MSDK_STRING("D3D Allocator: invalid fourcc is provided (%#X), exitting\n"),request->Info.FourCC); - return MFX_ERR_UNSUPPORTED; - } - - DWORD target; - - if (MFX_MEMTYPE_DXVA2_DECODER_TARGET & request->Type) - { - target = DXVA2_VideoDecoderRenderTarget; - } - else if (MFX_MEMTYPE_DXVA2_PROCESSOR_TARGET & request->Type) - { - target = DXVA2_VideoProcessorRenderTarget; - } - else - return MFX_ERR_UNSUPPORTED; - - IDirectXVideoAccelerationService* videoService = NULL; - - if (target == DXVA2_VideoProcessorRenderTarget) { - if (!m_hProcessor) { - hr = m_manager->OpenDeviceHandle(&m_hProcessor); - if (FAILED(hr)) - return MFX_ERR_MEMORY_ALLOC; - - hr = m_manager->GetVideoService(m_hProcessor, IID_IDirectXVideoProcessorService, (void**)&m_processorService); - if (FAILED(hr)) - return MFX_ERR_MEMORY_ALLOC; - } - videoService = m_processorService; - } - else { - if (!m_hDecoder) - { - hr = m_manager->OpenDeviceHandle(&m_hDecoder); - if (FAILED(hr)) - return MFX_ERR_MEMORY_ALLOC; - - hr = m_manager->GetVideoService(m_hDecoder, IID_IDirectXVideoDecoderService, (void**)&m_decoderService); - if (FAILED(hr)) - return MFX_ERR_MEMORY_ALLOC; - } - videoService = m_decoderService; - } - - mfxHDLPair **dxMidPtrs = (mfxHDLPair**)calloc(request->NumFrameSuggested, sizeof(mfxHDLPair*)); - if (!dxMidPtrs) - return MFX_ERR_MEMORY_ALLOC; - - for (int i = 0; i < request->NumFrameSuggested; i++) - { - dxMidPtrs[i] = (mfxHDLPair*)calloc(1, sizeof(mfxHDLPair)); - if (!dxMidPtrs[i]) - { - DeallocateMids(dxMidPtrs, i); - return MFX_ERR_MEMORY_ALLOC; - } - } - - response->mids = (mfxMemId*)dxMidPtrs; - response->NumFrameActual = request->NumFrameSuggested; - - if (request->Type & MFX_MEMTYPE_EXTERNAL_FRAME) { - for (int i = 0; i < request->NumFrameSuggested; i++) { - hr = videoService->CreateSurface(request->Info.Width, request->Info.Height, 0, format, - D3DPOOL_DEFAULT, m_surfaceUsage, target, (IDirect3DSurface9**)&dxMidPtrs[i]->first, &dxMidPtrs[i]->second); - if (FAILED(hr)) { - ReleaseResponse(response); - return MFX_ERR_MEMORY_ALLOC; - } - } - } else { - std::unique_ptr dxSrf(new (std::nothrow) IDirect3DSurface9*[request->NumFrameSuggested]); - if (!dxSrf.get()) - { - DeallocateMids(dxMidPtrs, request->NumFrameSuggested); - return MFX_ERR_MEMORY_ALLOC; - } - hr = videoService->CreateSurface(request->Info.Width, request->Info.Height, request->NumFrameSuggested - 1, format, - D3DPOOL_DEFAULT, m_surfaceUsage, target, dxSrf.get(), NULL); - if (FAILED(hr)) - { - DeallocateMids(dxMidPtrs, request->NumFrameSuggested); - return MFX_ERR_MEMORY_ALLOC; - } - - for (int i = 0; i < request->NumFrameSuggested; i++) { - dxMidPtrs[i]->first = dxSrf[i]; - } - } - m_midsAllocated.push_back(dxMidPtrs); - return MFX_ERR_NONE; -} - -void D3DFrameAllocator::DeallocateMids(mfxHDLPair** pair, int n) -{ - for (int i = 0; i < n; i++) - { - MSDK_SAFE_FREE(pair[i]); - } - MSDK_SAFE_FREE(pair); -} -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_device.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_device.cpp deleted file mode 100644 index d469cae4..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/d3d_device.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" -#include - -#if defined(_WIN32) || defined(_WIN64) - -//prefast singnature used in combaseapi.h -#ifndef _PREFAST_ - #pragma warning(disable:4068) -#endif - -#include "d3d_device.h" -#include "d3d_allocator.h" -#include "sample_defs.h" - -#include "atlbase.h" - -CD3D9Device::CD3D9Device() -{ - m_pD3D9 = NULL; - m_pD3DD9 = NULL; - m_pDeviceManager9 = NULL; - MSDK_ZERO_MEMORY(m_D3DPP); - m_resetToken = 0; - - m_nViews = 0; - - MSDK_ZERO_MEMORY(m_backBufferDesc); - m_pDXVAVPS = NULL; - m_pDXVAVP_Left = NULL; - m_pDXVAVP_Right = NULL; - - MSDK_ZERO_MEMORY(m_targetRect); - - MSDK_ZERO_MEMORY(m_VideoDesc); - MSDK_ZERO_MEMORY(m_BltParams); - MSDK_ZERO_MEMORY(m_Sample); - - // Initialize DXVA structures - - DXVA2_AYUVSample16 color = { - 0x8000, // Cr - 0x8000, // Cb - 0x1000, // Y - 0xffff // Alpha - }; - - DXVA2_ExtendedFormat format = { // DestFormat - DXVA2_SampleProgressiveFrame, // SampleFormat - DXVA2_VideoChromaSubsampling_MPEG2, // VideoChromaSubsampling - DXVA_NominalRange_0_255, // NominalRange - DXVA2_VideoTransferMatrix_BT709, // VideoTransferMatrix - DXVA2_VideoLighting_bright, // VideoLighting - DXVA2_VideoPrimaries_BT709, // VideoPrimaries - DXVA2_VideoTransFunc_709 // VideoTransferFunction - }; - - // init m_VideoDesc structure - MSDK_MEMCPY_VAR(m_VideoDesc.SampleFormat, &format, sizeof(DXVA2_ExtendedFormat)); - m_VideoDesc.SampleWidth = 0; - m_VideoDesc.SampleHeight = 0; - m_VideoDesc.InputSampleFreq.Numerator = 60; - m_VideoDesc.InputSampleFreq.Denominator = 1; - m_VideoDesc.OutputFrameFreq.Numerator = 60; - m_VideoDesc.OutputFrameFreq.Denominator = 1; - - // init m_BltParams structure - MSDK_MEMCPY_VAR(m_BltParams.DestFormat, &format, sizeof(DXVA2_ExtendedFormat)); - MSDK_MEMCPY_VAR(m_BltParams.BackgroundColor, &color, sizeof(DXVA2_AYUVSample16)); - - // init m_Sample structure - m_Sample.Start = 0; - m_Sample.End = 1; - m_Sample.SampleFormat = format; - m_Sample.PlanarAlpha.Fraction = 0; - m_Sample.PlanarAlpha.Value = 1; - - m_bIsA2rgb10 = FALSE; -} - -bool CD3D9Device::CheckOverlaySupport() -{ - D3DCAPS9 d3d9caps; - D3DOVERLAYCAPS d3doverlaycaps = {0}; - IDirect3D9ExOverlayExtension *d3d9overlay = NULL; - bool overlaySupported = false; - - memset(&d3d9caps, 0, sizeof(d3d9caps)); - HRESULT hr = m_pD3D9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3d9caps); - if (FAILED(hr) || !(d3d9caps.Caps & D3DCAPS_OVERLAY)) - { - overlaySupported = false; - } - else - { - hr = m_pD3D9->QueryInterface(IID_PPV_ARGS(&d3d9overlay)); - if (FAILED(hr) || (d3d9overlay == NULL)) - { - overlaySupported = false; - } - else - { - hr = d3d9overlay->CheckDeviceOverlayType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - m_D3DPP.BackBufferWidth, - m_D3DPP.BackBufferHeight, - m_D3DPP.BackBufferFormat, NULL, - D3DDISPLAYROTATION_IDENTITY, &d3doverlaycaps); - MSDK_SAFE_RELEASE(d3d9overlay); - - if (FAILED(hr)) - { - overlaySupported = false; - } - else - { - overlaySupported = true; - } - } - } - - return overlaySupported; -} - -mfxStatus CD3D9Device::FillD3DPP(mfxHDL hWindow, mfxU16 nViews, D3DPRESENT_PARAMETERS &D3DPP) -{ - mfxStatus sts = MFX_ERR_NONE; - - D3DPP.Windowed = true; - D3DPP.hDeviceWindow = (HWND)hWindow; - - D3DPP.Flags = D3DPRESENTFLAG_VIDEO; - D3DPP.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - D3DPP.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // note that this setting leads to an implicit timeBeginPeriod call - D3DPP.BackBufferCount = 1; - D3DPP.BackBufferFormat = (m_bIsA2rgb10) ? D3DFMT_A2R10G10B10 : D3DFMT_X8R8G8B8; - - if (hWindow) - { - RECT r; - GetClientRect((HWND)hWindow, &r); - int x = GetSystemMetrics(SM_CXSCREEN); - int y = GetSystemMetrics(SM_CYSCREEN); - D3DPP.BackBufferWidth = std::min(r.right - r.left, x); - D3DPP.BackBufferHeight = std::min(r.bottom - r.top, y); - } - else - { - D3DPP.BackBufferWidth = GetSystemMetrics(SM_CYSCREEN); - D3DPP.BackBufferHeight = GetSystemMetrics(SM_CYSCREEN); - } - // - // Mark the back buffer lockable if software DXVA2 could be used. - // This is because software DXVA2 device requires a lockable render target - // for the optimal performance. - // - { - D3DPP.Flags |= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; - } - - bool isOverlaySupported = CheckOverlaySupport(); - if (2 == nViews && !isOverlaySupported) - return MFX_ERR_UNSUPPORTED; - - bool needOverlay = (2 == nViews) ? true : false; - - D3DPP.SwapEffect = needOverlay ? D3DSWAPEFFECT_OVERLAY : D3DSWAPEFFECT_DISCARD; - - return sts; -} - -mfxStatus CD3D9Device::Init( - mfxHDL hWindow, - mfxU16 nViews, - mfxU32 nAdapterNum) -{ - mfxStatus sts = MFX_ERR_NONE; - - if (2 < nViews) - return MFX_ERR_UNSUPPORTED; - - m_nViews = nViews; - - HRESULT hr = Direct3DCreate9Ex(D3D_SDK_VERSION, &m_pD3D9); - if (!m_pD3D9 || FAILED(hr)) - return MFX_ERR_DEVICE_FAILED; - - ZeroMemory(&m_D3DPP, sizeof(m_D3DPP)); - sts = FillD3DPP(hWindow, nViews, m_D3DPP); - MSDK_CHECK_STATUS(sts, "FillD3DPP failed"); - - hr = m_pD3D9->CreateDeviceEx( - nAdapterNum, - D3DDEVTYPE_HAL, - (HWND)hWindow, - D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE, - &m_D3DPP, - NULL, - &m_pD3DD9); - if (FAILED(hr)) - return MFX_ERR_NULL_PTR; - - if(hWindow) - { - hr = m_pD3DD9->ResetEx(&m_D3DPP, NULL); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - hr = m_pD3DD9->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - UINT resetToken = 0; - - hr = DXVA2CreateDirect3DDeviceManager9(&resetToken, &m_pDeviceManager9); - if (FAILED(hr)) - return MFX_ERR_NULL_PTR; - - hr = m_pDeviceManager9->ResetDevice(m_pD3DD9, resetToken); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - m_resetToken = resetToken; - - return sts; -} - -mfxStatus CD3D9Device::Reset() -{ - HRESULT hr = NO_ERROR; - MSDK_CHECK_POINTER(m_pD3DD9, MFX_ERR_NULL_PTR); - - if (m_D3DPP.hDeviceWindow) - { - RECT r; - hr = GetClientRect((HWND)m_D3DPP.hDeviceWindow, &r); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - int x = GetSystemMetrics(SM_CXSCREEN); - int y = GetSystemMetrics(SM_CYSCREEN); - m_D3DPP.BackBufferWidth = std::min(r.right - r.left, x); - m_D3DPP.BackBufferHeight = std::min(r.bottom - r.top, y); - - // Reset will change the parameters, so use a copy instead. - D3DPRESENT_PARAMETERS d3dpp = m_D3DPP; - hr = m_pD3DD9->ResetEx(&d3dpp, NULL); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - } - else - { - m_D3DPP.BackBufferWidth = GetSystemMetrics(SM_CXSCREEN); - m_D3DPP.BackBufferHeight = GetSystemMetrics(SM_CYSCREEN); - } - - hr = m_pDeviceManager9->ResetDevice(m_pD3DD9, m_resetToken); - if (FAILED(hr)) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - return MFX_ERR_NONE; -} - -void CD3D9Device::Close() -{ - MSDK_SAFE_RELEASE(m_pDXVAVP_Left); - MSDK_SAFE_RELEASE(m_pDXVAVP_Right); - MSDK_SAFE_RELEASE(m_pDXVAVPS); - - MSDK_SAFE_RELEASE(m_pDeviceManager9); - MSDK_SAFE_RELEASE(m_pD3DD9); - MSDK_SAFE_RELEASE(m_pD3D9); -} - -CD3D9Device::~CD3D9Device() -{ - Close(); -} - -mfxStatus CD3D9Device::GetHandle(mfxHandleType type, mfxHDL *pHdl) -{ - if (MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9 == type && pHdl != NULL) - { - *pHdl = m_pDeviceManager9; - - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CD3D9Device::SetHandle(mfxHandleType type, mfxHDL hdl) -{ - if (MFX_HANDLE_DEVICEWINDOW == type && hdl != NULL) //for render window handle - { - m_D3DPP.hDeviceWindow = (HWND)hdl; - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CD3D9Device::RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc) -{ - HRESULT hr = S_OK; - - // Rendering of MVC is not supported - if (2 == m_nViews) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - MSDK_CHECK_POINTER(pSurface, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(m_pDeviceManager9, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pmfxAlloc, MFX_ERR_NULL_PTR); - - hr = m_pD3DD9->TestCooperativeLevel(); - - switch (hr) - { - case D3D_OK : - break; - - case D3DERR_DEVICELOST : - { - return MFX_ERR_DEVICE_LOST; - } - - case D3DERR_DEVICENOTRESET : - { - return MFX_ERR_UNKNOWN; - } - - default : - { - return MFX_ERR_UNKNOWN; - } - } - - CComPtr pBackBuffer; - hr = m_pD3DD9->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer); - - mfxHDLPair* dxMemId = (mfxHDLPair*)pSurface->Data.MemId; - - hr = m_pD3DD9->StretchRect((IDirect3DSurface9*)dxMemId->first, NULL, pBackBuffer, NULL, D3DTEXF_LINEAR); - if (FAILED(hr)) - { - return MFX_ERR_UNKNOWN; - } - - if (SUCCEEDED(hr)) - { - hr = m_pD3DD9->Present(NULL, NULL, NULL, NULL); - } - - return SUCCEEDED(hr) ? MFX_ERR_NONE : MFX_ERR_DEVICE_FAILED; -} - -mfxStatus CD3D9Device::CreateVideoProcessors() -{ - if (2 == m_nViews) - return MFX_ERR_UNDEFINED_BEHAVIOR; - - MSDK_SAFE_RELEASE(m_pDXVAVP_Left); - MSDK_SAFE_RELEASE(m_pDXVAVP_Right); - - HRESULT hr ; - - ZeroMemory(&m_backBufferDesc, sizeof(m_backBufferDesc)); - IDirect3DSurface9 *backBufferTmp = NULL; - hr = m_pD3DD9->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backBufferTmp); - if (NULL != backBufferTmp) - backBufferTmp->GetDesc(&m_backBufferDesc); - MSDK_SAFE_RELEASE(backBufferTmp); - - if (SUCCEEDED(hr)) - { - // Create DXVA2 Video Processor Service. - hr = DXVA2CreateVideoService(m_pD3DD9, - IID_IDirectXVideoProcessorService, - (void**)&m_pDXVAVPS); - } - - if (SUCCEEDED(hr)) - { - hr = m_pDXVAVPS->CreateVideoProcessor(DXVA2_VideoProcProgressiveDevice, - &m_VideoDesc, - m_D3DPP.BackBufferFormat, - 1, - &m_pDXVAVP_Right); - } - - return SUCCEEDED(hr) ? MFX_ERR_NONE : MFX_ERR_DEVICE_FAILED; -} - -#endif // #if defined(WIN32) || defined(WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/decode_render.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/decode_render.cpp deleted file mode 100644 index ac99fd09..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/decode_render.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include -#include -#include - -#include "sample_defs.h" -#include "decode_render.h" -#include "winUser.h" -#pragma warning(disable : 4100) - -bool CDecodeD3DRender::m_bIsMonitorFound = false; - -LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ -#ifdef _WIN64 - CDecodeD3DRender* pRender = (CDecodeD3DRender*)GetWindowLongPtr(hWnd, GWLP_USERDATA); -#else - CDecodeD3DRender* pRender = (CDecodeD3DRender*)LongToPtr(GetWindowLongPtr(hWnd, GWL_USERDATA)); -#endif - if (pRender) - { - switch(message) - { - HANDLE_MSG(hWnd, WM_DESTROY, pRender->OnDestroy); - HANDLE_MSG(hWnd, WM_KEYUP, pRender->OnKey); - } - } - - return DefWindowProc(hWnd, message, wParam, lParam); -} - -CDecodeD3DRender::CDecodeD3DRender() -{ - m_bDwmEnabled = false; - m_nMonitorCurrent = 0; - - m_hwdev = NULL; - MSDK_ZERO_MEMORY(m_sWindowParams); - m_Hwnd = 0; - MSDK_ZERO_MEMORY(m_rect); - m_style = 0; - - MSDK_ZERO_MEMORY(shiftedSurface); - MSDK_ZERO_MEMORY(shiftSurfaceResponse); - pAllocator=NULL; -} - -BOOL CALLBACK CDecodeD3DRender::MonitorEnumProc(HMONITOR /*hMonitor*/, - HDC /*hdcMonitor*/, - LPRECT lprcMonitor, - LPARAM dwData) -{ - CDecodeD3DRender * pRender = reinterpret_cast(dwData); - RECT r = {0}; - if (NULL == lprcMonitor) - lprcMonitor = &r; - - if (pRender->m_nMonitorCurrent++ == pRender->m_sWindowParams.nAdapter) - { - pRender->m_RectWindow = *lprcMonitor; - m_bIsMonitorFound = true; - } - return TRUE; -} - -CDecodeD3DRender::~CDecodeD3DRender() -{ - Close(); -} - -void CDecodeD3DRender::Close() -{ - if (m_Hwnd) - { - DestroyWindow(m_Hwnd); - m_Hwnd=NULL; - } - - if(pAllocator) - { - pAllocator->Free(pAllocator->pthis,&shiftSurfaceResponse); - pAllocator=NULL; - } -} - - -mfxStatus CDecodeD3DRender::Init(sWindowParams pWParams) -{ - mfxStatus sts = MFX_ERR_NONE; - - // window part - m_sWindowParams = pWParams; - - WNDCLASS window; - MSDK_ZERO_MEMORY(window); - - window.lpfnWndProc= (WNDPROC)WindowProc; - window.hInstance= GetModuleHandle(NULL); - window.hCursor= LoadCursor(NULL, IDC_ARROW); - window.lpszClassName= m_sWindowParams.lpClassName; - - if (!RegisterClass(&window)) - return MFX_ERR_UNKNOWN; - - EnumDisplayMonitors(NULL, NULL, &CDecodeD3DRender::MonitorEnumProc, (LPARAM)this); - if(!m_bIsMonitorFound) - return MFX_ERR_NOT_FOUND; - - ::RECT displayRegion = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT}; - - //right and bottom fields consist of width and height values of displayed reqion - if (0 != m_sWindowParams.nx ) - { - displayRegion.right = (m_RectWindow.right - m_RectWindow.left) / m_sWindowParams.nx; - displayRegion.bottom = (m_RectWindow.bottom - m_RectWindow.top) / m_sWindowParams.ny; - displayRegion.left = displayRegion.right * (m_sWindowParams.ncell % m_sWindowParams.nx) + m_RectWindow.left; - displayRegion.top = displayRegion.bottom * (m_sWindowParams.ncell / m_sWindowParams.nx) + m_RectWindow.top; - } - else - { - displayRegion.right = pWParams.nWidth; - displayRegion.bottom = pWParams.nHeight; - displayRegion.left = m_RectWindow.left; - displayRegion.top= m_RectWindow.top; - } - - //no title window style if required - DWORD dwStyle = NULL == m_sWindowParams.lpWindowName ? WS_POPUP|WS_BORDER|WS_MAXIMIZE : WS_OVERLAPPEDWINDOW; - - m_Hwnd = CreateWindowEx(NULL, - m_sWindowParams.lpClassName, - m_sWindowParams.lpWindowName, - !m_sWindowParams.bFullScreen ? dwStyle : (WS_POPUP), - !m_sWindowParams.bFullScreen ? displayRegion.left : 0, - !m_sWindowParams.bFullScreen ? displayRegion.top : 0, - !m_sWindowParams.bFullScreen ? displayRegion.right : GetSystemMetrics(SM_CXSCREEN), - !m_sWindowParams.bFullScreen ? displayRegion.bottom : GetSystemMetrics(SM_CYSCREEN), - m_sWindowParams.hWndParent, - m_sWindowParams.hMenu, - m_sWindowParams.hInstance, - m_sWindowParams.lpParam); - - if (!m_Hwnd) - return MFX_ERR_UNKNOWN; - - ShowWindow(m_Hwnd, SW_SHOWDEFAULT); - UpdateWindow(m_Hwnd); - -#ifdef _WIN64 - SetWindowLongPtr(m_Hwnd, GWLP_USERDATA, (LONG_PTR)this); -#else - SetWindowLong(m_Hwnd, GWL_USERDATA, PtrToLong(this)); -#endif - - m_hwdev->SetHandle((mfxHandleType)MFX_HANDLE_DEVICEWINDOW, m_Hwnd); - sts = m_hwdev->Reset(); - MSDK_CHECK_STATUS(sts, "m_hwdev->Reset failed"); - - return sts; -} - -mfxStatus CDecodeD3DRender::RenderFrame(mfxFrameSurface1 *pSurface, mfxFrameAllocator *pmfxAlloc) -{ - RECT rect; - mfxStatus sts = MFX_ERR_NONE; - - GetClientRect(m_Hwnd, &rect); - - if (IsRectEmpty(&rect)) - return MFX_ERR_UNKNOWN; - - //--- In case of 10 bit surfaces and SW library we have to copy it and shift its data - if(pSurface->Info.FourCC == MFX_FOURCC_P010 && !pSurface->Info.Shift) - { - sts = AllocateShiftedSurfaceIfNeeded(pSurface,pmfxAlloc); - MSDK_CHECK_STATUS(sts, "AllocateShiftedSurfaceIfNeeded failed"); - - sts = pAllocator->Lock(pAllocator->pthis,shiftedSurface.Data.MemId,&shiftedSurface.Data); - MSDK_CHECK_STATUS(sts, "pAllocator->Lock of shiftedSurface failed"); - sts = pAllocator->Lock(pAllocator->pthis,pSurface->Data.MemId,&pSurface->Data); - MSDK_CHECK_STATUS(sts, "pAllocator->Lock of pSurface failed"); - - int wordsNum = pSurface->Data.Pitch*pSurface->Info.Height*3/16; // Number of 8-byte words - mfxU64* pBuf = (mfxU64*)pSurface->Data.Y16; - mfxU64* pDestBuf = (mfxU64*)shiftedSurface.Data.Y16; - for(int i=0;iUnlock(pAllocator->pthis,shiftedSurface.Data.MemId,&shiftedSurface.Data); - MSDK_CHECK_STATUS(sts, "pAllocator->Unlock of shiftedSurface failed"); - sts = pAllocator->Unlock(pAllocator->pthis,pSurface->Data.MemId,&pSurface->Data); - MSDK_CHECK_STATUS(sts, "pAllocator->Unlock of pSurface failed"); - - sts = m_hwdev->RenderFrame(&shiftedSurface, pmfxAlloc); - } - else - { - sts = m_hwdev->RenderFrame(pSurface, pmfxAlloc); - } - MSDK_CHECK_STATUS(sts, "m_hwdev->RenderFrame failed"); - - return sts; -} - -HWND CDecodeD3DRender::GetWindowHandle() -{ - if (!m_Hwnd) - { - EnumDisplayMonitors(NULL, NULL, &CDecodeD3DRender::MonitorEnumProc, (LPARAM)this); - POINT point = {m_RectWindow.left, m_RectWindow.top}; - m_Hwnd = WindowFromPoint(point); - m_nMonitorCurrent = 0; - m_bIsMonitorFound = false; - } - return m_Hwnd; -} - -VOID CDecodeD3DRender::UpdateTitle(double fps) -{ - if (m_Hwnd) - { - MSG msg; - MSDK_ZERO_MEMORY(msg); - while (msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - if (NULL != m_sWindowParams.lpWindowName) { - TCHAR str[20]; - _stprintf_s(str, 20, MSDK_STRING("fps=%.2lf"), fps ); - - SetWindowText(m_Hwnd, str); - } - } -} - -VOID CDecodeD3DRender::OnDestroy(HWND /*hwnd*/) -{ - PostQuitMessage(0); -} - -VOID CDecodeD3DRender::OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) -{ - if (TRUE == fDown) - return; - - if ('1' == vk && false == m_sWindowParams.bFullScreen) - ChangeWindowSize(true); - else if (true == m_sWindowParams.bFullScreen) - ChangeWindowSize(false); -} - -void CDecodeD3DRender::AdjustWindowRect(RECT *rect) -{ - int cxmax = GetSystemMetrics(SM_CXMAXIMIZED); - int cymax = GetSystemMetrics(SM_CYMAXIMIZED); - int cxmin = GetSystemMetrics(SM_CXMINTRACK); - int cymin = GetSystemMetrics(SM_CYMINTRACK); - int leftmax = cxmax - cxmin; - int topmax = cymax - cxmin; - if (rect->left < 0) - rect->left = 0; - if (rect->left > leftmax) - rect->left = leftmax; - if (rect->top < 0) - rect->top = 0; - if (rect->top > topmax) - rect->top = topmax; - - if (rect->right < rect->left + cxmin) - rect->right = rect->left + cxmin; - if (rect->right - rect->left > cxmax) - rect->right = rect->left + cxmax; - - if (rect->bottom < rect->top + cymin) - rect->bottom = rect->top + cymin; - if (rect->bottom - rect->top > cymax) - rect->bottom = rect->top + cymax; -} - -VOID CDecodeD3DRender::ChangeWindowSize(bool bFullScreen) -{ - HMONITOR hMonitor = MonitorFromWindow(m_Hwnd, MONITOR_DEFAULTTONEAREST); - MONITORINFOEX mi; - mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); - - WINDOWINFO wndInfo; - wndInfo.cbSize = sizeof(WINDOWINFO); - GetWindowInfo(m_Hwnd, &wndInfo); - - if(!m_sWindowParams.bFullScreen) - { - m_rect = wndInfo.rcWindow; - m_style = wndInfo.dwStyle; - } - - m_sWindowParams.bFullScreen = bFullScreen; - - if(!bFullScreen) - { - AdjustWindowRectEx(&m_rect,0,0,0); - SetWindowLong(m_Hwnd, GWL_STYLE, m_style); - SetWindowPos(m_Hwnd, HWND_NOTOPMOST, - m_rect.left , m_rect.top , - abs(m_rect.right - m_rect.left), abs(m_rect.bottom - m_rect.top), - SWP_SHOWWINDOW); - } - else - { - SetWindowLong(m_Hwnd, GWL_STYLE, WS_POPUP); - SetWindowPos(m_Hwnd, HWND_NOTOPMOST,mi.rcMonitor.left , mi.rcMonitor.top, - abs(mi.rcMonitor.left - mi.rcMonitor.right), abs(mi.rcMonitor.top - mi.rcMonitor.bottom), SWP_SHOWWINDOW); - } -} - -mfxStatus CDecodeD3DRender::AllocateShiftedSurfaceIfNeeded(const mfxFrameSurface1* refSurface,mfxFrameAllocator* allocator) -{ - if(!pAllocator) - { - mfxFrameAllocRequest request={}; - request.AllocId = 0xF000; // Unique alloc ID - request.NumFrameMin=request.NumFrameSuggested=1; - request.Info = refSurface->Info; - request.Type = MFX_MEMTYPE_EXTERNAL_FRAME | MFX_MEMTYPE_FROM_DECODE | MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET; - - pAllocator = allocator; - mfxStatus sts = allocator->Alloc(allocator->pthis, &request, &shiftSurfaceResponse); - MSDK_CHECK_STATUS(sts, "Renderer: Shifted Surface allocation failed"); - - shiftedSurface.Data.MemId=shiftSurfaceResponse.mids[0]; - shiftedSurface.Info = request.Info; - } - return MFX_ERR_NONE; -} - -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/general_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/general_allocator.cpp deleted file mode 100644 index 258edfe7..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/general_allocator.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#include "general_allocator.h" - -#if defined(_WIN32) || defined(_WIN64) -#include "d3d_allocator.h" -#include "d3d11_allocator.h" -#else -#include -#include "vaapi_allocator.h" -#endif - -#include "sysmem_allocator.h" - -#include "sample_defs.h" - -// Wrapper on standard allocator for concurrent allocation of -// D3D and system surfaces -GeneralAllocator::GeneralAllocator() -{ -}; -GeneralAllocator::~GeneralAllocator() -{ -}; -mfxStatus GeneralAllocator::Init(mfxAllocatorParams *pParams) -{ - mfxStatus sts = MFX_ERR_NONE; - -#if defined(_WIN32) || defined(_WIN64) - D3DAllocatorParams *d3dAllocParams = dynamic_cast(pParams); - if (d3dAllocParams) - m_D3DAllocator.reset(new D3DFrameAllocator); -#if MFX_D3D11_SUPPORT - D3D11AllocatorParams *d3d11AllocParams = dynamic_cast(pParams); - if (d3d11AllocParams) - m_D3DAllocator.reset(new D3D11FrameAllocator); -#endif -#endif - -#ifdef LIBVA_SUPPORT - vaapiAllocatorParams *vaapiAllocParams = dynamic_cast(pParams); - if (vaapiAllocParams) - m_D3DAllocator.reset(new vaapiFrameAllocator); -#endif - - if (m_D3DAllocator.get()) - { - sts = m_D3DAllocator.get()->Init(pParams); - MSDK_CHECK_STATUS(sts, "m_D3DAllocator.get failed"); - } - - m_SYSAllocator.reset(new SysMemFrameAllocator); - sts = m_SYSAllocator.get()->Init(0); - MSDK_CHECK_STATUS(sts, "m_SYSAllocator.get failed"); - - return sts; -} -mfxStatus GeneralAllocator::Close() -{ - mfxStatus sts = MFX_ERR_NONE; - if (m_D3DAllocator.get()) - { - sts = m_D3DAllocator.get()->Close(); - MSDK_CHECK_STATUS(sts, "m_D3DAllocator.get failed"); - } - - sts = m_SYSAllocator.get()->Close(); - MSDK_CHECK_STATUS(sts, "m_SYSAllocator.get failed"); - - return sts; -} - -mfxStatus GeneralAllocator::LockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (isD3DMid(mid) && m_D3DAllocator.get()) - return m_D3DAllocator.get()->Lock(m_D3DAllocator.get(), mid, ptr); - else - return m_SYSAllocator.get()->Lock(m_SYSAllocator.get(),mid, ptr); -} -mfxStatus GeneralAllocator::UnlockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (isD3DMid(mid) && m_D3DAllocator.get()) - return m_D3DAllocator.get()->Unlock(m_D3DAllocator.get(), mid, ptr); - else - return m_SYSAllocator.get()->Unlock(m_SYSAllocator.get(),mid, ptr); -} - -mfxStatus GeneralAllocator::GetFrameHDL(mfxMemId mid, mfxHDL *handle) -{ - if (isD3DMid(mid) && m_D3DAllocator.get()) - return m_D3DAllocator.get()->GetHDL(m_D3DAllocator.get(), mid, handle); - else - return m_SYSAllocator.get()->GetHDL(m_SYSAllocator.get(), mid, handle); -} - -mfxStatus GeneralAllocator::ReleaseResponse(mfxFrameAllocResponse *response) -{ - // try to ReleaseResponse via D3D allocator - if (isD3DMid(response->mids[0]) && m_D3DAllocator.get()) - return m_D3DAllocator.get()->Free(m_D3DAllocator.get(),response); - else - return m_SYSAllocator.get()->Free(m_SYSAllocator.get(), response); -} - -mfxStatus GeneralAllocator::ReallocImpl(mfxMemId mid, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut) -{ - if (!info || !midOut) return MFX_ERR_NULL_PTR; - - mfxStatus sts; - if ((memType & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET || memType & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) && m_D3DAllocator.get()) - { - sts = m_D3DAllocator.get()->ReallocFrame(mid, info, memType, midOut); - MSDK_CHECK_NOT_EQUAL(MFX_ERR_NONE, sts, sts); - } - else - { - sts = m_SYSAllocator.get()->ReallocFrame(mid, info, memType, midOut); - MSDK_CHECK_NOT_EQUAL(MFX_ERR_NONE, sts, sts); - } - return sts; -} - -mfxStatus GeneralAllocator::AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - mfxStatus sts; - if ((request->Type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET || request->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) && m_D3DAllocator.get()) - { - sts = m_D3DAllocator.get()->Alloc(m_D3DAllocator.get(), request, response); - MSDK_CHECK_NOT_EQUAL(MFX_ERR_NONE, sts, sts); - StoreFrameMids(true, response); - } - else - { - sts = m_SYSAllocator.get()->Alloc(m_SYSAllocator.get(), request, response); - MSDK_CHECK_NOT_EQUAL(MFX_ERR_NONE, sts, sts); - StoreFrameMids(false, response); - } - return sts; -} -void GeneralAllocator::StoreFrameMids(bool isD3DFrames, mfxFrameAllocResponse *response) -{ - for (mfxU32 i = 0; i < response->NumFrameActual; i++) - m_Mids.insert(std::pair(response->mids[i], isD3DFrames)); -} -bool GeneralAllocator::isD3DMid(mfxHDL mid) -{ - std::map::iterator it; - it = m_Mids.find(mid); - if (it == m_Mids.end()) - return false; // sys mem allocator will check validity of mid further - else - return it->second; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/mfx_buffering.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/mfx_buffering.cpp deleted file mode 100644 index c8da7eca..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/mfx_buffering.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#include - -#include - -CBuffering::CBuffering(): - m_SurfacesNumber(0), - m_OutputSurfacesNumber(0), - m_pSurfaces(NULL), - m_pVppSurfaces(NULL), - m_FreeSurfacesPool(m_Mutex), - m_FreeVppSurfacesPool(m_Mutex), - m_UsedSurfacesPool(m_Mutex), - m_UsedVppSurfacesPool(m_Mutex), - m_pFreeOutputSurfaces(NULL), - m_OutputSurfacesPool(m_Mutex), - m_DeliveredSurfacesPool(m_Mutex) -{ -} - -CBuffering::~CBuffering() -{ -} - -mfxStatus -CBuffering::AllocBuffers(mfxU32 SurfaceNumber) -{ - if (!SurfaceNumber) return MFX_ERR_MEMORY_ALLOC; - - if (!m_OutputSurfacesNumber) { // true - if Vpp isn't enabled - m_OutputSurfacesNumber = SurfaceNumber; - } - m_SurfacesNumber = SurfaceNumber; - - m_pSurfaces = (msdkFrameSurface*)calloc(m_SurfacesNumber, sizeof(msdkFrameSurface)); - if (!m_pSurfaces) return MFX_ERR_MEMORY_ALLOC; - - msdkOutputSurface* p = NULL; - msdkOutputSurface* tail = NULL; - - m_pFreeOutputSurfaces = (msdkOutputSurface*)calloc(1, sizeof(msdkOutputSurface)); - if (!m_pFreeOutputSurfaces) return MFX_ERR_MEMORY_ALLOC; - - tail = m_pFreeOutputSurfaces; - - for (mfxU32 i = 1; i < m_OutputSurfacesNumber; ++i) { - p = (msdkOutputSurface*)calloc(1, sizeof(msdkOutputSurface)); - if (!p) return MFX_ERR_MEMORY_ALLOC; - tail->next = p; - tail = p; - } - - ResetBuffers(); - return MFX_ERR_NONE; -} - -mfxStatus -CBuffering::AllocVppBuffers(mfxU32 VppSurfaceNumber) -{ - m_OutputSurfacesNumber = VppSurfaceNumber; - m_pVppSurfaces = (msdkFrameSurface*)calloc(m_OutputSurfacesNumber, sizeof(msdkFrameSurface)); - if (!m_pVppSurfaces) return MFX_ERR_MEMORY_ALLOC; - - ResetVppBuffers(); - return MFX_ERR_NONE; -} - -void -CBuffering::AllocOutputBuffer() -{ - std::lock_guard lock(m_Mutex); - - m_pFreeOutputSurfaces = (msdkOutputSurface*)calloc(1, sizeof(msdkOutputSurface)); -} - -static void -FreeList(msdkOutputSurface*& head) { - msdkOutputSurface* next; - while (head) { - next = head->next; - free(head); - head = next; - } -} - -void -CBuffering::FreeBuffers() -{ - if (m_pSurfaces) { - free(m_pSurfaces); - m_pSurfaces = NULL; - } - - if (m_pVppSurfaces) { - free(m_pVppSurfaces); - m_pVppSurfaces = NULL; - } - - FreeList(m_pFreeOutputSurfaces); - FreeList(m_OutputSurfacesPool.m_pSurfacesHead); - FreeList(m_DeliveredSurfacesPool.m_pSurfacesHead); - - m_UsedSurfacesPool.m_pSurfacesHead = NULL; - m_UsedSurfacesPool.m_pSurfacesTail = NULL; - m_UsedVppSurfacesPool.m_pSurfacesHead = NULL; - m_UsedVppSurfacesPool.m_pSurfacesTail = NULL; - m_OutputSurfacesPool.m_pSurfacesHead = NULL; - m_OutputSurfacesPool.m_pSurfacesTail = NULL; - - m_FreeSurfacesPool.m_pSurfaces = NULL; - m_FreeVppSurfacesPool.m_pSurfaces = NULL; -} - -void -CBuffering::ResetBuffers() -{ - mfxU32 i; - msdkFrameSurface* pFreeSurf = m_FreeSurfacesPool.m_pSurfaces = m_pSurfaces; - - for (i = 0; i < m_SurfacesNumber; ++i) { - if (i < (m_SurfacesNumber-1)) { - pFreeSurf[i].next = &(pFreeSurf[i+1]); - pFreeSurf[i+1].prev = &(pFreeSurf[i]); - } - } -} - -void -CBuffering::ResetVppBuffers() -{ - mfxU32 i; - msdkFrameSurface* pFreeVppSurf = m_FreeVppSurfacesPool.m_pSurfaces = m_pVppSurfaces; - - for (i = 0; i < m_OutputSurfacesNumber; ++i) { - if (i < (m_OutputSurfacesNumber-1)) { - pFreeVppSurf[i].next = &(pFreeVppSurf[i+1]); - pFreeVppSurf[i+1].prev = &(pFreeVppSurf[i]); - } - } -} - -void -CBuffering::SyncFrameSurfaces() -{ - std::lock_guard lock(m_Mutex); - msdkFrameSurface *next = NULL; - msdkFrameSurface *cur = m_UsedSurfacesPool.m_pSurfacesHead; - - while (cur) { - if (cur->frame.Data.Locked || cur->render_lock) { - // frame is still locked: just moving to the next one - cur = cur->next; - } else { - // frame was unlocked: moving it to the free surfaces array - m_UsedSurfacesPool.DetachSurfaceUnsafe(cur); - m_FreeSurfacesPool.AddSurfaceUnsafe(cur); - - cur = next; - } - } -} - -void -CBuffering::SyncVppFrameSurfaces() -{ - std::lock_guard lock(m_Mutex); - msdkFrameSurface *next = NULL; - msdkFrameSurface *cur = m_UsedVppSurfacesPool.m_pSurfacesHead; - - while (cur) { - if (cur->frame.Data.Locked || cur->render_lock) { - // frame is still locked: just moving to the next one - cur = cur->next; - } else { - // frame was unlocked: moving it to the free surfaces array - m_UsedVppSurfacesPool.DetachSurfaceUnsafe(cur); - m_FreeVppSurfacesPool.AddSurfaceUnsafe(cur); - - cur = next; - } - } -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/parameters_dumper.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/parameters_dumper.cpp deleted file mode 100644 index 96892e62..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/parameters_dumper.cpp +++ /dev/null @@ -1,1044 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "parameters_dumper.h" -#include -#include -#include -#include - -#include "vm/strings_defs.h" - -#include "mfxstructures.h" -#include "mfxvideo.h" -#include "mfxvideo++.h" -#include "mfxjpeg.h" -#include "mfxplugin.h" - -#include "sample_types.h" -#include "mfxvp8.h" -#include "mfxmvc.h" -#include "mfxla.h" - -#ifndef MFX_VERSION -#error MFX_VERSION not defined -#endif - -#define START_PROC_ARRAY(arrName) for(unsigned int arrIdx=0;arrIdx<(sizeof(info.arrName)/sizeof(info.arrName[0]));arrIdx++){ -#define START_PROC_ARRAY_SIZE(arrName,numElems) for(unsigned int arrIdx=0;arrIdxBufferId,4); - std::string strName(name); - prefix+=msdk_string(strName.begin(),strName.end()); - - // Serializing header - { - mfxExtBuffer& info = *pExtBuffer; - SERIALIZE_INFO(BufferId); - SERIALIZE_INFO(BufferSz); - } - - // Serializing particular Ext buffer. - switch(pExtBuffer->BufferId) - { - case MFX_EXTBUFF_THREADS_PARAM: - { - mfxExtThreadsParam& info = *(mfxExtThreadsParam*)pExtBuffer; - SERIALIZE_INFO(NumThread); - SERIALIZE_INFO(SchedulingType); - SERIALIZE_INFO(Priority); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_JPEG_QT: - { - mfxExtJPEGQuantTables& info = *(mfxExtJPEGQuantTables*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(NumTable); - SERIALIZE_INFO_ARRAY(Qm[0]); - SERIALIZE_INFO_ARRAY(Qm[1]); - SERIALIZE_INFO_ARRAY(Qm[2]); - SERIALIZE_INFO_ARRAY(Qm[3]); - } - break; - case MFX_EXTBUFF_JPEG_HUFFMAN: - { - mfxExtJPEGHuffmanTables& info = *(mfxExtJPEGHuffmanTables*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(NumDCTable); - SERIALIZE_INFO(NumACTable); - START_PROC_ARRAY(DCTables) - SERIALIZE_INFO_ARRAY_ELEMENT(DCTables,Bits); - SERIALIZE_INFO_ARRAY_ELEMENT(DCTables,Values); - END_PROC_ARRAY - START_PROC_ARRAY(DCTables) - SERIALIZE_INFO_ARRAY_ELEMENT(ACTables,Bits); - SERIALIZE_INFO_ARRAY_ELEMENT(ACTables,Values); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_LOOKAHEAD_CTRL: - { - mfxExtLAControl& info = *(mfxExtLAControl*)pExtBuffer; - SERIALIZE_INFO(LookAheadDepth); - SERIALIZE_INFO(DependencyDepth); - SERIALIZE_INFO(DownScaleFactor); - SERIALIZE_INFO(BPyramid); - SERIALIZE_INFO_ARRAY(reserved1); - SERIALIZE_INFO(NumOutStream); - START_PROC_ARRAY(OutStream) - SERIALIZE_INFO_ELEMENT(OutStream,Width); - SERIALIZE_INFO_ELEMENT(OutStream,Height); - SERIALIZE_INFO_ARRAY_ELEMENT(OutStream,reserved2); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_LOOKAHEAD_STAT: - { - mfxExtLAFrameStatistics& info = *(mfxExtLAFrameStatistics*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(NumStream); - SERIALIZE_INFO(NumFrame); - //DO_MANUALLY: mfxLAFrameInfo *FrameStat; //frame statistics - //DO_MANUALLY: mfxFrameSurface1 *OutSurface; //reordered surface - } - break; - case MFX_EXTBUFF_MVC_SEQ_DESC: - { - mfxExtMVCSeqDesc& info = *(mfxExtMVCSeqDesc*)pExtBuffer; - SERIALIZE_INFO(NumView); - SERIALIZE_INFO(NumViewAlloc); - //DO_MANUALLY: mfxMVCViewDependency *View; - SERIALIZE_INFO(NumViewId); - SERIALIZE_INFO(NumViewIdAlloc); - SERIALIZE_INFO_MEMORY(ViewId,NumViewId); - SERIALIZE_INFO(NumOP); - SERIALIZE_INFO(NumOPAlloc); - //DO_MANUALLY: mfxMVCOperationPoint *OP; - SERIALIZE_INFO(NumRefsTotal); - SERIALIZE_INFO_ARRAY(Reserved); - } - break; - case MFX_EXTBUFF_MVC_TARGET_VIEWS: - { - mfxExtMVCTargetViews & info = *(mfxExtMVCTargetViews *)pExtBuffer; - SERIALIZE_INFO(TemporalId); - SERIALIZE_INFO(NumView); - SERIALIZE_INFO_ARRAY(ViewId); - } - break; - case MFX_EXTBUFF_VPP_PICSTRUCT_DETECTION: - { - // No structure accociated with MFX_EXTBUFF_VPP_PICSTRUCT_DETECTION - } - break; - case MFX_EXTBUFF_CODING_OPTION: - { - mfxExtCodingOption& info = *(mfxExtCodingOption*)pExtBuffer; - SERIALIZE_INFO(reserved1); - SERIALIZE_INFO(RateDistortionOpt); - SERIALIZE_INFO(MECostType); - SERIALIZE_INFO(MESearchType); - SERIALIZE_INFO(MVSearchWindow.x); - SERIALIZE_INFO(MVSearchWindow.y); - SERIALIZE_INFO(EndOfSequence); - SERIALIZE_INFO(FramePicture); - SERIALIZE_INFO(CAVLC); - SERIALIZE_INFO_ARRAY(reserved2); - SERIALIZE_INFO(RecoveryPointSEI); - SERIALIZE_INFO(ViewOutput); - SERIALIZE_INFO(NalHrdConformance); - SERIALIZE_INFO(SingleSeiNalUnit); - SERIALIZE_INFO(VuiVclHrdParameters); - SERIALIZE_INFO(RefPicListReordering); - SERIALIZE_INFO(ResetRefList); - SERIALIZE_INFO(RefPicMarkRep); - SERIALIZE_INFO(FieldOutput); - SERIALIZE_INFO(IntraPredBlockSize); - SERIALIZE_INFO(InterPredBlockSize); - SERIALIZE_INFO(MVPrecision); - SERIALIZE_INFO(MaxDecFrameBuffering); - SERIALIZE_INFO(AUDelimiter); - SERIALIZE_INFO(EndOfStream); - SERIALIZE_INFO(PicTimingSEI); - SERIALIZE_INFO(VuiNalHrdParameters); - } - break; - case MFX_EXTBUFF_CODING_OPTION2: - { - mfxExtCodingOption2& info = *(mfxExtCodingOption2*)pExtBuffer; - SERIALIZE_INFO(IntRefType); - SERIALIZE_INFO(IntRefCycleSize); - SERIALIZE_INFO(IntRefQPDelta); - SERIALIZE_INFO(MaxFrameSize); - SERIALIZE_INFO(MaxSliceSize); - SERIALIZE_INFO(BitrateLimit); - SERIALIZE_INFO(MBBRC); - SERIALIZE_INFO(ExtBRC); - SERIALIZE_INFO(LookAheadDepth); - SERIALIZE_INFO(Trellis); - SERIALIZE_INFO(RepeatPPS); - SERIALIZE_INFO(BRefType); - SERIALIZE_INFO(AdaptiveI); - SERIALIZE_INFO(AdaptiveB); - SERIALIZE_INFO(LookAheadDS); - SERIALIZE_INFO(NumMbPerSlice); - SERIALIZE_INFO(SkipFrame); - SERIALIZE_INFO(MinQPI); - SERIALIZE_INFO(MaxQPI); - SERIALIZE_INFO(MinQPP); - SERIALIZE_INFO(MaxQPP); - SERIALIZE_INFO(MinQPB); - SERIALIZE_INFO(MaxQPB); - SERIALIZE_INFO(FixedFrameRate); - SERIALIZE_INFO(DisableDeblockingIdc); - SERIALIZE_INFO(DisableVUI); - SERIALIZE_INFO(BufferingPeriodSEI); - SERIALIZE_INFO(EnableMAD); - SERIALIZE_INFO(UseRawRef); - } - break; - case MFX_EXTBUFF_CODING_OPTION3: - { - mfxExtCodingOption3& info = *(mfxExtCodingOption3*)pExtBuffer; - SERIALIZE_INFO(NumSliceI); - SERIALIZE_INFO(NumSliceP); - SERIALIZE_INFO(NumSliceB); - SERIALIZE_INFO(WinBRCMaxAvgKbps); - SERIALIZE_INFO(WinBRCSize); - SERIALIZE_INFO(QVBRQuality); - SERIALIZE_INFO(EnableMBQP); - SERIALIZE_INFO(IntRefCycleDist); - SERIALIZE_INFO(DirectBiasAdjustment); - SERIALIZE_INFO(GlobalMotionBiasAdjustment); - SERIALIZE_INFO(MVCostScalingFactor); - SERIALIZE_INFO(MBDisableSkipMap); - SERIALIZE_INFO(WeightedPred); - SERIALIZE_INFO(WeightedBiPred); - SERIALIZE_INFO(AspectRatioInfoPresent); - SERIALIZE_INFO(OverscanInfoPresent); - SERIALIZE_INFO(OverscanAppropriate); - SERIALIZE_INFO(TimingInfoPresent); - SERIALIZE_INFO(BitstreamRestriction); - SERIALIZE_INFO(LowDelayHrd); - SERIALIZE_INFO(MotionVectorsOverPicBoundaries); - SERIALIZE_INFO(ScenarioInfo); - SERIALIZE_INFO(ContentInfo); - SERIALIZE_INFO(PRefType); - SERIALIZE_INFO(FadeDetection); - SERIALIZE_INFO(GPB); - SERIALIZE_INFO(MaxFrameSizeI); - SERIALIZE_INFO(MaxFrameSizeP); -#if (MFX_VERSION >= 1027) - SERIALIZE_INFO(TargetBitDepthLuma); - SERIALIZE_INFO(TargetBitDepthChroma); -#endif -#if (MFX_VERSION >= MFX_VERSION_NEXT) - SERIALIZE_INFO(Log2MaxMvLengthHorizontal); - SERIALIZE_INFO(Log2MaxMvLengthVertical); -#else - SERIALIZE_INFO_ARRAY(reserved1); -#endif - SERIALIZE_INFO(EnableQPOffset); - SERIALIZE_INFO_ARRAY(QPOffset); - SERIALIZE_INFO_ARRAY(NumRefActiveP); - SERIALIZE_INFO_ARRAY(NumRefActiveBL0); - SERIALIZE_INFO_ARRAY(NumRefActiveBL1); - SERIALIZE_INFO(BRCPanicMode); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_DONOTUSE: - { - mfxExtVPPDoNotUse& info = *(mfxExtVPPDoNotUse*)pExtBuffer; - SERIALIZE_INFO(NumAlg); - SERIALIZE_INFO_MEMORY(AlgList,NumAlg); - } - break; - case MFX_EXTBUFF_VPP_DENOISE: - { - mfxExtVPPDenoise& info = *(mfxExtVPPDenoise*)pExtBuffer; - SERIALIZE_INFO(DenoiseFactor); - } - break; - case MFX_EXTBUFF_VPP_DETAIL: - { - mfxExtVPPDetail& info = *(mfxExtVPPDetail*)pExtBuffer; - SERIALIZE_INFO(DetailFactor); - } - break; - case MFX_EXTBUFF_VPP_PROCAMP: - { - mfxExtVPPProcAmp& info = *(mfxExtVPPProcAmp*)pExtBuffer; - SERIALIZE_INFO(Brightness); - SERIALIZE_INFO(Contrast); - SERIALIZE_INFO(Hue); - SERIALIZE_INFO(Saturation); - } - break; - case MFX_EXTBUFF_VPP_AUXDATA: - { - mfxExtVppAuxData& info = *(mfxExtVppAuxData*)pExtBuffer; - SERIALIZE_INFO(SpatialComplexity); - SERIALIZE_INFO(TemporalComplexity); - SERIALIZE_INFO(PicStruct); - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(SceneChangeRate); - SERIALIZE_INFO(RepeatedFrame); - } - break; - case MFX_EXTBUFF_CODING_OPTION_SPSPPS: - { - mfxExtCodingOptionSPSPPS& info = *(mfxExtCodingOptionSPSPPS*)pExtBuffer; - SERIALIZE_INFO(SPSBuffer); - SERIALIZE_INFO(PPSBuffer); - SERIALIZE_INFO(SPSBufSize); - SERIALIZE_INFO(PPSBufSize); - SERIALIZE_INFO(SPSId); - SERIALIZE_INFO(PPSId); - } - break; - case MFX_EXTBUFF_CODING_OPTION_VPS: - { - mfxExtCodingOptionVPS& info = *(mfxExtCodingOptionVPS*)pExtBuffer; - SERIALIZE_INFO(VPSBuffer); - SERIALIZE_INFO(reserved1); - SERIALIZE_INFO(VPSBufSize); - SERIALIZE_INFO(VPSId); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_VIDEO_SIGNAL_INFO: - { - mfxExtVideoSignalInfo& info = *(mfxExtVideoSignalInfo*)pExtBuffer; - SERIALIZE_INFO(VideoFormat); - SERIALIZE_INFO(VideoFullRange); - SERIALIZE_INFO(ColourDescriptionPresent); - SERIALIZE_INFO(ColourPrimaries); - SERIALIZE_INFO(TransferCharacteristics); - SERIALIZE_INFO(MatrixCoefficients); - } - break; - case MFX_EXTBUFF_VPP_DOUSE: - { - mfxExtVPPDoUse& info = *(mfxExtVPPDoUse*)pExtBuffer; - SERIALIZE_INFO(NumAlg); - SERIALIZE_INFO(AlgList); - } - break; - case MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION: - { - mfxExtOpaqueSurfaceAlloc& info = *(mfxExtOpaqueSurfaceAlloc*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved1); - SERIALIZE_INFO_ARRAY(In.reserved2); - SERIALIZE_INFO(In.Type); - SERIALIZE_INFO(In.NumSurface); - SERIALIZE_INFO_ARRAY(Out.reserved2); - SERIALIZE_INFO(Out.Type); - SERIALIZE_INFO(Out.NumSurface); - } - break; - case MFX_EXTBUFF_AVC_REFLIST_CTRL: - { - mfxExtAVCRefListCtrl& info = *(mfxExtAVCRefListCtrl*)pExtBuffer; - SERIALIZE_INFO(NumRefIdxL0Active); - SERIALIZE_INFO(NumRefIdxL1Active); - START_PROC_ARRAY(PreferredRefList) - SERIALIZE_INFO_ELEMENT(PreferredRefList,FrameOrder); - SERIALIZE_INFO_ELEMENT(PreferredRefList,PicStruct); - SERIALIZE_INFO_ELEMENT(PreferredRefList,ViewId); - SERIALIZE_INFO_ELEMENT(PreferredRefList,LongTermIdx); - SERIALIZE_INFO_ARRAY_ELEMENT(PreferredRefList,reserved); - END_PROC_ARRAY - - START_PROC_ARRAY(RejectedRefList) - SERIALIZE_INFO_ELEMENT(RejectedRefList,FrameOrder); - SERIALIZE_INFO_ELEMENT(RejectedRefList,PicStruct); - SERIALIZE_INFO_ELEMENT(RejectedRefList,ViewId); - SERIALIZE_INFO_ELEMENT(RejectedRefList,LongTermIdx); - SERIALIZE_INFO_ARRAY_ELEMENT(RejectedRefList,reserved); - END_PROC_ARRAY - - START_PROC_ARRAY(LongTermRefList) - SERIALIZE_INFO_ELEMENT(LongTermRefList,FrameOrder); - SERIALIZE_INFO_ELEMENT(LongTermRefList,PicStruct); - SERIALIZE_INFO_ELEMENT(LongTermRefList,ViewId); - SERIALIZE_INFO_ELEMENT(LongTermRefList,LongTermIdx); - SERIALIZE_INFO_ARRAY_ELEMENT(LongTermRefList,reserved); - END_PROC_ARRAY - - SERIALIZE_INFO(ApplyLongTermIdx); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION: - { - mfxExtVPPFrameRateConversion& info = *(mfxExtVPPFrameRateConversion*)pExtBuffer; - SERIALIZE_INFO(Algorithm); - SERIALIZE_INFO(reserved); - SERIALIZE_INFO_ARRAY(reserved2); - } - break; - case MFX_EXTBUFF_VPP_IMAGE_STABILIZATION: - { - mfxExtVPPImageStab& info = *(mfxExtVPPImageStab*)pExtBuffer; - SERIALIZE_INFO(Mode); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_PICTURE_TIMING_SEI: - { - mfxExtPictureTimingSEI& info = *(mfxExtPictureTimingSEI*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - - SERIALIZE_INFO(TimeStamp[0].ClockTimestampFlag); - SERIALIZE_INFO(TimeStamp[0].CtType); - SERIALIZE_INFO(TimeStamp[0].NuitFieldBasedFlag); - SERIALIZE_INFO(TimeStamp[0].CountingType); - SERIALIZE_INFO(TimeStamp[0].FullTimestampFlag); - SERIALIZE_INFO(TimeStamp[0].DiscontinuityFlag); - SERIALIZE_INFO(TimeStamp[0].CntDroppedFlag); - SERIALIZE_INFO(TimeStamp[0].NFrames); - SERIALIZE_INFO(TimeStamp[0].SecondsFlag); - SERIALIZE_INFO(TimeStamp[0].MinutesFlag); - SERIALIZE_INFO(TimeStamp[0].HoursFlag); - SERIALIZE_INFO(TimeStamp[0].SecondsValue); - SERIALIZE_INFO(TimeStamp[0].MinutesValue); - SERIALIZE_INFO(TimeStamp[0].HoursValue); - SERIALIZE_INFO(TimeStamp[0].TimeOffset); - - SERIALIZE_INFO(TimeStamp[1].ClockTimestampFlag); - SERIALIZE_INFO(TimeStamp[1].CtType); - SERIALIZE_INFO(TimeStamp[1].NuitFieldBasedFlag); - SERIALIZE_INFO(TimeStamp[1].CountingType); - SERIALIZE_INFO(TimeStamp[1].FullTimestampFlag); - SERIALIZE_INFO(TimeStamp[1].DiscontinuityFlag); - SERIALIZE_INFO(TimeStamp[1].CntDroppedFlag); - SERIALIZE_INFO(TimeStamp[1].NFrames); - SERIALIZE_INFO(TimeStamp[1].SecondsFlag); - SERIALIZE_INFO(TimeStamp[1].MinutesFlag); - SERIALIZE_INFO(TimeStamp[1].HoursFlag); - SERIALIZE_INFO(TimeStamp[1].SecondsValue); - SERIALIZE_INFO(TimeStamp[1].MinutesValue); - SERIALIZE_INFO(TimeStamp[1].HoursValue); - SERIALIZE_INFO(TimeStamp[1].TimeOffset); - - SERIALIZE_INFO(TimeStamp[2].ClockTimestampFlag); - SERIALIZE_INFO(TimeStamp[2].CtType); - SERIALIZE_INFO(TimeStamp[2].NuitFieldBasedFlag); - SERIALIZE_INFO(TimeStamp[2].CountingType); - SERIALIZE_INFO(TimeStamp[2].FullTimestampFlag); - SERIALIZE_INFO(TimeStamp[2].DiscontinuityFlag); - SERIALIZE_INFO(TimeStamp[2].CntDroppedFlag); - SERIALIZE_INFO(TimeStamp[2].NFrames); - SERIALIZE_INFO(TimeStamp[2].SecondsFlag); - SERIALIZE_INFO(TimeStamp[2].MinutesFlag); - SERIALIZE_INFO(TimeStamp[2].HoursFlag); - SERIALIZE_INFO(TimeStamp[2].SecondsValue); - SERIALIZE_INFO(TimeStamp[2].MinutesValue); - SERIALIZE_INFO(TimeStamp[2].HoursValue); - SERIALIZE_INFO(TimeStamp[2].TimeOffset); - } - break; - case MFX_EXTBUFF_AVC_TEMPORAL_LAYERS: - { - mfxExtAvcTemporalLayers& info = *(mfxExtAvcTemporalLayers*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved1); - SERIALIZE_INFO(reserved2); - SERIALIZE_INFO(BaseLayerPID); - SERIALIZE_INFO(Layer[0].Scale); - SERIALIZE_INFO_ARRAY(Layer[0].reserved); - SERIALIZE_INFO(Layer[1].Scale); - SERIALIZE_INFO_ARRAY(Layer[1].reserved); - SERIALIZE_INFO(Layer[2].Scale); - SERIALIZE_INFO_ARRAY(Layer[2].reserved); - SERIALIZE_INFO(Layer[3].Scale); - SERIALIZE_INFO_ARRAY(Layer[3].reserved); - SERIALIZE_INFO(Layer[4].Scale); - SERIALIZE_INFO_ARRAY(Layer[4].reserved); - SERIALIZE_INFO(Layer[5].Scale); - SERIALIZE_INFO_ARRAY(Layer[5].reserved); - SERIALIZE_INFO(Layer[6].Scale); - SERIALIZE_INFO_ARRAY(Layer[6].reserved); - SERIALIZE_INFO(Layer[7].Scale); - SERIALIZE_INFO_ARRAY(Layer[7].reserved); - } - break; - case MFX_EXTBUFF_ENCODER_CAPABILITY: - { - mfxExtEncoderCapability& info = *(mfxExtEncoderCapability*)pExtBuffer; - SERIALIZE_INFO(MBPerSec); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_ENCODER_RESET_OPTION: - { - mfxExtEncoderResetOption& info = *(mfxExtEncoderResetOption*)pExtBuffer; - SERIALIZE_INFO(StartNewSequence); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_ENCODED_FRAME_INFO: - { - mfxExtAVCEncodedFrameInfo& info = *(mfxExtAVCEncodedFrameInfo*)pExtBuffer; - SERIALIZE_INFO(FrameOrder); - SERIALIZE_INFO(PicStruct); - SERIALIZE_INFO(LongTermIdx); - SERIALIZE_INFO(MAD); - SERIALIZE_INFO(BRCPanicMode); - SERIALIZE_INFO(QP); - SERIALIZE_INFO(SecondFieldOffset); - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(FrameOrder); - SERIALIZE_INFO(PicStruct); - SERIALIZE_INFO(LongTermIdx); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_COMPOSITE: - { - mfxExtVPPComposite& info = *(mfxExtVPPComposite*)pExtBuffer; - SERIALIZE_INFO(Y); - SERIALIZE_INFO(R); - SERIALIZE_INFO(U); - SERIALIZE_INFO(G); - SERIALIZE_INFO(V); - SERIALIZE_INFO(B); - SERIALIZE_INFO_ARRAY(reserved1); - SERIALIZE_INFO(NumInputStream); - for(int i=0;i= 1022 - SERIALIZE_INFO(ROIMode); -#endif //MFX_VERSION >= 1022 - SERIALIZE_INFO_ARRAY(reserved1); - START_PROC_ARRAY_SIZE(ROI,NumROI) - SERIALIZE_INFO_ELEMENT(ROI,Left); - SERIALIZE_INFO_ELEMENT(ROI,Top); - SERIALIZE_INFO_ELEMENT(ROI,Right); - SERIALIZE_INFO_ELEMENT(ROI,Bottom); - SERIALIZE_INFO_ELEMENT(ROI,Priority); -#if MFX_VERSION >= 1022 - SERIALIZE_INFO_ELEMENT(ROI,DeltaQP); -#endif //MFX_VERSION >= 1022 - - SERIALIZE_INFO_ARRAY_ELEMENT(ROI,reserved2); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_VPP_DEINTERLACING: - { - mfxExtVPPDeinterlacing& info = *(mfxExtVPPDeinterlacing*)pExtBuffer; - SERIALIZE_INFO(Mode); - SERIALIZE_INFO(TelecinePattern); - SERIALIZE_INFO(TelecineLocation); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_AVC_REFLISTS: - { - mfxExtAVCRefLists& info = *(mfxExtAVCRefLists*)pExtBuffer; - SERIALIZE_INFO(NumRefIdxL0Active); - SERIALIZE_INFO(NumRefIdxL1Active); - SERIALIZE_INFO_ARRAY(reserved); - - START_PROC_ARRAY(RefPicList0) - SERIALIZE_INFO_ELEMENT(RefPicList0,FrameOrder); - SERIALIZE_INFO_ELEMENT(RefPicList0,PicStruct); - SERIALIZE_INFO_ELEMENT(RefPicList0,reserved); - END_PROC_ARRAY - - START_PROC_ARRAY(RefPicList1) - SERIALIZE_INFO_ELEMENT(RefPicList1,FrameOrder); - SERIALIZE_INFO_ELEMENT(RefPicList1,PicStruct); - SERIALIZE_INFO_ELEMENT(RefPicList1,reserved); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_VPP_FIELD_PROCESSING: - { - mfxExtVPPFieldProcessing& info = *(mfxExtVPPFieldProcessing*)pExtBuffer; - SERIALIZE_INFO(Mode); - SERIALIZE_INFO(InField); - SERIALIZE_INFO(OutField); - SERIALIZE_INFO_ARRAY(reserved); - } - break; -#if MFX_VERSION >= 1022 - case MFX_EXTBUFF_DEC_VIDEO_PROCESSING: - { - mfxExtDecVideoProcessing& info = *(mfxExtDecVideoProcessing*)pExtBuffer; - SERIALIZE_INFO(In.CropX); - SERIALIZE_INFO(In.CropY); - SERIALIZE_INFO(In.CropW); - SERIALIZE_INFO(In.CropH); - SERIALIZE_INFO_ARRAY(In.reserved); - SERIALIZE_INFO(Out.FourCC); - SERIALIZE_INFO(Out.ChromaFormat); - SERIALIZE_INFO(Out.Width); - SERIALIZE_INFO(Out.Height); - SERIALIZE_INFO(Out.CropX); - SERIALIZE_INFO(Out.CropY); - SERIALIZE_INFO(Out.CropW); - SERIALIZE_INFO(Out.CropH); - SERIALIZE_INFO_ARRAY(Out.reserved); - } - break; -#endif //MFX_VERSION >= 1022 - case MFX_EXTBUFF_CHROMA_LOC_INFO: - { - mfxExtChromaLocInfo& info = *(mfxExtChromaLocInfo*)pExtBuffer; - SERIALIZE_INFO(ChromaLocInfoPresentFlag); - SERIALIZE_INFO(ChromaSampleLocTypeTopField); - SERIALIZE_INFO(ChromaSampleLocTypeBottomField); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_MBQP: - { - mfxExtMBQP& info = *(mfxExtMBQP*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(NumQPAlloc); - SERIALIZE_INFO_MEMORY(QP,NumQPAlloc); - SERIALIZE_INFO(reserved2); - } - break; - case MFX_EXTBUFF_HEVC_TILES: - { - mfxExtHEVCTiles& info = *(mfxExtHEVCTiles*)pExtBuffer; - SERIALIZE_INFO(NumTileRows); - SERIALIZE_INFO(NumTileColumns); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_MB_DISABLE_SKIP_MAP: - { - mfxExtMBDisableSkipMap& info = *(mfxExtMBDisableSkipMap*)pExtBuffer; - SERIALIZE_INFO_ARRAY(reserved); - SERIALIZE_INFO(MapSize); - SERIALIZE_INFO_MEMORY(Map,MapSize); - SERIALIZE_INFO(reserved2); - } - break; - case MFX_EXTBUFF_HEVC_PARAM: - { - mfxExtHEVCParam& info = *(mfxExtHEVCParam*)pExtBuffer; - SERIALIZE_INFO(PicWidthInLumaSamples); - SERIALIZE_INFO(PicHeightInLumaSamples); - SERIALIZE_INFO(GeneralConstraintFlags); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_DECODED_FRAME_INFO: - { - mfxExtDecodedFrameInfo& info = *(mfxExtDecodedFrameInfo*)pExtBuffer; - SERIALIZE_INFO(FrameType); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_TIME_CODE: - { - mfxExtTimeCode& info = *(mfxExtTimeCode*)pExtBuffer; - SERIALIZE_INFO(DropFrameFlag); - SERIALIZE_INFO(TimeCodeHours); - SERIALIZE_INFO(TimeCodeMinutes); - SERIALIZE_INFO(TimeCodeSeconds); - SERIALIZE_INFO(TimeCodePictures); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_HEVC_REGION: - { - mfxExtHEVCRegion& info = *(mfxExtHEVCRegion*)pExtBuffer; - SERIALIZE_INFO(RegionId); - SERIALIZE_INFO(RegionType); - SERIALIZE_INFO(RegionEncoding); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_PRED_WEIGHT_TABLE: - { - mfxExtPredWeightTable& info = *(mfxExtPredWeightTable*)pExtBuffer; - SERIALIZE_INFO(LumaLog2WeightDenom); - SERIALIZE_INFO(ChromaLog2WeightDenom); - SERIALIZE_INFO_ARRAY(LumaWeightFlag[0]); - SERIALIZE_INFO_ARRAY(LumaWeightFlag[1]); - SERIALIZE_INFO_ARRAY(ChromaWeightFlag[0]); - SERIALIZE_INFO_ARRAY(ChromaWeightFlag[1]); - //DO_MANUALLY: Weights[2][32][3][2]; - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_DIRTY_RECTANGLES: - { - mfxExtDirtyRect& info = *(mfxExtDirtyRect*)pExtBuffer; - SERIALIZE_INFO(NumRect); - SERIALIZE_INFO_ARRAY(reserved1); - - START_PROC_ARRAY_SIZE(Rect,NumRect) - SERIALIZE_INFO_ELEMENT(Rect,Left); - SERIALIZE_INFO_ELEMENT(Rect,Top); - SERIALIZE_INFO_ELEMENT(Rect,Right); - SERIALIZE_INFO_ELEMENT(Rect,Bottom); - SERIALIZE_INFO_ARRAY_ELEMENT(Rect,reserved2); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_MOVING_RECTANGLES: - { - mfxExtMoveRect& info = *(mfxExtMoveRect*)pExtBuffer; - SERIALIZE_INFO(NumRect); - SERIALIZE_INFO_ARRAY(reserved1); - - START_PROC_ARRAY_SIZE(Rect,NumRect) - SERIALIZE_INFO_ELEMENT(Rect,DestLeft); - SERIALIZE_INFO_ELEMENT(Rect,DestTop); - SERIALIZE_INFO_ELEMENT(Rect,DestRight); - SERIALIZE_INFO_ELEMENT(Rect,DestBottom); - SERIALIZE_INFO_ELEMENT(Rect,SourceLeft); - SERIALIZE_INFO_ELEMENT(Rect,SourceTop); - SERIALIZE_INFO_ARRAY_ELEMENT(Rect,reserved2); - END_PROC_ARRAY - } - break; - case MFX_EXTBUFF_VPP_ROTATION: - { - mfxExtVPPRotation& info = *(mfxExtVPPRotation*)pExtBuffer; - SERIALIZE_INFO(Angle); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_ENCODED_SLICES_INFO: - { - mfxExtEncodedSlicesInfo& info = *(mfxExtEncodedSlicesInfo*)pExtBuffer; - SERIALIZE_INFO(SliceSizeOverflow); - SERIALIZE_INFO(NumSliceNonCopliant); - SERIALIZE_INFO(NumEncodedSlice); - SERIALIZE_INFO(NumSliceSizeAlloc); - SERIALIZE_INFO_MEMORY(SliceSize,NumSliceSizeAlloc); - SERIALIZE_INFO(reserved1); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_SCALING: - { - mfxExtVPPScaling& info = *(mfxExtVPPScaling*)pExtBuffer; - SERIALIZE_INFO(ScalingMode); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_MIRRORING: - { - mfxExtVPPMirroring& info = *(mfxExtVPPMirroring*)pExtBuffer; - SERIALIZE_INFO(Type); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_MV_OVER_PIC_BOUNDARIES: - { - mfxExtMVOverPicBoundaries& info = *(mfxExtMVOverPicBoundaries*)pExtBuffer; - SERIALIZE_INFO(StickTop); - SERIALIZE_INFO(StickBottom); - SERIALIZE_INFO(StickLeft); - SERIALIZE_INFO(StickRight); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VPP_COLORFILL: - { - mfxExtVPPColorFill& info = *(mfxExtVPPColorFill*)pExtBuffer; - SERIALIZE_INFO(Enable); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - case MFX_EXTBUFF_VP8_CODING_OPTION: - { - mfxExtVP8CodingOption& info = *(mfxExtVP8CodingOption*)pExtBuffer; - SERIALIZE_INFO(Version); - SERIALIZE_INFO(EnableMultipleSegments); - SERIALIZE_INFO(LoopFilterType); - SERIALIZE_INFO_ARRAY(LoopFilterLevel); - SERIALIZE_INFO(SharpnessLevel); - SERIALIZE_INFO(NumTokenPartitions); - SERIALIZE_INFO_ARRAY(LoopFilterRefTypeDelta); - SERIALIZE_INFO_ARRAY(LoopFilterMbModeDelta); - SERIALIZE_INFO_ARRAY(SegmentQPDelta); - SERIALIZE_INFO_ARRAY(CoeffTypeQPDelta); - SERIALIZE_INFO(WriteIVFHeaders); - SERIALIZE_INFO(NumFramesForIVFHeader); - SERIALIZE_INFO_ARRAY(reserved); - } - break; - } - // End of autogenerated code -} - -void CParametersDumper::SerializeVPPCompInputStream(msdk_ostream& sstr,msdk_string prefix,mfxVPPCompInputStream& info) -{ - SERIALIZE_INFO(DstX); - SERIALIZE_INFO(DstY); - SERIALIZE_INFO(DstW); - SERIALIZE_INFO(DstH); - - SERIALIZE_INFO(LumaKeyEnable); - SERIALIZE_INFO(LumaKeyMin); - SERIALIZE_INFO(LumaKeyMax); - - SERIALIZE_INFO(GlobalAlphaEnable); - SERIALIZE_INFO(GlobalAlpha); - - SERIALIZE_INFO(PixelAlphaEnable); - - SERIALIZE_INFO_ARRAY(reserved2); -} - - -void CParametersDumper::SerializeVideoParamStruct(msdk_ostream& sstr,msdk_string sectionName,mfxVideoParam& info,bool shouldUseVPPSection) -{ - msdk_string prefix=MSDK_STRING(""); - - sstr<> l && ss2 >> r) - { - if (l != r) - { - msdk_printf(MSDK_STRING("%s changed to %s \n"), l.c_str(), r.c_str()); - } - else - { - continue; - } - } -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/plugin_utils.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/plugin_utils.cpp deleted file mode 100644 index b4899ade..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/plugin_utils.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#include "plugin_utils.h" -#include "mfxvp8.h" -#include -#include - -bool AreGuidsEqual(const mfxPluginUID& guid1, const mfxPluginUID& guid2) -{ - for(size_t i = 0; i != sizeof(mfxPluginUID); i++) - { - if (guid1.Data[i] != guid2.Data[i]) - return false; - } - return true; -} - -mfxStatus ConvertStringToGuid(const msdk_string & strGuid, mfxPluginUID & mfxGuid) -{ - mfxStatus sts = MFX_ERR_NONE; - - // Check if symbolic GUID value - std::map uid; - uid[MSDK_STRING("hevcd_sw")] = MFX_PLUGINID_HEVCD_SW; - uid[MSDK_STRING("hevcd_hw")] = MFX_PLUGINID_HEVCD_HW; - - uid[MSDK_STRING("hevce_sw")] = MFX_PLUGINID_HEVCE_SW; - uid[MSDK_STRING("hevce_gacc")] = MFX_PLUGINID_HEVCE_GACC; - uid[MSDK_STRING("hevce_hw")] = MFX_PLUGINID_HEVCE_HW; - - uid[MSDK_STRING("vp8d_hw")] = MFX_PLUGINID_VP8D_HW; - uid[MSDK_STRING("vp8e_hw")] = MFX_PLUGINID_VP8E_HW; - - uid[MSDK_STRING("vp9d_hw")] = MFX_PLUGINID_VP9D_HW; - uid[MSDK_STRING("vp9e_hw")] = MFX_PLUGINID_VP9E_HW; - - uid[MSDK_STRING("camera_hw")] = MFX_PLUGINID_CAMERA_HW; - - uid[MSDK_STRING("capture_hw")] = MFX_PLUGINID_CAPTURE_HW; - - uid[MSDK_STRING("ptir_hw")] = MFX_PLUGINID_ITELECINE_HW; - uid[MSDK_STRING("h264_la_hw")] = MFX_PLUGINID_H264LA_HW; - uid[MSDK_STRING("aacd")] = MFX_PLUGINID_AACD; - uid[MSDK_STRING("aace")] = MFX_PLUGINID_AACE; - - uid[MSDK_STRING("hevce_fei_hw")] = MFX_PLUGINID_HEVCE_FEI_HW; - - if (uid.find(strGuid) == uid.end()) - { - mfxGuid = MSDK_PLUGINGUID_NULL; - sts = MFX_ERR_UNKNOWN; - } - else - { - mfxGuid = uid[strGuid]; - sts = MFX_ERR_NONE; - } - - // Check if plain GUID value - if (sts) - { - if (strGuid.size() != 32) - { - sts = MFX_ERR_UNKNOWN; - } - else - { - for (size_t i = 0; i < 16; i++) - { - unsigned int xx = 0; - msdk_stringstream ss; - ss << std::hex << strGuid.substr(i * 2, 2); - ss >> xx; - mfxGuid.Data[i] = (mfxU8)xx; - } - sts = MFX_ERR_NONE; - } - } - return sts; -} - -const mfxPluginUID & msdkGetPluginUID(mfxIMPL impl, msdkComponentType type, mfxU32 uCodecid) -{ - if (impl == MFX_IMPL_SOFTWARE) - { - switch(type) - { - case MSDK_VDECODE: - switch(uCodecid) - { - case MFX_CODEC_HEVC: - return MFX_PLUGINID_HEVCD_SW; - } - break; - case MSDK_VENCODE: - switch(uCodecid) - { - case MFX_CODEC_HEVC: - return MFX_PLUGINID_HEVCE_SW; - } - break; - } - } - else - { - switch(type) - { - case MSDK_VENCODE: - switch(uCodecid) - { - case MFX_CODEC_VP8: - return MFX_PLUGINID_VP8E_HW; - } - break; -#if MFX_VERSION >= 1027 - case (MSDK_VENCODE | MSDK_FEI): - switch (uCodecid) - { - case MFX_CODEC_HEVC: - return MFX_PLUGINID_HEVC_FEI_ENCODE; - } - break; -#endif - case MSDK_VENC: - switch(uCodecid) - { - case MFX_CODEC_HEVC: - return MFX_PLUGINID_HEVCE_FEI_HW; // HEVC FEI uses ENC interface - } - break; - } - } - - return MSDK_PLUGINGUID_NULL; -} - -sPluginParams ParsePluginGuid(msdk_char* strPluginGuid) -{ - sPluginParams pluginParams; - mfxPluginUID uid; - mfxStatus sts = ConvertStringToGuid(strPluginGuid, uid); - - if (sts == MFX_ERR_NONE) - { - pluginParams.type = MFX_PLUGINLOAD_TYPE_GUID; - pluginParams.pluginGuid = uid; - } - - return pluginParams; -} - -sPluginParams ParsePluginPath(msdk_char* strPluginGuid) -{ - sPluginParams pluginParams; - - msdk_char tmpVal[MSDK_MAX_FILENAME_LEN]; - msdk_opt_read(strPluginGuid, tmpVal); - - MSDK_MAKE_BYTE_STRING(tmpVal, pluginParams.strPluginPath); - pluginParams.type = MFX_PLUGINLOAD_TYPE_FILE; - - return pluginParams; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/preset_manager.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/preset_manager.cpp deleted file mode 100644 index ab8267d0..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/preset_manager.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "preset_manager.h" -#include "mfxvideo.h" -#include "brc_routines.h" - -CPresetManager CPresetManager::Inst; - -msdk_string CPresetManager::modesName[PRESET_MAX_MODES] = -{ - MSDK_STRING("Default"), - MSDK_STRING("DSS"), - MSDK_STRING("Conference"), - MSDK_STRING("Gaming"), -}; - -//GopRefDist, TargetUsage, RateControlMethod, ExtBRCType, AsyncDepth, BRefType -// AdaptiveMaxFrameSize, LowDelayBRC, IntRefType, IntRefCycleSize, IntRefQPDelta, IntRefCycleDist, WeightedPred, WeightedBiPred, EnableBPyramid, EnablePPyramid - -CPresetParameters CPresetManager::presets[PRESET_MAX_MODES][PRESET_MAX_CODECS] = -{ - // Default - { - {4, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_VBR, EXTBRC_DEFAULT, 4, MFX_B_REF_PYRAMID, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0}, - {0, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_VBR, EXTBRC_DEFAULT, 4, 0, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 } - }, - // DSS - { - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_QVBR, EXTBRC_DEFAULT, 1, 0, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 }, - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_QVBR, EXTBRC_DEFAULT, 1, 0, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 1, 1 }, - }, - // Conference - { - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_VCM, EXTBRC_DEFAULT, 1, 0, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 }, - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_VBR, EXTBRC_ON, 1, 0, - 0, 0, 0, 0, 0, 0, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 }, - }, - // Gaming - { - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_QVBR, EXTBRC_DEFAULT, 1, 0, - MFX_CODINGOPTION_ON, MFX_CODINGOPTION_ON, MFX_REFRESH_HORIZONTAL, 8, 0, 4, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 }, - {1, MFX_TARGETUSAGE_BALANCED, MFX_RATECONTROL_VBR, EXTBRC_ON, 1, 0, - MFX_CODINGOPTION_ON, MFX_CODINGOPTION_ON, MFX_REFRESH_HORIZONTAL, 8, 0, 4, MFX_WEIGHTED_PRED_UNKNOWN, MFX_WEIGHTED_PRED_UNKNOWN, 0, 0 }, - } -}; - -CPresetManager::CPresetManager() -{ -} - - -CPresetManager::~CPresetManager() -{ -} - -COutputPresetParameters CPresetManager::GetPreset(EPresetModes mode, mfxU32 codecFourCC, mfxF64 fps, mfxU32 width, mfxU32 height, bool isHWLib) -{ - COutputPresetParameters retVal = GetBasicPreset(mode, codecFourCC); - *(dynamic_cast(&retVal)) = GetDependentPresetParameters(mode, codecFourCC, fps, width, height,retVal.TargetUsage); - - if (!isHWLib) - { - // These features are unsupported in SW library - retVal.WeightedBiPred = 0; - retVal.WeightedPred = 0; - } - - return retVal; -} - -COutputPresetParameters CPresetManager::GetBasicPreset(EPresetModes mode, mfxU32 codecFourCC) -{ - COutputPresetParameters retVal; - - if (mode < 0 || mode >= PRESET_MAX_MODES) - { - mode = PRESET_DEFAULT; - } - - // Reading basic preset values - switch (codecFourCC) - { - case MFX_CODEC_AVC: - retVal = presets[mode][PRESET_AVC]; - break; - case MFX_CODEC_HEVC: - retVal = presets[mode][PRESET_HEVC]; - break; - default: - if (mode != PRESET_DEFAULT) - { - msdk_printf(MSDK_STRING("WARNING: Presets are available for h.264 or h.265 codecs only. Request for particular preset is ignored.\n")); - } - - if (codecFourCC != MFX_CODEC_JPEG) - { - retVal.TargetUsage = MFX_TARGETUSAGE_BALANCED; - retVal.RateControlMethod = MFX_RATECONTROL_CBR; - } - retVal.AsyncDepth = 4; - return retVal; - } - - retVal.PresetName = modesName[mode]; - return retVal; -} - -CDependentPresetParameters CPresetManager::GetDependentPresetParameters(EPresetModes mode, mfxU32 codecFourCC, mfxF64 fps, mfxU32 width, mfxU32 height,mfxU16 targetUsage) -{ - CDependentPresetParameters retVal = {}; - retVal.TargetKbps = codecFourCC != MFX_CODEC_JPEG ? CalculateDefaultBitrate(codecFourCC, targetUsage, width, height, fps) : 0; - - if (codecFourCC == MFX_CODEC_AVC || codecFourCC == MFX_CODEC_HEVC) - { - // Calculating dependent preset values - retVal.MaxKbps = (mode == PRESET_GAMING ? (mfxU16)(1.2*retVal.TargetKbps) : 0); - retVal.GopPicSize = (mode == PRESET_GAMING || mode == PRESET_DEFAULT ? 0 : (mfxU16)(2 * fps)); - retVal.BufferSizeInKB = (mode == PRESET_DEFAULT ? 0 : retVal.TargetKbps); // 1 second buffers - retVal.LookAheadDepth = 0; // Enable this setting if LA BRC will be enabled - retVal.MaxFrameSize = (mode == PRESET_GAMING ? (mfxU32)(retVal.TargetKbps*0.166) : 0); - } - return retVal; -} - -EPresetModes CPresetManager::PresetNameToMode(const msdk_char* name) -{ - for (int i = 0; i < PRESET_MAX_MODES; i++) - { - if (!msdk_stricmp(modesName[i].c_str(), name)) - { - return (EPresetModes)i; - } - } - return PRESET_MAX_MODES; -} \ No newline at end of file diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sample_utils.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sample_utils.cpp deleted file mode 100644 index 26aac019..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sample_utils.cpp +++ /dev/null @@ -1,2779 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2020, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#include -#include -#include -#include - -#include "vm/strings_defs.h" -#include "time_statistics.h" -#include "sample_defs.h" -#include "sample_utils.h" -#include "mfxcommon.h" -#include "mfxjpeg.h" -#include "mfxvp8.h" - - -msdk_tick CTimer::frequency = 0; -msdk_tick CTimeStatisticsReal::frequency = 0; - -mfxStatus CopyBitstream2(mfxBitstream *dest, mfxBitstream *src) -{ - if (!dest || !src) - return MFX_ERR_NULL_PTR; - - if (!dest->DataLength) - { - dest->DataOffset = 0; - } - else - { - memmove(dest->Data, dest->Data + dest->DataOffset, dest->DataLength); - dest->DataOffset = 0; - } - - if (src->DataLength > dest->MaxLength - dest->DataLength - dest->DataOffset) - return MFX_ERR_NOT_ENOUGH_BUFFER; - - MSDK_MEMCPY_BITSTREAM(*dest, dest->DataOffset, src->Data, src->DataLength); - dest->DataLength = src->DataLength; - - dest->DataFlag = src->DataFlag; - - //common Extended buffer will be for src and dest bit streams - dest->EncryptedData = src->EncryptedData; - - return MFX_ERR_NONE; -} - -mfxStatus GetFrameLength(mfxU16 width, mfxU16 height, mfxU32 ColorFormat, mfxU32 &length) -{ - switch (ColorFormat) - { - case MFX_FOURCC_NV12: - case MFX_FOURCC_I420: - length = 3 * width * height / 2; - break; - case MFX_FOURCC_YUY2: - length = 2 * width * height; - break; - case MFX_FOURCC_RGB4: - length = 4 * width * height; - break; - case MFX_FOURCC_P010: - length = 3 * width * height; - break; - default: - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -CSmplYUVReader::CSmplYUVReader() -{ - m_bInited = false; - m_ColorFormat = MFX_FOURCC_YV12; - shouldShift10BitsHigh = false; -} - -mfxStatus CSmplYUVReader::Init(std::list inputs, mfxU32 ColorFormat, bool enableShifting) -{ - Close(); - - if( MFX_FOURCC_NV12 != ColorFormat && - MFX_FOURCC_YV12 != ColorFormat && - MFX_FOURCC_I420 != ColorFormat && - MFX_FOURCC_YUY2 != ColorFormat && - MFX_FOURCC_UYVY != ColorFormat && - MFX_FOURCC_RGB4 != ColorFormat && - MFX_FOURCC_BGR4 != ColorFormat && - MFX_FOURCC_P010 != ColorFormat && - MFX_FOURCC_P210 != ColorFormat && - MFX_FOURCC_AYUV != ColorFormat && - MFX_FOURCC_A2RGB10 != ColorFormat -#if (MFX_VERSION >= 1027) - && MFX_FOURCC_Y210 != ColorFormat - && MFX_FOURCC_Y410 != ColorFormat -#endif -#if (MFX_VERSION >= 1031) - && MFX_FOURCC_P016 != ColorFormat - && MFX_FOURCC_Y216 != ColorFormat -#endif - ) - { - return MFX_ERR_UNSUPPORTED; - } - - if ( MFX_FOURCC_P010 == ColorFormat - || MFX_FOURCC_P210 == ColorFormat -#if (MFX_VERSION >= 1027) - || MFX_FOURCC_Y210 == ColorFormat -#endif -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_P016 == ColorFormat - || MFX_FOURCC_Y216 == ColorFormat -#endif - ) - { - shouldShift10BitsHigh = enableShifting; - } - - if (!inputs.size()) - { - return MFX_ERR_UNSUPPORTED; - } - - for (ls_iterator it = inputs.begin(); it != inputs.end(); it++) - { - FILE *f = 0; - MSDK_FOPEN(f, (*it).c_str(), MSDK_STRING("rb")); - MSDK_CHECK_POINTER(f, MFX_ERR_NULL_PTR); - - m_files.push_back(f); - } - - m_ColorFormat = ColorFormat; - - m_bInited = true; - - return MFX_ERR_NONE; -} - -CSmplYUVReader::~CSmplYUVReader() -{ - Close(); -} - -void CSmplYUVReader::Close() -{ - for (mfxU32 i = 0; i < m_files.size(); i++) - { - fclose(m_files[i]); - } - m_files.clear(); - m_bInited = false; -} - -void CSmplYUVReader::Reset() -{ - for (mfxU32 i = 0; i < m_files.size(); i++) - { - fseek(m_files[i], 0, SEEK_SET); - } -} - -mfxStatus CSmplYUVReader::SkipNframesFromBeginning(mfxU16 w, mfxU16 h, mfxU32 viewId, mfxU32 nframes) -{ - // change file position for read from beginning to "frameLength * nframes". - mfxU32 frameLength; - - if (MFX_ERR_NONE != GetFrameLength(w, h, m_ColorFormat, frameLength)) - { - msdk_printf(MSDK_STRING("Input color format %s is unsupported in qpfile mode\n"), ColorFormatToStr(m_ColorFormat)); - return MFX_ERR_UNSUPPORTED; - } - - if (0 != fseek(m_files[viewId], frameLength * nframes, SEEK_SET)) - return MFX_ERR_MORE_DATA; - - return MFX_ERR_NONE; -} - -mfxStatus CSmplYUVReader::LoadNextFrame(mfxFrameSurface1* pSurface) -{ - // check if reader is initialized - MSDK_CHECK_ERROR(m_bInited, false, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pSurface, MFX_ERR_NULL_PTR); - - mfxU32 nBytesRead; - mfxU16 w, h, i, pitch; - mfxU8 *ptr, *ptr2; - mfxFrameInfo& pInfo = pSurface->Info; - mfxFrameData& pData = pSurface->Data; - - mfxU32 shiftSizeLuma = 16 - pInfo.BitDepthLuma; - mfxU32 shiftSizeChroma = 16 - pInfo.BitDepthChroma; - - mfxU32 vid = pInfo.FrameId.ViewId; - - if (vid > m_files.size()) - { - return MFX_ERR_UNSUPPORTED; - } - - if (pInfo.CropH > 0 && pInfo.CropW > 0) - { - w = pInfo.CropW; - h = pInfo.CropH; - } - else - { - w = pInfo.Width; - h = pInfo.Height; - } - - mfxU32 nBytesPerPixel = (pInfo.FourCC == MFX_FOURCC_P010 || pInfo.FourCC == MFX_FOURCC_P210 -#if (MFX_VERSION >= 1031) - || pInfo.FourCC == MFX_FOURCC_P016 -#endif - ) ? 2 : 1; - - if ( MFX_FOURCC_YUY2 == pInfo.FourCC - || MFX_FOURCC_UYVY == pInfo.FourCC - || MFX_FOURCC_RGB4 == pInfo.FourCC - || MFX_FOURCC_BGR4 == pInfo.FourCC - || MFX_FOURCC_AYUV == pInfo.FourCC - || MFX_FOURCC_A2RGB10 == pInfo.FourCC -#if (MFX_VERSION >= 1027) - || MFX_FOURCC_Y210 == pInfo.FourCC - || MFX_FOURCC_Y410 == pInfo.FourCC -#endif -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_Y216 == pInfo.FourCC -#endif - ) - { - //Packed format: Luminance and chrominance are on the same plane - switch (m_ColorFormat) - { - case MFX_FOURCC_A2RGB10: - case MFX_FOURCC_RGB4: - case MFX_FOURCC_BGR4: - pitch = pData.Pitch; - ptr = std::min({pData.R, pData.G, pData.B}); - ptr = ptr + pInfo.CropX*4 + pInfo.CropY * pData.Pitch; - - for(i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, 1, 4*w, m_files[vid]); - - if ((mfxU32)4*w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - } - break; - case MFX_FOURCC_YUY2: - case MFX_FOURCC_UYVY: - pitch = pData.Pitch; - ptr = m_ColorFormat == MFX_FOURCC_YUY2? - pData.Y + pInfo.CropX*2 + pInfo.CropY * pData.Pitch - : pData.U + pInfo.CropX + pInfo.CropY * pData.Pitch; - - for(i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, 2, w, m_files[vid]); - - if ((mfxU32)w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - } - break; - case MFX_FOURCC_AYUV: - pitch = pData.Pitch; - ptr = pData.V + pInfo.CropX*4 + pInfo.CropY * pData.Pitch; - - for (i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, 4, w, m_files[vid]); - - if ((mfxU32)w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - } - break; - -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - case MFX_FOURCC_Y410: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y216: -#endif - pitch = pData.Pitch; - ptr = ((pInfo.FourCC == MFX_FOURCC_Y210 -#if (MFX_VERSION >= 1031) - || pInfo.FourCC == MFX_FOURCC_Y216 -#endif - ) ? pData.Y : (mfxU8*)pData.Y410) + pInfo.CropX*4 + pInfo.CropY * pData.Pitch; - - for (i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, 1, 4 * w, m_files[vid]); - - if ((mfxU32)4 * w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - - if ((MFX_FOURCC_Y210 == pInfo.FourCC -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_Y216 == pInfo.FourCC -#endif - ) && shouldShift10BitsHigh) - { - mfxU16* shortPtr = (mfxU16*)(ptr + i * pitch); - for (int idx = 0; idx < w*2; idx++) - { - shortPtr[idx] <<= shiftSizeLuma; - } - } - - } - break; -#endif - default: - return MFX_ERR_UNSUPPORTED; - } - } - else if (MFX_FOURCC_NV12 == pInfo.FourCC - || MFX_FOURCC_YV12 == pInfo.FourCC - || MFX_FOURCC_P010 == pInfo.FourCC - || MFX_FOURCC_P210 == pInfo.FourCC -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_P016 == pInfo.FourCC -#endif - ) - { - pitch = pData.Pitch; - ptr = pData.Y + pInfo.CropX + pInfo.CropY * pData.Pitch; - - // read luminance plane - for(i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, nBytesPerPixel, w, m_files[vid]); - - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - - // Shifting data if required - if((MFX_FOURCC_P010 == pInfo.FourCC - || MFX_FOURCC_P210 == pInfo.FourCC -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_P016 == pInfo.FourCC -#endif - ) && shouldShift10BitsHigh) - { - mfxU16* shortPtr = (mfxU16*)(ptr + i * pitch); - for(int idx = 0; idx < w; idx++) - { - shortPtr[idx]<<=shiftSizeLuma; - } - } - } - - // read chroma planes - switch (m_ColorFormat) // color format of data in the input file - { - case MFX_FOURCC_I420: - case MFX_FOURCC_YV12: - switch (pInfo.FourCC) - { - case MFX_FOURCC_NV12: - - mfxU8 buf[2048]; // maximum supported chroma width for nv12 - mfxU32 j, dstOffset[2]; - w /= 2; - h /= 2; - ptr = pData.UV + pInfo.CropX + (pInfo.CropY / 2) * pitch; - if (w > 2048) - { - return MFX_ERR_UNSUPPORTED; - } - - if (m_ColorFormat == MFX_FOURCC_I420) { - dstOffset[0] = 0; - dstOffset[1] = 1; - } else { - dstOffset[0] = 1; - dstOffset[1] = 0; - } - - // load first chroma plane: U (input == I420) or V (input == YV12) - for (i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(buf, 1, w, m_files[vid]); - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - for (j = 0; j < w; j++) - { - ptr[i * pitch + j * 2 + dstOffset[0]] = buf[j]; - } - } - - // load second chroma plane: V (input == I420) or U (input == YV12) - for (i = 0; i < h; i++) - { - - nBytesRead = (mfxU32)fread(buf, 1, w, m_files[vid]); - - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - for (j = 0; j < w; j++) - { - ptr[i * pitch + j * 2 + dstOffset[1]] = buf[j]; - } - } - - break; - case MFX_FOURCC_YV12: - w /= 2; - h /= 2; - pitch /= 2; - - if (m_ColorFormat == MFX_FOURCC_I420) { - ptr = pData.U + (pInfo.CropX / 2) + (pInfo.CropY / 2) * pitch; - ptr2 = pData.V + (pInfo.CropX / 2) + (pInfo.CropY / 2) * pitch; - } else { - ptr = pData.V + (pInfo.CropX / 2) + (pInfo.CropY / 2) * pitch; - ptr2 = pData.U + (pInfo.CropX / 2) + (pInfo.CropY / 2) * pitch; - } - - for(i = 0; i < h; i++) - { - - nBytesRead = (mfxU32)fread(ptr + i * pitch, 1, w, m_files[vid]); - - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - } - for(i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr2 + i * pitch, 1, w, m_files[vid]); - - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - } - break; - default: - return MFX_ERR_UNSUPPORTED; - } - break; - case MFX_FOURCC_NV12: - case MFX_FOURCC_P010: - case MFX_FOURCC_P210: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - if (MFX_FOURCC_P210 != pInfo.FourCC) - { - h /= 2; - } - ptr = pData.UV + pInfo.CropX + (pInfo.CropY / 2) * pitch; - for(i = 0; i < h; i++) - { - nBytesRead = (mfxU32)fread(ptr + i * pitch, nBytesPerPixel, w, m_files[vid]); - - if (w != nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - - // Shifting data if required - if((MFX_FOURCC_P010 == pInfo.FourCC - || MFX_FOURCC_P210 == pInfo.FourCC -#if (MFX_VERSION >= 1031) - || MFX_FOURCC_P016 == pInfo.FourCC -#endif - ) && shouldShift10BitsHigh) - { - mfxU16* shortPtr = (mfxU16*)(ptr + i * pitch); - for(int idx = 0; idx < w; idx++) - { - shortPtr[idx]<<=shiftSizeChroma; - } - } - } - - break; - default: - return MFX_ERR_UNSUPPORTED; - } - } - else - { - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -CSmplBitstreamWriter::CSmplBitstreamWriter() -{ - m_fSource = NULL; - m_bInited = false; - m_nProcessedFramesNum = 0; -} - -CSmplBitstreamWriter::~CSmplBitstreamWriter() -{ - Close(); -} - -void CSmplBitstreamWriter::Close() -{ - if (m_fSource) - { - fclose(m_fSource); - m_fSource = NULL; - } - - m_bInited = false; -} - -mfxStatus CSmplBitstreamWriter::Init(const msdk_char *strFileName) -{ - MSDK_CHECK_POINTER(strFileName, MFX_ERR_NULL_PTR); - if (!msdk_strlen(strFileName)) - return MFX_ERR_NONE; - - Close(); - - //init file to write encoded data - MSDK_FOPEN(m_fSource, strFileName, MSDK_STRING("wb+")); - MSDK_CHECK_POINTER(m_fSource, MFX_ERR_NULL_PTR); - - m_sFile = msdk_string(strFileName); - //set init state to true in case of success - m_bInited = true; - return MFX_ERR_NONE; -} - -mfxStatus CSmplBitstreamWriter::Reset() -{ - return Init(m_sFile.c_str()); -} - -mfxStatus CSmplBitstreamWriter::WriteNextFrame(mfxBitstream *pMfxBitstream, bool isPrint) -{ - // check if writer is initialized - MSDK_CHECK_ERROR(m_bInited, false, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pMfxBitstream, MFX_ERR_NULL_PTR); - - mfxU32 nBytesWritten = 0; - - nBytesWritten = (mfxU32)fwrite(pMfxBitstream->Data + pMfxBitstream->DataOffset, 1, pMfxBitstream->DataLength, m_fSource); - MSDK_CHECK_NOT_EQUAL(nBytesWritten, pMfxBitstream->DataLength, MFX_ERR_UNDEFINED_BEHAVIOR); - - // mark that we don't need bit stream data any more - pMfxBitstream->DataLength = 0; - - m_nProcessedFramesNum++; - - // print encoding progress to console every certain number of frames (not to affect performance too much) - if (isPrint && (1 == m_nProcessedFramesNum || (0 == (m_nProcessedFramesNum % 100)))) - { - msdk_printf(MSDK_STRING("Frame number: %u\r"), m_nProcessedFramesNum); - } - - return MFX_ERR_NONE; -} - - -CSmplBitstreamDuplicateWriter::CSmplBitstreamDuplicateWriter() - : CSmplBitstreamWriter() -{ - m_fSourceDuplicate = NULL; - m_bJoined = false; -} - -mfxStatus CSmplBitstreamDuplicateWriter::InitDuplicate(const msdk_char *strFileName) -{ - MSDK_CHECK_POINTER(strFileName, MFX_ERR_NULL_PTR); - MSDK_CHECK_ERROR(msdk_strlen(strFileName), 0, MFX_ERR_NOT_INITIALIZED); - - if (m_fSourceDuplicate) - { - fclose(m_fSourceDuplicate); - m_fSourceDuplicate = NULL; - } - MSDK_FOPEN(m_fSourceDuplicate, strFileName, MSDK_STRING("wb+")); - MSDK_CHECK_POINTER(m_fSourceDuplicate, MFX_ERR_NULL_PTR); - - m_bJoined = false; // mark we own the file handle - - return MFX_ERR_NONE; -} - -mfxStatus CSmplBitstreamDuplicateWriter::JoinDuplicate(CSmplBitstreamDuplicateWriter *pJoinee) -{ - MSDK_CHECK_POINTER(pJoinee, MFX_ERR_NULL_PTR); - MSDK_CHECK_ERROR(pJoinee->m_fSourceDuplicate, NULL, MFX_ERR_NOT_INITIALIZED); - - m_fSourceDuplicate = pJoinee->m_fSourceDuplicate; - m_bJoined = true; // mark we do not own the file handle - - return MFX_ERR_NONE; -} - -mfxStatus CSmplBitstreamDuplicateWriter::WriteNextFrame(mfxBitstream *pMfxBitstream, bool isPrint) -{ - MSDK_CHECK_ERROR(m_fSourceDuplicate, NULL, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pMfxBitstream, MFX_ERR_NULL_PTR); - - mfxU32 nBytesWritten = (mfxU32)fwrite(pMfxBitstream->Data + pMfxBitstream->DataOffset, 1, pMfxBitstream->DataLength, m_fSourceDuplicate); - MSDK_CHECK_NOT_EQUAL(nBytesWritten, pMfxBitstream->DataLength, MFX_ERR_UNDEFINED_BEHAVIOR); - - CSmplBitstreamWriter::WriteNextFrame(pMfxBitstream, isPrint); - - return MFX_ERR_NONE; -} - -void CSmplBitstreamDuplicateWriter::Close() -{ - if (m_fSourceDuplicate && !m_bJoined) - { - fclose(m_fSourceDuplicate); - } - - m_fSourceDuplicate = NULL; - m_bJoined = false; - - CSmplBitstreamWriter::Close(); -} - -CSmplBitstreamReader::CSmplBitstreamReader() -{ - m_fSource = NULL; - m_bInited = false; -} - -CSmplBitstreamReader::~CSmplBitstreamReader() -{ - Close(); -} - -void CSmplBitstreamReader::Close() -{ - if (m_fSource) - { - fclose(m_fSource); - m_fSource = NULL; - } - - m_bInited = false; -} - -void CSmplBitstreamReader::Reset() -{ - if (!m_bInited) - return; - - fseek(m_fSource, 0, SEEK_SET); -} - -mfxStatus CSmplBitstreamReader::Init(const msdk_char *strFileName) -{ - MSDK_CHECK_POINTER(strFileName, MFX_ERR_NULL_PTR); - if (!msdk_strlen(strFileName)) - return MFX_ERR_NONE; - - Close(); - - //open file to read input stream - MSDK_FOPEN(m_fSource, strFileName, MSDK_STRING("rb")); - MSDK_CHECK_POINTER(m_fSource, MFX_ERR_NULL_PTR); - - m_bInited = true; - return MFX_ERR_NONE; -} - -#define CHECK_SET_EOS(pBitstream) \ - if (feof(m_fSource)) \ - { \ - pBitstream->DataFlag |= MFX_BITSTREAM_EOS; \ - } - -mfxStatus CSmplBitstreamReader::ReadNextFrame(mfxBitstream *pBS) -{ - if (!m_bInited) - return MFX_ERR_NOT_INITIALIZED; - - MSDK_CHECK_POINTER(pBS, MFX_ERR_NULL_PTR); - - // Not enough memory to read new chunk of data - if (pBS->MaxLength == pBS->DataLength) - return MFX_ERR_NOT_ENOUGH_BUFFER; - - memmove(pBS->Data, pBS->Data + pBS->DataOffset, pBS->DataLength); - pBS->DataOffset = 0; - mfxU32 nBytesRead = (mfxU32)fread(pBS->Data + pBS->DataLength, 1, pBS->MaxLength - pBS->DataLength, m_fSource); - - CHECK_SET_EOS(pBS); - - if (0 == nBytesRead) - { - return MFX_ERR_MORE_DATA; - } - - pBS->DataLength += nBytesRead; - - return MFX_ERR_NONE; -} - - -mfxU32 CJPEGFrameReader::FindMarker(mfxBitstream *pBS,mfxU32 startOffset,CJPEGFrameReader::JPEGMarker marker) -{ - for (mfxU32 i = startOffset; i + sizeof(mfxU16) <= pBS->DataLength; i++) - { - if ( *(mfxU16*)(pBS->Data + i)==(mfxU16)marker) - { - return i; - } - } - return 0xFFFFFFFF; -} - -mfxStatus CJPEGFrameReader::ReadNextFrame(mfxBitstream *pBS) -{ - mfxStatus sts = MFX_ERR_NONE; - mfxU32 offsetSOI=0xFFFFFFFF; - - pBS->DataFlag = MFX_BITSTREAM_COMPLETE_FRAME; - - while ((offsetSOI = FindMarker(pBS,pBS->DataOffset,CJPEGFrameReader::SOI))==0xFFFFFFFF && sts == MFX_ERR_NONE) - { - sts = CSmplBitstreamReader::ReadNextFrame(pBS); - } - - //--- Finding EOI of frame, to make sure that it is complete - while (FindMarker(pBS,offsetSOI,CJPEGFrameReader::EOI)==0xFFFFFFFF && sts == MFX_ERR_NONE) - { - sts = CSmplBitstreamReader::ReadNextFrame(pBS); - } - - return sts; -} - -CIVFFrameReader::CIVFFrameReader() -{ - MSDK_ZERO_MEMORY(m_hdr); -} - -#define READ_BYTES(pBuf, size)\ -{\ - mfxU32 nBytesRead = (mfxU32)fread(pBuf, 1, size, m_fSource);\ - if (nBytesRead !=size)\ - return MFX_ERR_MORE_DATA;\ -}\ - -mfxStatus CIVFFrameReader::ReadHeader() -{ - // read and skip IVF header - READ_BYTES(&m_hdr.dkif, sizeof(m_hdr.dkif)); - READ_BYTES(&m_hdr.version, sizeof(m_hdr.version)); - READ_BYTES(&m_hdr.header_len, sizeof(m_hdr.header_len)); - READ_BYTES(&m_hdr.codec_FourCC, sizeof(m_hdr.codec_FourCC)); - READ_BYTES(&m_hdr.width, sizeof(m_hdr.width)); - READ_BYTES(&m_hdr.height, sizeof(m_hdr.height)); - READ_BYTES(&m_hdr.frame_rate, sizeof(m_hdr.frame_rate)); - READ_BYTES(&m_hdr.time_scale, sizeof(m_hdr.time_scale)); - READ_BYTES(&m_hdr.num_frames, sizeof(m_hdr.num_frames)); - READ_BYTES(&m_hdr.unused, sizeof(m_hdr.unused)); - MSDK_CHECK_NOT_EQUAL(fseek(m_fSource, m_hdr.header_len, SEEK_SET), 0, MFX_ERR_UNSUPPORTED); - return MFX_ERR_NONE; -} - -void CIVFFrameReader::Reset() -{ - CSmplBitstreamReader::Reset(); - std::ignore = ReadHeader(); -} - -mfxStatus CIVFFrameReader::Init(const msdk_char *strFileName) -{ - mfxStatus sts = CSmplBitstreamReader::Init(strFileName); - MSDK_CHECK_STATUS(sts, "CSmplBitstreamReader::Init failed"); - - sts = ReadHeader(); - MSDK_CHECK_STATUS(sts, "CIVFFrameReader::ReadHeader failed"); - - // check header - MSDK_CHECK_NOT_EQUAL(MFX_MAKEFOURCC('D','K','I','F'), m_hdr.dkif, MFX_ERR_UNSUPPORTED); - if ((m_hdr.codec_FourCC != MFX_MAKEFOURCC('V','P','8','0')) && - (m_hdr.codec_FourCC != MFX_MAKEFOURCC('V','P','9','0')) && - (m_hdr.codec_FourCC != MFX_MAKEFOURCC('A','V','0','1'))) - { - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -// reads a complete frame into given bitstream -mfxStatus CIVFFrameReader::ReadNextFrame(mfxBitstream *pBS) -{ - MSDK_CHECK_POINTER(pBS, MFX_ERR_NULL_PTR); - - memmove(pBS->Data, pBS->Data + pBS->DataOffset, pBS->DataLength); - pBS->DataOffset = 0; - pBS->DataFlag = MFX_BITSTREAM_COMPLETE_FRAME; - - /*bytes pos-(pos+3) size of frame in bytes (not including the 12-byte header) - bytes (pos+4)-(pos+11) 64-bit presentation timestamp - bytes (pos+12)-(pos+12+nBytesInFrame) frame data - */ - - mfxU32 nBytesInFrame = 0; - mfxU64 nTimeStamp = 0; - - // read frame size - READ_BYTES(&nBytesInFrame, sizeof(nBytesInFrame)); - CHECK_SET_EOS(pBS); - - // read time stamp - READ_BYTES(&nTimeStamp, sizeof(nTimeStamp)); - CHECK_SET_EOS(pBS); - - //check if bitstream has enough space to hold the frame - if (nBytesInFrame > pBS->MaxLength - pBS->DataLength - pBS->DataOffset) - return MFX_ERR_NOT_ENOUGH_BUFFER; - - // read frame data - READ_BYTES(pBS->Data + pBS->DataOffset + pBS->DataLength, nBytesInFrame); - CHECK_SET_EOS(pBS); - pBS->DataLength += nBytesInFrame; - - // it is application's responsibility to make sure the bitstream contains a single complete frame and nothing else - // application has to provide input pBS with pBS->DataLength = 0 - - return MFX_ERR_NONE; -} - - -CSmplYUVWriter::CSmplYUVWriter() -{ - m_bInited = false; - m_bIsMultiView = false; - m_fDest = NULL; - m_fDestMVC = NULL; - m_numCreatedFiles = 0; - m_nViews = 0; -}; - -mfxStatus CSmplYUVWriter::Init(const msdk_char *strFileName, const mfxU32 numViews) -{ - MSDK_CHECK_POINTER(strFileName, MFX_ERR_NULL_PTR); - MSDK_CHECK_ERROR(msdk_strlen(strFileName), 0, MFX_ERR_NOT_INITIALIZED); - - m_sFile = msdk_string(strFileName); - m_nViews = numViews; - - Close(); - - //open file to write decoded data - - if (!m_bIsMultiView) - { - MSDK_FOPEN(m_fDest, m_sFile.c_str(), MSDK_STRING("wb")); - MSDK_CHECK_POINTER(m_fDest, MFX_ERR_NULL_PTR); - ++m_numCreatedFiles; - } - else - { - mfxU32 i; - - MSDK_CHECK_ERROR(numViews, 0, MFX_ERR_NOT_INITIALIZED); - - m_fDestMVC = new FILE*[numViews]; - for (i = 0; i < numViews; ++i) - { - MSDK_FOPEN(m_fDestMVC[i], FormMVCFileName(m_sFile.c_str(), i).c_str(), MSDK_STRING("wb")); - MSDK_CHECK_POINTER(m_fDestMVC[i], MFX_ERR_NULL_PTR); - ++m_numCreatedFiles; - } - } - - m_bInited = true; - - return MFX_ERR_NONE; -} - -mfxStatus CSmplYUVWriter::Reset() -{ - if (!m_bInited) - return MFX_ERR_NONE; - - return Init(m_sFile.c_str(), m_nViews); -} - -CSmplYUVWriter::~CSmplYUVWriter() -{ - Close(); -} - -void CSmplYUVWriter::Close() -{ - if (m_fDest) - { - fclose(m_fDest); - m_fDest = NULL; - } - - if (m_fDestMVC) - { - mfxU32 i = 0; - for (i = 0; i < m_numCreatedFiles; ++i) - { - if (m_fDestMVC[i] != NULL) - { - fclose(m_fDestMVC[i]); - m_fDestMVC[i] = NULL; - } - } - delete [] m_fDestMVC; - m_fDestMVC = NULL; - } - - m_numCreatedFiles = 0; - m_bInited = false; -} - -mfxStatus GetChromaSize(const mfxFrameInfo & pInfo, mfxU32 & ChromaW, mfxU32 & ChromaH) -{ - switch (pInfo.FourCC) - { - case MFX_FOURCC_YV12: - { - ChromaW = (pInfo.CropW + 1) / 2; - ChromaH = (pInfo.CropH + 1) / 2; - break; - } - case MFX_FOURCC_NV12: - { - ChromaW = (pInfo.CropW % 2) ? (pInfo.CropW + 1) : pInfo.CropW; - ChromaH = (pInfo.CropH + 1) / 2; - break; - } - case MFX_FOURCC_P010: - case MFX_FOURCC_P016: - { - ChromaW = (pInfo.CropW % 2) ? (pInfo.CropW + 1) : pInfo.CropW; - ChromaH = (mfxU32)(pInfo.CropH + 1) / 2; - break; - } - - case MFX_FOURCC_P210: - case MFX_FOURCC_Y210: - case MFX_FOURCC_Y216: - { - ChromaW = (pInfo.CropW % 2) ? (pInfo.CropW + 1) : pInfo.CropW; - ChromaH = pInfo.CropH; - break; - } - - case MFX_FOURCC_RGB4: - case MFX_FOURCC_AYUV: - case MFX_FOURCC_YUY2: - case MFX_FOURCC_NV16: - case MFX_FOURCC_A2RGB10: - case MFX_FOURCC_Y410: - case MFX_FOURCC_Y416: - { - if (pInfo.CropH > 0 && pInfo.CropW > 0) - { - ChromaW = pInfo.FourCC == MFX_FOURCC_YUY2 ? (pInfo.CropW + 1) / 2 : pInfo.CropW; - ChromaH = pInfo.CropH; - } - else - { - ChromaW = pInfo.FourCC == MFX_FOURCC_YUY2 ? (pInfo.Width + 1) / 2 : pInfo.Width; - ChromaH = pInfo.Height; - } - break; - } - - default: - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -mfxStatus CSmplYUVWriter::WriteNextFrame(mfxFrameSurface1 *pSurface) -{ - MSDK_CHECK_ERROR(m_bInited, false, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pSurface, MFX_ERR_NULL_PTR); - - mfxFrameInfo &pInfo = pSurface->Info; - mfxFrameData &pData = pSurface->Data; - - mfxU32 i; - mfxU32 vid = pInfo.FrameId.ViewId; - - mfxU32 shiftSizeLuma = 16 - pInfo.BitDepthLuma; - mfxU32 shiftSizeChroma = 16 - pInfo.BitDepthChroma; - // Temporary buffer to convert MS to no-MS format - std::vector tmp; - - if (!m_bIsMultiView) - { - MSDK_CHECK_POINTER(m_fDest, MFX_ERR_NULL_PTR); - } - else - { - MSDK_CHECK_POINTER(m_fDestMVC, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(m_fDestMVC[vid], MFX_ERR_NULL_PTR); - } - - FILE* dstFile = m_bIsMultiView ? m_fDestMVC[vid] : m_fDest; - - mfxU32 ChromaW, ChromaH; - if (MFX_ERR_NONE != GetChromaSize(pInfo, ChromaW, ChromaH)) - return MFX_ERR_UNSUPPORTED; - - switch (pInfo.FourCC) - { - case MFX_FOURCC_YV12: - case MFX_FOURCC_NV12: - case MFX_FOURCC_NV16: - for (i = 0; i < pInfo.CropH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.Y + (pInfo.CropY * pData.Pitch + pInfo.CropX) + i * pData.Pitch, 1, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - break; -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y216: // Luma and chroma will be filled below -#endif - { - for (i = 0; i < pInfo.CropH; i++) - { - mfxU8* pBuffer = ((mfxU8*)pData.Y) + (pInfo.CropY * pData.Pitch + pInfo.CropX * 4) + i * pData.Pitch; - if (pInfo.Shift) - { - // Bits will be shifted to the lower position - tmp.resize(pInfo.CropW * 2); - - for (int idx = 0; idx < pInfo.CropW*2; idx++) - { - tmp[idx] = ((mfxU16*)pBuffer)[idx] >> shiftSizeLuma; - } - - MSDK_CHECK_NOT_EQUAL( - fwrite(((const mfxU8*)tmp.data()), 4, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pBuffer, 4, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - return MFX_ERR_NONE; - } - break; -#endif -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y410: // Luma and chroma will be filled below - { - mfxU8* pBuffer = (mfxU8*)pData.Y410; - for (i = 0; i < pInfo.CropH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pBuffer + (pInfo.CropY * pData.Pitch + pInfo.CropX * 4) + i * pData.Pitch, 4, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - return MFX_ERR_NONE; - } - break; -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y416: // Luma and chroma will be filled below - { - for (i = 0; i < pInfo.CropH; i++) - { - mfxU8* pBuffer = ((mfxU8*)pData.U) + (pInfo.CropY * pData.Pitch + pInfo.CropX * 8) + i * pData.Pitch; - if (pInfo.Shift) - { - tmp.resize(pInfo.CropW * 4); - - for (int idx = 0; idx < pInfo.CropW*4; idx++) - { - tmp[idx] = ((mfxU16*)pBuffer)[idx] >> shiftSizeLuma; - } - - MSDK_CHECK_NOT_EQUAL( - fwrite(((const mfxU8*)tmp.data()), 8, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pBuffer, 8, pInfo.CropW, dstFile), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - return MFX_ERR_NONE; - } - break; -#endif - case MFX_FOURCC_P010: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - case MFX_FOURCC_P210: - { - for (i = 0; i < pInfo.CropH; i++) - { - mfxU16* shortPtr = (mfxU16*)(pData.Y + (pInfo.CropY * pData.Pitch + pInfo.CropX) + i * pData.Pitch); - if (pInfo.Shift) - { - // Convert MS-P*1* to P*1* and write - // Bits will be shifted to the lower position - tmp.resize(pData.Pitch); - - for (int idx = 0; idx < pInfo.CropW; idx++) - { - tmp[idx] = shortPtr[idx] >> shiftSizeLuma; - } - - MSDK_CHECK_NOT_EQUAL( - fwrite(&tmp[0], 1, (mfxU32)pInfo.CropW * 2, dstFile), - (mfxU32)pInfo.CropW * 2, MFX_ERR_UNDEFINED_BEHAVIOR); - - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(shortPtr, 1, (mfxU32)pInfo.CropW * 2, dstFile), - (mfxU32)pInfo.CropW * 2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - - break; - } - case MFX_FOURCC_RGB4: - case MFX_FOURCC_AYUV: - case MFX_FOURCC_A2RGB10: - case MFX_FOURCC_YUY2: - // Implementation for these formats is in the next switch below - break; - - default: - return MFX_ERR_UNSUPPORTED; - } - switch (pInfo.FourCC) - { - case MFX_FOURCC_YV12: - { - for (i = 0; i < ChromaH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.V + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2) + i * pData.Pitch, 1, ChromaW, dstFile), - ChromaW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - for (i = 0; i < ChromaH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.U + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2) + i * pData.Pitch / 2, 1, ChromaW, dstFile), - ChromaW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - break; - } - case MFX_FOURCC_NV12: - { - for (i = 0; i < ChromaH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch + pInfo.CropX) + i * pData.Pitch, 1, ChromaW, dstFile), - ChromaW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - break; - } - case MFX_FOURCC_NV16: - { - for (i = 0; i < ChromaH; i++) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX) + i * pData.Pitch, 1, ChromaW, dstFile), - ChromaW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - break; - } - case MFX_FOURCC_P010: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - case MFX_FOURCC_P210: - { - for (i = 0; i < ChromaH; i++) - { - mfxU16* shortPtr = (mfxU16*)(pData.UV + (pInfo.CropY * pData.Pitch + pInfo.CropX*2) + i * pData.Pitch); - if (pInfo.Shift) - { - // Convert MS-P*1* to P*1* and write - // Bits will be shifted to the lower position - tmp.resize(pData.Pitch); - - for (mfxU32 idx = 0; idx < ChromaW; idx++) - { - tmp[idx] = shortPtr[idx] >> shiftSizeChroma; - } - - MSDK_CHECK_NOT_EQUAL( - fwrite(&tmp[0], 1, ChromaW * 2, dstFile), - (mfxU32)ChromaW * 2, MFX_ERR_UNDEFINED_BEHAVIOR); - - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(shortPtr, 1, ChromaW * 2, dstFile), - ChromaW * 2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - break; - } - - case MFX_FOURCC_RGB4: - case MFX_FOURCC_AYUV: - case MFX_FOURCC_YUY2: - case MFX_FOURCC_A2RGB10: - { - mfxU8* ptr; - - ptr = std::min({pData.R, pData.G, pData.B}); - ptr = ptr + pInfo.CropX + pInfo.CropY * pData.Pitch; - - for (i = 0; i < ChromaH; i++) - { - MSDK_CHECK_NOT_EQUAL(fwrite(ptr + i * pData.Pitch, 1, 4 * ChromaW, dstFile), 4 * ChromaW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - fflush(dstFile); - break; - } - - default: - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -mfxStatus CSmplYUVWriter::WriteNextFrameI420(mfxFrameSurface1 *pSurface) -{ - MSDK_CHECK_ERROR(m_bInited, false, MFX_ERR_NOT_INITIALIZED); - MSDK_CHECK_POINTER(pSurface, MFX_ERR_NULL_PTR); - - mfxFrameInfo &pInfo = pSurface->Info; - mfxFrameData &pData = pSurface->Data; - - mfxU32 i, j; - mfxU32 vid = pInfo.FrameId.ViewId; - - if (!m_bIsMultiView) - { - MSDK_CHECK_POINTER(m_fDest, MFX_ERR_NULL_PTR); - } - else - { - MSDK_CHECK_POINTER(m_fDestMVC, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(m_fDestMVC[vid], MFX_ERR_NULL_PTR); - } - - mfxU32 ChromaW, ChromaH; - if (MFX_ERR_NONE != GetChromaSize(pInfo, ChromaW, ChromaH)) - return MFX_ERR_UNSUPPORTED; - - // Write Y - switch (pInfo.FourCC) - { - case MFX_FOURCC_YV12: - case MFX_FOURCC_NV12: - { - for (i = 0; i < pInfo.CropH; i++) - { - if (!m_bIsMultiView) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.Y + (pInfo.CropY * pData.Pitch + pInfo.CropX)+ i * pData.Pitch, 1, pInfo.CropW, m_fDest), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.Y + (pInfo.CropY * pData.Pitch + pInfo.CropX)+ i * pData.Pitch, 1, pInfo.CropW, m_fDestMVC[vid]), - pInfo.CropW, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - break; - } - default: - { - msdk_printf(MSDK_STRING("ERROR: I420 output is accessible only for NV12 and YV12.\n")); - return MFX_ERR_UNSUPPORTED; - } - } - - // Write U and V - switch (pInfo.FourCC) - { - case MFX_FOURCC_YV12: - { - for (i = 0; i < ChromaH; i++) - { - if (!m_bIsMultiView) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.U + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2)+ i * pData.Pitch / 2, 1, ChromaW, m_fDest), - (mfxU32)pInfo.CropW/2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.U + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2)+ i * pData.Pitch / 2, 1, ChromaW, m_fDestMVC[vid]), - (mfxU32)pInfo.CropW/2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - for (i = 0; i < ChromaH; i++) - { - if (!m_bIsMultiView) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.V + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2)+ i * pData.Pitch / 2, 1, ChromaW, m_fDest), - (mfxU32)pInfo.CropW/2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.V + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX / 2)+ i * pData.Pitch / 2, 1, ChromaW, m_fDestMVC[vid]), - (mfxU32)pInfo.CropW/2, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - break; - } - case MFX_FOURCC_NV12: - { - for (i = 0; i < ChromaH; i++) - { - for (j = 0; j < ChromaW; j += 2) - { - if (!m_bIsMultiView) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX) + i * pData.Pitch + j, 1, 1, m_fDest), - 1, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX) + i * pData.Pitch + j, 1, 1, m_fDestMVC[vid]), - 1, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - } - for (i = 0; i < ChromaH; i++) - { - for (j = 1; j < ChromaW; j += 2) - { - if (!m_bIsMultiView) - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX)+ i * pData.Pitch + j, 1, 1, m_fDest), - 1, MFX_ERR_UNDEFINED_BEHAVIOR); - } - else - { - MSDK_CHECK_NOT_EQUAL( - fwrite(pData.UV + (pInfo.CropY * pData.Pitch / 2 + pInfo.CropX)+ i * pData.Pitch + j, 1, 1, m_fDestMVC[vid]), - 1, MFX_ERR_UNDEFINED_BEHAVIOR); - } - } - } - break; - } - default: - { - msdk_printf(MSDK_STRING("ERROR: I420 output is accessible only for NV12 and YV12.\n")); - return MFX_ERR_UNSUPPORTED; - } - } - - return MFX_ERR_NONE; -} - -void QPFile::Reader::ResetState() -{ - ResetState(READER_ERR_NOT_INITIALIZED); -} - -void QPFile::Reader::ResetState(ReaderStatus set_sts) -{ - m_CurFrameNum = std::numeric_limits::max(); - m_nFrames = std::numeric_limits::max(); - m_ReaderSts = set_sts; - m_FrameVals.clear(); -} - -mfxStatus QPFile::Reader::Read(const msdk_string& strFileName, mfxU32 codecid) -{ - m_ReaderSts = READER_ERR_NONE; - m_CurFrameNum = 0; - - if (codecid != MFX_CODEC_AVC && codecid != MFX_CODEC_HEVC) - { - ResetState(READER_ERR_CODEC_UNSUPPORTED); - return MFX_ERR_NOT_INITIALIZED; - } - - std::ifstream ifs(strFileName, msdk_fstream::in); - if (!ifs.is_open()) - { - ResetState(READER_ERR_FILE_NOT_OPEN); - return MFX_ERR_NOT_INITIALIZED; - } - - FrameInfo frameInfo{}; - std::string line; - std::getline(ifs, line); - m_nFrames = std::stoi(line); // number of frames at first line - - m_FrameVals.reserve(m_nFrames); - - while (QPFile::get_line(ifs, line)) - { - frameInfo.displayOrder = QPFile::ReadDisplayOrder(line); - frameInfo.QP = QPFile::ReadQP(line); - frameInfo.frameType = QPFile::ReadFrameType(line); - if ( frameInfo.displayOrder > m_nFrames || - frameInfo.QP > 51 || - frameInfo.frameType == MFX_FRAMETYPE_UNKNOWN ) - { - ResetState(READER_ERR_INCORRECT_FILE); - return MFX_ERR_NOT_INITIALIZED; - } - m_FrameVals.push_back(frameInfo); - } - if (m_FrameVals.size() < m_nFrames) - { - ResetState(READER_ERR_INCORRECT_FILE); - return MFX_ERR_NOT_INITIALIZED; - } - - return MFX_ERR_NONE; -} - -std::string QPFile::Reader::GetErrorMessage() const { return ReaderStatusToString(m_ReaderSts); } -mfxU32 QPFile::Reader::GetCurrentEncodedOrder() const { return m_CurFrameNum; } -mfxU32 QPFile::Reader::GetCurrentDisplayOrder() const { return m_FrameVals.at(m_CurFrameNum).displayOrder; } -mfxU16 QPFile::Reader::GetCurrentQP() const { return m_FrameVals.at(m_CurFrameNum).QP; } -mfxU16 QPFile::Reader::GetCurrentFrameType() const { return m_FrameVals.at(m_CurFrameNum).frameType; } -mfxU32 QPFile::Reader::GetFramesNum() const { return m_nFrames; } -void QPFile::Reader::NextFrame() { ++m_CurFrameNum; } - - -void TCBRCTestFile::Reader::ResetState(ReaderStatus set_sts) -{ - m_CurFrameNum = std::numeric_limits::max(); - m_ReaderSts = set_sts; - m_FrameVals.clear(); -} - -mfxStatus TCBRCTestFile::Reader::Read(const msdk_string& strFileName, mfxU32 codecid) -{ - m_ReaderSts = READER_ERR_NONE; - m_CurFrameNum = 0; - - if (codecid != MFX_CODEC_AVC && codecid != MFX_CODEC_HEVC) - { - ResetState(READER_ERR_CODEC_UNSUPPORTED); - return MFX_ERR_NOT_INITIALIZED; - } - - std::ifstream ifs(strFileName, msdk_fstream::in); - if (!ifs.is_open()) - { - ResetState(READER_ERR_FILE_NOT_OPEN); - return MFX_ERR_NOT_INITIALIZED; - } - - FrameInfo frameInfo{}; - std::string line; - - - mfxU32 n = 0; - while (TCBRCTestFile::get_line(ifs, line)) - { - frameInfo.displayOrder = TCBRCTestFile::ReadDisplayOrder(line); - frameInfo.targetFrameSize = TCBRCTestFile::ReadTargetFrameSize(line); - if (frameInfo.displayOrder==0) - frameInfo.displayOrder = n; - m_FrameVals.push_back(frameInfo); - n++; - } - return MFX_ERR_NONE; -} -std::string TCBRCTestFile::Reader::GetErrorMessage() const { return ReaderStatusToString(m_ReaderSts); } -mfxU32 TCBRCTestFile::Reader::GetTargetFrameSize(mfxU32 displayOrder) const -{ - mfxU32 num = (mfxU32)m_FrameVals.size(); - if (num == 0) return 0; - for (mfxU32 i = 0; i < num - 1; i++) - { - if (m_FrameVals.at(i + 1).displayOrder > displayOrder) - return m_FrameVals.at(i).targetFrameSize; - - } - return m_FrameVals.at(num - 1).targetFrameSize; -} - -mfxStatus ConvertFrameRate(mfxF64 dFrameRate, mfxU32* pnFrameRateExtN, mfxU32* pnFrameRateExtD) -{ - MSDK_CHECK_POINTER(pnFrameRateExtN, MFX_ERR_NULL_PTR); - MSDK_CHECK_POINTER(pnFrameRateExtD, MFX_ERR_NULL_PTR); - - mfxU32 fr; - - fr = (mfxU32)(dFrameRate + .5); - - if (fabs(fr - dFrameRate) < 0.0001) - { - *pnFrameRateExtN = fr; - *pnFrameRateExtD = 1; - return MFX_ERR_NONE; - } - - fr = (mfxU32)(dFrameRate * 1.001 + .5); - - if (fabs(fr * 1000 - dFrameRate * 1001) < 10) - { - *pnFrameRateExtN = fr * 1000; - *pnFrameRateExtD = 1001; - return MFX_ERR_NONE; - } - - *pnFrameRateExtN = (mfxU32)(dFrameRate * 10000 + .5); - *pnFrameRateExtD = 10000; - - return MFX_ERR_NONE; -} - -mfxF64 CalculateFrameRate(mfxU32 nFrameRateExtN, mfxU32 nFrameRateExtD) -{ - if (nFrameRateExtN && nFrameRateExtD) - return (mfxF64)nFrameRateExtN / nFrameRateExtD; - else - return 0; -} - -void FreeSurfacePool(mfxFrameSurface1* pSurfacesPool, mfxU16 nPoolSize) -{ - if (pSurfacesPool) - { - for (mfxU16 i = 0; i < nPoolSize; i++) - { - pSurfacesPool[i].Data.Locked = 0; - } - } -} - -mfxU16 GetFreeSurface(mfxFrameSurface1* pSurfacesPool, mfxU16 nPoolSize) -{ - mfxU32 SleepInterval = 10; // milliseconds - - mfxU16 idx = MSDK_INVALID_SURF_IDX; - - CTimer t; - t.Start(); - //wait if there's no free surface - do - { - idx = GetFreeSurfaceIndex(pSurfacesPool, nPoolSize); - - if (MSDK_INVALID_SURF_IDX != idx) - { - break; - } - else - { - MSDK_SLEEP(SleepInterval); - } - } while ( t.GetTime() < MSDK_SURFACE_WAIT_INTERVAL / 1000 ); - - if(idx==MSDK_INVALID_SURF_IDX) - { - msdk_printf(MSDK_STRING("ERROR: No free surfaces in pool (during long period)\n")); - } - - return idx; -} - -std::basic_string CodecIdToStr(mfxU32 nFourCC) -{ - std::basic_string fcc; - for (size_t i = 0; i < 4; i++) - { - fcc.push_back((msdk_char)*(i + (char*)&nFourCC)); - } - return fcc; -} - -PartiallyLinearFNC::PartiallyLinearFNC() -: m_pX() -, m_pY() -, m_nPoints() -, m_nAllocated() -{ -} - -PartiallyLinearFNC::~PartiallyLinearFNC() -{ - delete []m_pX; - m_pX = NULL; - delete []m_pY; - m_pY = NULL; -} - -void PartiallyLinearFNC::AddPair(mfxF64 x, mfxF64 y) -{ - //duplicates searching - for (mfxU32 i = 0; i < m_nPoints; i++) - { - if (m_pX[i] == x) - return; - } - if (m_nPoints == m_nAllocated) - { - m_nAllocated += 20; - mfxF64 * pnew; - pnew = new mfxF64[m_nAllocated]; - //memcpy_s(pnew, sizeof(mfxF64)*m_nAllocated, m_pX, sizeof(mfxF64) * m_nPoints); - MSDK_MEMCPY_BUF(pnew,0,sizeof(mfxF64)*m_nAllocated, m_pX,sizeof(mfxF64) * m_nPoints); - delete [] m_pX; - m_pX = pnew; - - pnew = new mfxF64[m_nAllocated]; - //memcpy_s(pnew, sizeof(mfxF64)*m_nAllocated, m_pY, sizeof(mfxF64) * m_nPoints); - MSDK_MEMCPY_BUF(pnew,0,sizeof(mfxF64)*m_nAllocated, m_pY,sizeof(mfxF64) * m_nPoints); - delete [] m_pY; - m_pY = pnew; - } - m_pX[m_nPoints] = x; - m_pY[m_nPoints] = y; - - m_nPoints ++; -} - -mfxF64 PartiallyLinearFNC::at(mfxF64 x) -{ - if (m_nPoints < 2) - { - return 0; - } - bool bwasmin = false; - bool bwasmax = false; - - mfxU32 maxx = 0; - mfxU32 minx = 0; - mfxU32 i; - - for (i=0; i < m_nPoints; i++) - { - if (m_pX[i] <= x && (!bwasmin || m_pX[i] > m_pX[maxx])) - { - maxx = i; - bwasmin = true; - } - if (m_pX[i] > x && (!bwasmax || m_pX[i] < m_pX[minx])) - { - minx = i; - bwasmax = true; - } - } - - //point on the left - if (!bwasmin) - { - for (i=0; i < m_nPoints; i++) - { - if (m_pX[i] > m_pX[minx] && (!bwasmin || m_pX[i] < m_pX[minx])) - { - maxx = i; - bwasmin = true; - } - } - } - //point on the right - if (!bwasmax) - { - for (i=0; i < m_nPoints; i++) - { - if (m_pX[i] < m_pX[maxx] && (!bwasmax || m_pX[i] > m_pX[minx])) - { - minx = i; - bwasmax = true; - } - } - } - - //linear interpolation - return (x - m_pX[minx])*(m_pY[maxx] - m_pY[minx]) / (m_pX[maxx] - m_pX[minx]) + m_pY[minx]; -} - -mfxU16 CalculateDefaultBitrate(mfxU32 nCodecId, mfxU32 nTargetUsage, mfxU32 nWidth, mfxU32 nHeight, mfxF64 dFrameRate) -{ - PartiallyLinearFNC fnc; - mfxF64 bitrate = 0; - - switch (nCodecId) - { - case MFX_CODEC_HEVC : - { - fnc.AddPair(0, 0); - fnc.AddPair(25344, 225/1.3); - fnc.AddPair(101376, 1000/1.3); - fnc.AddPair(414720, 4000/1.3); - fnc.AddPair(2058240, 5000/1.3); - break; - } - case MFX_CODEC_AVC : - { - fnc.AddPair(0, 0); - fnc.AddPair(25344, 225); - fnc.AddPair(101376, 1000); - fnc.AddPair(414720, 4000); - fnc.AddPair(2058240, 5000); - break; - } - case MFX_CODEC_MPEG2: - { - fnc.AddPair(0, 0); - fnc.AddPair(414720, 12000); - break; - } - default: - { - fnc.AddPair(0, 0); - fnc.AddPair(414720, 12000); - break; - } - } - - mfxF64 at = nWidth * nHeight * dFrameRate / 30.0; - - if (!at) - return 0; - - switch (nTargetUsage) - { - case MFX_TARGETUSAGE_BEST_QUALITY : - { - bitrate = (&fnc)->at(at); - break; - } - case MFX_TARGETUSAGE_BEST_SPEED : - { - bitrate = (&fnc)->at(at) * 0.5; - break; - } - case MFX_TARGETUSAGE_BALANCED : - default: - { - bitrate = (&fnc)->at(at) * 0.75; - break; - } - } - - return (mfxU16)bitrate; -} - -mfxU16 StrToTargetUsage(msdk_string strInput) -{ - std::map tu; - tu[MSDK_STRING("quality")] = (mfxU16)MFX_TARGETUSAGE_1; - tu[MSDK_STRING("veryslow")] = (mfxU16)MFX_TARGETUSAGE_1; - tu[MSDK_STRING("slower")] = (mfxU16)MFX_TARGETUSAGE_2; - tu[MSDK_STRING("slow")] = (mfxU16)MFX_TARGETUSAGE_3; - tu[MSDK_STRING("medium")] = (mfxU16)MFX_TARGETUSAGE_4; - tu[MSDK_STRING("balanced")] = (mfxU16)MFX_TARGETUSAGE_4; - tu[MSDK_STRING("fast")] = (mfxU16)MFX_TARGETUSAGE_5; - tu[MSDK_STRING("faster")] = (mfxU16)MFX_TARGETUSAGE_6; - tu[MSDK_STRING("veryfast")] = (mfxU16)MFX_TARGETUSAGE_7; - tu[MSDK_STRING("speed")] = (mfxU16)MFX_TARGETUSAGE_7; - tu[MSDK_STRING("1")] = (mfxU16)MFX_TARGETUSAGE_1; - tu[MSDK_STRING("2")] = (mfxU16)MFX_TARGETUSAGE_2; - tu[MSDK_STRING("3")] = (mfxU16)MFX_TARGETUSAGE_3; - tu[MSDK_STRING("4")] = (mfxU16)MFX_TARGETUSAGE_4; - tu[MSDK_STRING("5")] = (mfxU16)MFX_TARGETUSAGE_5; - tu[MSDK_STRING("6")] = (mfxU16)MFX_TARGETUSAGE_6; - tu[MSDK_STRING("7")] = (mfxU16)MFX_TARGETUSAGE_7; - - if (tu.find(strInput) == tu.end()) - return 0; - else - return tu[strInput]; -} - -const msdk_char* TargetUsageToStr(mfxU16 tu) -{ - switch(tu) - { - case MFX_TARGETUSAGE_BALANCED: - return MSDK_STRING("balanced"); - case MFX_TARGETUSAGE_BEST_QUALITY: - return MSDK_STRING("quality"); - case MFX_TARGETUSAGE_BEST_SPEED: - return MSDK_STRING("speed"); - case MFX_TARGETUSAGE_UNKNOWN: - return MSDK_STRING("unknown"); - default: - return MSDK_STRING("unsupported"); - } -} - -const msdk_char* ColorFormatToStr(mfxU32 format) -{ - switch(format) - { - case MFX_FOURCC_NV12: - return MSDK_STRING("NV12"); - case MFX_FOURCC_YV12: - return MSDK_STRING("YV12"); - case MFX_FOURCC_I420: - return MSDK_STRING("YUV420"); - case MFX_FOURCC_RGB4: - return MSDK_STRING("RGB4"); - case MFX_FOURCC_YUY2: - return MSDK_STRING("YUY2"); - case MFX_FOURCC_UYVY: - return MSDK_STRING("UYVY"); - case MFX_FOURCC_P010: - return MSDK_STRING("P010"); - case MFX_FOURCC_P210: - return MSDK_STRING("P210"); -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - return MSDK_STRING("Y210"); - case MFX_FOURCC_Y410: - return MSDK_STRING("Y410"); -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: - return MSDK_STRING("P016"); - case MFX_FOURCC_Y216: - return MSDK_STRING("Y216"); -#endif - default: - return MSDK_STRING("unsupported"); - } -} - -mfxU32 GCD(mfxU32 a, mfxU32 b) -{ - if (0 == a) - return b; - else if (0 == b) - return a; - - mfxU32 a1, b1; - - if (a >= b) - { - a1 = a; - b1 = b; - } - else - { - a1 = b; - b1 = a; - } - - // a1 >= b1; - mfxU32 r = a1 % b1; - - while (0 != r) - { - a1 = b1; - b1 = r; - r = a1 % b1; - } - - return b1; -} - - - -std::basic_string FormMVCFileName(const msdk_char *strFileNamePattern, const mfxU32 numView) -{ - if (NULL == strFileNamePattern) - return MSDK_STRING(""); - - std::basic_string fileName, mvcFileName, fileExt; - fileName = strFileNamePattern; - - msdk_char postfixBuffer[4]; - msdk_itoa_decimal(numView, postfixBuffer); - mvcFileName = fileName; - mvcFileName.append(MSDK_STRING("_")); - mvcFileName.append(postfixBuffer); - mvcFileName.append(MSDK_STRING(".yuv")); - - return mvcFileName; -} - -// function for getting a pointer to a specific external buffer from the array -mfxExtBuffer* GetExtBuffer(mfxExtBuffer** ebuffers, mfxU32 nbuffers, mfxU32 BufferId) -{ - if (!ebuffers) return 0; - for(mfxU32 i=0; iBufferId == BufferId) { - return ebuffers[i]; - } - } - return 0; -} - -mfxStatus MJPEG_AVI_ParsePicStruct(mfxBitstream *bitstream) -{ - // check input for consistency - MSDK_CHECK_POINTER(bitstream->Data, MFX_ERR_MORE_DATA); - if (bitstream->DataLength <= 0) - return MFX_ERR_MORE_DATA; - - // define JPEG markers - const mfxU8 APP0_marker [] = { 0xFF, 0xE0 }; - const mfxU8 SOI_marker [] = { 0xFF, 0xD8 }; - const mfxU8 AVI1 [] = { 'A', 'V', 'I', '1' }; - - // size of length field in header - const mfxU8 len_size = 2; - // size of picstruct field in header - const mfxU8 picstruct_size = 1; - - mfxU32 length = bitstream->DataLength; - const mfxU8 *ptr = reinterpret_cast(bitstream->Data); - - //search for SOI marker - while ((length >= sizeof(SOI_marker)) && memcmp(ptr, SOI_marker, sizeof(SOI_marker))) - { - skip(ptr, length, (mfxU32)1); - } - - // skip SOI - if (!skip(ptr, length, (mfxU32)sizeof(SOI_marker)) || length < sizeof(APP0_marker)) - return MFX_ERR_MORE_DATA; - - // if there is no APP0 marker return - if (memcmp(ptr, APP0_marker, sizeof(APP0_marker))) - { - bitstream->PicStruct = MFX_PICSTRUCT_UNKNOWN; - return MFX_ERR_NONE; - } - - // skip APP0 & length value - if (!skip(ptr, length, (mfxU32)sizeof(APP0_marker) + len_size) || length < sizeof(AVI1)) - return MFX_ERR_MORE_DATA; - - if (memcmp(ptr, AVI1, sizeof(AVI1))) - { - bitstream->PicStruct = MFX_PICSTRUCT_UNKNOWN; - return MFX_ERR_NONE; - } - - // skip 'AVI1' - if (!skip(ptr, length, (mfxU32)sizeof(AVI1)) || length < picstruct_size) - return MFX_ERR_MORE_DATA; - - // get PicStruct - switch (*ptr) - { - case 0: - bitstream->PicStruct = MFX_PICSTRUCT_PROGRESSIVE; - break; - case 1: - bitstream->PicStruct = MFX_PICSTRUCT_FIELD_TFF; - break; - case 2: - bitstream->PicStruct = MFX_PICSTRUCT_FIELD_BFF; - break; - default: - bitstream->PicStruct = MFX_PICSTRUCT_UNKNOWN; - } - - return MFX_ERR_NONE; -} - -mfxVersion getMinimalRequiredVersion(const APIChangeFeatures &features) -{ - mfxVersion version = {{1, 1}}; - - if (features.MVCDecode || features.MVCEncode || features.LowLatency || features.JpegDecode) - { - version.Minor = 3; - } - - if (features.ViewOutput) - { - version.Minor = 4; - } - - if (features.JpegEncode || features.IntraRefresh) - { - version.Minor = 6; - } - - if (features.LookAheadBRC) - { - version.Minor = 7; - } - - if (features.AudioDecode) { - version.Minor = 8; - } - - if (features.SupportCodecPluginAPI) { - version.Minor = 8; - } - - return version; -} - -bool CheckVersion(mfxVersion* version, msdkAPIFeature feature) -{ - if (!version) { - return false; - } - - mfxU32 ver = MakeVersion(version->Major, version->Minor); - - switch (feature) { - case MSDK_FEATURE_NONE: - return true; - case MSDK_FEATURE_MVC: - if (ver >= 1003) { - return true; - } - break; - case MSDK_FEATURE_JPEG_DECODE: - if (ver >= 1003) { - return true; - } - break; - case MSDK_FEATURE_LOW_LATENCY: - if (ver >= 1003) { - return true; - } - break; - case MSDK_FEATURE_MVC_VIEWOUTPUT: - if (ver >= 1004) { - return true; - } - break; - case MSDK_FEATURE_JPEG_ENCODE: - if (ver >= 1006) { - return true; - } - break; - case MSDK_FEATURE_LOOK_AHEAD: - if (ver >= 1007) { - return true; - } - break; - case MSDK_FEATURE_PLUGIN_API: - if (ver >= 1008) { - return true; - } - break; - default: - return false; - } - return false; -} - -void ConfigureAspectRatioConversion(mfxInfoVPP* pVppInfo) -{ - if (!pVppInfo) return; - - if (pVppInfo->In.AspectRatioW && - pVppInfo->In.AspectRatioH && - pVppInfo->In.CropW && - pVppInfo->In.CropH && - pVppInfo->Out.AspectRatioW && - pVppInfo->Out.AspectRatioH && - pVppInfo->Out.CropW && - pVppInfo->Out.CropH) - { - mfxF64 dFrameAR = ((mfxF64)pVppInfo->In.AspectRatioW * pVppInfo->In.CropW) / - (mfxF64)pVppInfo->In.AspectRatioH / - (mfxF64)pVppInfo->In.CropH; - - mfxF64 dPixelAR = pVppInfo->Out.AspectRatioW / (mfxF64)pVppInfo->Out.AspectRatioH; - - mfxU16 dProportionalH = (mfxU16)(pVppInfo->Out.CropW * dPixelAR / dFrameAR + 1) & -2; //round to closest odd (values are always positive) - - if (dProportionalH < pVppInfo->Out.CropH) - { - pVppInfo->Out.CropY = (mfxU16)((pVppInfo->Out.CropH - dProportionalH) / 2. + 1) & -2; - pVppInfo->Out.CropH = pVppInfo->Out.CropH - 2 * pVppInfo->Out.CropY; - } - else if (dProportionalH > pVppInfo->Out.CropH) - { - mfxU16 dProportionalW = (mfxU16)(pVppInfo->Out.CropH * dFrameAR / dPixelAR + 1) & -2; - - pVppInfo->Out.CropX = (mfxU16)((pVppInfo->Out.CropW - dProportionalW) / 2 + 1) & -2; - pVppInfo->Out.CropW = pVppInfo->Out.CropW - 2 * pVppInfo->Out.CropX; - } - } -} - -void SEICalcSizeType(std::vector& data, mfxU16 type, mfxU32 size) -{ - mfxU32 B = type; - - while (B > 255) - { - data.push_back(255); - B -= 255; - } - data.push_back(mfxU8(B)); - - B = size; - - while (B > 255) - { - data.push_back(255); - B -= 255; - } - data.push_back(mfxU8(B)); -} - -mfxU8 Char2Hex(msdk_char ch) -{ - msdk_char value = ch; - if(value >= MSDK_CHAR('0') && value <= MSDK_CHAR('9')) - { - value -= MSDK_CHAR('0'); - } - else if (value >= MSDK_CHAR('a') && value <= MSDK_CHAR('f')) - { - value = value - MSDK_CHAR('a') + 10; - } - else if (value >= MSDK_CHAR('A') && value <= MSDK_CHAR('F')) - { - value = value - MSDK_CHAR('A') + 10; - } - else - { - value = 0; - } - return (mfxU8)value; -} - -namespace { - int g_trace_level = MSDK_TRACE_LEVEL_INFO; -} - -int msdk_trace_get_level() { - return g_trace_level; -} - -void msdk_trace_set_level(int newLevel) { - g_trace_level = newLevel; -} - -bool msdk_trace_is_printable(int level) { - return g_trace_level >= level; -} - -msdk_ostream & operator <<(msdk_ostream & os, MsdkTraceLevel tl) { - switch (tl) - { - case MSDK_TRACE_LEVEL_CRITICAL : - os< mfxStatus -msdk_opt_read(const msdk_char* string, mfxU8& value) -{ - msdk_char* stopCharacter; - value = (mfxU8)msdk_strtol(string, &stopCharacter, 10); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxU16& value) -{ - msdk_char* stopCharacter; - value = (mfxU16)msdk_strtol(string, &stopCharacter, 10); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxU32& value) -{ - msdk_char* stopCharacter; - value = (mfxU32)msdk_strtol(string, &stopCharacter, 10); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxF32& value) -{ - msdk_char* stopCharacter; - value = (mfxF32)msdk_strtod(string, &stopCharacter); - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxF64& value) -{ - msdk_char* stopCharacter; - value = (mfxF64)msdk_strtod(string, &stopCharacter); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -mfxStatus msdk_opt_read(const msdk_char* string, mfxU8& value); -mfxStatus msdk_opt_read(const msdk_char* string, mfxU16& value); -mfxStatus msdk_opt_read(const msdk_char* string, mfxU32& value); -mfxStatus msdk_opt_read(const msdk_char* string, mfxF64& value); -mfxStatus msdk_opt_read(const msdk_char* string, mfxF32& value); - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxI16& value) -{ - msdk_char* stopCharacter; - value = (mfxI16)msdk_strtol(string, &stopCharacter, 10); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxI32& value) -{ - msdk_char* stopCharacter; - value = (mfxI32)msdk_strtol(string, &stopCharacter, 10); - - return (msdk_strlen(stopCharacter) == 0)? MFX_ERR_NONE: MFX_ERR_UNKNOWN; -} - -mfxStatus msdk_opt_read(const msdk_char* string, mfxI16& value); -mfxStatus msdk_opt_read(const msdk_char* string, mfxI32& value); - -template<> mfxStatus -msdk_opt_read(const msdk_char* string, mfxPriority& value) -{ - mfxU32 priority = 0; - mfxStatus sts = msdk_opt_read<>(string, priority); - - if (MFX_ERR_NONE == sts) value = (mfxPriority)priority; - return sts; -} - -mfxStatus msdk_opt_read(msdk_char* string, mfxPriority& value); - -bool IsDecodeCodecSupported(mfxU32 codecFormat) -{ - switch(codecFormat) - { - case MFX_CODEC_MPEG2: - case MFX_CODEC_AVC: - case MFX_CODEC_HEVC: - case MFX_CODEC_VC1: - case CODEC_MVC: - case MFX_CODEC_JPEG: - case MFX_CODEC_VP8: - case MFX_CODEC_VP9: - case MFX_CODEC_AV1: - break; - default: - return false; - } - return true; -} - -bool IsEncodeCodecSupported(mfxU32 codecFormat) -{ - switch(codecFormat) - { - case MFX_CODEC_AVC: - case MFX_CODEC_HEVC: - case MFX_CODEC_MPEG2: - case CODEC_MVC: - case MFX_CODEC_VP8: - case MFX_CODEC_JPEG: - case MFX_CODEC_VP9: - break; - default: - return false; - } - return true; -} - -bool IsPluginCodecSupported(mfxU32 codecFormat) -{ - switch(codecFormat) - { - case MFX_CODEC_HEVC: - case MFX_CODEC_AVC: - case MFX_CODEC_MPEG2: - case MFX_CODEC_VC1: - case MFX_CODEC_VP8: - case MFX_CODEC_VP9: - break; - default: - return false; - } - return true; -} - -mfxStatus StrFormatToCodecFormatFourCC(msdk_char* strInput, mfxU32 &codecFormat) -{ - mfxStatus sts = MFX_ERR_NONE; - codecFormat = 0; - - if (strInput == NULL) - sts = MFX_ERR_NULL_PTR; - - if (sts == MFX_ERR_NONE) - { - if (0 == msdk_strcmp(strInput, MSDK_STRING("mpeg2"))) - { - codecFormat = MFX_CODEC_MPEG2; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("h264"))) - { - codecFormat = MFX_CODEC_AVC; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("h265"))) - { - codecFormat = MFX_CODEC_HEVC; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("vc1"))) - { - codecFormat = MFX_CODEC_VC1; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("mvc"))) - { - codecFormat = CODEC_MVC; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("jpeg"))) - { - codecFormat = MFX_CODEC_JPEG; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("vp8"))) - { - codecFormat = MFX_CODEC_VP8; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("vp9"))) - { - codecFormat = MFX_CODEC_VP9; - } - else if (0 == msdk_strcmp(strInput, MSDK_STRING("av1"))) - { - codecFormat = MFX_CODEC_AV1; - } - else if ((0 == msdk_strcmp(strInput, MSDK_STRING("raw")))) - { - codecFormat = MFX_CODEC_DUMP; - } - else if ((0 == msdk_strcmp(strInput, MSDK_STRING("rgb4_frame")))) - { - codecFormat = MFX_CODEC_RGB4; - } - else if ((0 == msdk_strcmp(strInput, MSDK_STRING("nv12")))) - { - codecFormat = MFX_CODEC_NV12; - } - else if ((0 == msdk_strcmp(strInput, MSDK_STRING("i420")))) - { - codecFormat = MFX_CODEC_I420; - } - else if ((0 == msdk_strcmp(strInput, MSDK_STRING("p010")))) { - codecFormat = MFX_CODEC_P010; - } - else - sts = MFX_ERR_UNSUPPORTED; - } - - return sts; -} - -msdk_string StatusToString(mfxStatus sts) -{ - switch(sts) - { - case MFX_ERR_NONE: - return msdk_string(MSDK_STRING("MFX_ERR_NONE")); - case MFX_ERR_UNKNOWN: - return msdk_string(MSDK_STRING("MFX_ERR_UNKNOWN")); - case MFX_ERR_NULL_PTR: - return msdk_string(MSDK_STRING("MFX_ERR_NULL_PTR")); - case MFX_ERR_UNSUPPORTED: - return msdk_string(MSDK_STRING("MFX_ERR_UNSUPPORTED")); - case MFX_ERR_MEMORY_ALLOC: - return msdk_string(MSDK_STRING("MFX_ERR_MEMORY_ALLOC")); - case MFX_ERR_NOT_ENOUGH_BUFFER: - return msdk_string(MSDK_STRING("MFX_ERR_NOT_ENOUGH_BUFFER")); - case MFX_ERR_INVALID_HANDLE: - return msdk_string(MSDK_STRING("MFX_ERR_INVALID_HANDLE")); - case MFX_ERR_LOCK_MEMORY: - return msdk_string(MSDK_STRING("MFX_ERR_LOCK_MEMORY")); - case MFX_ERR_NOT_INITIALIZED: - return msdk_string(MSDK_STRING("MFX_ERR_NOT_INITIALIZED")); - case MFX_ERR_NOT_FOUND: - return msdk_string(MSDK_STRING("MFX_ERR_NOT_FOUND")); - case MFX_ERR_MORE_DATA: - return msdk_string(MSDK_STRING("MFX_ERR_MORE_DATA")); - case MFX_ERR_MORE_SURFACE: - return msdk_string(MSDK_STRING("MFX_ERR_MORE_SURFACE")); - case MFX_ERR_ABORTED: - return msdk_string(MSDK_STRING("MFX_ERR_ABORTED")); - case MFX_ERR_DEVICE_LOST: - return msdk_string(MSDK_STRING("MFX_ERR_DEVICE_LOST")); - case MFX_ERR_INCOMPATIBLE_VIDEO_PARAM: - return msdk_string(MSDK_STRING("MFX_ERR_INCOMPATIBLE_VIDEO_PARAM")); - case MFX_ERR_INVALID_VIDEO_PARAM: - return msdk_string(MSDK_STRING("MFX_ERR_INVALID_VIDEO_PARAM")); - case MFX_ERR_UNDEFINED_BEHAVIOR: - return msdk_string(MSDK_STRING("MFX_ERR_UNDEFINED_BEHAVIOR")); - case MFX_ERR_DEVICE_FAILED: - return msdk_string(MSDK_STRING("MFX_ERR_DEVICE_FAILED")); - case MFX_ERR_MORE_BITSTREAM: - return msdk_string(MSDK_STRING("MFX_ERR_MORE_BITSTREAM")); - case MFX_ERR_INCOMPATIBLE_AUDIO_PARAM: - return msdk_string(MSDK_STRING("MFX_ERR_INCOMPATIBLE_AUDIO_PARAM")); - case MFX_ERR_INVALID_AUDIO_PARAM: - return msdk_string(MSDK_STRING("MFX_ERR_INVALID_AUDIO_PARAM")); - case MFX_ERR_GPU_HANG: - return msdk_string(MSDK_STRING("MFX_ERR_GPU_HANG")); - case MFX_ERR_REALLOC_SURFACE: - return msdk_string(MSDK_STRING("MFX_ERR_REALLOC_SURFACE")); - case MFX_WRN_IN_EXECUTION: - return msdk_string(MSDK_STRING("MFX_WRN_IN_EXECUTION")); - case MFX_WRN_DEVICE_BUSY: - return msdk_string(MSDK_STRING("MFX_WRN_DEVICE_BUSY")); - case MFX_WRN_VIDEO_PARAM_CHANGED: - return msdk_string(MSDK_STRING("MFX_WRN_VIDEO_PARAM_CHANGED")); - case MFX_WRN_PARTIAL_ACCELERATION: - return msdk_string(MSDK_STRING("MFX_WRN_PARTIAL_ACCELERATION")); - case MFX_WRN_INCOMPATIBLE_VIDEO_PARAM: - return msdk_string(MSDK_STRING("MFX_WRN_INCOMPATIBLE_VIDEO_PARAM")); - case MFX_WRN_VALUE_NOT_CHANGED: - return msdk_string(MSDK_STRING("MFX_WRN_VALUE_NOT_CHANGED")); - case MFX_WRN_OUT_OF_RANGE: - return msdk_string(MSDK_STRING("MFX_WRN_OUT_OF_RANGE")); - case MFX_WRN_FILTER_SKIPPED: - return msdk_string(MSDK_STRING("MFX_WRN_FILTER_SKIPPED")); - case MFX_WRN_INCOMPATIBLE_AUDIO_PARAM: - return msdk_string(MSDK_STRING("MFX_WRN_INCOMPATIBLE_AUDIO_PARAM")); - case MFX_TASK_WORKING: - return msdk_string(MSDK_STRING("MFX_TASK_WORKING")); - case MFX_TASK_BUSY: - return msdk_string(MSDK_STRING("MFX_TASK_BUSY")); - case MFX_ERR_MORE_DATA_SUBMIT_TASK: - return msdk_string(MSDK_STRING("MFX_ERR_MORE_DATA_SUBMIT_TASK")); - default: - return msdk_string(MSDK_STRING("[Unknown status]")); - } -} - -mfxI32 getMonitorType(msdk_char* str) -{ - struct { - const msdk_char* str; - mfxI32 mfx_type; - } table[] = { -#define __DECLARE(type) { MSDK_STRING(#type), MFX_MONITOR_ ## type } - __DECLARE(Unknown), - __DECLARE(VGA), - __DECLARE(DVII), - __DECLARE(DVID), - __DECLARE(DVIA), - __DECLARE(Composite), - __DECLARE(SVIDEO), - __DECLARE(LVDS), - __DECLARE(Component), - __DECLARE(9PinDIN), - __DECLARE(HDMIA), - __DECLARE(HDMIB), - __DECLARE(eDP), - __DECLARE(TV), - __DECLARE(DisplayPort), -#if defined(DRM_MODE_CONNECTOR_VIRTUAL) // from libdrm 2.4.59 - __DECLARE(VIRTUAL), -#endif -#if defined(DRM_MODE_CONNECTOR_DSI) // from libdrm 2.4.59 - __DECLARE(DSI) -#endif -#undef __DECLARE - }; - for (unsigned int i=0; i < sizeof(table)/sizeof(table[0]); ++i) { - if (0 == msdk_strcmp(str, table[i].str)) { - return table[i].mfx_type; - } - } - return MFX_MONITOR_MAXNUMBER; -} - -CH264FrameReader::CH264FrameReader() -: CSmplBitstreamReader() -, m_processedBS(0) -, m_isEndOfStream(false) -, m_frame(0) -, m_plainBuffer(0) -, m_plainBufferSize(0) -{ -} - -CH264FrameReader::~CH264FrameReader() -{ -} - -void CH264FrameReader::Close() -{ - CSmplBitstreamReader::Close(); - - if (NULL != m_plainBuffer) - { - free(m_plainBuffer); - m_plainBuffer = NULL; - m_plainBufferSize = 0; - } -} - -mfxStatus CH264FrameReader::Init(const msdk_char *strFileName) -{ - mfxStatus sts = MFX_ERR_NONE; - - sts = CSmplBitstreamReader::Init(strFileName); - if (sts != MFX_ERR_NONE) - return sts; - - m_isEndOfStream = false; - m_processedBS = NULL; - - m_originalBS.Extend(1024 * 1024); - - m_pNALSplitter.reset(new ProtectedLibrary::AVC_Spl()); - - m_frame = 0; - m_plainBuffer = 0; - m_plainBufferSize = 0; - - return sts; -} - -mfxStatus CH264FrameReader::ReadNextFrame(mfxBitstream *pBS) -{ - mfxStatus sts = MFX_ERR_NONE; - pBS->DataFlag = MFX_BITSTREAM_COMPLETE_FRAME; - //read bit stream from source - while (!m_originalBS.DataLength) - { - sts = CSmplBitstreamReader::ReadNextFrame(&m_originalBS); - if (sts != MFX_ERR_NONE && sts != MFX_ERR_MORE_DATA) - return sts; - if (sts == MFX_ERR_MORE_DATA) - { - m_isEndOfStream = true; - break; - } - } - - do - { - sts = PrepareNextFrame(m_isEndOfStream ? NULL : &m_originalBS, &m_processedBS); - - if (sts == MFX_ERR_MORE_DATA) - { - if (m_isEndOfStream) - { - break; - } - - sts = CSmplBitstreamReader::ReadNextFrame(&m_originalBS); - if (sts == MFX_ERR_MORE_DATA) - m_isEndOfStream = true; - continue; - } - else if (MFX_ERR_NONE != sts) - return sts; - - } while (MFX_ERR_NONE != sts); - - // get output stream - if (NULL != m_processedBS) - { - mfxStatus copySts = CopyBitstream2( - pBS, - m_processedBS); - if (copySts < MFX_ERR_NONE) - return copySts; - m_processedBS = NULL; - } - - return sts; -} - -mfxStatus CH264FrameReader::PrepareNextFrame(mfxBitstream *in, mfxBitstream **out) -{ - mfxStatus sts = MFX_ERR_NONE; - - if (NULL == out) - return MFX_ERR_NULL_PTR; - - *out = NULL; - - // get frame if it is not ready yet - if (NULL == m_frame) - { - sts = m_pNALSplitter->GetFrame(in, &m_frame); - if (sts != MFX_ERR_NONE) - return sts; - } - - if (m_plainBufferSize < m_frame->DataLength) - { - if (NULL != m_plainBuffer) - { - free(m_plainBuffer); - m_plainBuffer = NULL; - m_plainBufferSize = 0; - } - m_plainBuffer = (mfxU8*)malloc(m_frame->DataLength); - if (NULL == m_plainBuffer) - return MFX_ERR_MEMORY_ALLOC; - m_plainBufferSize = m_frame->DataLength; - } - - MSDK_MEMCPY_BUF(m_plainBuffer, 0, m_plainBufferSize, m_frame->Data, m_frame->DataLength); - - memset(&m_outBS, 0, sizeof(mfxBitstream)); - m_outBS.Data = m_plainBuffer; - m_outBS.DataOffset = 0; - m_outBS.DataLength = m_frame->DataLength; - m_outBS.MaxLength = m_frame->DataLength; - m_outBS.DataFlag = MFX_BITSTREAM_COMPLETE_FRAME; - m_outBS.TimeStamp = m_frame->TimeStamp; - - m_pNALSplitter->ResetCurrentState(); - m_frame = NULL; - - *out = &m_outBS; - - return sts; -} - -// This function either performs synchronization using provided syncpoint, -// or just waits for predefined time if no available syncpoint -void WaitForDeviceToBecomeFree(MFXVideoSession& session, mfxSyncPoint& syncPoint, mfxStatus& currentStatus) -{ - if (syncPoint) - { - mfxStatus stsSync = session.SyncOperation(syncPoint, MSDK_WAIT_INTERVAL); - if (MFX_ERR_NONE == stsSync) - { - // Retire completed sync point (otherwise we may start active polling) - syncPoint = NULL; - currentStatus = MFX_ERR_NONE; - } - else - { - MSDK_TRACE_ERROR(MSDK_STRING("WaitForDeviceToBecomeFree: SyncOperation failed, sts = ") << stsSync); - currentStatus = MFX_ERR_ABORTED; - } - } - else - { - MSDK_SLEEP(1); - currentStatus = MFX_ERR_NONE; - } -} - -mfxU16 FourCCToChroma(mfxU32 fourCC) -{ - switch(fourCC) - { - case MFX_FOURCC_NV12: - case MFX_FOURCC_P010: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - return MFX_CHROMAFORMAT_YUV420; - case MFX_FOURCC_NV16: - case MFX_FOURCC_P210: -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y216: -#endif - case MFX_FOURCC_YUY2: - case MFX_FOURCC_UYVY: - return MFX_CHROMAFORMAT_YUV422; -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y410: - case MFX_FOURCC_A2RGB10: -#endif - case MFX_FOURCC_AYUV: - case MFX_FOURCC_RGB4: - return MFX_CHROMAFORMAT_YUV444; - } - - return MFX_CHROMAFORMAT_YUV420; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sysmem_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sysmem_allocator.cpp deleted file mode 100644 index 5fe7a3e3..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/sysmem_allocator.cpp +++ /dev/null @@ -1,538 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "sysmem_allocator.h" -#include "sample_utils.h" - -#define MSDK_ALIGN32(X) (((mfxU32)((X)+31)) & (~ (mfxU32)31)) -#define ID_BUFFER MFX_MAKEFOURCC('B','U','F','F') -#define ID_FRAME MFX_MAKEFOURCC('F','R','M','E') - - -SysMemFrameAllocator::SysMemFrameAllocator() -: m_pBufferAllocator(0), m_bOwnBufferAllocator(false) -{ -} - -SysMemFrameAllocator::~SysMemFrameAllocator() -{ - Close(); -} - -mfxStatus SysMemFrameAllocator::Init(mfxAllocatorParams *pParams) -{ - // check if any params passed from application - if (pParams) - { - SysMemAllocatorParams *pSysMemParams = 0; - pSysMemParams = dynamic_cast(pParams); - if (!pSysMemParams) - return MFX_ERR_NOT_INITIALIZED; - - m_pBufferAllocator = pSysMemParams->pBufferAllocator; - m_bOwnBufferAllocator = false; - } - - // if buffer allocator wasn't passed from application create own - if (!m_pBufferAllocator) - { - m_pBufferAllocator = new SysMemBufferAllocator; - if (!m_pBufferAllocator) - return MFX_ERR_MEMORY_ALLOC; - - m_bOwnBufferAllocator = true; - } - - return MFX_ERR_NONE; -} - -mfxStatus SysMemFrameAllocator::Close() -{ - mfxStatus sts = BaseFrameAllocator::Close(); - - if (m_bOwnBufferAllocator) - { - delete m_pBufferAllocator; - m_pBufferAllocator = 0; - } - return sts; -} - -mfxStatus SysMemFrameAllocator::LockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (!m_pBufferAllocator) - return MFX_ERR_NOT_INITIALIZED; - - if (!ptr) - return MFX_ERR_NULL_PTR; - - // If allocator uses pointers instead of mids, no further action is required - if (!mid && ptr->Y) - return MFX_ERR_NONE; - - sFrame *fs = 0; - mfxStatus sts = m_pBufferAllocator->Lock(m_pBufferAllocator->pthis, mid,(mfxU8 **)&fs); - - if (MFX_ERR_NONE != sts) - return sts; - - if (ID_FRAME != fs->id) - { - m_pBufferAllocator->Unlock(m_pBufferAllocator->pthis, mid); - return MFX_ERR_INVALID_HANDLE; - } - - mfxU16 Width2 = (mfxU16)MSDK_ALIGN32(fs->info.Width); - mfxU16 Height2 = (mfxU16)MSDK_ALIGN32(fs->info.Height); - ptr->B = ptr->Y = (mfxU8 *)fs + MSDK_ALIGN32(sizeof(sFrame)); - - switch (fs->info.FourCC) - { - case MFX_FOURCC_NV12: - ptr->U = ptr->Y + Width2 * Height2; - ptr->V = ptr->U + 1; - ptr->PitchHigh = 0; - ptr->PitchLow = (mfxU16)MSDK_ALIGN32(fs->info.Width); - break; - case MFX_FOURCC_NV16: - ptr->U = ptr->Y + Width2 * Height2; - ptr->V = ptr->U + 1; - ptr->PitchHigh = 0; - ptr->PitchLow = (mfxU16)MSDK_ALIGN32(fs->info.Width); - break; - case MFX_FOURCC_YV12: - ptr->V = ptr->Y + Width2 * Height2; - ptr->U = ptr->V + (Width2 >> 1) * (Height2 >> 1); - ptr->PitchHigh = 0; - ptr->PitchLow = (mfxU16)MSDK_ALIGN32(fs->info.Width); - break; - case MFX_FOURCC_UYVY: - ptr->U = ptr->Y; - ptr->Y = ptr->U + 1; - ptr->V = ptr->U + 2; - ptr->PitchHigh = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; - case MFX_FOURCC_YUY2: - ptr->U = ptr->Y + 1; - ptr->V = ptr->Y + 3; - ptr->PitchHigh = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#if (MFX_VERSION >= 1028) - case MFX_FOURCC_RGB565: - ptr->G = ptr->B; - ptr->R = ptr->B; - ptr->PitchHigh = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#endif - case MFX_FOURCC_RGB3: - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->PitchHigh = (mfxU16)((3 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((3 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#if !(defined(_WIN32) || defined(_WIN64)) - case MFX_FOURCC_RGBP: - ptr->G = ptr->R + Width2 * Height2; - ptr->B = ptr->G + Width2 * Height2; - ptr->PitchHigh = (mfxU16)((MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#endif - case MFX_FOURCC_RGB4: - case MFX_FOURCC_A2RGB10: - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->A = ptr->B + 3; - ptr->PitchHigh = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; - case MFX_FOURCC_R16: - ptr->Y16 = (mfxU16 *)ptr->B; - ptr->PitchHigh = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((2 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - case MFX_FOURCC_P010: - ptr->U = ptr->Y + Width2 * Height2 * 2; - ptr->V = ptr->U + 2; - ptr->PitchHigh = 0; - ptr->PitchLow = (mfxU16)MSDK_ALIGN32(fs->info.Width * 2); - break; - case MFX_FOURCC_P210: - ptr->U = ptr->Y + Width2 * Height2 * 2; - ptr->V = ptr->U + 2; - ptr->PitchHigh = 0; - ptr->PitchLow = (mfxU16)MSDK_ALIGN32(fs->info.Width * 2); - break; - case MFX_FOURCC_AYUV: - ptr->V = ptr->B; - ptr->U = ptr->V + 1; - ptr->Y = ptr->V + 2; - ptr->A = ptr->V + 3; - ptr->PitchHigh = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y416: - ptr->U16 = (mfxU16*)ptr->B; - ptr->Y16 = ptr->U16 + 1; - ptr->V16 = ptr->Y16 + 1; - ptr->A = (mfxU8 *)(ptr->V16 + 1); - ptr->PitchHigh = (mfxU16)(8 * MSDK_ALIGN32(fs->info.Width) / (1 << 16)); - ptr->PitchLow = (mfxU16)(8 * MSDK_ALIGN32(fs->info.Width) % (1 << 16)); - break; - case MFX_FOURCC_Y216: -#endif -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - ptr->Y16 = (mfxU16 *)ptr->B; - ptr->U16 = ptr->Y16 + 1; - ptr->V16 = ptr->Y16 + 3; - //4 words per macropixel -> 2 words per pixel -> 4 bytes per pixel - ptr->PitchHigh = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; - case MFX_FOURCC_Y410: - ptr->U = ptr->V = ptr->A = ptr->Y; - ptr->PitchHigh = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) / (1 << 16)); - ptr->PitchLow = (mfxU16)((4 * MSDK_ALIGN32(fs->info.Width)) % (1 << 16)); - break; -#endif - - default: - return MFX_ERR_UNSUPPORTED; - } - - return MFX_ERR_NONE; -} - -mfxStatus SysMemFrameAllocator::UnlockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - if (!m_pBufferAllocator) - return MFX_ERR_NOT_INITIALIZED; - - // If allocator uses pointers instead of mids, no further action is required - if (!mid && ptr->Y) - return MFX_ERR_NONE; - - mfxStatus sts = m_pBufferAllocator->Unlock(m_pBufferAllocator->pthis, mid); - - if (MFX_ERR_NONE != sts) - return sts; - - if (NULL != ptr) - { - ptr->Pitch = 0; - ptr->Y = 0; - ptr->U = 0; - ptr->V = 0; - ptr->A = 0; - } - - return MFX_ERR_NONE; -} - -mfxStatus SysMemFrameAllocator::GetFrameHDL(mfxMemId /*mid*/, mfxHDL* /*handle*/) -{ - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus SysMemFrameAllocator::CheckRequestType(mfxFrameAllocRequest *request) -{ - mfxStatus sts = BaseFrameAllocator::CheckRequestType(request); - if (MFX_ERR_NONE != sts) - return sts; - - if ((request->Type & MFX_MEMTYPE_SYSTEM_MEMORY) != 0) - return MFX_ERR_NONE; - else - return MFX_ERR_UNSUPPORTED; -} - -mfxMemId *SysMemFrameAllocator::GetMidHolder(mfxMemId mid) -{ - for (auto resp : m_vResp) - { - mfxMemId *it = std::find(resp->mids, resp->mids + resp->NumFrameActual, mid); - if (it != resp->mids + resp->NumFrameActual) - return it; - } - return nullptr; -} - -static mfxU32 GetSurfaceSize(mfxU32 FourCC, mfxU32 Width2, mfxU32 Height2) -{ - mfxU32 nbytes = 0; - - switch (FourCC) - { - case MFX_FOURCC_YV12: - case MFX_FOURCC_NV12: - nbytes = Width2*Height2 + (Width2>>1)*(Height2>>1) + (Width2>>1)*(Height2>>1); - break; - case MFX_FOURCC_NV16: - nbytes = Width2*Height2 + (Width2>>1)*(Height2) + (Width2>>1)*(Height2); - break; -#if (MFX_VERSION >= 1028) - case MFX_FOURCC_RGB565: - nbytes = 2*Width2*Height2; - break; -#endif -#if !(defined(_WIN32) || defined(_WIN64)) - case MFX_FOURCC_RGBP: -#endif - case MFX_FOURCC_RGB3: - nbytes = Width2*Height2 + Width2*Height2 + Width2*Height2; - break; - case MFX_FOURCC_RGB4: - case MFX_FOURCC_AYUV: -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y410: -#endif - nbytes = Width2*Height2 + Width2*Height2 + Width2*Height2 + Width2*Height2; - break; - case MFX_FOURCC_UYVY: - case MFX_FOURCC_YUY2: - nbytes = Width2*Height2 + (Width2>>1)*(Height2) + (Width2>>1)*(Height2); - break; - case MFX_FOURCC_R16: - nbytes = 2*Width2*Height2; - break; - case MFX_FOURCC_P010: -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: -#endif - nbytes = Width2*Height2 + (Width2>>1)*(Height2>>1) + (Width2>>1)*(Height2>>1); - nbytes *= 2; - break; - case MFX_FOURCC_A2RGB10: - nbytes = Width2*Height2*4; // 4 bytes per pixel - break; - case MFX_FOURCC_P210: -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_Y216: - nbytes = Width2*Height2 + (Width2>>1)*(Height2) + (Width2>>1)*(Height2); - nbytes *= 2; // 16bits - break; - case MFX_FOURCC_Y416: - nbytes = (Width2*Height2 + Width2*Height2 + Width2*Height2 + Width2*Height2) * 2; - break; -#endif - - - default: - break; - } - - return nbytes; -} - -mfxStatus SysMemFrameAllocator::ReallocImpl(mfxMemId mid, const mfxFrameInfo *info, mfxU16 /*memType*/, mfxMemId *midOut) -{ - if (!info || !midOut) - return MFX_ERR_NULL_PTR; - - if (!m_pBufferAllocator) - return MFX_ERR_NOT_INITIALIZED; - - mfxU32 nbytes = GetSurfaceSize(info->FourCC, MSDK_ALIGN32(info->Width), MSDK_ALIGN32(info->Height)); - if(!nbytes) - return MFX_ERR_UNSUPPORTED; - - // pointer to the record in m_mids structure - mfxMemId *pmid = GetMidHolder(mid); - if (!pmid) - return MFX_ERR_MEMORY_ALLOC; - - mfxStatus sts = m_pBufferAllocator->Free(m_pBufferAllocator->pthis, *pmid); - if (MFX_ERR_NONE != sts) - return sts; - - sts = m_pBufferAllocator->Alloc(m_pBufferAllocator->pthis, - MSDK_ALIGN32(nbytes) + MSDK_ALIGN32(sizeof(sFrame)), MFX_MEMTYPE_SYSTEM_MEMORY, pmid); - if (MFX_ERR_NONE != sts) - return sts; - - sFrame *fs; - sts = m_pBufferAllocator->Lock(m_pBufferAllocator->pthis, *pmid, (mfxU8 **)&fs); - if (MFX_ERR_NONE != sts) - return sts; - - fs->id = ID_FRAME; - fs->info = *info; - m_pBufferAllocator->Unlock(m_pBufferAllocator->pthis, *pmid); - - *midOut = *pmid; - return MFX_ERR_NONE; -} - -mfxStatus SysMemFrameAllocator::AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - if (!m_pBufferAllocator) - return MFX_ERR_NOT_INITIALIZED; - - mfxU32 numAllocated = 0; - - mfxU32 nbytes = GetSurfaceSize(request->Info.FourCC, MSDK_ALIGN32(request->Info.Width), MSDK_ALIGN32(request->Info.Height)); - if(!nbytes) - return MFX_ERR_UNSUPPORTED; - - std::unique_ptr mids(new mfxMemId[request->NumFrameSuggested]); - - // allocate frames - for (numAllocated = 0; numAllocated < request->NumFrameSuggested; numAllocated ++) - { - mfxStatus sts = m_pBufferAllocator->Alloc(m_pBufferAllocator->pthis, - nbytes + MSDK_ALIGN32(sizeof(sFrame)), request->Type, &(mids[numAllocated])); - - if (MFX_ERR_NONE != sts) - break; - - sFrame *fs; - sts = m_pBufferAllocator->Lock(m_pBufferAllocator->pthis, mids[numAllocated], (mfxU8 **)&fs); - - if (MFX_ERR_NONE != sts) - break; - - fs->id = ID_FRAME; - fs->info = request->Info; - sts = m_pBufferAllocator->Unlock(m_pBufferAllocator->pthis, mids[numAllocated]); - - if (MFX_ERR_NONE != sts) - break; - } - - // check the number of allocated frames - if (numAllocated < request->NumFrameSuggested) - { - return MFX_ERR_MEMORY_ALLOC; - } - - response->NumFrameActual = (mfxU16) numAllocated; - response->mids = mids.release(); - - m_vResp.push_back(response); - return MFX_ERR_NONE; -} - -mfxStatus SysMemFrameAllocator::ReleaseResponse(mfxFrameAllocResponse *response) -{ - if (!response) - return MFX_ERR_NULL_PTR; - - if (!m_pBufferAllocator) - return MFX_ERR_NOT_INITIALIZED; - - mfxStatus sts = MFX_ERR_NONE; - - if (response->mids) - { - for (mfxU32 i = 0; i < response->NumFrameActual; i++) - { - if (response->mids[i]) - { - sts = m_pBufferAllocator->Free(m_pBufferAllocator->pthis, response->mids[i]); - if (MFX_ERR_NONE != sts) - return sts; - } - } - } - - m_vResp.erase(std::remove(m_vResp.begin(), m_vResp.end(), response), m_vResp.end()); - delete [] response->mids; - response->mids = 0; - - return sts; -} - -SysMemBufferAllocator::SysMemBufferAllocator() -{ - -} - -SysMemBufferAllocator::~SysMemBufferAllocator() -{ - -} - -mfxStatus SysMemBufferAllocator::AllocBuffer(mfxU32 nbytes, mfxU16 type, mfxMemId *mid) -{ - if (!mid) - return MFX_ERR_NULL_PTR; - - if (0 == (type & MFX_MEMTYPE_SYSTEM_MEMORY)) - return MFX_ERR_UNSUPPORTED; - - mfxU32 header_size = MSDK_ALIGN32(sizeof(sBuffer)); - mfxU8 *buffer_ptr = (mfxU8 *)calloc(header_size + nbytes + 32, 1); - - if (!buffer_ptr) - return MFX_ERR_MEMORY_ALLOC; - - sBuffer *bs = (sBuffer *)buffer_ptr; - bs->id = ID_BUFFER; - bs->type = type; - bs->nbytes = nbytes; - *mid = (mfxHDL) bs; - return MFX_ERR_NONE; -} - -mfxStatus SysMemBufferAllocator::LockBuffer(mfxMemId mid, mfxU8 **ptr) -{ - if (!ptr) - return MFX_ERR_NULL_PTR; - - sBuffer *bs = (sBuffer *)mid; - - if (!bs) - return MFX_ERR_INVALID_HANDLE; - if (ID_BUFFER != bs->id) - return MFX_ERR_INVALID_HANDLE; - - *ptr = (mfxU8*)((size_t)((mfxU8 *)bs+MSDK_ALIGN32(sizeof(sBuffer))+31)&(~((size_t)31))); - return MFX_ERR_NONE; -} - -mfxStatus SysMemBufferAllocator::UnlockBuffer(mfxMemId mid) -{ - sBuffer *bs = (sBuffer *)mid; - - if (!bs || ID_BUFFER != bs->id) - return MFX_ERR_INVALID_HANDLE; - - return MFX_ERR_NONE; -} - -mfxStatus SysMemBufferAllocator::FreeBuffer(mfxMemId mid) -{ - sBuffer *bs = (sBuffer *)mid; - if (!bs || ID_BUFFER != bs->id) - return MFX_ERR_INVALID_HANDLE; - - free(bs); - return MFX_ERR_NONE; -} diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/v4l2_util.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/v4l2_util.cpp deleted file mode 100644 index 95c7c21e..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/v4l2_util.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined (ENABLE_V4L2_SUPPORT) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "v4l2_util.h" - -/* Global Declaration */ -Buffer *buffers, *CurBuffers; -bool CtrlFlag = false; -int m_q[5], m_first = 0, m_last = 0, m_numInQ = 0; -pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t empty = PTHREAD_MUTEX_INITIALIZER; - -v4l2Device::v4l2Device( const char *devname, - uint32_t width, - uint32_t height, - uint32_t num_buffers, - enum AtomISPMode MipiMode, - enum V4L2PixelFormat v4l2Format): - m_devname(devname), - m_height(height), - m_width(width), - m_num_buffers(num_buffers), - m_MipiPort(0), - m_MipiMode(MipiMode), - m_v4l2Format(v4l2Format), - m_fd(-1) -{ -} - -v4l2Device::~v4l2Device() -{ - if (m_fd > -1) - { - BYE_ON(close(m_fd) < 0, "V4L2 device close failed: %s\n", ERRSTR); - } -} - -int v4l2Device::blockIOCTL(int handle, int request, void *args) -{ - int ioctlStatus; - do - { - ioctlStatus = ioctl(handle, request, args); - } while (-1 == ioctlStatus && EINTR == errno); - return ioctlStatus; -} - -int v4l2Device::GetAtomISPModes(enum AtomISPMode mode) -{ - switch(mode) - { - case VIDEO: return _ISP_MODE_VIDEO; - case PREVIEW: return _ISP_MODE_PREVIEW; - case CONTINUOUS: return _ISP_MODE_CONTINUOUS; - case STILL: return _ISP_MODE_STILL; - case NONE: - - default: - return _ISP_MODE_NONE; - } -} - -int v4l2Device::ConvertToMFXFourCC(enum V4L2PixelFormat v4l2Format) -{ - switch (v4l2Format) - { - case UYVY: return MFX_FOURCC_UYVY; - case YUY2: return MFX_FOURCC_YUY2; - case NO_FORMAT: - - default: - assert( !"Unsupported mfx fourcc"); - return 0; - } -} - -int v4l2Device::ConvertToV4L2FourCC() -{ - switch (m_v4l2Format) - { - case UYVY: return V4L2_PIX_FMT_UYVY; - case YUY2: return V4L2_PIX_FMT_YUYV; - case NO_FORMAT: - - default: - assert( !"Unsupported v4l2 fourcc"); - return 0; - } -} - -void v4l2Device::Init( const char *devname, - uint32_t width, - uint32_t height, - uint32_t num_buffers, - enum V4L2PixelFormat v4l2Format, - enum AtomISPMode MipiMode, - int MipiPort) -{ - - (devname != NULL)? m_devname = devname : m_devname; - (m_width != width )? m_width = width : m_width; - (m_height != height)? m_height = height : m_height; - (m_num_buffers != num_buffers)? m_num_buffers = num_buffers : m_num_buffers; - (m_v4l2Format != v4l2Format )? m_v4l2Format = v4l2Format : m_v4l2Format; - (m_MipiMode != MipiMode )? m_MipiMode = MipiMode : m_MipiMode; - (m_MipiPort != MipiPort )? m_MipiPort = MipiPort : m_MipiPort; - - memset(&m_format, 0, sizeof m_format); - m_format.width = m_width; - m_format.height = m_height; - m_format.pixelformat = ConvertToV4L2FourCC(); - - V4L2Init(); -} - -void v4l2Device::V4L2Init() -{ - int ret; - struct v4l2_format fmt; - struct v4l2_capability caps; - struct v4l2_streamparm parm; - struct v4l2_requestbuffers rqbufs; - CLEAR(parm); - - m_fd = open(m_devname, O_RDWR); - BYE_ON(m_fd < 0, "failed to open %s: %s\n", m_devname, ERRSTR); - CLEAR(caps); - - /* Specifically for setting up mipi configuration. DMABUFF is - * also enable by default here. - */ - if (m_MipiPort > -1 && m_MipiMode != NONE) { - parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - parm.parm.capture.capturemode = GetAtomISPModes(m_MipiMode); - - ret = blockIOCTL(m_fd, VIDIOC_S_INPUT, &m_MipiPort); - BYE_ON(ret < 0, "VIDIOC_S_INPUT failed: %s\n", ERRSTR); - - ret = blockIOCTL(m_fd, VIDIOC_S_PARM, &parm); - BYE_ON(ret < 0, "VIDIOC_S_PARAM failed: %s\n", ERRSTR); - } - - ret = blockIOCTL(m_fd, VIDIOC_QUERYCAP, &caps); - msdk_printf( "Driver Caps:\n" - " Driver: \"%s\"\n" - " Card: \"%s\"\n" - " Bus: \"%s\"\n" - " Version: %d.%d\n" - " Capabilities: %08x\n", - caps.driver, - caps.card, - caps.bus_info, - (caps.version>>16)&&0xff, - (caps.version>>24)&&0xff, - caps.capabilities); - - BYE_ON(ret, "VIDIOC_QUERYCAP failed: %s\n", ERRSTR); - BYE_ON(~caps.capabilities & V4L2_CAP_VIDEO_CAPTURE, - "video: singleplanar capture is not supported\n"); - - CLEAR(fmt); - fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - ret = blockIOCTL(m_fd, VIDIOC_G_FMT, &fmt); - - BYE_ON(ret < 0, "VIDIOC_G_FMT failed: %s\n", ERRSTR); - - msdk_printf("G_FMT(start): width = %u, height = %u, 4cc = %.4s, BPP = %u sizeimage = %d field = %d\n", - fmt.fmt.pix.width, fmt.fmt.pix.height, - (char*)&fmt.fmt.pix.pixelformat, - fmt.fmt.pix.bytesperline, - fmt.fmt.pix.sizeimage, - fmt.fmt.pix.field); - - fmt.fmt.pix = m_format; - - msdk_printf("G_FMT(pre): width = %u, height = %u, 4cc = %.4s, BPP = %u sizeimage = %d field = %d\n", - fmt.fmt.pix.width, fmt.fmt.pix.height, - (char*)&fmt.fmt.pix.pixelformat, - fmt.fmt.pix.bytesperline, - fmt.fmt.pix.sizeimage, - fmt.fmt.pix.field); - - ret = blockIOCTL(m_fd, VIDIOC_S_FMT, &fmt); - BYE_ON(ret < 0, "VIDIOC_S_FMT failed: %s\n", ERRSTR); - - ret = blockIOCTL(m_fd, VIDIOC_G_FMT, &fmt); - BYE_ON(ret < 0, "VIDIOC_G_FMT failed: %s\n", ERRSTR); - msdk_printf("G_FMT(final): width = %u, height = %u, 4cc = %.4s, BPP = %u\n", - fmt.fmt.pix.width, fmt.fmt.pix.height, - (char*)&fmt.fmt.pix.pixelformat, - fmt.fmt.pix.bytesperline); - - CLEAR(rqbufs); - rqbufs.count = m_num_buffers; - rqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - rqbufs.memory = V4L2_MEMORY_DMABUF; - - ret = blockIOCTL(m_fd, VIDIOC_REQBUFS, &rqbufs); - BYE_ON(ret < 0, "VIDIOC_REQBUFS failed: %s\n", ERRSTR); - BYE_ON(rqbufs.count < m_num_buffers, "video node allocated only " - "%u of %u buffers\n", rqbufs.count, m_num_buffers); - - m_format = fmt.fmt.pix; -} - -void v4l2Device::V4L2Alloc() -{ - buffers = (Buffer *)malloc(sizeof(Buffer) * (int) m_num_buffers); -} - -void v4l2Device::V4L2QueueBuffer(Buffer *buffer) -{ - struct v4l2_buffer buf; - int ret; - - memset(&buf, 0, sizeof buf); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_DMABUF; - buf.index = buffer->index; - buf.m.fd = buffer->fd; - - ret = blockIOCTL(m_fd, VIDIOC_QBUF, &buf); - BYE_ON(ret < 0, "VIDIOC_QBUF for buffer %d failed: %s (fd %u) (i %u)\n", - buf.index, ERRSTR, buffer->fd, buffer->index); -} - -Buffer *v4l2Device::V4L2DeQueueBuffer(Buffer *buffer) -{ - struct v4l2_buffer buf; - int ret; - - memset(&buf, 0, sizeof buf); - - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_DMABUF; - - ret = blockIOCTL(m_fd, VIDIOC_DQBUF, &buf); - BYE_ON(ret, "VIDIOC_DQBUF failed: %s\n", ERRSTR); - - return &buffer[buf.index]; -} - -void v4l2Device::V4L2StartCapture() -{ - int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - int ret = 0; - - ret = blockIOCTL(m_fd, VIDIOC_STREAMON, &type); - BYE_ON(ret < 0, "STREAMON failed: %s\n", ERRSTR); -} - -void v4l2Device::V4L2StopCapture() -{ - int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - int ret = 0; - - ret = blockIOCTL(m_fd, VIDIOC_STREAMOFF, &type); - BYE_ON(ret < 0, "STREAMOFF failed: %s\n", ERRSTR); -} - -void v4l2Device::PutOnQ(int x) -{ - pthread_mutex_lock(&mutex); - m_q[m_first] = x; - m_first = (m_first+1) % 5; - m_numInQ++; - pthread_mutex_unlock(&mutex); - pthread_mutex_unlock(&empty); -} - -int v4l2Device::GetOffQ() -{ - int thing; - - /* wait if the queue is empty. */ - while (m_numInQ == 0) - pthread_mutex_lock(&empty); - - pthread_mutex_lock(&mutex); - thing = m_q[m_last]; - m_last = (m_last+1) % 5; - m_numInQ--; - pthread_mutex_unlock(&mutex); - - return thing; -} - -int v4l2Device::GetV4L2TerminationSignal() -{ - return (CtrlFlag && m_numInQ == 0)? 1 : 0; -} - -static void CtrlCTerminationHandler(int s) { CtrlFlag = true; } - -void *PollingThread(void *data) -{ - - v4l2Device *v4l2 = (v4l2Device *)data; - - struct sigaction sigIntHandler; - sigIntHandler.sa_handler = CtrlCTerminationHandler; - sigemptyset(&sigIntHandler.sa_mask); - sigIntHandler.sa_flags = 0; - sigaction(SIGINT, &sigIntHandler, NULL); - - struct pollfd fd; - fd.fd = v4l2->GetV4L2DisplayID(); - fd.events = POLLIN; - - while(1) - { - if (poll(&fd, 1, 5000) > 0) - { - if (fd.revents & POLLIN) - { - CurBuffers = v4l2->V4L2DeQueueBuffer(buffers); - v4l2->PutOnQ(CurBuffers->index); - - if (CtrlFlag) - break; - - if (CurBuffers) - v4l2->V4L2QueueBuffer(&buffers[CurBuffers->index]); - } - } - } -} - -#endif // ifdef ENABLE_V4L2_SUPPORT diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_allocator.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_allocator.cpp deleted file mode 100644 index 442eca02..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_allocator.cpp +++ /dev/null @@ -1,747 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(LIBVA_SUPPORT) - -#include -#include - -#include "vaapi_allocator.h" -#include "vaapi_utils.h" - -enum { - MFX_FOURCC_VP8_NV12 = MFX_MAKEFOURCC('V','P','8','N'), - MFX_FOURCC_VP8_MBDATA = MFX_MAKEFOURCC('V','P','8','M'), - MFX_FOURCC_VP8_SEGMAP = MFX_MAKEFOURCC('V','P','8','S'), -}; - -unsigned int ConvertMfxFourccToVAFormat(mfxU32 fourcc) -{ - switch (fourcc) - { - case MFX_FOURCC_NV12: - return VA_FOURCC_NV12; - case MFX_FOURCC_YUY2: - return VA_FOURCC_YUY2; - case MFX_FOURCC_UYVY: - return VA_FOURCC_UYVY; - case MFX_FOURCC_YV12: - return VA_FOURCC_YV12; -#if (MFX_VERSION >= 1028) - case MFX_FOURCC_RGB565: - return VA_FOURCC_RGB565; -#endif - case MFX_FOURCC_RGB4: - return VA_FOURCC_ARGB; - case MFX_FOURCC_BGR4: - return VA_FOURCC_ABGR; - case MFX_FOURCC_RGBP: - return VA_FOURCC_RGBP; - case MFX_FOURCC_P8: - return VA_FOURCC_P208; - case MFX_FOURCC_P010: - return VA_FOURCC_P010; - case MFX_FOURCC_A2RGB10: - return VA_FOURCC_ARGB; // rt format will be VA_RT_FORMAT_RGB32_10BPP - case MFX_FOURCC_AYUV: - return VA_FOURCC_AYUV; -#if (MFX_VERSION >= 1027) - case MFX_FOURCC_Y210: - return VA_FOURCC_Y210; - case MFX_FOURCC_Y410: - return VA_FOURCC_Y410; -#endif -#if (MFX_VERSION >= 1031) - case MFX_FOURCC_P016: - return VA_FOURCC_P016; - case MFX_FOURCC_Y216: - return VA_FOURCC_Y216; - case MFX_FOURCC_Y416: - return VA_FOURCC_Y416; -#endif - default: - assert(!"unsupported fourcc"); - return 0; - } -} - -unsigned int ConvertVP8FourccToMfxFourcc(mfxU32 fourcc) -{ - switch (fourcc) - { - case MFX_FOURCC_VP8_NV12: - case MFX_FOURCC_VP8_MBDATA: - return MFX_FOURCC_NV12; - case MFX_FOURCC_VP8_SEGMAP: - return MFX_FOURCC_P8; - - default: - return fourcc; - } -} - -vaapiFrameAllocator::vaapiFrameAllocator() - : m_dpy(0) - , m_libva(new MfxLoader::VA_Proxy) - , m_export_mode(vaapiAllocatorParams::DONOT_EXPORT) - , m_exporter(NULL) -{ -} - -vaapiFrameAllocator::~vaapiFrameAllocator() -{ - Close(); - delete m_libva; -} - -mfxStatus vaapiFrameAllocator::Init(mfxAllocatorParams *pParams) -{ - vaapiAllocatorParams* p_vaapiParams = dynamic_cast(pParams); - - if ((NULL == p_vaapiParams) || (NULL == p_vaapiParams->m_dpy)) - return MFX_ERR_NOT_INITIALIZED; - - if ((p_vaapiParams->m_export_mode != vaapiAllocatorParams::DONOT_EXPORT) && - !(p_vaapiParams->m_export_mode & vaapiAllocatorParams::FLINK) && - !(p_vaapiParams->m_export_mode & vaapiAllocatorParams::PRIME) && - !(p_vaapiParams->m_export_mode & vaapiAllocatorParams::CUSTOM)) - return MFX_ERR_UNSUPPORTED; - if ((p_vaapiParams->m_export_mode & vaapiAllocatorParams::CUSTOM) && - !p_vaapiParams->m_exporter) - return MFX_ERR_UNSUPPORTED; - - m_dpy = p_vaapiParams->m_dpy; - m_export_mode = p_vaapiParams->m_export_mode; - m_exporter = p_vaapiParams->m_exporter; - return MFX_ERR_NONE; -} - -mfxStatus vaapiFrameAllocator::CheckRequestType(mfxFrameAllocRequest *request) -{ - mfxStatus sts = BaseFrameAllocator::CheckRequestType(request); - if (MFX_ERR_NONE != sts) - return sts; - - if ((request->Type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) != 0) - return MFX_ERR_NONE; - else - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus vaapiFrameAllocator::Close() -{ - return BaseFrameAllocator::Close(); -} - -static mfxStatus GetVAFourcc(mfxU32 fourcc, unsigned int &va_fourcc) -{ - // VP8 hybrid driver has weird requirements for allocation of surfaces/buffers for VP8 encoding - // to comply with them additional logic is required to support regular and VP8 hybrid allocation pathes - mfxU32 mfx_fourcc = ConvertVP8FourccToMfxFourcc(fourcc); - va_fourcc = ConvertMfxFourccToVAFormat(mfx_fourcc); - if (!va_fourcc || ((VA_FOURCC_NV12 != va_fourcc) && - (VA_FOURCC_YV12 != va_fourcc) && - (VA_FOURCC_YUY2 != va_fourcc) && - (VA_FOURCC_ARGB != va_fourcc) && - (VA_FOURCC_ABGR != va_fourcc) && - (VA_FOURCC_RGBP != va_fourcc) && - (VA_FOURCC_P208 != va_fourcc) && - (VA_FOURCC_P010 != va_fourcc) && - (VA_FOURCC_YUY2 != va_fourcc) && -#if (MFX_VERSION >= 1027) - (VA_FOURCC_Y210 != va_fourcc) && - (VA_FOURCC_Y410 != va_fourcc) && -#endif -#if (MFX_VERSION >= 1028) - (VA_FOURCC_RGB565 != va_fourcc) && -#endif -#if (MFX_VERSION >= 1031) - (VA_FOURCC_P016 != va_fourcc) && - (VA_FOURCC_Y216 != va_fourcc) && - (VA_FOURCC_Y416 != va_fourcc) && -#endif - (VA_FOURCC_AYUV != va_fourcc))) - { - return MFX_ERR_MEMORY_ALLOC; - } - - return MFX_ERR_NONE; -} - -mfxStatus vaapiFrameAllocator::ReallocImpl(mfxMemId mid, const mfxFrameInfo *info, mfxU16 memType, mfxMemId *midOut) -{ - if (!info || !midOut) return MFX_ERR_NULL_PTR; - - mfxStatus mfx_res = MFX_ERR_NONE; - VAStatus va_res = VA_STATUS_SUCCESS; - unsigned int va_fourcc = 0; - mfxU32 fourcc = info->FourCC; - - mfx_res = GetVAFourcc(fourcc, va_fourcc); - if (MFX_ERR_NONE != mfx_res) - return mfx_res; - - mfxU32 Width = info->Width; - mfxU32 Height = info->Height; - - if (VA_FOURCC_P208 == va_fourcc) - return MFX_ERR_UNSUPPORTED; - - VASurfaceID surfaces[1]; - VASurfaceAttrib attrib[2]; - vaapiMemId *vaapiMid = (vaapiMemId *)mid; - surfaces[0] = *vaapiMid->m_surface; - m_libva->vaDestroySurfaces(m_dpy, surfaces, 1); - - unsigned int format; - int attrCnt = 0; - - attrib[attrCnt].type = VASurfaceAttribPixelFormat; - attrib[attrCnt].flags = VA_SURFACE_ATTRIB_SETTABLE; - attrib[attrCnt].value.type = VAGenericValueTypeInteger; - attrib[attrCnt++].value.value.i = va_fourcc; - format = va_fourcc; - - if ((fourcc == MFX_FOURCC_VP8_NV12) || - ((MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET & memType) - && ((fourcc == MFX_FOURCC_RGB4) || (fourcc == MFX_FOURCC_BGR4)))) - { - /* - * special configuration for NV12 surf allocation for VP8 hybrid encoder and - * RGB32 for JPEG is required - */ - attrib[attrCnt].type = (VASurfaceAttribType)VASurfaceAttribUsageHint; - attrib[attrCnt].flags = VA_SURFACE_ATTRIB_SETTABLE; - attrib[attrCnt].value.type = VAGenericValueTypeInteger; - attrib[attrCnt++].value.value.i = VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER; - } - else if (fourcc == MFX_FOURCC_VP8_MBDATA) - { - // special configuration for MB data surf allocation for VP8 hybrid encoder is required - attrib[0].value.value.i = VA_FOURCC_P208; - format = VA_FOURCC_P208; - } - else if (va_fourcc == VA_FOURCC_NV12) - { - format = VA_RT_FORMAT_YUV420; - } - - va_res = m_libva->vaCreateSurfaces(m_dpy, - format, - Width, Height, - surfaces, - 1, - &attrib[0], attrCnt); - - *vaapiMid->m_surface = surfaces[0]; - vaapiMid->m_fourcc = fourcc; - *midOut = mid; - - mfx_res = va_to_mfx_status(va_res); - - return mfx_res; -} - -mfxStatus vaapiFrameAllocator::AllocImpl(mfxFrameAllocRequest *request, mfxFrameAllocResponse *response) -{ - mfxStatus mfx_res = MFX_ERR_NONE; - VAStatus va_res = VA_STATUS_SUCCESS; - unsigned int va_fourcc = 0; - VASurfaceID* surfaces = NULL; - vaapiMemId *vaapi_mids = NULL, *vaapi_mid = NULL; - mfxMemId* mids = NULL; - mfxU32 fourcc = request->Info.FourCC; - mfxU16 surfaces_num = request->NumFrameSuggested, numAllocated = 0, i = 0; - bool bCreateSrfSucceeded = false; - - memset(response, 0, sizeof(mfxFrameAllocResponse)); - - mfx_res = GetVAFourcc(fourcc, va_fourcc); - if (MFX_ERR_NONE != mfx_res) - return mfx_res; - - if (!surfaces_num) - { - return MFX_ERR_MEMORY_ALLOC; - } - - if (MFX_ERR_NONE == mfx_res) - { - surfaces = (VASurfaceID*)calloc(surfaces_num, sizeof(VASurfaceID)); - vaapi_mids = (vaapiMemId*)calloc(surfaces_num, sizeof(vaapiMemId)); - mids = (mfxMemId*)calloc(surfaces_num, sizeof(mfxMemId)); - if ((NULL == surfaces) || (NULL == vaapi_mids) || (NULL == mids)) mfx_res = MFX_ERR_MEMORY_ALLOC; - } - if (MFX_ERR_NONE == mfx_res) - { - if( VA_FOURCC_P208 != va_fourcc ) - { - unsigned int format; - VASurfaceAttrib attrib[2]; - int attrCnt = 0; - - attrib[attrCnt].type = VASurfaceAttribPixelFormat; - attrib[attrCnt].flags = VA_SURFACE_ATTRIB_SETTABLE; - attrib[attrCnt].value.type = VAGenericValueTypeInteger; - attrib[attrCnt++].value.value.i = va_fourcc; - format = va_fourcc; - - if (fourcc == MFX_FOURCC_VP8_NV12) - { - // special configuration for NV12 surf allocation for VP8 hybrid encoder is required - attrib[attrCnt].type = (VASurfaceAttribType)VASurfaceAttribUsageHint; - attrib[attrCnt].flags = VA_SURFACE_ATTRIB_SETTABLE; - attrib[attrCnt].value.type = VAGenericValueTypeInteger; - attrib[attrCnt++].value.value.i = VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER; - } - else if (fourcc == MFX_FOURCC_VP8_MBDATA) - { - // special configuration for MB data surf allocation for VP8 hybrid encoder is required - attrib[0].value.value.i = VA_FOURCC_P208; - format = VA_FOURCC_P208; - } - else if (va_fourcc == VA_FOURCC_NV12) - { - format = VA_RT_FORMAT_YUV420; - } - else if ((va_fourcc == VA_FOURCC_UYVY) || (va_fourcc == VA_FOURCC_YUY2)) - { - format = VA_RT_FORMAT_YUV422; - } - else if (fourcc == MFX_FOURCC_A2RGB10) - { - format = VA_RT_FORMAT_RGB32_10BPP; - } - else if (fourcc == MFX_FOURCC_RGBP) - { - format = VA_RT_FORMAT_RGBP; - } - - va_res = m_libva->vaCreateSurfaces(m_dpy, - format, - request->Info.Width, request->Info.Height, - surfaces, - surfaces_num, - &attrib[0], attrCnt); - - mfx_res = va_to_mfx_status(va_res); - bCreateSrfSucceeded = (MFX_ERR_NONE == mfx_res); - } - else - { - VAContextID context_id = request->AllocId; - int codedbuf_size, codedbuf_num; - - VABufferType codedbuf_type; - if (fourcc == MFX_FOURCC_VP8_SEGMAP) - { - codedbuf_size = request->Info.Width; - codedbuf_num = request->Info.Height; - codedbuf_type = VAEncMacroblockMapBufferType; - } - else - { - int width32 = 32 * ((request->Info.Width + 31) >> 5); - int height32 = 32 * ((request->Info.Height + 31) >> 5); - codedbuf_size = static_cast((width32 * height32) * 400LL / (16 * 16)); - codedbuf_num = 1; - codedbuf_type = VAEncCodedBufferType; - } - - for (numAllocated = 0; numAllocated < surfaces_num; numAllocated++) - { - VABufferID coded_buf; - - va_res = m_libva->vaCreateBuffer(m_dpy, - context_id, - codedbuf_type, - codedbuf_size, - codedbuf_num, - NULL, - &coded_buf); - mfx_res = va_to_mfx_status(va_res); - if (MFX_ERR_NONE != mfx_res) break; - surfaces[numAllocated] = coded_buf; - } - } - } - - if ((MFX_ERR_NONE == mfx_res) && - (request->Type & MFX_MEMTYPE_EXPORT_FRAME)) - { - if (m_export_mode == vaapiAllocatorParams::DONOT_EXPORT) { - mfx_res = MFX_ERR_UNKNOWN; - } - for (i=0; i < surfaces_num; ++i) - { - if (m_export_mode & vaapiAllocatorParams::NATIVE_EXPORT_MASK) { - vaapi_mids[i].m_buffer_info.mem_type = (m_export_mode & vaapiAllocatorParams::PRIME)? - VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM; - va_res = m_libva->vaDeriveImage(m_dpy, surfaces[i], &(vaapi_mids[i].m_image)); - mfx_res = va_to_mfx_status(va_res); - - if (MFX_ERR_NONE != mfx_res) break; - - va_res = m_libva->vaAcquireBufferHandle(m_dpy, vaapi_mids[i].m_image.buf, &(vaapi_mids[i].m_buffer_info)); - - mfx_res = va_to_mfx_status(va_res); - - if (MFX_ERR_NONE != mfx_res) { - m_libva->vaDestroyImage(m_dpy, vaapi_mids[i].m_image.image_id); - break; - } - } - if (m_exporter) { - vaapi_mids[i].m_fourcc = va_fourcc; - vaapi_mids[i].m_custom = m_exporter->acquire(&vaapi_mids[i]); - if (!vaapi_mids[i].m_custom) { - mfx_res = MFX_ERR_UNKNOWN; - break; - } - } - } - } - if (MFX_ERR_NONE == mfx_res) - { - for (i = 0; i < surfaces_num; ++i) - { - vaapi_mid = &(vaapi_mids[i]); - vaapi_mid->m_fourcc = fourcc; - vaapi_mid->m_surface = &(surfaces[i]); - mids[i] = vaapi_mid; - } - } - if (MFX_ERR_NONE == mfx_res) - { - response->mids = mids; - response->NumFrameActual = surfaces_num; - } - else // i.e. MFX_ERR_NONE != mfx_res - { - response->mids = NULL; - response->NumFrameActual = 0; - if (VA_FOURCC_P208 != va_fourcc - || fourcc == MFX_FOURCC_VP8_MBDATA ) - { - if (bCreateSrfSucceeded) - m_libva->vaDestroySurfaces(m_dpy, surfaces, surfaces_num); - } - else - { - for (i = 0; i < numAllocated; i++) - m_libva->vaDestroyBuffer(m_dpy, surfaces[i]); - } - if (mids) - { - free(mids); - mids = NULL; - } - if (vaapi_mids) { free(vaapi_mids); vaapi_mids = NULL; } - if (surfaces) { free(surfaces); surfaces = NULL; } - } - return mfx_res; -} - -mfxStatus vaapiFrameAllocator::ReleaseResponse(mfxFrameAllocResponse *response) -{ - vaapiMemId *vaapi_mids = NULL; - VASurfaceID* surfaces = NULL; - mfxU32 i = 0; - bool isBitstreamMemory=false; - - if (!response) return MFX_ERR_NULL_PTR; - - if (response->mids) - { - vaapi_mids = (vaapiMemId*)(response->mids[0]); - mfxU32 mfx_fourcc = ConvertVP8FourccToMfxFourcc(vaapi_mids->m_fourcc); - isBitstreamMemory = (MFX_FOURCC_P8 == mfx_fourcc)?true:false; - surfaces = vaapi_mids->m_surface; - for (i = 0; i < response->NumFrameActual; ++i) - { - if (MFX_FOURCC_P8 == vaapi_mids[i].m_fourcc) m_libva->vaDestroyBuffer(m_dpy, surfaces[i]); - else if (vaapi_mids[i].m_sys_buffer) free(vaapi_mids[i].m_sys_buffer); - if (m_export_mode != vaapiAllocatorParams::DONOT_EXPORT) { - if (m_exporter && vaapi_mids[i].m_custom) { - m_exporter->release(&vaapi_mids[i], vaapi_mids[i].m_custom); - } - if (m_export_mode & vaapiAllocatorParams::NATIVE_EXPORT_MASK) { - m_libva->vaReleaseBufferHandle(m_dpy, vaapi_mids[i].m_image.buf); - m_libva->vaDestroyImage(m_dpy, vaapi_mids[i].m_image.image_id); - } - } - } - free(vaapi_mids); - free(response->mids); - response->mids = NULL; - - if (!isBitstreamMemory) m_libva->vaDestroySurfaces(m_dpy, surfaces, response->NumFrameActual); - free(surfaces); - } - response->NumFrameActual = 0; - return MFX_ERR_NONE; -} - -mfxStatus vaapiFrameAllocator::LockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - mfxStatus mfx_res = MFX_ERR_NONE; - VAStatus va_res = VA_STATUS_SUCCESS; - vaapiMemId* vaapi_mid = (vaapiMemId*)mid; - mfxU8* pBuffer = 0; - - if (!vaapi_mid || !(vaapi_mid->m_surface)) return MFX_ERR_INVALID_HANDLE; - - mfxU32 mfx_fourcc = ConvertVP8FourccToMfxFourcc(vaapi_mid->m_fourcc); - - if (MFX_FOURCC_P8 == mfx_fourcc) // bitstream processing - { - VACodedBufferSegment *coded_buffer_segment; - if (vaapi_mid->m_fourcc == MFX_FOURCC_VP8_SEGMAP) - va_res = m_libva->vaMapBuffer(m_dpy, *(vaapi_mid->m_surface), (void **)(&pBuffer)); - else - va_res = m_libva->vaMapBuffer(m_dpy, *(vaapi_mid->m_surface), (void **)(&coded_buffer_segment)); - mfx_res = va_to_mfx_status(va_res); - if (MFX_ERR_NONE == mfx_res) - { - if (vaapi_mid->m_fourcc == MFX_FOURCC_VP8_SEGMAP) - ptr->Y = pBuffer; - else - ptr->Y = (mfxU8*)coded_buffer_segment->buf; - - } - } - else // Image processing - { - va_res = m_libva->vaDeriveImage(m_dpy, *(vaapi_mid->m_surface), &(vaapi_mid->m_image)); - mfx_res = va_to_mfx_status(va_res); - - if (MFX_ERR_NONE == mfx_res) - { - va_res = m_libva->vaMapBuffer(m_dpy, vaapi_mid->m_image.buf, (void **)&pBuffer); - mfx_res = va_to_mfx_status(va_res); - } - if (MFX_ERR_NONE == mfx_res) - { - switch (vaapi_mid->m_image.format.fourcc) - { - case VA_FOURCC_NV12: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->U = pBuffer + vaapi_mid->m_image.offsets[1]; - ptr->V = ptr->U + 1; - } - break; - case VA_FOURCC_YV12: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->V = pBuffer + vaapi_mid->m_image.offsets[1]; - ptr->U = pBuffer + vaapi_mid->m_image.offsets[2]; - } - break; - case VA_FOURCC_YUY2: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->U = ptr->Y + 1; - ptr->V = ptr->Y + 3; - } - break; - case VA_FOURCC_UYVY: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->U = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->Y = ptr->U + 1; - ptr->V = ptr->U + 2; - } - break; -#if (MFX_VERSION >= 1028) - case VA_FOURCC_RGB565: - if (mfx_fourcc == MFX_FOURCC_RGB565) - { - ptr->B = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->G = ptr->B; - ptr->R = ptr->B; - } - else return MFX_ERR_LOCK_MEMORY; - break; -#endif - case VA_FOURCC_ARGB: - if (mfx_fourcc == MFX_FOURCC_RGB4) - { - ptr->B = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->G = ptr->B + 1; - ptr->R = ptr->B + 2; - ptr->A = ptr->B + 3; - } - else return MFX_ERR_LOCK_MEMORY; - break; -#ifndef ANDROID - case VA_FOURCC_A2R10G10B10: - if (mfx_fourcc == MFX_FOURCC_A2RGB10) - { - ptr->B = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->G = ptr->B; - ptr->R = ptr->B; - ptr->A = ptr->B; - } - else return MFX_ERR_LOCK_MEMORY; - break; -#endif - case VA_FOURCC_ABGR: - if (mfx_fourcc == MFX_FOURCC_BGR4) - { - ptr->R = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->G = pBuffer + vaapi_mid->m_image.offsets[1]; - ptr->B = pBuffer + vaapi_mid->m_image.offsets[2]; - ptr->A = ptr->R + 3; - } - else return MFX_ERR_LOCK_MEMORY; - break; - case VA_FOURCC_RGBP: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->B = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->G = pBuffer + vaapi_mid->m_image.offsets[1]; - ptr->R = pBuffer + vaapi_mid->m_image.offsets[2]; - } - break; - case VA_FOURCC_P208: - if (mfx_fourcc == MFX_FOURCC_NV12) - { - ptr->Y = pBuffer + vaapi_mid->m_image.offsets[0]; - } - else return MFX_ERR_LOCK_MEMORY; - break; - case VA_FOURCC_P010: -#if (MFX_VERSION >= 1031) - case VA_FOURCC_P016: -#endif - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y16 = (mfxU16 *) (pBuffer + vaapi_mid->m_image.offsets[0]); - ptr->U16 = (mfxU16 *) (pBuffer + vaapi_mid->m_image.offsets[1]); - ptr->V16 = ptr->U16 + 1; - } - break; - case VA_FOURCC_AYUV: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->V = pBuffer + vaapi_mid->m_image.offsets[0]; - ptr->U = ptr->V + 1; - ptr->Y = ptr->V + 2; - ptr->A = ptr->V + 3; - } - break; -#if (MFX_VERSION >= 1027) - case VA_FOURCC_Y210: -#if (MFX_VERSION >= 1031) - case VA_FOURCC_Y216: -#endif - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y16 = (mfxU16 *) (pBuffer + vaapi_mid->m_image.offsets[0]); - ptr->U16 = ptr->Y16 + 1; - ptr->V16 = ptr->Y16 + 3; - } - break; - case VA_FOURCC_Y410: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->Y410 = (mfxY410 *)(pBuffer + vaapi_mid->m_image.offsets[0]); - ptr->Y = 0; - ptr->V = 0; - ptr->A = 0; - } - break; -#endif -#if (MFX_VERSION >= 1031) - case VA_FOURCC_Y416: - if (mfx_fourcc != vaapi_mid->m_image.format.fourcc) return MFX_ERR_LOCK_MEMORY; - - { - ptr->U16 = (mfxU16 *) (pBuffer + vaapi_mid->m_image.offsets[0]); - ptr->Y16 = ptr->U16 + 1; - ptr->V16 = ptr->Y16 + 1; - ptr->A = (mfxU8 *)(ptr->V16 + 1); - } - break; -#endif - default: - return MFX_ERR_LOCK_MEMORY; - } - } - - ptr->PitchHigh = (mfxU16)(vaapi_mid->m_image.pitches[0] / (1 << 16)); - ptr->PitchLow = (mfxU16)(vaapi_mid->m_image.pitches[0] % (1 << 16)); - } - return mfx_res; -} - -mfxStatus vaapiFrameAllocator::UnlockFrame(mfxMemId mid, mfxFrameData *ptr) -{ - vaapiMemId* vaapi_mid = (vaapiMemId*)mid; - - if (!vaapi_mid || !(vaapi_mid->m_surface)) return MFX_ERR_INVALID_HANDLE; - - mfxU32 mfx_fourcc = ConvertVP8FourccToMfxFourcc(vaapi_mid->m_fourcc); - - if (MFX_FOURCC_P8 == mfx_fourcc) // bitstream processing - { - m_libva->vaUnmapBuffer(m_dpy, *(vaapi_mid->m_surface)); - } - else // Image processing - { - m_libva->vaUnmapBuffer(m_dpy, vaapi_mid->m_image.buf); - m_libva->vaDestroyImage(m_dpy, vaapi_mid->m_image.image_id); - - if (NULL != ptr) - { - ptr->PitchLow = 0; - ptr->PitchHigh = 0; - ptr->Y = NULL; - ptr->U = NULL; - ptr->V = NULL; - ptr->A = NULL; - } - } - return MFX_ERR_NONE; -} - -mfxStatus vaapiFrameAllocator::GetFrameHDL(mfxMemId mid, mfxHDL *handle) -{ - vaapiMemId* vaapi_mid = (vaapiMemId*)mid; - - if (!handle || !vaapi_mid || !(vaapi_mid->m_surface)) return MFX_ERR_INVALID_HANDLE; - - *handle = vaapi_mid->m_surface; //VASurfaceID* <-> mfxHDL - return MFX_ERR_NONE; -} - -#endif // #if defined(LIBVA_SUPPORT) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_device.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_device.cpp deleted file mode 100644 index 238449ff..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_device.cpp +++ /dev/null @@ -1,538 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) || defined(LIBVA_ANDROID_SUPPORT) - -#include "vaapi_device.h" - -#if defined(LIBVA_WAYLAND_SUPPORT) -#include "class_wayland.h" -#endif - -#if defined(LIBVA_X11_SUPPORT) - -#include -#include - -#include "vaapi_allocator.h" -#if defined(X11_DRI3_SUPPORT) -#include - -#define ALIGN(x, y) (((x) + (y) - 1) & -(y)) -#define PAGE_ALIGN(x) ALIGN(x, 4096) -#endif // X11_DRI3_SUPPORT - -#define VAAPI_GET_X_DISPLAY(_display) (Display*)(_display) -#define VAAPI_GET_X_WINDOW(_window) (Window*)(_window) - -CVAAPIDeviceX11::~CVAAPIDeviceX11(void) -{ - Close(); -} - -mfxStatus CVAAPIDeviceX11::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum) -{ - mfxStatus mfx_res = MFX_ERR_NONE; - Window* window = NULL; - - if (nViews) - { - if (MFX_ERR_NONE == mfx_res) - { - m_window = window = (Window*)malloc(sizeof(Window)); - if (!m_window) mfx_res = MFX_ERR_MEMORY_ALLOC; - } - if (MFX_ERR_NONE == mfx_res) - { - Display* display = VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay()); - MfxLoader::XLib_Proxy & x11lib = m_X11LibVA.GetX11(); - mfxU32 screen_number = DefaultScreen(display); - - *window = x11lib.XCreateSimpleWindow( - display, - RootWindow(display, screen_number), - m_bRenderWin ? m_nRenderWinX : 0, - m_bRenderWin ? m_nRenderWinY : 0, - 100, - 100, - 0, - 0, - BlackPixel(display, screen_number)); - - if (!(*window)) mfx_res = MFX_ERR_UNKNOWN; - else - { - x11lib.XMapWindow(display, *window); - x11lib.XSync(display, False); - } - } - } -#if defined(X11_DRI3_SUPPORT) - MfxLoader::DrmIntel_Proxy & drmintellib = m_X11LibVA.GetDrmIntelX11(); - MfxLoader::X11_Xcb_Proxy & x11xcblib = m_X11LibVA.GetX11XcbX11(); - - m_xcbconn = x11xcblib.XGetXCBConnection(VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay())); - - // it's enough to pass render node, because we only request - // information from kernel via m_dri_fd - m_dri_fd = open("/dev/dri/renderD128", O_RDWR); - if (m_dri_fd < 0) { - msdk_printf(MSDK_STRING("Failed to open dri device\n")); - return MFX_ERR_NOT_INITIALIZED; - } - - m_bufmgr = drmintellib.drm_intel_bufmgr_gem_init(m_dri_fd, 4096); - if (!m_bufmgr){ - msdk_printf(MSDK_STRING("Failed to get buffer manager\n")); - return MFX_ERR_NOT_INITIALIZED; - } - -#endif - - return mfx_res; -} - -void CVAAPIDeviceX11::Close(void) -{ - if (m_window) - { - Display* display = VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay()); - Window* window = VAAPI_GET_X_WINDOW(m_window); - - MfxLoader::XLib_Proxy & x11lib = m_X11LibVA.GetX11(); - x11lib.XDestroyWindow(display, *window); - - free(m_window); - m_window = NULL; - } -#if defined(X11_DRI3_SUPPORT) - if (m_dri_fd) - { - close(m_dri_fd); - } -#endif -} - -mfxStatus CVAAPIDeviceX11::Reset(void) -{ - return MFX_ERR_NONE; -} - -mfxStatus CVAAPIDeviceX11::GetHandle(mfxHandleType type, mfxHDL *pHdl) -{ - if ((MFX_HANDLE_VA_DISPLAY == type) && (NULL != pHdl)) - { - *pHdl = m_X11LibVA.GetVADisplay(); - - return MFX_ERR_NONE; - } - - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CVAAPIDeviceX11::SetHandle(mfxHandleType type, mfxHDL hdl) -{ - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CVAAPIDeviceX11::RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * /*pmfxAlloc*/) -{ - mfxStatus mfx_res = MFX_ERR_NONE; - vaapiMemId * memId = NULL; - -#if !defined(X11_DRI3_SUPPORT) - VAStatus va_res = VA_STATUS_SUCCESS; - VASurfaceID surface; - Display* display = VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay()); - Window* window = VAAPI_GET_X_WINDOW(m_window); - - if(!window || !(*window)) mfx_res = MFX_ERR_NOT_INITIALIZED; - // should MFX_ERR_NONE be returned below considering situation as EOS? - if ((MFX_ERR_NONE == mfx_res) && NULL == pSurface) mfx_res = MFX_ERR_NULL_PTR; - if (MFX_ERR_NONE == mfx_res) - { - memId = (vaapiMemId*)(pSurface->Data.MemId); - if (!memId || !memId->m_surface) mfx_res = MFX_ERR_NULL_PTR; - } - if (MFX_ERR_NONE == mfx_res) - { - VADisplay dpy = m_X11LibVA.GetVADisplay(); - VADisplay rnddpy = m_X11LibVA.GetVADisplay(); - VASurfaceID rndsrf; - void* ctx; - - surface = *memId->m_surface; - - va_res = m_X11LibVA.AcquireVASurface(&ctx, dpy, surface, rnddpy, &rndsrf); - mfx_res = va_to_mfx_status(va_res); - if (MFX_ERR_NONE != mfx_res) return mfx_res; - - MfxLoader::XLib_Proxy & x11lib = m_X11LibVA.GetX11(); - x11lib.XResizeWindow(display, *window, pSurface->Info.CropW, pSurface->Info.CropH); - - - MfxLoader::VA_X11Proxy & vax11lib = m_X11LibVA.GetVAX11(); - va_res = vax11lib.vaPutSurface(rnddpy, - rndsrf, - *window, - pSurface->Info.CropX, - pSurface->Info.CropY, - pSurface->Info.CropX + pSurface->Info.CropW, - pSurface->Info.CropY + pSurface->Info.CropH, - pSurface->Info.CropX, - pSurface->Info.CropY, - pSurface->Info.CropX + pSurface->Info.CropW, - pSurface->Info.CropY + pSurface->Info.CropH, - NULL, - 0, - VA_FRAME_PICTURE); - - mfx_res = va_to_mfx_status(va_res); - x11lib.XSync(display, False); - - m_X11LibVA.ReleaseVASurface(ctx, dpy, surface, rnddpy, rndsrf); - - } - return mfx_res; -#else //\/ X11_DRI3_SUPPORT - Window* window = VAAPI_GET_X_WINDOW(m_window); - Window root; - drm_intel_bo *bo = NULL; - unsigned int border, depth, stride, size, - width, height; - int fd = 0, bpp = 0, x, y; - - MfxLoader::Xcb_Proxy & xcblib = m_X11LibVA.GetXcbX11(); - MfxLoader::XLib_Proxy & x11lib = m_X11LibVA.GetX11(); - MfxLoader::DrmIntel_Proxy & drmintellib = m_X11LibVA.GetDrmIntelX11(); - MfxLoader::Xcbpresent_Proxy & xcbpresentlib = m_X11LibVA.GetXcbpresentX11(); - MfxLoader::XCB_Dri3_Proxy & dri3lib= m_X11LibVA.GetXCBDri3X11(); - - if(!window || !(*window)) mfx_res = MFX_ERR_NOT_INITIALIZED; - // should MFX_ERR_NONE be returned below considering situation as EOS? - if ((MFX_ERR_NONE == mfx_res) && NULL == pSurface) mfx_res = MFX_ERR_NULL_PTR; - if (MFX_ERR_NONE == mfx_res) - { - memId = (vaapiMemId*)(pSurface->Data.MemId); - if (!memId || !memId->m_surface) mfx_res = MFX_ERR_NULL_PTR; - } - - if(memId && memId->m_buffer_info.mem_type != VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME){ - msdk_printf(MSDK_STRING("Memory type invalid!\n")); - return MFX_ERR_UNSUPPORTED; - } - - if (MFX_ERR_NONE == mfx_res) - { - x11lib.XResizeWindow(VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay()), - *window, pSurface->Info.CropW, pSurface->Info.CropH); - x11lib.XGetGeometry(VAAPI_GET_X_DISPLAY(m_X11LibVA.GetXDisplay()), - *window, &root, &x, &y, &width, &height, &border, &depth); - - switch (depth) { - case 8: bpp = 8; break; - case 15: case 16: bpp = 16; break; - case 24: case 32: bpp = 32; break; - default: msdk_printf(MSDK_STRING("Invalid depth\n")); - } - - width = pSurface->Info.CropX + pSurface->Info.CropW; - height = pSurface->Info.CropY + pSurface->Info.CropH; - - stride = width * bpp/8; - size = PAGE_ALIGN(stride * height); - - bo = drmintellib.drm_intel_bo_gem_create_from_prime(m_bufmgr, memId->m_buffer_info.handle, size); - if (!bo) { - msdk_printf(MSDK_STRING("Failed to create buffer object\n")); - return MFX_ERR_MEMORY_ALLOC; - } - - drmintellib.drm_intel_bo_gem_export_to_prime(bo, &fd); - if (!fd) { - msdk_printf(MSDK_STRING("Invalid fd\n")); - return MFX_ERR_INVALID_HANDLE; - } - - xcb_pixmap_t pixmap = xcblib.xcb_generate_id(m_xcbconn); - xcb_void_cookie_t cookie; - xcb_generic_error_t *error; - - cookie = dri3lib.xcb_dri3_pixmap_from_buffer_checked(m_xcbconn, pixmap, root, size, width, height, stride, depth, bpp, fd); - if ((error = xcblib.xcb_request_check(m_xcbconn, cookie))) { - msdk_printf(MSDK_STRING("Failed to create xcb pixmap from the %s surface: try another color format (e.g. RGB4)\n"), - ColorFormatToStr(pSurface->Info.FourCC)); - free(error); - return MFX_ERR_INVALID_HANDLE; - } - - cookie = xcbpresentlib.xcb_present_pixmap_checked(m_xcbconn, - *window, pixmap, - 0, - 0, - 0, - 0, - 0, - None, - None, - None, - XCB_PRESENT_OPTION_NONE, - 0, - 0, - 0, - 0, NULL); - if ((error = xcblib.xcb_request_check(m_xcbconn, cookie))) { - msdk_printf(MSDK_STRING("Failed to present pixmap\n")); - free(error); - return MFX_ERR_UNKNOWN; - } - - xcblib.xcb_free_pixmap(m_xcbconn, pixmap); - xcblib.xcb_flush(m_xcbconn); - } - - return mfx_res; - -#endif // X11_DRI3_SUPPORT -} -#endif - -#if defined(LIBVA_WAYLAND_SUPPORT) -#include "wayland-drm-client-protocol.h" - -CVAAPIDeviceWayland::~CVAAPIDeviceWayland(void) -{ - Close(); -} - -mfxStatus CVAAPIDeviceWayland::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum) -{ - mfxStatus mfx_res = MFX_ERR_NONE; - - if(nViews) - { - m_Wayland = (Wayland*)m_WaylandClient.WaylandCreate(); - if(!m_Wayland->InitDisplay()) { - return MFX_ERR_DEVICE_FAILED; - } - - if(NULL == m_Wayland->GetDisplay()) - { - mfx_res = MFX_ERR_UNKNOWN; - return mfx_res; - } - if(-1 == m_Wayland->DisplayRoundtrip()) - { - mfx_res = MFX_ERR_UNKNOWN; - return mfx_res; - } - if(!m_Wayland->CreateSurface()) - { - mfx_res = MFX_ERR_UNKNOWN; - return mfx_res; - } - } - return mfx_res; -} - -mfxStatus CVAAPIDeviceWayland::RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * /*pmfxAlloc*/) -{ - uint32_t drm_format = 0; - int offsets[3], pitches[3]; - mfxStatus mfx_res = MFX_ERR_NONE; - vaapiMemId * memId = NULL; - struct wl_buffer *m_wl_buffer = NULL; - if(NULL==pSurface) { - mfx_res = MFX_ERR_UNKNOWN; - return mfx_res; - } - m_Wayland->Sync(); - memId = (vaapiMemId*)(pSurface->Data.MemId); - - if (pSurface->Info.FourCC == MFX_FOURCC_NV12) - { - drm_format = WL_DRM_FORMAT_NV12; - } else if(pSurface->Info.FourCC == MFX_FOURCC_RGB4) - { - drm_format = WL_DRM_FORMAT_ARGB8888; - - if (m_isMondelloInputEnabled) - { - drm_format = WL_DRM_FORMAT_XBGR8888; - } - } - - offsets[0] = memId->m_image.offsets[0]; - offsets[1] = memId->m_image.offsets[1]; - offsets[2] = memId->m_image.offsets[2]; - pitches[0] = memId->m_image.pitches[0]; - pitches[1] = memId->m_image.pitches[1]; - pitches[2] = memId->m_image.pitches[2]; - m_wl_buffer = m_Wayland->CreatePrimeBuffer(memId->m_buffer_info.handle - , pSurface->Info.CropW - , pSurface->Info.CropH - , drm_format - , offsets - , pitches); - if(NULL == m_wl_buffer) - { - msdk_printf("\nCan't wrap flink to wl_buffer\n"); - mfx_res = MFX_ERR_UNKNOWN; - return mfx_res; - } - - m_Wayland->RenderBuffer(m_wl_buffer, pSurface); - - return mfx_res; -} - -void CVAAPIDeviceWayland::Close(void) -{ - m_Wayland->FreeSurface(); -} - -CHWDevice* CreateVAAPIDevice(void) -{ - return new CVAAPIDeviceWayland(); -} - -#endif // LIBVA_WAYLAND_SUPPORT - -#if defined(LIBVA_DRM_SUPPORT) - -CVAAPIDeviceDRM::CVAAPIDeviceDRM(const std::string& devicePath, int type) - : m_DRMLibVA(devicePath, type) - , m_rndr(NULL) -{ -} - -CVAAPIDeviceDRM::~CVAAPIDeviceDRM(void) -{ - MSDK_SAFE_DELETE(m_rndr); -} - -mfxStatus CVAAPIDeviceDRM::Init(mfxHDL hWindow, mfxU16 nViews, mfxU32 nAdapterNum) -{ - if (0 == nViews) { - return MFX_ERR_NONE; - } - if (1 == nViews) { - if (m_DRMLibVA.getBackendType() == MFX_LIBVA_DRM_RENDERNODE) { - return MFX_ERR_NONE; - } - mfxI32 * monitorType = (mfxI32*)hWindow; - if (!monitorType) return MFX_ERR_INVALID_VIDEO_PARAM; - try { - m_rndr = new drmRenderer(m_DRMLibVA.getFD(), *monitorType); - } catch(...) { - msdk_printf(MSDK_STRING("vaapi_device: failed to initialize drmrender\n")); - return MFX_ERR_UNKNOWN; - } - return MFX_ERR_NONE; - } - return MFX_ERR_UNSUPPORTED; -} - -mfxStatus CVAAPIDeviceDRM::RenderFrame(mfxFrameSurface1 * pSurface, mfxFrameAllocator * pmfxAlloc) -{ - return (m_rndr)? m_rndr->render(pSurface): MFX_ERR_NONE; -} - -#endif - -#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) || defined (LIBVA_WAYLAND_SUPPORT) - -CHWDevice* CreateVAAPIDevice(const std::string& devicePath, int type) -{ - CHWDevice * device = NULL; - - switch (type) - { - case MFX_LIBVA_DRM_RENDERNODE: - case MFX_LIBVA_DRM_MODESET: -#if defined(LIBVA_DRM_SUPPORT) - try - { - device = new CVAAPIDeviceDRM(devicePath, type); - } - catch (std::exception&) - { - device = NULL; - } -#endif - break; - - case MFX_LIBVA_X11: -#if defined(LIBVA_X11_SUPPORT) - try - { - device = new CVAAPIDeviceX11; - } - catch (std::exception&) - { - device = NULL; - } -#endif - break; - case MFX_LIBVA_WAYLAND: -#if defined(LIBVA_WAYLAND_SUPPORT) - device = new CVAAPIDeviceWayland; -#endif - break; - case MFX_LIBVA_AUTO: -#if defined(LIBVA_X11_SUPPORT) - try - { - device = new CVAAPIDeviceX11; - } - catch (std::exception&) - { - device = NULL; - } -#endif -#if defined(LIBVA_DRM_SUPPORT) - if (!device) - { - try - { - device = new CVAAPIDeviceDRM(devicePath, type); - } - catch (std::exception&) - { - device = NULL; - } - } -#endif - break; - } // switch(type) - - return device; -} - -#elif defined(LIBVA_ANDROID_SUPPORT) - -static AndroidLibVA g_LibVA; -CHWDevice* CreateVAAPIDevice(const std::string& devicePath, int type) -{ - return new CVAAPIDeviceAndroid(&g_LibVA); -} - -#endif - -#endif //#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) || defined(LIBVA_ANDROID_SUPPORT) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils.cpp deleted file mode 100644 index c88adcde..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifdef LIBVA_SUPPORT - -#include "vaapi_utils.h" -#include -#include - -//#if defined(LIBVA_DRM_SUPPORT) -#include "vaapi_utils_drm.h" -//#elif defined(LIBVA_X11_SUPPORT) -#include "vaapi_utils_x11.h" -//#endif - -#if defined(LIBVA_WAYLAND_SUPPORT) -#include "class_wayland.h" -#endif - -namespace MfxLoader -{ - -SimpleLoader::SimpleLoader(const char * name) -{ - dlerror(); - so_handle = dlopen(name, RTLD_GLOBAL | RTLD_NOW); - if (NULL == so_handle) - { - std::cerr << dlerror() << std::endl; - throw std::runtime_error("Can't load library"); - } -} - -void * SimpleLoader::GetFunction(const char * name) -{ - void * fn_ptr = dlsym(so_handle, name); - if (!fn_ptr) - throw std::runtime_error("Can't find function"); - return fn_ptr; -} - -SimpleLoader::~SimpleLoader() -{ - dlclose(so_handle); -} - -#define SIMPLE_LOADER_STRINGIFY1( x) #x -#define SIMPLE_LOADER_STRINGIFY(x) SIMPLE_LOADER_STRINGIFY1(x) -#define SIMPLE_LOADER_DECORATOR1(fun,suffix) fun ## _ ## suffix -#define SIMPLE_LOADER_DECORATOR(fun,suffix) SIMPLE_LOADER_DECORATOR1(fun,suffix) - - -// Following macro applied on vaInitialize will give: vaInitialize((vaInitialize_type)lib.GetFunction("vaInitialize")) -#define SIMPLE_LOADER_FUNCTION(name) name( (SIMPLE_LOADER_DECORATOR(name, type)) lib.GetFunction(SIMPLE_LOADER_STRINGIFY(name)) ) - - -#if defined(LIBVA_SUPPORT) -VA_Proxy::VA_Proxy() -#ifdef ANDROID - : lib("libva-android.so") -#else - : lib("libva.so.2") -#endif - , SIMPLE_LOADER_FUNCTION(vaInitialize) - , SIMPLE_LOADER_FUNCTION(vaTerminate) - , SIMPLE_LOADER_FUNCTION(vaCreateSurfaces) - , SIMPLE_LOADER_FUNCTION(vaDestroySurfaces) - , SIMPLE_LOADER_FUNCTION(vaCreateBuffer) - , SIMPLE_LOADER_FUNCTION(vaDestroyBuffer) - , SIMPLE_LOADER_FUNCTION(vaMapBuffer) - , SIMPLE_LOADER_FUNCTION(vaUnmapBuffer) - , SIMPLE_LOADER_FUNCTION(vaSyncSurface) - , SIMPLE_LOADER_FUNCTION(vaDeriveImage) - , SIMPLE_LOADER_FUNCTION(vaDestroyImage) - , SIMPLE_LOADER_FUNCTION(vaGetLibFunc) - , SIMPLE_LOADER_FUNCTION(vaAcquireBufferHandle) - , SIMPLE_LOADER_FUNCTION(vaReleaseBufferHandle) - , SIMPLE_LOADER_FUNCTION(vaMaxNumEntrypoints) - , SIMPLE_LOADER_FUNCTION(vaQueryConfigEntrypoints) - , SIMPLE_LOADER_FUNCTION(vaGetConfigAttributes) - , SIMPLE_LOADER_FUNCTION(vaCreateConfig) - , SIMPLE_LOADER_FUNCTION(vaCreateContext) - , SIMPLE_LOADER_FUNCTION(vaDestroyConfig) - , SIMPLE_LOADER_FUNCTION(vaDestroyContext) -{ -} - -VA_Proxy::~VA_Proxy() -{} - -#endif - -#if defined(LIBVA_DRM_SUPPORT) -DRM_Proxy::DRM_Proxy() - : lib("libdrm.so.2") - , SIMPLE_LOADER_FUNCTION(drmIoctl) - , SIMPLE_LOADER_FUNCTION(drmModeAddFB) - , SIMPLE_LOADER_FUNCTION(drmModeAddFB2WithModifiers) - , SIMPLE_LOADER_FUNCTION(drmModeFreeConnector) - , SIMPLE_LOADER_FUNCTION(drmModeFreeCrtc) - , SIMPLE_LOADER_FUNCTION(drmModeFreeEncoder) - , SIMPLE_LOADER_FUNCTION(drmModeFreePlane) - , SIMPLE_LOADER_FUNCTION(drmModeFreePlaneResources) - , SIMPLE_LOADER_FUNCTION(drmModeFreeResources) - , SIMPLE_LOADER_FUNCTION(drmModeGetConnector) - , SIMPLE_LOADER_FUNCTION(drmModeGetCrtc) - , SIMPLE_LOADER_FUNCTION(drmModeGetEncoder) - , SIMPLE_LOADER_FUNCTION(drmModeGetPlane) - , SIMPLE_LOADER_FUNCTION(drmModeGetPlaneResources) - , SIMPLE_LOADER_FUNCTION(drmModeGetResources) - , SIMPLE_LOADER_FUNCTION(drmModeRmFB) - , SIMPLE_LOADER_FUNCTION(drmModeSetCrtc) - , SIMPLE_LOADER_FUNCTION(drmSetMaster) - , SIMPLE_LOADER_FUNCTION(drmDropMaster) - , SIMPLE_LOADER_FUNCTION(drmModeSetPlane) -{ -} - -DrmIntel_Proxy::~DrmIntel_Proxy() -{} - -DrmIntel_Proxy::DrmIntel_Proxy() - : lib("libdrm_intel.so.1") - , SIMPLE_LOADER_FUNCTION(drm_intel_bo_gem_create_from_prime) - , SIMPLE_LOADER_FUNCTION(drm_intel_bo_unreference) - , SIMPLE_LOADER_FUNCTION(drm_intel_bufmgr_gem_init) - , SIMPLE_LOADER_FUNCTION(drm_intel_bufmgr_destroy) -#if defined(X11_DRI3_SUPPORT) - , SIMPLE_LOADER_FUNCTION(drm_intel_bo_gem_export_to_prime) -#endif -{ -} - -DRM_Proxy::~DRM_Proxy() -{} - -VA_DRMProxy::VA_DRMProxy() - : lib("libva-drm.so.2") - , SIMPLE_LOADER_FUNCTION(vaGetDisplayDRM) -{ -} - -VA_DRMProxy::~VA_DRMProxy() -{} - -#if defined(X11_DRI3_SUPPORT) -XCB_Dri3_Proxy::XCB_Dri3_Proxy() - : lib("libxcb-dri3.so.0") - , SIMPLE_LOADER_FUNCTION(xcb_dri3_pixmap_from_buffer_checked) -{ -} - -XCB_Dri3_Proxy::~XCB_Dri3_Proxy() -{} - -Xcb_Proxy::Xcb_Proxy() - : lib("libxcb.so.1") - , SIMPLE_LOADER_FUNCTION(xcb_generate_id) - , SIMPLE_LOADER_FUNCTION(xcb_free_pixmap) - , SIMPLE_LOADER_FUNCTION(xcb_flush) - , SIMPLE_LOADER_FUNCTION(xcb_request_check) -{ -} - -Xcb_Proxy::~Xcb_Proxy() -{} - -X11_Xcb_Proxy::X11_Xcb_Proxy() - : lib("libX11-xcb.so.1") - , SIMPLE_LOADER_FUNCTION(XGetXCBConnection) -{ -} - -X11_Xcb_Proxy::~X11_Xcb_Proxy() -{} - -Xcbpresent_Proxy::Xcbpresent_Proxy() - : lib("libxcb-present.so.0") - , SIMPLE_LOADER_FUNCTION(xcb_present_pixmap_checked) -{ -} - -Xcbpresent_Proxy::~Xcbpresent_Proxy() -{} -#endif // X11_DRI3_SUPPORT -#endif - -#if defined(LIBVA_WAYLAND_SUPPORT) - -VA_WaylandClientProxy::VA_WaylandClientProxy() - : lib("libmfx_wayland.so") - , SIMPLE_LOADER_FUNCTION(WaylandCreate) -{ -} - -VA_WaylandClientProxy::~VA_WaylandClientProxy() -{} - -#endif // LIBVA_WAYLAND_SUPPORT - -#if defined(LIBVA_X11_SUPPORT) -VA_X11Proxy::VA_X11Proxy() - : lib("libva-x11.so.2") - , SIMPLE_LOADER_FUNCTION(vaGetDisplay) - , SIMPLE_LOADER_FUNCTION(vaPutSurface) -{ -} - -VA_X11Proxy::~VA_X11Proxy() -{} - -XLib_Proxy::XLib_Proxy() - : lib("libX11.so.6") - , SIMPLE_LOADER_FUNCTION(XOpenDisplay) - , SIMPLE_LOADER_FUNCTION(XCloseDisplay) - , SIMPLE_LOADER_FUNCTION(XCreateSimpleWindow) - , SIMPLE_LOADER_FUNCTION(XMapWindow) - , SIMPLE_LOADER_FUNCTION(XSync) - , SIMPLE_LOADER_FUNCTION(XDestroyWindow) - , SIMPLE_LOADER_FUNCTION(XResizeWindow) -#if defined(X11_DRI3_SUPPORT) - , SIMPLE_LOADER_FUNCTION(XGetGeometry) -#endif // X11_DRI3_SUPPORT -{} - -XLib_Proxy::~XLib_Proxy() -{} - - -#endif - -#undef SIMPLE_LOADER_FUNCTION - -} // MfxLoader - -mfxStatus va_to_mfx_status(VAStatus va_res) -{ - mfxStatus mfxRes = MFX_ERR_NONE; - - switch (va_res) - { - case VA_STATUS_SUCCESS: - mfxRes = MFX_ERR_NONE; - break; - case VA_STATUS_ERROR_ALLOCATION_FAILED: - mfxRes = MFX_ERR_MEMORY_ALLOC; - break; - case VA_STATUS_ERROR_ATTR_NOT_SUPPORTED: - case VA_STATUS_ERROR_UNSUPPORTED_PROFILE: - case VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT: - case VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT: - case VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE: - case VA_STATUS_ERROR_FLAG_NOT_SUPPORTED: - case VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED: - mfxRes = MFX_ERR_UNSUPPORTED; - break; - case VA_STATUS_ERROR_INVALID_DISPLAY: - case VA_STATUS_ERROR_INVALID_CONFIG: - case VA_STATUS_ERROR_INVALID_CONTEXT: - case VA_STATUS_ERROR_INVALID_SURFACE: - case VA_STATUS_ERROR_INVALID_BUFFER: - case VA_STATUS_ERROR_INVALID_IMAGE: - case VA_STATUS_ERROR_INVALID_SUBPICTURE: - mfxRes = MFX_ERR_NOT_INITIALIZED; - break; - case VA_STATUS_ERROR_INVALID_PARAMETER: - mfxRes = MFX_ERR_INVALID_VIDEO_PARAM; - default: - mfxRes = MFX_ERR_UNKNOWN; - break; - } - return mfxRes; -} - -#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) -CLibVA* CreateLibVA(const std::string& devicePath, int type) -{ - CLibVA * libva = NULL; - switch (type) - { - case MFX_LIBVA_DRM: -#if defined(LIBVA_DRM_SUPPORT) - try - { - libva = new DRMLibVA(devicePath, type); - } - catch (std::exception&) - { - libva = 0; - } -#endif - break; - - case MFX_LIBVA_X11: -#if defined(LIBVA_X11_SUPPORT) - try - { - libva = new X11LibVA; - } - catch (std::exception&) - { - libva = NULL; - } -#endif - break; - - case MFX_LIBVA_AUTO: -#if defined(LIBVA_X11_SUPPORT) - try - { - libva = new X11LibVA; - } - catch (std::exception&) - { - libva = NULL; - } -#endif -#if defined(LIBVA_DRM_SUPPORT) - if (!libva) - { - try - { - libva = new DRMLibVA(devicePath, type); - } - catch (std::exception&) - { - libva = NULL; - } - } -#endif - break; - } // switch(type) - - return libva; -} -#endif // #if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_X11_SUPPORT) - -#if defined(LIBVA_X11_SUPPORT) - -struct AcquireCtx -{ - VAImage image; -}; - -VAStatus CLibVA::AcquireVASurface( - void** pctx, - VADisplay dpy1, - VASurfaceID srf1, - VADisplay dpy2, - VASurfaceID* srf2) -{ - if (!pctx || !srf2) return VA_STATUS_ERROR_OPERATION_FAILED; - - if (dpy1 == dpy2) { - *srf2 = srf1; - return VA_STATUS_SUCCESS; - } - - AcquireCtx* ctx; - uintptr_t handle=0; - VAStatus va_res; - VASurfaceAttrib attribs[2]; - VASurfaceAttribExternalBuffers extsrf; - VABufferInfo bufferInfo; - uint32_t memtype = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; - - MSDK_ZERO_MEMORY(attribs); - MSDK_ZERO_MEMORY(extsrf); - MSDK_ZERO_MEMORY(bufferInfo); - extsrf.num_buffers = 1; - extsrf.buffers = &handle; - - attribs[0].type = (VASurfaceAttribType)VASurfaceAttribMemoryType; - attribs[0].flags = VA_SURFACE_ATTRIB_SETTABLE; - attribs[0].value.type = VAGenericValueTypeInteger; - attribs[0].value.value.i = memtype; - - attribs[1].type = (VASurfaceAttribType)VASurfaceAttribExternalBufferDescriptor; - attribs[1].flags = VA_SURFACE_ATTRIB_SETTABLE; - attribs[1].value.type = VAGenericValueTypePointer; - attribs[1].value.value.p = &extsrf; - - ctx = (AcquireCtx*)calloc(1, sizeof(AcquireCtx)); - if (!ctx) return VA_STATUS_ERROR_OPERATION_FAILED; - - va_res = m_libva.vaDeriveImage(dpy1, srf1, &ctx->image); - if (VA_STATUS_SUCCESS != va_res) { - free(ctx); - return va_res; - } - - va_res = m_libva.vaAcquireBufferHandle(dpy1, ctx->image.buf, &bufferInfo); - if (VA_STATUS_SUCCESS != va_res) { - m_libva.vaDestroyImage(dpy1, ctx->image.image_id); - free(ctx); - return va_res; - } - - extsrf.width = ctx->image.width; - extsrf.height = ctx->image.height; - extsrf.num_planes = ctx->image.num_planes; - extsrf.pixel_format = ctx->image.format.fourcc; - for (int i=0; i < 3; ++i) { - extsrf.pitches[i] = ctx->image.pitches[i]; - extsrf.offsets[i] = ctx->image.offsets[i]; - } - extsrf.data_size = ctx->image.data_size; - extsrf.flags = memtype; - extsrf.buffers[0] = bufferInfo.handle; - - va_res = m_libva.vaCreateSurfaces(dpy2, - VA_RT_FORMAT_YUV420, - extsrf.width, extsrf.height, - srf2, 1, attribs, 2); - if (VA_STATUS_SUCCESS != va_res) { - m_libva.vaDestroyImage(dpy1, ctx->image.image_id); - free(ctx); - return va_res; - } - - *pctx = ctx; - - return VA_STATUS_SUCCESS; -} - -void CLibVA::ReleaseVASurface( - void* actx, - VADisplay dpy1, - VASurfaceID /*srf1*/, - VADisplay dpy2, - VASurfaceID srf2) -{ - if (dpy1 != dpy2) { - AcquireCtx* ctx = (AcquireCtx*)actx; - if (ctx) { - m_libva.vaDestroySurfaces(dpy2, &srf2, 1); - m_libva.vaReleaseBufferHandle(dpy1, ctx->image.buf); - m_libva.vaDestroyImage(dpy1, ctx->image.image_id); - free(ctx); - } - } -} - -#endif //LIBVA_X11_SUPPORT - -#endif // #ifdef LIBVA_SUPPORT diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_android.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_android.cpp deleted file mode 100644 index c5aa9638..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_android.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#ifdef LIBVA_ANDROID_SUPPORT -#ifdef ANDROID - -#include "vaapi_utils_android.h" - -CLibVA* CreateLibVA(int) -{ - return new AndroidLibVA; -} - -/*------------------------------------------------------------------------------*/ - -typedef unsigned int vaapiAndroidDisplay; - -#define VAAPI_ANDROID_DEFAULT_DISPLAY 0x18c34078 - -AndroidLibVA::AndroidLibVA(void) - : CLibVA(MFX_LIBVA_AUTO) - , m_display(NULL) -{ - VAStatus va_res = VA_STATUS_SUCCESS; - mfxStatus sts = MFX_ERR_NONE; - int major_version = 0, minor_version = 0; - vaapiAndroidDisplay* display = NULL; - - m_display = display = (vaapiAndroidDisplay*)malloc(sizeof(vaapiAndroidDisplay)); - if (NULL == m_display) sts = MFX_ERR_NOT_INITIALIZED; - else *display = VAAPI_ANDROID_DEFAULT_DISPLAY; - - if (MFX_ERR_NONE == sts) - { - m_va_dpy = vaGetDisplay(m_display); - if (!m_va_dpy) - { - free(m_display); - sts = MFX_ERR_NULL_PTR; - } - } - if (MFX_ERR_NONE == sts) - { - va_res = vaInitialize(m_va_dpy, &major_version, &minor_version); - sts = va_to_mfx_status(va_res); - if (MFX_ERR_NONE != sts) - { - free(display); - m_display = NULL; - } - } - if (MFX_ERR_NONE != sts) throw std::bad_alloc(); -} - -AndroidLibVA::~AndroidLibVA(void) -{ - if (m_va_dpy) - { - vaTerminate(m_va_dpy); - } - if (m_display) - { - free(m_display); - } -} - -#endif // #ifdef ANDROID -#endif // #ifdef LIBVA_ANDROID_SUPPORT diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_drm.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_drm.cpp deleted file mode 100644 index 73c8bd29..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_drm.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(LIBVA_DRM_SUPPORT) || defined(LIBVA_WAYLAND_SUPPORT) - -#include "vaapi_utils_drm.h" -#include "vaapi_allocator.h" -#include -#include - -#include - -#include "vaapi_utils_drm.h" -#include -#include "i915_drm.h" - -constexpr mfxU32 MFX_DRI_MAX_NODES_NUM = 16; -constexpr mfxU32 MFX_DRI_RENDER_START_INDEX = 128; -constexpr mfxU32 MFX_DRI_CARD_START_INDEX = 0; -constexpr mfxU32 MFX_DRM_DRIVER_NAME_LEN = 4; -const char* MFX_DRM_INTEL_DRIVER_NAME = "i915"; -const char* MFX_DRI_PATH = "/dev/dri/"; -const char* MFX_DRI_NODE_RENDER = "renderD"; -const char* MFX_DRI_NODE_CARD = "card"; - -int get_drm_driver_name(int fd, char *name, int name_size) -{ - drm_version_t version = {}; - version.name_len = name_size; - version.name = name; - return ioctl(fd, DRM_IOWR(0, drm_version), &version); -} - -int open_first_intel_adapter(int type) -{ - std::string adapterPath = MFX_DRI_PATH; - char driverName[MFX_DRM_DRIVER_NAME_LEN + 1] = {}; - mfxU32 nodeIndex; - - switch (type) { - case MFX_LIBVA_DRM: - case MFX_LIBVA_AUTO: - adapterPath += MFX_DRI_NODE_RENDER; - nodeIndex = MFX_DRI_RENDER_START_INDEX; - break; - case MFX_LIBVA_DRM_MODESET: - adapterPath += MFX_DRI_NODE_CARD; - nodeIndex = MFX_DRI_CARD_START_INDEX; - break; - default: - throw std::invalid_argument("Wrong libVA backend type"); - } - - for (mfxU32 i = 0; i < MFX_DRI_MAX_NODES_NUM; ++i) { - std::string curAdapterPath = adapterPath + std::to_string(nodeIndex + i); - - int fd = open(curAdapterPath.c_str(), O_RDWR); - if (fd < 0) continue; - - if (!get_drm_driver_name(fd, driverName, MFX_DRM_DRIVER_NAME_LEN) && - !strcmp(driverName, MFX_DRM_INTEL_DRIVER_NAME)) { - return fd; - } - close(fd); - } - - return -1; -} - -int open_intel_adapter(const std::string& devicePath, int type) -{ - if(devicePath.empty()) - return open_first_intel_adapter(type); - - int fd = open(devicePath.c_str(), O_RDWR); - - if (fd < 0) { - msdk_printf(MSDK_STRING("Failed to open specified device\n")); - return -1; - } - - char driverName[MFX_DRM_DRIVER_NAME_LEN + 1] = {}; - if (!get_drm_driver_name(fd, driverName, MFX_DRM_DRIVER_NAME_LEN) && - !strcmp(driverName, MFX_DRM_INTEL_DRIVER_NAME)) { - return fd; - } - else { - close(fd); - msdk_printf(MSDK_STRING("Specified device is not Intel one\n")); - return -1; - } -} - -DRMLibVA::DRMLibVA(const std::string& devicePath, int type) - : CLibVA(type) - , m_fd(-1) -{ - mfxStatus sts = MFX_ERR_NONE; - - m_fd = open_intel_adapter(devicePath, type); - if (m_fd < 0) throw std::range_error("Intel GPU was not found"); - - m_va_dpy = m_vadrmlib.vaGetDisplayDRM(m_fd); - if (m_va_dpy) - { - int major_version = 0, minor_version = 0; - VAStatus va_res = m_libva.vaInitialize(m_va_dpy, &major_version, &minor_version); - sts = va_to_mfx_status(va_res); - } - else { - sts = MFX_ERR_NULL_PTR; - } - - if (MFX_ERR_NONE != sts) - { - if (m_va_dpy) m_libva.vaTerminate(m_va_dpy); - close(m_fd); - throw std::runtime_error("Loading of VA display was failed"); - } -} - -DRMLibVA::~DRMLibVA(void) -{ - if (m_va_dpy) - { - m_libva.vaTerminate(m_va_dpy); - } - if (m_fd >= 0) - { - close(m_fd); - } -} - -struct drmMonitorsTable { - mfxI32 mfx_type; - uint32_t drm_type; - const msdk_char * type_name; -}; - -drmMonitorsTable g_drmMonitorsTable[] = { -#define __DECLARE(type) { MFX_MONITOR_ ## type, DRM_MODE_CONNECTOR_ ## type, MSDK_STRING(#type) } - __DECLARE(Unknown), - __DECLARE(VGA), - __DECLARE(DVII), - __DECLARE(DVID), - __DECLARE(DVIA), - __DECLARE(Composite), - __DECLARE(SVIDEO), - __DECLARE(LVDS), - __DECLARE(Component), - __DECLARE(9PinDIN), - __DECLARE(HDMIA), - __DECLARE(HDMIB), - __DECLARE(eDP), - __DECLARE(TV), - __DECLARE(DisplayPort), -#if defined(DRM_MODE_CONNECTOR_VIRTUAL) // from libdrm 2.4.59 - __DECLARE(VIRTUAL), -#endif -#if defined(DRM_MODE_CONNECTOR_DSI) // from libdrm 2.4.59 - __DECLARE(DSI) -#endif -#undef __DECLARE -}; - -uint32_t drmRenderer::getConnectorType(mfxI32 monitor_type) -{ - for (size_t i=0; i < sizeof(g_drmMonitorsTable)/sizeof(g_drmMonitorsTable[0]); ++i) { - if (g_drmMonitorsTable[i].mfx_type == monitor_type) { - return g_drmMonitorsTable[i].drm_type; - } - } - return DRM_MODE_CONNECTOR_Unknown; -} - -const msdk_char* drmRenderer::getConnectorName(uint32_t connector_type) -{ - for (size_t i=0; i < sizeof(g_drmMonitorsTable)/sizeof(g_drmMonitorsTable[0]); ++i) { - if (g_drmMonitorsTable[i].drm_type == connector_type) { - return g_drmMonitorsTable[i].type_name; - } - } - return MSDK_STRING("Unknown"); -} - -drmRenderer::drmRenderer(int fd, mfxI32 monitorType) - : m_fd(fd) - , m_bufmgr(NULL) - , m_overlay_wrn(true) - , m_pCurrentRenderTargetSurface(NULL) -{ - bool res = false; - uint32_t connectorType = getConnectorType(monitorType); - - if (monitorType == MFX_MONITOR_AUTO) { - connectorType = DRM_MODE_CONNECTOR_Unknown; - } else if (connectorType == DRM_MODE_CONNECTOR_Unknown) { - throw std::invalid_argument("Unsupported monitor type"); - } - drmModeRes *resource = m_drmlib.drmModeGetResources(m_fd); - if (resource) { - if (getConnector(resource, connectorType) && - getPlane()) { - res = true; - } - m_drmlib.drmModeFreeResources(resource); - } - if (!res) { - throw std::invalid_argument("Failed to allocate renderer"); - } - msdk_printf(MSDK_STRING("drmrender: connected via %s to %dx%d@%d capable display\n"), - getConnectorName(m_connector_type), m_mode.hdisplay, m_mode.vdisplay, m_mode.vrefresh); -} - -drmRenderer::~drmRenderer() -{ - m_drmlib.drmModeFreeCrtc(m_crtc); - if (m_bufmgr) - { - m_drmintellib.drm_intel_bufmgr_destroy(m_bufmgr); - m_bufmgr = NULL; - } -} - -bool drmRenderer::getConnector(drmModeRes *resource, uint32_t connector_type) -{ - bool found = false; - drmModeConnectorPtr connector = NULL; - - for (int i = 0; i < resource->count_connectors; ++i) { - connector = m_drmlib.drmModeGetConnector(m_fd, resource->connectors[i]); - if (connector) { - if ((connector->connector_type == connector_type) || - (connector_type == DRM_MODE_CONNECTOR_Unknown)) { - if (connector->connection == DRM_MODE_CONNECTED) { - msdk_printf(MSDK_STRING("drmrender: trying connection: %s\n"), getConnectorName(connector->connector_type)); - m_connector_type = connector->connector_type; - m_connectorID = connector->connector_id; - found = setupConnection(resource, connector); - if (found) msdk_printf(MSDK_STRING("drmrender: succeeded...\n")); - else msdk_printf(MSDK_STRING("drmrender: failed...\n")); - } else if ((connector_type != DRM_MODE_CONNECTOR_Unknown)) { - msdk_printf(MSDK_STRING("drmrender: error: requested monitor not connected\n")); - } - } - m_drmlib.drmModeFreeConnector(connector); - if (found) return true; - } - } - msdk_printf(MSDK_STRING("drmrender: error: requested monitor not available\n")); - return false; -} - -bool drmRenderer::setupConnection(drmModeRes *resource, drmModeConnector* connector) -{ - bool ret = false; - drmModeEncoderPtr encoder; - - if (!connector->count_modes) { - msdk_printf(MSDK_STRING("drmrender: error: no valid modes for %s connector\n"), - getConnectorName(connector->connector_type)); - return false; - } - // we will use the first available mode - that's always mode with the highest resolution - m_mode = connector->modes[0]; - - // trying encoder+crtc which are currently attached to connector - m_encoderID = connector->encoder_id; - encoder = m_drmlib.drmModeGetEncoder(m_fd, m_encoderID); - if (encoder) { - m_crtcID = encoder->crtc_id; - for (int j = 0; j < resource->count_crtcs; ++j) - { - if (m_crtcID == resource->crtcs[j]) - { - m_crtcIndex = j; - break; - } - } - ret = true; - msdk_printf(MSDK_STRING("drmrender: selected crtc already attached to connector\n")); - m_drmlib.drmModeFreeEncoder(encoder); - } - - // if previous attempt to get crtc failed, let performs global search - // searching matching encoder+crtc globally - if (!ret) { - for (int i = 0; i < connector->count_encoders; ++i) { - encoder = m_drmlib.drmModeGetEncoder(m_fd, connector->encoders[i]); - if (encoder) { - for (int j = 0; j < resource->count_crtcs; ++j) { - // check whether this CRTC works with the encoder - if ( !((encoder->possible_crtcs & (1 << j)) && - (encoder->crtc_id == resource->crtcs[j])) ) - continue; - - m_encoderID = connector->encoders[i]; - m_crtcIndex = j; - m_crtcID = resource->crtcs[j]; - ret = true; - msdk_printf(MSDK_STRING("drmrender: found crtc with global search\n")); - break; - } - m_drmlib.drmModeFreeEncoder(encoder); - if (ret) - break; - } - } - } - if (ret) { - m_crtc = m_drmlib.drmModeGetCrtc(m_fd, m_crtcID); - if (!m_crtc) - ret = false; - } else { - msdk_printf(MSDK_STRING("drmrender: failed to select crtc\n")); - } - return ret; -} - -bool drmRenderer::getPlane() -{ - drmModePlaneResPtr planes = m_drmlib.drmModeGetPlaneResources(m_fd); - if (!planes) { - return false; - } - for (uint32_t i = 0; i < planes->count_planes; ++i) { - drmModePlanePtr plane = m_drmlib.drmModeGetPlane(m_fd, planes->planes[i]); - if (plane) { - if (plane->possible_crtcs & (1 << m_crtcIndex)) { - for (uint32_t j = 0; j < plane->count_formats; ++j) { - if ((plane->formats[j] == DRM_FORMAT_XRGB8888) - || (plane->formats[j] == DRM_FORMAT_NV12)) { - m_planeID = plane->plane_id; - m_drmlib.drmModeFreePlane(plane); - m_drmlib.drmModeFreePlaneResources(planes); - return true; - } - } - } - m_drmlib.drmModeFreePlane(plane); - } - } - m_drmlib.drmModeFreePlaneResources(planes); - return false; -} - -bool drmRenderer::setMaster() -{ - int wait_count = 0; - do { - if (!m_drmlib.drmSetMaster(m_fd)) return true; - usleep(100); - ++wait_count; - } while(wait_count < 30000); - msdk_printf(MSDK_STRING("drmrender: error: failed to get drm mastership during 3 seconds - aborting\n")); - return false; -} - -void drmRenderer::dropMaster() -{ - m_drmlib.drmDropMaster(m_fd); -} - -bool drmRenderer::restore() -{ - if (!setMaster()) return false; - - int ret = m_drmlib.drmModeSetCrtc(m_fd, m_crtcID, m_crtc->buffer_id, m_crtc->x, m_crtc->y, &m_connectorID, 1, &m_mode); - if (ret) { - msdk_printf(MSDK_STRING("drmrender: failed to restore original mode\n")); - return false; - } - dropMaster(); - return true; -} - -void* drmRenderer::acquire(mfxMemId mid) -{ - vaapiMemId* vmid = (vaapiMemId*)mid; - uint32_t fbhandle=0; - - if (vmid->m_buffer_info.mem_type == VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME) { - if (!m_bufmgr) { - m_bufmgr = m_drmintellib.drm_intel_bufmgr_gem_init(m_fd, 4096); - if (!m_bufmgr) return NULL; - } - - drm_intel_bo* bo = m_drmintellib.drm_intel_bo_gem_create_from_prime( - m_bufmgr, (int)vmid->m_buffer_info.handle, vmid->m_buffer_info.mem_size); - if (!bo) return NULL; - - int ret = m_drmlib.drmModeAddFB(m_fd, - vmid->m_image.width, vmid->m_image.height, - 24, 32, vmid->m_image.pitches[0], - bo->handle, &fbhandle); - if (ret) { - return NULL; - } - m_drmintellib.drm_intel_bo_unreference(bo); - } else if (vmid->m_buffer_info.mem_type == VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM) { - struct drm_gem_open flink_open; - struct drm_gem_close flink_close; - - MSDK_ZERO_MEMORY(flink_open); - flink_open.name = vmid->m_buffer_info.handle; - int ret = m_drmlib.drmIoctl(m_fd, DRM_IOCTL_GEM_OPEN, &flink_open); - if (ret) return NULL; - - uint32_t handles[4], pitches[4], offsets[4], pixel_format, flags = 0; - uint64_t modifiers[4]; - - memset(&handles, 0, sizeof(handles)); - memset(&pitches, 0, sizeof(pitches)); - memset(&offsets, 0, sizeof(offsets)); - memset(&modifiers, 0, sizeof(modifiers)); - - handles[0] = flink_open.handle; - pitches[0] = vmid->m_image.pitches[0]; - offsets[0] = vmid->m_image.offsets[0]; - - if (VA_FOURCC_NV12 == vmid->m_fourcc) { - struct drm_i915_gem_set_tiling set_tiling; - - pixel_format = DRM_FORMAT_NV12; - memset(&set_tiling, 0, sizeof(set_tiling)); - set_tiling.handle = flink_open.handle; - set_tiling.tiling_mode = I915_TILING_Y; - set_tiling.stride = vmid->m_image.pitches[0]; - ret = m_drmlib.drmIoctl(m_fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); - if (ret) { - msdk_printf(MSDK_STRING("DRM_IOCTL_I915_GEM_SET_TILING Failed ret = %d\n"),ret); - return NULL; - } - - handles[1] = flink_open.handle; - pitches[1] = vmid->m_image.pitches[1]; - offsets[1] = vmid->m_image.offsets[1]; - modifiers[0] = modifiers[1] = I915_FORMAT_MOD_Y_TILED; - flags = 2; // DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] - } - else { - pixel_format = DRM_FORMAT_XRGB8888; - } - - ret = m_drmlib.drmModeAddFB2WithModifiers(m_fd, vmid->m_image.width, vmid->m_image.height, - pixel_format, handles, pitches, offsets, modifiers, &fbhandle, flags); - if (ret) return NULL; - - MSDK_ZERO_MEMORY(flink_close); - flink_close.handle = flink_open.handle; - ret = m_drmlib.drmIoctl(m_fd, DRM_IOCTL_GEM_CLOSE, &flink_close); - if (ret) return NULL; - } else { - return NULL; - } - try { - uint32_t* hdl = new uint32_t; - *hdl = fbhandle; - return hdl; - } catch(...) { - return NULL; - } -} - -void drmRenderer::release(mfxMemId mid, void * mem) -{ - uint32_t* hdl = (uint32_t*)mem; - if (!hdl) return; - if (!restore()) { - msdk_printf(MSDK_STRING("drmrender: warning: failure to restore original mode may lead to application segfault!\n")); - } - m_drmlib.drmModeRmFB(m_fd, *hdl); - delete(hdl); -} - -mfxStatus drmRenderer::render(mfxFrameSurface1 * pSurface) -{ - int ret; - vaapiMemId * memid; - uint32_t fbhandle; - - if (!pSurface || !pSurface->Data.MemId) return MFX_ERR_INVALID_HANDLE; - memid = (vaapiMemId*)(pSurface->Data.MemId); - if (!memid->m_custom) return MFX_ERR_INVALID_HANDLE; - fbhandle = *(uint32_t*)memid->m_custom; - - // rendering on the screen - if (!setMaster()) { - return MFX_ERR_UNKNOWN; - } - if ((m_mode.hdisplay == memid->m_image.width) && - (m_mode.vdisplay == memid->m_image.height)) { - // surface in the framebuffer exactly matches crtc scanout port, so we - // can scanout from this framebuffer for the whole crtc - ret = m_drmlib.drmModeSetCrtc(m_fd, m_crtcID, fbhandle, 0, 0, &m_connectorID, 1, &m_mode); - if (ret) { - return MFX_ERR_UNKNOWN; - } - } else { - if (m_overlay_wrn) { - m_overlay_wrn = false; - msdk_printf(MSDK_STRING("drmrender: warning: rendering via OVERLAY plane\n")); - } - // surface in the framebuffer exactly does NOT match crtc scanout port, - // and we can only use overlay technique with possible resize (depending on the driver)) - ret = m_drmlib.drmModeSetPlane(m_fd, m_planeID, m_crtcID, fbhandle, 0, - 0, 0, m_crtc->width, m_crtc->height, - pSurface->Info.CropX << 16, pSurface->Info.CropY << 16, pSurface->Info.CropW << 16, pSurface->Info.CropH << 16); - if (ret) { - return MFX_ERR_UNKNOWN; - } - } - dropMaster(); - - /* Unlock previous Render Target Surface (if exists) */ - if (NULL != m_pCurrentRenderTargetSurface) - msdk_atomic_dec16((volatile mfxU16*)&m_pCurrentRenderTargetSurface->Data.Locked); - - /* new Render target */ - m_pCurrentRenderTargetSurface = pSurface; - /* And lock it */ - msdk_atomic_inc16((volatile mfxU16*)&m_pCurrentRenderTargetSurface->Data.Locked); - return MFX_ERR_NONE; -} - -#endif // #if defined(LIBVA_DRM_SUPPORT) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_x11.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_x11.cpp deleted file mode 100644 index 4ec24230..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vaapi_utils_x11.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(LIBVA_X11_SUPPORT) - -#include "sample_defs.h" -#include "vaapi_utils_x11.h" - -#include -#if defined(X11_DRI3_SUPPORT) -#include -#endif - -#define VAAPI_X_DEFAULT_DISPLAY ":0.0" - -X11LibVA::X11LibVA(void) - : CLibVA(MFX_LIBVA_X11) - , m_display(0) - , m_configID(VA_INVALID_ID) - , m_contextID(VA_INVALID_ID) -{ - char* currentDisplay = getenv("DISPLAY"); - - m_display = (currentDisplay)? - m_x11lib.XOpenDisplay(currentDisplay) : - m_x11lib.XOpenDisplay(VAAPI_X_DEFAULT_DISPLAY); - - if (!m_display) - { - msdk_printf(MSDK_STRING("Failed to open X Display: try to check/set DISPLAY environment variable.\n")); - throw std::bad_alloc(); - } - - m_va_dpy = m_vax11lib.vaGetDisplay(m_display); - if (!m_va_dpy) - { - m_x11lib.XCloseDisplay(m_display); - msdk_printf(MSDK_STRING("Failed to get VA Display\n")); - throw std::bad_alloc(); - } - - int major_version = 0, minor_version = 0; - VAStatus sts = m_libva.vaInitialize(m_va_dpy, &major_version, &minor_version); - - if (VA_STATUS_SUCCESS != sts) - { - m_x11lib.XCloseDisplay(m_display); - msdk_printf(MSDK_STRING("Failed to initialize VAAPI: %d\n"), sts); - throw std::bad_alloc(); - } - -#if !defined(X11_DRI3_SUPPORT) - VAConfigAttrib cfgAttrib{}; - if (VA_STATUS_SUCCESS == sts) - { - cfgAttrib.type = VAConfigAttribRTFormat; - sts = m_libva.vaGetConfigAttributes( - m_va_dpy, - VAProfileNone, VAEntrypointVideoProc, - &cfgAttrib, 1); - } - if (VA_STATUS_SUCCESS == sts) - { - sts = m_libva.vaCreateConfig( - m_va_dpy, - VAProfileNone, VAEntrypointVideoProc, - &cfgAttrib, 1, - &m_configID); - } - if (VA_STATUS_SUCCESS == sts) - { - sts = m_libva.vaCreateContext( - m_va_dpy, - m_configID, 0, 0, VA_PROGRESSIVE, 0, 0, - &m_contextID); - } - if (VA_STATUS_SUCCESS != sts) - { - Close(); - msdk_printf(MSDK_STRING("Failed to initialize VP: %d\n"), sts); - throw std::bad_alloc(); - } -#endif // X11_DRI3_SUPPORT -} - -X11LibVA::~X11LibVA(void) -{ - Close(); -} - -void X11LibVA::Close() -{ - VAStatus sts; - - if (m_contextID != VA_INVALID_ID) - { - sts = m_libva.vaDestroyContext(m_va_dpy, m_contextID); - if (sts != VA_STATUS_SUCCESS) - msdk_printf(MSDK_STRING("Failed to destroy VA context: %d\n"), sts); - } - if (m_configID != VA_INVALID_ID) - { - sts = m_libva.vaDestroyConfig(m_va_dpy, m_configID); - if (sts != VA_STATUS_SUCCESS) - msdk_printf(MSDK_STRING("Failed to destroy VA config: %d\n"), sts); - } - sts = m_libva.vaTerminate(m_va_dpy); - if (sts != VA_STATUS_SUCCESS) - msdk_printf(MSDK_STRING("Failed to close VAAPI library: %d\n"), sts); - - m_x11lib.XCloseDisplay(m_display); -} - -#endif // #if defined(LIBVA_X11_SUPPORT) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic.cpp deleted file mode 100644 index 80a71eeb..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if defined(_WIN32) || defined(_WIN64) - -#include "vm/atomic_defs.h" - -//#define _interlockedbittestandset fake_set -//#define _interlockedbittestandreset fake_reset -//#define _interlockedbittestandset64 fake_set64 -//#define _interlockedbittestandreset64 fake_reset64 -#include -//#undef _interlockedbittestandset -//#undef _interlockedbittestandreset -//#undef _interlockedbittestandset64 -//#undef _interlockedbittestandreset64 -#pragma intrinsic (_InterlockedIncrement16) -#pragma intrinsic (_InterlockedDecrement16) -#pragma intrinsic (_InterlockedIncrement) -#pragma intrinsic (_InterlockedDecrement) - -mfxU16 msdk_atomic_inc16(volatile mfxU16 *pVariable) -{ - return _InterlockedIncrement16((volatile short*)pVariable); -} - -/* Thread-safe 16-bit variable decrementing */ -mfxU16 msdk_atomic_dec16(volatile mfxU16 *pVariable) -{ - return _InterlockedDecrement16((volatile short*)pVariable); -} - -mfxU32 msdk_atomic_inc32(volatile mfxU32 *pVariable) -{ - return _InterlockedIncrement((volatile long*)pVariable); -} - -/* Thread-safe 16-bit variable decrementing */ -mfxU32 msdk_atomic_dec32(volatile mfxU32 *pVariable) -{ - return _InterlockedDecrement((volatile long*)pVariable); -} - -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic_linux.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic_linux.cpp deleted file mode 100644 index 537619ed..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/atomic_linux.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if !defined(_WIN32) && !defined(_WIN64) - -#include "vm/atomic_defs.h" - -static mfxU16 msdk_atomic_add16(volatile mfxU16 *mem, mfxU16 val) -{ - asm volatile ("lock; xaddw %0,%1" - : "=r" (val), "=m" (*mem) - : "0" (val), "m" (*mem) - : "memory", "cc"); - return val; -} - -static mfxU32 msdk_atomic_add32(volatile mfxU32 *mem, mfxU32 val) -{ - asm volatile ("lock; xaddl %0,%1" - : "=r" (val), "=m" (*mem) - : "0" (val), "m" (*mem) - : "memory", "cc"); - return val; -} - -mfxU16 msdk_atomic_inc16(volatile mfxU16 *pVariable) -{ - return msdk_atomic_add16(pVariable, 1) + 1; -} - -/* Thread-safe 16-bit variable decrementing */ -mfxU16 msdk_atomic_dec16(volatile mfxU16 *pVariable) -{ - return msdk_atomic_add16(pVariable, (mfxU16)-1) + 1; -} - -mfxU32 msdk_atomic_inc32(volatile mfxU32 *pVariable) -{ - return msdk_atomic_add32(pVariable, 1) + 1; -} - -/* Thread-safe 16-bit variable decrementing */ -mfxU32 msdk_atomic_dec32(volatile mfxU32 *pVariable) -{ - return msdk_atomic_add32(pVariable, (mfxU32)-1) + 1; -} - -#endif // #if !defined(_WIN32) && !defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object.cpp deleted file mode 100644 index 41c299c8..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include "vm/so_defs.h" - -#include - -msdk_so_handle msdk_so_load(const msdk_char *file_name) -{ - if (!file_name) return NULL; - return (msdk_so_handle) LoadLibrary((LPCTSTR)file_name); -} - -msdk_func_pointer msdk_so_get_addr(msdk_so_handle handle, const char *func_name) -{ - if (!handle) return NULL; - return (msdk_func_pointer)GetProcAddress((HMODULE)handle, /*(LPCSTR)*/func_name); -} - -void msdk_so_free(msdk_so_handle handle) -{ - if (!handle) return; - FreeLibrary((HMODULE)handle); -} - -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object_linux.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object_linux.cpp deleted file mode 100644 index ae39889f..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/shared_object_linux.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if !defined(_WIN32) && !defined(_WIN64) - -#include "vm/so_defs.h" -#include - -msdk_so_handle msdk_so_load(const msdk_char *file_name) -{ - if (!file_name) return NULL; - return (msdk_so_handle) dlopen(file_name, RTLD_LAZY); -} - -msdk_func_pointer msdk_so_get_addr(msdk_so_handle handle, const char *func_name) -{ - if (!handle) return NULL; - return (msdk_func_pointer)dlsym(handle, func_name); -} - -void msdk_so_free(msdk_so_handle handle) -{ - if (!handle) return; - dlclose(handle); -} - -#endif // #if !defined(_WIN32) && !defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_linux.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_linux.cpp deleted file mode 100644 index 870462bc..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_linux.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if !defined(_WIN32) && !defined(_WIN64) - -#include // std::bad_alloc -#include // setrlimit -#include -#include -#include - -#include "vm/thread_defs.h" -#include "sample_utils.h" - -/* ****************************************************************************** */ - -MSDKSemaphore::MSDKSemaphore(mfxStatus &sts, mfxU32 count): - msdkSemaphoreHandle(count) -{ - sts = MFX_ERR_NONE; - int res = pthread_cond_init(&m_semaphore, NULL); - if (!res) { - res = pthread_mutex_init(&m_mutex, NULL); - if (res) { - pthread_cond_destroy(&m_semaphore); - } - } - if (res) throw std::bad_alloc(); -} - -MSDKSemaphore::~MSDKSemaphore(void) -{ - pthread_mutex_destroy(&m_mutex); - pthread_cond_destroy(&m_semaphore); -} - -mfxStatus MSDKSemaphore::Post(void) -{ - int res = pthread_mutex_lock(&m_mutex); - if (!res) { - if (0 == m_count++) res = pthread_cond_signal(&m_semaphore); - } - int sts = pthread_mutex_unlock(&m_mutex); - if (!res) res = sts; - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -mfxStatus MSDKSemaphore::Wait(void) -{ - int res = pthread_mutex_lock(&m_mutex); - if (!res) { - while(!m_count) { - res = pthread_cond_wait(&m_semaphore, &m_mutex); - } - if (!res) --m_count; - int sts = pthread_mutex_unlock(&m_mutex); - if (!res) res = sts; - } - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -/* ****************************************************************************** */ - -MSDKEvent::MSDKEvent(mfxStatus &sts, bool manual, bool state): - msdkEventHandle(manual, state) -{ - sts = MFX_ERR_NONE; - - int res = pthread_cond_init(&m_event, NULL); - if (!res) { - res = pthread_mutex_init(&m_mutex, NULL); - if (res) { - pthread_cond_destroy(&m_event); - } - } - if (res) throw std::bad_alloc(); -} - -MSDKEvent::~MSDKEvent(void) -{ - pthread_mutex_destroy(&m_mutex); - pthread_cond_destroy(&m_event); -} - -mfxStatus MSDKEvent::Signal(void) -{ - int res = pthread_mutex_lock(&m_mutex); - if (!res) { - if (!m_state) { - m_state = true; - if (m_manual) res = pthread_cond_broadcast(&m_event); - else res = pthread_cond_signal(&m_event); - } - int sts = pthread_mutex_unlock(&m_mutex); - if (!res) res = sts; - } - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::Reset(void) -{ - int res = pthread_mutex_lock(&m_mutex); - if (!res) - { - if (m_state) m_state = false; - res = pthread_mutex_unlock(&m_mutex); - } - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::Wait(void) -{ - int res = pthread_mutex_lock(&m_mutex); - if (!res) - { - while(!m_state) res = pthread_cond_wait(&m_event, &m_mutex); - if (!m_manual) m_state = false; - int sts = pthread_mutex_unlock(&m_mutex); - if (!res) res = sts; - } - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::TimedWait(mfxU32 msec) -{ - if (MFX_INFINITE == msec) return MFX_ERR_UNSUPPORTED; - mfxStatus mfx_res = MFX_ERR_NOT_INITIALIZED; - - int res = pthread_mutex_lock(&m_mutex); - if (!res) - { - if (!m_state) - { - struct timeval tval; - struct timespec tspec; - mfxI32 res; - - gettimeofday(&tval, NULL); - msec = 1000 * msec + tval.tv_usec; - tspec.tv_sec = tval.tv_sec + msec / 1000000; - tspec.tv_nsec = (msec % 1000000) * 1000; - res = pthread_cond_timedwait(&m_event, - &m_mutex, - &tspec); - if (!res) mfx_res = MFX_ERR_NONE; - else if (ETIMEDOUT == res) mfx_res = MFX_TASK_WORKING; - else mfx_res = MFX_ERR_UNKNOWN; - } - else mfx_res = MFX_ERR_NONE; - if (!m_manual) - m_state = false; - - res = pthread_mutex_unlock(&m_mutex); - if (res) mfx_res = MFX_ERR_UNKNOWN; - } - else mfx_res = MFX_ERR_UNKNOWN; - - return mfx_res; -} - -/* ****************************************************************************** */ - -void* msdk_thread_start(void* arg) -{ - if (arg) { - MSDKThread* thread = (MSDKThread*)arg; - - if (thread->m_func) thread->m_func(thread->m_arg); - thread->m_event->Signal(); - } - return NULL; -} - -/* ****************************************************************************** */ - -MSDKThread::MSDKThread(mfxStatus &sts, msdk_thread_callback func, void* arg): - msdkThreadHandle(func, arg) -{ - m_event = new MSDKEvent(sts, false, false); - if (pthread_create(&(m_thread), NULL, msdk_thread_start, this)) { - delete(m_event); - throw std::bad_alloc(); - } -} - -MSDKThread::~MSDKThread(void) -{ - delete m_event; -} - -mfxStatus MSDKThread::Wait(void) -{ - int res = pthread_join(m_thread, NULL); - return (res)? MFX_ERR_UNKNOWN: MFX_ERR_NONE; -} - -mfxStatus MSDKThread::TimedWait(mfxU32 msec) -{ - if (MFX_INFINITE == msec) return MFX_ERR_UNSUPPORTED; - - mfxStatus mfx_res = m_event->TimedWait(msec); - - if (MFX_ERR_NONE == mfx_res) { - return (pthread_join(m_thread, NULL))? MFX_ERR_UNKNOWN: MFX_ERR_NONE; - } - return mfx_res; -} - -mfxStatus MSDKThread::GetExitCode() -{ - if (!m_event) return MFX_ERR_NOT_INITIALIZED; - - /** @todo: Need to add implementation. */ - return MFX_ERR_NONE; -} - -/* ****************************************************************************** */ - -mfxStatus msdk_setrlimit_vmem(mfxU64 size) -{ - struct rlimit limit; - - limit.rlim_cur = size; - limit.rlim_max = size; - if (setrlimit(RLIMIT_AS, &limit)) return MFX_ERR_UNKNOWN; - return MFX_ERR_NONE; -} - -mfxStatus msdk_thread_get_schedtype(const msdk_char* str, mfxI32 &type) -{ - if (!msdk_strcmp(str, MSDK_STRING("fifo"))) { - type = SCHED_FIFO; - } - else if (!msdk_strcmp(str, MSDK_STRING("rr"))) { - type = SCHED_RR; - } - else if (!msdk_strcmp(str, MSDK_STRING("other"))) { - type = SCHED_OTHER; - } - else if (!msdk_strcmp(str, MSDK_STRING("batch"))) { - type = SCHED_BATCH; - } - else if (!msdk_strcmp(str, MSDK_STRING("idle"))) { - type = SCHED_IDLE; - } -// else if (!msdk_strcmp(str, MSDK_STRING("deadline"))) { -// type = SCHED_DEADLINE; -// } - else { - return MFX_ERR_UNSUPPORTED; - } - return MFX_ERR_NONE; -} - -void msdk_thread_printf_scheduling_help() -{ - msdk_printf(MSDK_STRING("Note on the scheduling types and priorities:\n")); - msdk_printf(MSDK_STRING(" - : .. (notes)\n")); - msdk_printf(MSDK_STRING("The following scheduling types requires root privileges:\n")); - msdk_printf(MSDK_STRING(" - fifo: %d .. %d (static priority: low .. high)\n"), sched_get_priority_min(SCHED_FIFO), sched_get_priority_max(SCHED_FIFO)); - msdk_printf(MSDK_STRING(" - rr: %d .. %d (static priority: low .. high)\n"), sched_get_priority_min(SCHED_RR), sched_get_priority_max(SCHED_RR)); - msdk_printf(MSDK_STRING("The following scheduling types can be used by non-privileged users:\n")); - msdk_printf(MSDK_STRING(" - other: 0 .. 0 (static priority always 0)\n")); - msdk_printf(MSDK_STRING(" - batch: 0 .. 0 (static priority always 0)\n")); - msdk_printf(MSDK_STRING(" - idle: n/a\n")); - msdk_printf(MSDK_STRING("If you want to adjust priority for the other or batch scheduling type,\n")); - msdk_printf(MSDK_STRING("you can do that process-wise using dynamic priority - so called nice value.\n")); - msdk_printf(MSDK_STRING("Range for the nice value is: %d .. %d (high .. low)\n"), PRIO_MIN, PRIO_MAX); - msdk_printf(MSDK_STRING("Please, see 'man(1) nice' for details.\n")); -} - -mfxU32 msdk_get_current_pid() -{ - return syscall(SYS_getpid); -} - -#endif // #if !defined(_WIN32) && !defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_windows.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_windows.cpp deleted file mode 100644 index 7abd454c..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/thread_windows.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include "vm/thread_defs.h" -#include - -MSDKSemaphore::MSDKSemaphore(mfxStatus &sts, mfxU32 count) -{ - sts = MFX_ERR_NONE; - m_semaphore = CreateSemaphore(NULL, count, LONG_MAX, 0); - if (!m_semaphore) throw std::bad_alloc(); -} - -MSDKSemaphore::~MSDKSemaphore(void) -{ - CloseHandle(m_semaphore); -} - -mfxStatus MSDKSemaphore::Post(void) -{ - return (ReleaseSemaphore(m_semaphore, 1, NULL) == false) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -mfxStatus MSDKSemaphore::Wait(void) -{ - return (WaitForSingleObject(m_semaphore, INFINITE) != WAIT_OBJECT_0) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -/* ****************************************************************************** */ - -MSDKEvent::MSDKEvent(mfxStatus &sts, bool manual, bool state) -{ - sts = MFX_ERR_NONE; - m_event = CreateEvent(NULL, manual, state, NULL); - if (!m_event) throw std::bad_alloc(); -} - -MSDKEvent::~MSDKEvent(void) -{ - CloseHandle(m_event); -} - -mfxStatus MSDKEvent::Signal(void) -{ - return (SetEvent(m_event) == false) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::Reset(void) -{ - return (ResetEvent(m_event) == false) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::Wait(void) -{ - return (WaitForSingleObject(m_event, INFINITE) != WAIT_OBJECT_0) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -mfxStatus MSDKEvent::TimedWait(mfxU32 msec) -{ - if(MFX_INFINITE == msec) return MFX_ERR_UNSUPPORTED; - mfxStatus mfx_res = MFX_ERR_NOT_INITIALIZED; - DWORD res = WaitForSingleObject(m_event, msec); - - if(WAIT_OBJECT_0 == res) mfx_res = MFX_ERR_NONE; - else if (WAIT_TIMEOUT == res) mfx_res = MFX_TASK_WORKING; - else mfx_res = MFX_ERR_UNKNOWN; - - return mfx_res; -} - -MSDKThread::MSDKThread(mfxStatus &sts, msdk_thread_callback func, void* arg) -{ - sts = MFX_ERR_NONE; - m_thread = (void*)_beginthreadex(NULL, 0, func, arg, 0, NULL); - if (!m_thread) throw std::bad_alloc(); -} - -MSDKThread::~MSDKThread(void) -{ - CloseHandle(m_thread); -} - -mfxStatus MSDKThread::Wait(void) -{ - return (WaitForSingleObject(m_thread, INFINITE) != WAIT_OBJECT_0) ? MFX_ERR_UNKNOWN : MFX_ERR_NONE; -} - -mfxStatus MSDKThread::TimedWait(mfxU32 msec) -{ - if(MFX_INFINITE == msec) return MFX_ERR_UNSUPPORTED; - - mfxStatus mfx_res = MFX_ERR_NONE; - DWORD res = WaitForSingleObject(m_thread, msec); - - if(WAIT_OBJECT_0 == res) mfx_res = MFX_ERR_NONE; - else if (WAIT_TIMEOUT == res) mfx_res = MFX_TASK_WORKING; - else mfx_res = MFX_ERR_UNKNOWN; - - return mfx_res; -} - -mfxStatus MSDKThread::GetExitCode() -{ - mfxStatus mfx_res = MFX_ERR_NOT_INITIALIZED; - - DWORD code = 0; - int sts = 0; - sts = GetExitCodeThread(m_thread, &code); - - if (sts == 0) mfx_res = MFX_ERR_UNKNOWN; - else if (STILL_ACTIVE == code) mfx_res = MFX_TASK_WORKING; - else mfx_res = MFX_ERR_NONE; - - return mfx_res; -} - -mfxU32 msdk_get_current_pid() -{ - return GetCurrentProcessId(); -} - -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time.cpp deleted file mode 100644 index 9d6e01de..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#if defined(_WIN32) || defined(_WIN64) - -#include "vm/time_defs.h" - -msdk_tick msdk_time_get_tick(void) -{ - LARGE_INTEGER t1; - - QueryPerformanceCounter(&t1); - return t1.QuadPart; -} - -msdk_tick msdk_time_get_frequency(void) -{ - LARGE_INTEGER t1; - - QueryPerformanceFrequency(&t1); - return t1.QuadPart; -} - -mfxU64 rdtsc(){ - return __rdtsc(); -} - -#endif // #if defined(_WIN32) || defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time_linux.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time_linux.cpp deleted file mode 100644 index 17cec56c..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vm/time_linux.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#if !defined(_WIN32) && !defined(_WIN64) - -#include "vm/time_defs.h" -#include - -#define MSDK_TIME_MHZ 1000000 - -msdk_tick msdk_time_get_tick(void) -{ - struct timeval tv; - - gettimeofday(&tv, NULL); - return (msdk_tick)tv.tv_sec * (msdk_tick)MSDK_TIME_MHZ + (msdk_tick)tv.tv_usec; -} - -msdk_tick msdk_time_get_frequency(void) -{ - return (msdk_tick)MSDK_TIME_MHZ; -} - -mfxU64 rdtsc(void){ - unsigned int lo,hi; - __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); - return ((mfxU64)hi << 32) | lo; -} - - -#endif // #if !defined(_WIN32) && !defined(_WIN64) diff --git a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vpp_ex.cpp b/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vpp_ex.cpp deleted file mode 100644 index 3f81af58..00000000 --- a/libs/hwcodec/externals/MediaSDK_22.5.4/samples/sample_common/src/vpp_ex.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/******************************************************************************\ -Copyright (c) 2005-2019, Intel Corporation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This sample was distributed or derived from the Intel's Media Samples package. -The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio -or https://software.intel.com/en-us/media-client-solutions-support. -\**********************************************************************************/ - -#include "mfx_samples_config.h" - -#include "sample_defs.h" - -#include "vpp_ex.h" -#include "vm/atomic_defs.h" - - -MFXVideoVPPEx::MFXVideoVPPEx(mfxSession session) : -MFXVideoVPP(session) -#if !defined (USE_VPP_EX) -{}; -#else -, m_nCurrentPTS(0) -, m_nIncreaseTime(0) -, m_nInputTimeStamp(0) -, m_nArraySize(0) -{ - memset(&m_VideoParams, 0, sizeof(m_VideoParams)); -}; - -mfxStatus MFXVideoVPPEx::Close(void) -{ - for(std::vector::iterator it = m_LockedSurfacesList.begin(); it != m_LockedSurfacesList.end(); ++it) - { - try { - msdk_atomic_dec16((volatile mfxU16*)(&(*it)->Data.Locked)); - } catch (...) { // improve robustness by try/catch - } - } - - m_LockedSurfacesList.clear(); - - return MFXVideoVPP::Close(); -}; - -mfxStatus MFXVideoVPPEx::QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]) -{ - mfxVideoParam params; - - if (NULL == par) - { - return MFX_ERR_NULL_PTR; - }; - - MSDK_MEMCPY_VAR(params, par, sizeof(mfxVideoParam)); - - params.vpp.In.FrameRateExtD = params.vpp.Out.FrameRateExtD; - params.vpp.In.FrameRateExtN = params.vpp.Out.FrameRateExtN; - - return MFXVideoVPP::QueryIOSurf(¶ms, request); -}; - -mfxStatus MFXVideoVPPEx::Query(mfxVideoParam *in, mfxVideoParam *out) -{ - mfxVideoParam params; - - if (NULL == out) - { - return MFX_ERR_NULL_PTR; - } - - if (in) - { - MSDK_MEMCPY_VAR(params, in, sizeof(mfxVideoParam)); - - params.vpp.In.FrameRateExtD = params.vpp.Out.FrameRateExtD; - params.vpp.In.FrameRateExtN = params.vpp.Out.FrameRateExtN; - } - - return MFXVideoVPP::Query((in) ? ¶ms : NULL, out); -}; - -mfxStatus MFXVideoVPPEx::Init(mfxVideoParam *par) -{ - mfxStatus sts = MFX_ERR_NONE; - - if (NULL == par) - { - return MFX_ERR_NULL_PTR; - }; - - m_nCurrentPTS = 0; - m_nArraySize = 0; - m_nInputTimeStamp = 0; - - for(std::vector::iterator it = m_LockedSurfacesList.begin(); it != m_LockedSurfacesList.end(); ++it) - { - msdk_atomic_dec16((volatile mfxU16*)(&(*it)->Data.Locked)); - } - - m_LockedSurfacesList.clear(); - - m_nIncreaseTime = (mfxU64)((mfxF64)MFX_TIME_STAMP_FREQUENCY * par->vpp.Out.FrameRateExtD / par->vpp.Out.FrameRateExtN); - - MSDK_MEMCPY_VAR(m_VideoParams, par, sizeof(mfxVideoParam)); - - m_VideoParams.vpp.In.FrameRateExtD = m_VideoParams.vpp.Out.FrameRateExtD; - m_VideoParams.vpp.In.FrameRateExtN = m_VideoParams.vpp.Out.FrameRateExtN; - - sts = MFXVideoVPP::Init(&m_VideoParams); - - m_VideoParams.vpp.In.FrameRateExtD = par->vpp.In.FrameRateExtD; - m_VideoParams.vpp.In.FrameRateExtN = par->vpp.In.FrameRateExtN; - - return sts; -} - -mfxStatus MFXVideoVPPEx::GetVideoParam(mfxVideoParam *par) -{ - mfxStatus sts = MFXVideoVPP::GetVideoParam(par); - - if (MFX_ERR_NONE == sts) - { - par->vpp.In.FrameRateExtD = m_VideoParams.vpp.In.FrameRateExtD; - par->vpp.In.FrameRateExtN = m_VideoParams.vpp.In.FrameRateExtN; - - par->vpp.Out.FrameRateExtD = m_VideoParams.vpp.Out.FrameRateExtD; - par->vpp.Out.FrameRateExtN = m_VideoParams.vpp.Out.FrameRateExtN; - }; - - return sts; -}; - -mfxStatus MFXVideoVPPEx::RunFrameVPPAsync(mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp) -{ - mfxStatus sts = MFX_ERR_NONE; - - if (NULL == out || NULL == syncp) - { - return MFX_ERR_NULL_PTR; - }; - - if (!in) - { - if (!m_LockedSurfacesList.empty()) - { - // subtract 1 to handle minimal difference between input and expected timestamps - if (m_nCurrentPTS - 1 <= m_LockedSurfacesList[0]->Data.TimeStamp) - { - mfxU64 nPTS = m_LockedSurfacesList[0]->Data.TimeStamp; - m_LockedSurfacesList[0]->Data.TimeStamp = m_nCurrentPTS; - - sts = MFXVideoVPP::RunFrameVPPAsync(m_LockedSurfacesList[0], out, aux, syncp); - - m_LockedSurfacesList[0]->Data.TimeStamp = nPTS; - - if (MFX_WRN_DEVICE_BUSY != sts) - { - m_nCurrentPTS += m_nIncreaseTime; - } - } - else - { - for(std::vector::iterator it = m_LockedSurfacesList.begin(); it != m_LockedSurfacesList.end(); ++it) - { - msdk_atomic_dec16((volatile mfxU16*)(&(*it)->Data.Locked)); - } - - m_LockedSurfacesList.clear(); - - return MFXVideoVPP::RunFrameVPPAsync(in, out, aux, syncp); - } - } - else - { - return MFXVideoVPP::RunFrameVPPAsync(in, out, aux, syncp); - } - } - else - { - m_nArraySize = m_LockedSurfacesList.size(); - - if (!m_nArraySize) - { - m_nCurrentPTS = (mfxU64)in->Data.TimeStamp; - - msdk_atomic_inc16((volatile mfxU16*)&in->Data.Locked); - m_LockedSurfacesList.push_back(in); - - return MFX_ERR_MORE_DATA; - } - - if (1 == m_nArraySize) - { - if (in->Data.TimeStamp < m_nCurrentPTS) - { - return MFX_ERR_MORE_DATA; - } - - if (in->Data.TimeStamp > m_LockedSurfacesList[0]->Data.TimeStamp && (in->Data.TimeStamp < m_nCurrentPTS + m_nIncreaseTime/2)) - { - return MFX_ERR_MORE_DATA; - } - } - - { - mfxStatus stsRunFrame = MFX_ERR_NONE; - - m_nInputTimeStamp = m_LockedSurfacesList[0]->Data.TimeStamp; - - if (m_nCurrentPTS <= m_LockedSurfacesList[0]->Data.TimeStamp || - m_nCurrentPTS < (in->Data.TimeStamp - (mfxF64)m_nIncreaseTime/2)) - { - m_nInputTimeStamp = m_LockedSurfacesList[0]->Data.TimeStamp; - m_LockedSurfacesList[0]->Data.TimeStamp = m_nCurrentPTS; - - stsRunFrame = sts = MFXVideoVPP::RunFrameVPPAsync(m_LockedSurfacesList[0], out, aux, syncp); - - m_LockedSurfacesList[0]->Data.TimeStamp = m_nInputTimeStamp; - - if (MFX_WRN_DEVICE_BUSY != stsRunFrame) - { - m_nCurrentPTS += m_nIncreaseTime; - } - - if (MFX_ERR_NONE == stsRunFrame) - { - sts = MFX_ERR_MORE_SURFACE; - } - } - - if (MFX_WRN_DEVICE_BUSY != stsRunFrame) - { - if (1 == m_nArraySize) - { - msdk_atomic_inc16((volatile mfxU16*)&in->Data.Locked); - m_LockedSurfacesList.push_back(in); - } - - if (m_nCurrentPTS > m_LockedSurfacesList[0]->Data.TimeStamp && - m_nCurrentPTS >= (m_LockedSurfacesList[1]->Data.TimeStamp - (mfxF64)m_nIncreaseTime/2)) - { - msdk_atomic_dec16((volatile mfxU16*)&m_LockedSurfacesList[0]->Data.Locked); - m_LockedSurfacesList.erase(m_LockedSurfacesList.begin()); - - if (MFX_ERR_NONE == stsRunFrame) - { - if (stsRunFrame != sts) - { - sts = MFX_ERR_NONE; - } - else - { - sts = MFX_ERR_MORE_DATA; - } - } - } - } - } - } - - return sts; -}; - -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL.h b/libs/hwcodec/externals/SDL/include/SDL.h deleted file mode 100644 index 9ba8f68c..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL.h - * - * Main include header for the SDL library - */ - - -#ifndef SDL_h_ -#define SDL_h_ - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_assert.h" -#include "SDL_atomic.h" -#include "SDL_audio.h" -#include "SDL_clipboard.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_filesystem.h" -#include "SDL_gamecontroller.h" -#include "SDL_guid.h" -#include "SDL_haptic.h" -#include "SDL_hidapi.h" -#include "SDL_hints.h" -#include "SDL_joystick.h" -#include "SDL_loadso.h" -#include "SDL_log.h" -#include "SDL_messagebox.h" -#include "SDL_metal.h" -#include "SDL_mutex.h" -#include "SDL_power.h" -#include "SDL_render.h" -#include "SDL_rwops.h" -#include "SDL_sensor.h" -#include "SDL_shape.h" -#include "SDL_system.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_version.h" -#include "SDL_video.h" -#include "SDL_locale.h" -#include "SDL_misc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* As of version 0.5, SDL is loaded dynamically into the application */ - -/** - * \name SDL_INIT_* - * - * These are the flags which may be passed to SDL_Init(). You should - * specify the subsystems which you will be using in your application. - */ -/* @{ */ -#define SDL_INIT_TIMER 0x00000001u -#define SDL_INIT_AUDIO 0x00000010u -#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ -#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ -#define SDL_INIT_HAPTIC 0x00001000u -#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ -#define SDL_INIT_EVENTS 0x00004000u -#define SDL_INIT_SENSOR 0x00008000u -#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ -#define SDL_INIT_EVERYTHING ( \ - SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ - SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ - ) -/* @} */ - -/** - * Initialize the SDL library. - * - * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the - * two may be used interchangeably. Though for readability of your code - * SDL_InitSubSystem() might be preferred. - * - * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread) - * subsystems are initialized by default. Message boxes - * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the - * video subsystem, in hopes of being useful in showing an error dialog when - * SDL_Init fails. You must specifically initialize other subsystems if you - * use them in your application. - * - * Logging (such as SDL_Log) works without initialization, too. - * - * `flags` may be any of the following OR'd together: - * - * - `SDL_INIT_TIMER`: timer subsystem - * - `SDL_INIT_AUDIO`: audio subsystem - * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events - * subsystem - * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the - * events subsystem - * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem - * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically - * initializes the joystick subsystem - * - `SDL_INIT_EVENTS`: events subsystem - * - `SDL_INIT_EVERYTHING`: all of the above subsystems - * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored - * - * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem() - * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or - * call SDL_Quit() to force shutdown). If a subsystem is already loaded then - * this call will increase the ref-count and return. - * - * \param flags subsystem initialization flags - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_InitSubSystem - * \sa SDL_Quit - * \sa SDL_SetMainReady - * \sa SDL_WasInit - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/** - * Compatibility function to initialize the SDL library. - * - * In SDL2, this function and SDL_Init() are interchangeable. - * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Init - * \sa SDL_Quit - * \sa SDL_QuitSubSystem - */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/** - * Shut down specific SDL subsystems. - * - * If you start a subsystem using a call to that subsystem's init function - * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), - * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use - * that subsystem's quit function (SDL_VideoQuit()) directly instead. But - * generally, you should not be using those functions directly anyhow; use - * SDL_Init() instead. - * - * You still need to call SDL_Quit() even if you close all open subsystems - * with SDL_QuitSubSystem(). - * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_InitSubSystem - * \sa SDL_Quit - */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/** - * Get a mask of the specified subsystems which are currently initialized. - * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it - * returns the initialization status of the specified subsystems. - * - * The return value does not include SDL_INIT_NOPARACHUTE. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Init - * \sa SDL_InitSubSystem - */ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/** - * Clean up all initialized subsystems. - * - * You should call this function even if you have already shutdown each - * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this - * function even in the case of errors in initialization. - * - * If you start a subsystem using a call to that subsystem's init function - * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), - * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut - * it down before calling SDL_Quit(). But generally, you should not be using - * those functions directly anyhow; use SDL_Init() instead. - * - * You can use this function with atexit() to ensure that it is run when your - * application is shutdown, but it is not wise to do this from a library or - * other dynamically loaded code. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Init - * \sa SDL_QuitSubSystem - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_assert.h b/libs/hwcodec/externals/SDL/include/SDL_assert.h deleted file mode 100644 index 87d5c1bd..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_assert.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_assert_h_ -#define SDL_assert_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef SDL_ASSERT_LEVEL -#ifdef SDL_DEFAULT_ASSERT_LEVEL -#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL -#elif defined(_DEBUG) || defined(DEBUG) || \ - (defined(__GNUC__) && !defined(__OPTIMIZE__)) -#define SDL_ASSERT_LEVEL 2 -#else -#define SDL_ASSERT_LEVEL 1 -#endif -#endif /* SDL_ASSERT_LEVEL */ - -/* -These are macros and not first class functions so that the debugger breaks -on the assertion line and not in some random guts of SDL, and so each -assert can have unique static variables associated with it. -*/ - -#if defined(_MSC_VER) -/* Don't include intrin.h here because it contains C++ code */ - extern void __cdecl __debugbreak(void); - #define SDL_TriggerBreakpoint() __debugbreak() -#elif _SDL_HAS_BUILTIN(__builtin_debugtrap) - #define SDL_TriggerBreakpoint() __builtin_debugtrap() -#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) -#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */ - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) -#elif defined(__APPLE__) && defined(__arm__) - #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" ) -#elif defined(__386__) && defined(__WATCOMC__) - #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } -#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) - #include - #define SDL_TriggerBreakpoint() raise(SIGTRAP) -#else - /* How do we trigger breakpoints on this platform? */ - #define SDL_TriggerBreakpoint() -#endif - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ -# define SDL_FUNCTION __func__ -#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__)) -# define SDL_FUNCTION __FUNCTION__ -#else -# define SDL_FUNCTION "???" -#endif -#define SDL_FILE __FILE__ -#define SDL_LINE __LINE__ - -/* -sizeof (x) makes the compiler still parse the expression even without -assertions enabled, so the code is always checked at compile time, but -doesn't actually generate code for it, so there are no side effects or -expensive checks at run time, just the constant size of what x WOULD be, -which presumably gets optimized out as unused. -This also solves the problem of... - - int somevalue = blah(); - SDL_assert(somevalue == 1); - -...which would cause compiles to complain that somevalue is unused if we -disable assertions. -*/ - -/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking - this condition isn't constant. And looks like an owl's face! */ -#ifdef _MSC_VER /* stupid /W4 warnings. */ -#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) -#else -#define SDL_NULL_WHILE_LOOP_CONDITION (0) -#endif - -#define SDL_disabled_assert(condition) \ - do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) - -typedef enum -{ - SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ - SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ - SDL_ASSERTION_ABORT, /**< Terminate the program. */ - SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ - SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ -} SDL_AssertState; - -typedef struct SDL_AssertData -{ - int always_ignore; - unsigned int trigger_count; - const char *condition; - const char *filename; - int linenum; - const char *function; - const struct SDL_AssertData *next; -} SDL_AssertData; - -/* Never call this directly. Use the SDL_assert* macros. */ -extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, - const char *, - const char *, int) -#if defined(__clang__) -#if __has_feature(attribute_analyzer_noreturn) -/* this tells Clang's static analysis that we're a custom assert function, - and that the analyzer should assume the condition was always true past this - SDL_assert test. */ - __attribute__((analyzer_noreturn)) -#endif -#endif -; - -/* the do {} while(0) avoids dangling else problems: - if (x) SDL_assert(y); else blah(); - ... without the do/while, the "else" could attach to this macro's "if". - We try to handle just the minimum we need here in a macro...the loop, - the static vars, and break points. The heavy lifting is handled in - SDL_ReportAssertion(), in SDL_assert.c. -*/ -#define SDL_enabled_assert(condition) \ - do { \ - while ( !(condition) ) { \ - static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \ - const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ - if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ - continue; /* go again. */ \ - } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ - SDL_TriggerBreakpoint(); \ - } \ - break; /* not retrying. */ \ - } \ - } while (SDL_NULL_WHILE_LOOP_CONDITION) - -/* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_disabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ -# define SDL_assert(condition) SDL_disabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ -# define SDL_assert(condition) SDL_enabled_assert(condition) -# define SDL_assert_release(condition) SDL_enabled_assert(condition) -# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) -#else -# error Unknown assertion level. -#endif - -/* this assertion is never disabled at any level. */ -#define SDL_assert_always(condition) SDL_enabled_assert(condition) - - -/** - * A callback that fires when an SDL assertion fails. - * - * \param data a pointer to the SDL_AssertData structure corresponding to the - * current assertion - * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler() - * \returns an SDL_AssertState value indicating how to handle the failure. - */ -typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( - const SDL_AssertData* data, void* userdata); - -/** - * Set an application-defined assertion handler. - * - * This function allows an application to show its own assertion UI and/or - * force the response to an assertion failure. If the application doesn't - * provide this, SDL will try to do the right thing, popping up a - * system-specific GUI dialog, and probably minimizing any fullscreen windows. - * - * This callback may fire from any thread, but it runs wrapped in a mutex, so - * it will only fire from one thread at a time. - * - * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! - * - * \param handler the SDL_AssertionHandler function to call when an assertion - * fails or NULL for the default handler - * \param userdata a pointer that is passed to `handler` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAssertionHandler - */ -extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( - SDL_AssertionHandler handler, - void *userdata); - -/** - * Get the default assertion handler. - * - * This returns the function pointer that is called by default when an - * assertion is triggered. This is an internal function provided by SDL, that - * is used for assertions when SDL_SetAssertionHandler() hasn't been used to - * provide a different function. - * - * \returns the default SDL_AssertionHandler that is called when an assert - * triggers. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_GetAssertionHandler - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); - -/** - * Get the current assertion handler. - * - * This returns the function pointer that is called when an assertion is - * triggered. This is either the value last passed to - * SDL_SetAssertionHandler(), or if no application-specified function is set, - * is equivalent to calling SDL_GetDefaultAssertionHandler(). - * - * The parameter `puserdata` is a pointer to a void*, which will store the - * "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value - * will always be NULL for the default handler. If you don't care about this - * data, it is safe to pass a NULL pointer to this function to ignore it. - * - * \param puserdata pointer which is filled with the "userdata" pointer that - * was passed to SDL_SetAssertionHandler() - * \returns the SDL_AssertionHandler that is called when an assert triggers. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_SetAssertionHandler - */ -extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); - -/** - * Get a list of all assertion failures. - * - * This function gets all assertions triggered since the last call to - * SDL_ResetAssertionReport(), or the start of the program. - * - * The proper way to examine this data looks something like this: - * - * ```c - * const SDL_AssertData *item = SDL_GetAssertionReport(); - * while (item) { - * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n", - * item->condition, item->function, item->filename, - * item->linenum, item->trigger_count, - * item->always_ignore ? "yes" : "no"); - * item = item->next; - * } - * ``` - * - * \returns a list of all failed assertions or NULL if the list is empty. This - * memory should not be modified or freed by the application. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ResetAssertionReport - */ -extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); - -/** - * Clear the list of all assertion failures. - * - * This function will clear the list of all assertions triggered up to that - * point. Immediately following this call, SDL_GetAssertionReport will return - * no items. In addition, any previously-triggered assertions will be reset to - * a trigger_count of zero, and their always_ignore state will be false. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAssertionReport - */ -extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); - - -/* these had wrong naming conventions until 2.0.4. Please update your app! */ -#define SDL_assert_state SDL_AssertState -#define SDL_assert_data SDL_AssertData - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_assert_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_atomic.h b/libs/hwcodec/externals/SDL/include/SDL_atomic.h deleted file mode 100644 index 22ea0191..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_atomic.h +++ /dev/null @@ -1,415 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_atomic.h - * - * Atomic operations. - * - * IMPORTANT: - * If you are not an expert in concurrent lockless programming, you should - * only be using the atomic lock and reference counting functions in this - * file. In all other cases you should be protecting your data structures - * with full mutexes. - * - * The list of "safe" functions to use are: - * SDL_AtomicLock() - * SDL_AtomicUnlock() - * SDL_AtomicIncRef() - * SDL_AtomicDecRef() - * - * Seriously, here be dragons! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * You can find out a little more about lockless programming and the - * subtle issues that can arise here: - * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx - * - * There's also lots of good information here: - * http://www.1024cores.net/home/lock-free-algorithms - * http://preshing.com/ - * - * These operations may or may not actually be implemented using - * processor specific atomic operations. When possible they are - * implemented as true processor specific atomic operations. When that - * is not possible the are implemented using locks that *do* use the - * available atomic operations. - * - * All of the atomic operations that modify memory are full memory barriers. - */ - -#ifndef SDL_atomic_h_ -#define SDL_atomic_h_ - -#include "SDL_stdinc.h" -#include "SDL_platform.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SDL AtomicLock - * - * The atomic locks are efficient spinlocks using CPU instructions, - * but are vulnerable to starvation and can spin forever if a thread - * holding a lock has been terminated. For this reason you should - * minimize the code executed inside an atomic lock and never do - * expensive things like API or system calls while holding them. - * - * The atomic locks are not safe to lock recursively. - * - * Porting Note: - * The spin lock functions and type are required and can not be - * emulated because they are used in the atomic emulation code. - */ -/* @{ */ - -typedef int SDL_SpinLock; - -/** - * Try to lock a spin lock by setting it to a non-zero value. - * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** - * - * \param lock a pointer to a lock variable - * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already - * held. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicLock - * \sa SDL_AtomicUnlock - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); - -/** - * Lock a spin lock by setting it to a non-zero value. - * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** - * - * \param lock a pointer to a lock variable - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicTryLock - * \sa SDL_AtomicUnlock - */ -extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); - -/** - * Unlock a spin lock by setting it to 0. - * - * Always returns immediately. - * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** - * - * \param lock a pointer to a lock variable - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicLock - * \sa SDL_AtomicTryLock - */ -extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); - -/* @} *//* SDL AtomicLock */ - - -/** - * The compiler barrier prevents the compiler from reordering - * reads and writes to globally visible variables across the call. - */ -#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) -void _ReadWriteBarrier(void); -#pragma intrinsic(_ReadWriteBarrier) -#define SDL_CompilerBarrier() _ReadWriteBarrier() -#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ -#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") -#elif defined(__WATCOMC__) -extern __inline void SDL_CompilerBarrier(void); -#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; -#else -#define SDL_CompilerBarrier() \ -{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } -#endif - -/** - * Memory barriers are designed to prevent reads and writes from being - * reordered by the compiler and being seen out of order on multi-core CPUs. - * - * A typical pattern would be for thread A to write some data and a flag, and - * for thread B to read the flag and get the data. In this case you would - * insert a release barrier between writing the data and the flag, - * guaranteeing that the data write completes no later than the flag is - * written, and you would insert an acquire barrier between reading the flag - * and reading the data, to ensure that all the reads associated with the flag - * have completed. - * - * In this pattern you should always see a release barrier paired with an - * acquire barrier and you should gate the data reads/writes with a single - * flag variable. - * - * For more information on these semantics, take a look at the blog post: - * http://preshing.com/20120913/acquire-and-release-semantics - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void); -extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); - -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") -#elif defined(__GNUC__) && defined(__aarch64__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__GNUC__) && defined(__arm__) -#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */ -/* Information from: - https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19 - - The Linux kernel provides a helper function which provides the right code for a memory barrier, - hard-coded at address 0xffff0fa0 -*/ -typedef void (*SDL_KernelMemoryBarrierFunc)(); -#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() -#elif 0 /* defined(__QNXNTO__) */ -#include - -#define SDL_MemoryBarrierRelease() __cpu_membarrier() -#define SDL_MemoryBarrierAcquire() __cpu_membarrier() -#else -#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) -#ifdef __thumb__ -/* The mcr instruction isn't available in thumb mode, use real functions */ -#define SDL_MEMORY_BARRIER_USES_FUNCTION -#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() -#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") -#endif /* __thumb__ */ -#else -#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") -#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") -#endif /* __LINUX__ || __ANDROID__ */ -#endif /* __GNUC__ && __arm__ */ -#else -#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) -/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ -#include -#define SDL_MemoryBarrierRelease() __machine_rel_barrier() -#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() -#else -/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ -#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() -#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() -#endif -#endif - -/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */ -#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) - #define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */ -#elif (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) - #define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory") -#elif (defined(__powerpc__) || defined(__powerpc64__)) - #define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27"); -#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) - #define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */ -#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) - #define SDL_CPUPauseInstruction() __yield() -#elif defined(__WATCOMC__) && defined(__386__) - /* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */ - extern __inline void SDL_CPUPauseInstruction(void); - #pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h" -#else - #define SDL_CPUPauseInstruction() -#endif - - -/** - * \brief A type representing an atomic integer value. It is a struct - * so people don't accidentally use numeric operations on it. - */ -typedef struct { int value; } SDL_atomic_t; - -/** - * Set an atomic variable to a new value if it is currently an old value. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param oldval the old value - * \param newval the new value - * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicGet - * \sa SDL_AtomicSet - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); - -/** - * Set an atomic variable to a value. - * - * This function also acts as a full memory barrier. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value - * \returns the previous value of the atomic variable. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_AtomicGet - */ -extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); - -/** - * Get the value of an atomic variable. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable - * \returns the current value of an atomic variable. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_AtomicSet - */ -extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); - -/** - * Add to an atomic variable. - * - * This function also acts as a full memory barrier. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value to add - * \returns the previous value of the atomic variable. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_AtomicDecRef - * \sa SDL_AtomicIncRef - */ -extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); - -/** - * \brief Increment an atomic variable used as a reference count. - */ -#ifndef SDL_AtomicIncRef -#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) -#endif - -/** - * \brief Decrement an atomic variable used as a reference count. - * - * \return SDL_TRUE if the variable reached zero after decrementing, - * SDL_FALSE otherwise - */ -#ifndef SDL_AtomicDecRef -#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) -#endif - -/** - * Set a pointer to a new value if it is currently an old value. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to a pointer - * \param oldval the old pointer value - * \param newval the new pointer value - * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicCAS - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); - -/** - * Set a pointer to a value atomically. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to a pointer - * \param v the desired pointer value - * \returns the previous value of the pointer. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicGetPtr - */ -extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); - -/** - * Get the value of a pointer atomically. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to a pointer - * \returns the current value of a pointer. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicSetPtr - */ -extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#include "close_code.h" - -#endif /* SDL_atomic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_audio.h b/libs/hwcodec/externals/SDL/include/SDL_audio.h deleted file mode 100644 index 2c0f2119..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_audio.h +++ /dev/null @@ -1,1500 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* !!! FIXME: several functions in here need Doxygen comments. */ - -/** - * \file SDL_audio.h - * - * Access to the raw audio mixing buffer for the SDL library. - */ - -#ifndef SDL_audio_h_ -#define SDL_audio_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * \verbatim - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - \endverbatim - * - * There are macros in SDL 2.0 and later to query these bits. - */ -typedef Uint16 SDL_AudioFormat; - -/** - * \name Audio flags - */ -/* @{ */ - -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) - -/** - * \name Audio format flags - * - * Defaults to LSB byte order. - */ -/* @{ */ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB -/* @} */ - -/** - * \name int32 support - */ -/* @{ */ -#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB -/* @} */ - -/** - * \name float32 support - */ -/* @{ */ -#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ -#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ -#define AUDIO_F32 AUDIO_F32LSB -/* @} */ - -/** - * \name Native audio byte ordering - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#define AUDIO_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB -#endif -/* @} */ - -/** - * \name Allow change flags - * - * Which audio format changes are allowed when opening a device. - */ -/* @{ */ -#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 -#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 -#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 -#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008 -#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE) -/* @} */ - -/* @} *//* Audio flags */ - -/** - * This function is called when the audio device needs more data. - * - * \param userdata An application-specific parameter saved in - * the SDL_AudioSpec structure - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - * - * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if - * you like. Just open your audio device with a NULL callback. - */ -typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, - int len); - -/** - * The calculated values in this structure are calculated by SDL_OpenAudio(). - * - * For multi-channel audio, the default SDL channel mapping is: - * 2: FL FR (stereo) - * 3: FL FR LFE (2.1 surround) - * 4: FL FR BL BR (quad) - * 5: FL FR LFE BL BR (4.1 surround) - * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) - * 7: FL FR FC LFE BC SL SR (6.1 surround) - * 8: FL FR FC LFE BL BR SL SR (7.1 surround) - */ -typedef struct SDL_AudioSpec -{ - int freq; /**< DSP frequency -- samples per second */ - SDL_AudioFormat format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ - void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ -} SDL_AudioSpec; - - -struct SDL_AudioCVT; -typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, - SDL_AudioFormat format); - -/** - * \brief Upper limit of filters in SDL_AudioCVT - * - * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is - * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, - * one of which is the terminating NULL pointer. - */ -#define SDL_AUDIOCVT_MAX_FILTERS 9 - -/** - * \struct SDL_AudioCVT - * \brief A structure to hold a set of audio conversion filters and buffers. - * - * Note that various parts of the conversion pipeline can take advantage - * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require - * you to pass it aligned data, but can possibly run much faster if you - * set both its (buf) field to a pointer that is aligned to 16 bytes, and its - * (len) field to something that's a multiple of 16, if possible. - */ -#if defined(__GNUC__) && !defined(__CHERI_PURE_CAPABILITY__) -/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't - pad it out to 88 bytes to guarantee ABI compatibility between compilers. - This is not a concern on CHERI architectures, where pointers must be stored - at aligned locations otherwise they will become invalid, and thus structs - containing pointers cannot be packed without giving a warning or error. - vvv - The next time we rev the ABI, make sure to size the ints and add padding. -*/ -#define SDL_AUDIOCVT_PACKED __attribute__((packed)) -#else -#define SDL_AUDIOCVT_PACKED -#endif -/* */ -typedef struct SDL_AudioCVT -{ - int needed; /**< Set to 1 if conversion possible */ - SDL_AudioFormat src_format; /**< Source audio format */ - SDL_AudioFormat dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */ - int filter_index; /**< Current audio conversion function */ -} SDL_AUDIOCVT_PACKED SDL_AudioCVT; - - -/* Function prototypes */ - -/** - * \name Driver discovery functions - * - * These functions return the list of built in audio drivers, in the - * order that they are normally initialized by default. - */ -/* @{ */ - -/** - * Use this function to get the number of built-in audio drivers. - * - * This function returns a hardcoded number. This never returns a negative - * value; if there are no drivers compiled into this build of SDL, this - * function returns zero. The presence of a driver in this list does not mean - * it will function, it just means SDL is capable of interacting with that - * interface. For example, a build of SDL might have esound support, but if - * there's no esound server available, SDL's esound driver would fail if used. - * - * By default, SDL tries all drivers, in its preferred order, until one is - * found to be usable. - * - * \returns the number of built-in audio drivers. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAudioDriver - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); - -/** - * Use this function to get the name of a built in audio driver. - * - * The list of audio drivers is given in the order that they are normally - * initialized by default; the drivers that seem more reasonable to choose - * first (as far as the SDL developers believe) are earlier in the list. - * - * The names of drivers are all simple, low-ASCII identifiers, like "alsa", - * "coreaudio" or "xaudio2". These never have Unicode characters, and are not - * meant to be proper names. - * - * \param index the index of the audio driver; the value ranges from 0 to - * SDL_GetNumAudioDrivers() - 1 - * \returns the name of the audio driver at the requested index, or NULL if an - * invalid index was specified. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumAudioDrivers - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); -/* @} */ - -/** - * \name Initialization and cleanup - * - * \internal These functions are used internally, and should not be used unless - * you have a specific need to specify the audio driver you want to - * use. You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -/* @{ */ - -/** - * Use this function to initialize a particular audio driver. - * - * This function is used internally, and should not be used unless you have a - * specific need to designate the audio driver you want to use. You should - * normally use SDL_Init() or SDL_InitSubSystem(). - * - * \param driver_name the name of the desired audio driver - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AudioQuit - */ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); - -/** - * Use this function to shut down audio if you initialized it with - * SDL_AudioInit(). - * - * This function is used internally, and should not be used unless you have a - * specific need to specify the audio driver you want to use. You should - * normally use SDL_Quit() or SDL_QuitSubSystem(). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AudioInit - */ -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); -/* @} */ - -/** - * Get the name of the current audio driver. - * - * The returned string points to internal static memory and thus never becomes - * invalid, even if you quit the audio subsystem and initialize a new driver - * (although such a case would return a different static string from another - * call to this function, of course). As such, you should not modify or free - * the returned string. - * - * \returns the name of the current audio driver or NULL if no driver has been - * initialized. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AudioInit - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); - -/** - * This function is a legacy means of opening the audio device. - * - * This function remains for compatibility with SDL 1.2, but also because it's - * slightly easier to use than the new functions in SDL 2.0. The new, more - * powerful, and preferred way to do this is SDL_OpenAudioDevice(). - * - * This function is roughly equivalent to: - * - * ```c - * SDL_OpenAudioDevice(NULL, 0, desired, obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); - * ``` - * - * With two notable exceptions: - * - * - If `obtained` is NULL, we use `desired` (and allow no changes), which - * means desired will be modified to have the correct values for silence, - * etc, and SDL will convert any differences between your app's specific - * request and the hardware behind the scenes. - * - The return value is always success or failure, and not a device ID, which - * means you can only have one device open at a time with this function. - * - * \param desired an SDL_AudioSpec structure representing the desired output - * format. Please refer to the SDL_OpenAudioDevice - * documentation for details on how to prepare this structure. - * \param obtained an SDL_AudioSpec structure filled in with the actual - * parameters, or NULL. - * \returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by `obtained`. - * - * If `obtained` is NULL, the audio data passed to the callback - * function will be guaranteed to be in the requested format, and - * will be automatically converted to the actual hardware audio - * format if necessary. If `obtained` is NULL, `desired` will have - * fields modified. - * - * This function returns a negative error code on failure to open the - * audio device or failure to set up the audio thread; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CloseAudio - * \sa SDL_LockAudio - * \sa SDL_PauseAudio - * \sa SDL_UnlockAudio - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, - SDL_AudioSpec * obtained); - -/** - * SDL Audio Device IDs. - * - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. - */ -typedef Uint32 SDL_AudioDeviceID; - -/** - * Get the number of built-in audio devices. - * - * This function is only valid after successfully initializing the audio - * subsystem. - * - * Note that audio capture support is not implemented as of SDL 2.0.4, so the - * `iscapture` parameter is for future expansion and should always be zero for - * now. - * - * This function will return -1 if an explicit list of devices can't be - * determined. Returning -1 is not an error. For example, if SDL is set up to - * talk to a remote audio server, it can't list every one available on the - * Internet, but it will still allow a specific host to be specified in - * SDL_OpenAudioDevice(). - * - * In many common cases, when this function returns a value <= 0, it can still - * successfully open the default device (NULL for first argument of - * SDL_OpenAudioDevice()). - * - * This function may trigger a complete redetect of available hardware. It - * should not be called for each iteration of a loop, but rather once at the - * start of a loop: - * - * ```c - * // Don't do this: - * for (int i = 0; i < SDL_GetNumAudioDevices(0); i++) - * - * // do this instead: - * const int count = SDL_GetNumAudioDevices(0); - * for (int i = 0; i < count; ++i) { do_something_here(); } - * ``` - * - * \param iscapture zero to request playback devices, non-zero to request - * recording devices - * \returns the number of available devices exposed by the current driver or - * -1 if an explicit list of devices can't be determined. A return - * value of -1 does not necessarily mean an error condition. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAudioDeviceName - * \sa SDL_OpenAudioDevice - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); - -/** - * Get the human-readable name of a specific audio device. - * - * This function is only valid after successfully initializing the audio - * subsystem. The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); re-call that function to redetect available - * hardware. - * - * The string returned by this function is UTF-8 encoded, read-only, and - * managed internally. You are not to free it. If you need to keep the string - * for any length of time, you should make your own copy of it, as it will be - * invalid next time any of several other SDL functions are called. - * - * \param index the index of the audio device; valid values range from 0 to - * SDL_GetNumAudioDevices() - 1 - * \param iscapture non-zero to query the list of recording devices, zero to - * query the list of output devices. - * \returns the name of the audio device at the requested index, or NULL on - * error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumAudioDevices - * \sa SDL_GetDefaultAudioInfo - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, - int iscapture); - -/** - * Get the preferred audio format of a specific audio device. - * - * This function is only valid after a successfully initializing the audio - * subsystem. The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); re-call that function to redetect available - * hardware. - * - * `spec` will be filled with the sample rate, sample format, and channel - * count. - * - * \param index the index of the audio device; valid values range from 0 to - * SDL_GetNumAudioDevices() - 1 - * \param iscapture non-zero to query the list of recording devices, zero to - * query the list of output devices. - * \param spec The SDL_AudioSpec to be initialized by this function. - * \returns 0 on success, nonzero on error - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_GetNumAudioDevices - * \sa SDL_GetDefaultAudioInfo - */ -extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index, - int iscapture, - SDL_AudioSpec *spec); - - -/** - * Get the name and preferred format of the default audio device. - * - * Some (but not all!) platforms have an isolated mechanism to get information - * about the "default" device. This can actually be a completely different - * device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can - * even be a network address! (This is discussed in SDL_OpenAudioDevice().) - * - * As a result, this call is not guaranteed to be performant, as it can query - * the sound server directly every time, unlike the other query functions. You - * should call this function sparingly! - * - * `spec` will be filled with the sample rate, sample format, and channel - * count, if a default device exists on the system. If `name` is provided, - * will be filled with either a dynamically-allocated UTF-8 string or NULL. - * - * \param name A pointer to be filled with the name of the default device (can - * be NULL). Please call SDL_free() when you are done with this - * pointer! - * \param spec The SDL_AudioSpec to be initialized by this function. - * \param iscapture non-zero to query the default recording device, zero to - * query the default output device. - * \returns 0 on success, nonzero on error - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GetAudioDeviceName - * \sa SDL_GetAudioDeviceSpec - * \sa SDL_OpenAudioDevice - */ -extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name, - SDL_AudioSpec *spec, - int iscapture); - - -/** - * Open a specific audio device. - * - * SDL_OpenAudio(), unlike this function, always acts on device ID 1. As such, - * this function will never return a 1 so as not to conflict with the legacy - * function. - * - * Please note that SDL 2.0 before 2.0.5 did not support recording; as such, - * this function would fail if `iscapture` was not zero. Starting with SDL - * 2.0.5, recording is implemented and this value can be non-zero. - * - * Passing in a `device` name of NULL requests the most reasonable default - * (and is equivalent to what SDL_OpenAudio() does to choose a device). The - * `device` name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but - * some drivers allow arbitrary and driver-specific strings, such as a - * hostname/IP address for a remote audio server, or a filename in the - * diskaudio driver. - * - * An opened audio device starts out paused, and should be enabled for playing - * by calling SDL_PauseAudioDevice(devid, 0) when you are ready for your audio - * callback function to be called. Since the audio driver may modify the - * requested size of the audio buffer, you should allocate any local mixing - * buffers after you open the audio device. - * - * The audio callback runs in a separate thread in most cases; you can prevent - * race conditions between your callback and other threads without fully - * pausing playback with SDL_LockAudioDevice(). For more information about the - * callback, see SDL_AudioSpec. - * - * Managing the audio spec via 'desired' and 'obtained': - * - * When filling in the desired audio spec structure: - * - * - `desired->freq` should be the frequency in sample-frames-per-second (Hz). - * - `desired->format` should be the audio format (`AUDIO_S16SYS`, etc). - * - `desired->samples` is the desired size of the audio buffer, in _sample - * frames_ (with stereo output, two samples--left and right--would make a - * single sample frame). This number should be a power of two, and may be - * adjusted by the audio driver to a value more suitable for the hardware. - * Good values seem to range between 512 and 8096 inclusive, depending on - * the application and CPU speed. Smaller values reduce latency, but can - * lead to underflow if the application is doing heavy processing and cannot - * fill the audio buffer in time. Note that the number of sample frames is - * directly related to time by the following formula: `ms = - * (sampleframes*1000)/freq` - * - `desired->size` is the size in _bytes_ of the audio buffer, and is - * calculated by SDL_OpenAudioDevice(). You don't initialize this. - * - `desired->silence` is the value used to set the buffer to silence, and is - * calculated by SDL_OpenAudioDevice(). You don't initialize this. - * - `desired->callback` should be set to a function that will be called when - * the audio device is ready for more data. It is passed a pointer to the - * audio buffer, and the length in bytes of the audio buffer. This function - * usually runs in a separate thread, and so you should protect data - * structures that it accesses by calling SDL_LockAudioDevice() and - * SDL_UnlockAudioDevice() in your code. Alternately, you may pass a NULL - * pointer here, and call SDL_QueueAudio() with some frequency, to queue - * more audio samples to be played (or for capture devices, call - * SDL_DequeueAudio() with some frequency, to obtain audio samples). - * - `desired->userdata` is passed as the first parameter to your callback - * function. If you passed a NULL callback, this value is ignored. - * - * `allowed_changes` can have the following flags OR'd together: - * - * - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE` - * - `SDL_AUDIO_ALLOW_FORMAT_CHANGE` - * - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE` - * - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE` - * - `SDL_AUDIO_ALLOW_ANY_CHANGE` - * - * These flags specify how SDL should behave when a device cannot offer a - * specific feature. If the application requests a feature that the hardware - * doesn't offer, SDL will always try to get the closest equivalent. - * - * For example, if you ask for float32 audio format, but the sound card only - * supports int16, SDL will set the hardware to int16. If you had set - * SDL_AUDIO_ALLOW_FORMAT_CHANGE, SDL will change the format in the `obtained` - * structure. If that flag was *not* set, SDL will prepare to convert your - * callback's float32 audio to int16 before feeding it to the hardware and - * will keep the originally requested format in the `obtained` structure. - * - * The resulting audio specs, varying depending on hardware and on what - * changes were allowed, will then be written back to `obtained`. - * - * If your application can only handle one specific data format, pass a zero - * for `allowed_changes` and let SDL transparently handle any differences. - * - * \param device a UTF-8 string reported by SDL_GetAudioDeviceName() or a - * driver-specific name as appropriate. NULL requests the most - * reasonable default device. - * \param iscapture non-zero to specify a device should be opened for - * recording, not playback - * \param desired an SDL_AudioSpec structure representing the desired output - * format; see SDL_OpenAudio() for more information - * \param obtained an SDL_AudioSpec structure filled in with the actual output - * format; see SDL_OpenAudio() for more information - * \param allowed_changes 0, or one or more flags OR'd together - * \returns a valid device ID that is > 0 on success or 0 on failure; call - * SDL_GetError() for more information. - * - * For compatibility with SDL 1.2, this will never return 1, since - * SDL reserves that ID for the legacy SDL_OpenAudio() function. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CloseAudioDevice - * \sa SDL_GetAudioDeviceName - * \sa SDL_LockAudioDevice - * \sa SDL_OpenAudio - * \sa SDL_PauseAudioDevice - * \sa SDL_UnlockAudioDevice - */ -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice( - const char *device, - int iscapture, - const SDL_AudioSpec *desired, - SDL_AudioSpec *obtained, - int allowed_changes); - - - -/** - * \name Audio state - * - * Get the current audio state. - */ -/* @{ */ -typedef enum -{ - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_AudioStatus; - -/** - * This function is a legacy means of querying the audio device. - * - * New programs might want to use SDL_GetAudioDeviceStatus() instead. This - * function is equivalent to calling... - * - * ```c - * SDL_GetAudioDeviceStatus(1); - * ``` - * - * ...and is only useful if you used the legacy SDL_OpenAudio() function. - * - * \returns the SDL_AudioStatus of the audio device opened by SDL_OpenAudio(). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAudioDeviceStatus - */ -extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); - -/** - * Use this function to get the current audio state of an audio device. - * - * \param dev the ID of an audio device previously opened with - * SDL_OpenAudioDevice() - * \returns the SDL_AudioStatus of the specified audio device. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PauseAudioDevice - */ -extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); -/* @} *//* Audio State */ - -/** - * \name Pause audio functions - * - * These functions pause and unpause the audio callback processing. - * They should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -/* @{ */ - -/** - * This function is a legacy means of pausing the audio device. - * - * New programs might want to use SDL_PauseAudioDevice() instead. This - * function is equivalent to calling... - * - * ```c - * SDL_PauseAudioDevice(1, pause_on); - * ``` - * - * ...and is only useful if you used the legacy SDL_OpenAudio() function. - * - * \param pause_on non-zero to pause, 0 to unpause - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetAudioStatus - * \sa SDL_PauseAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); - -/** - * Use this function to pause and unpause audio playback on a specified - * device. - * - * This function pauses and unpauses the audio callback processing for a given - * device. Newly-opened audio devices start in the paused state, so you must - * call this function with **pause_on**=0 after opening the specified audio - * device to start playing sound. This allows you to safely initialize data - * for your callback function after opening the audio device. Silence will be - * written to the audio device while paused, and the audio callback is - * guaranteed to not be called. Pausing one device does not prevent other - * unpaused devices from running their callbacks. - * - * Pausing state does not stack; even if you pause a device several times, a - * single unpause will start the device playing again, and vice versa. This is - * different from how SDL_LockAudioDevice() works. - * - * If you just need to protect a few variables from race conditions vs your - * callback, you shouldn't pause the audio device, as it will lead to dropouts - * in the audio playback. Instead, you should use SDL_LockAudioDevice(). - * - * \param dev a device opened by SDL_OpenAudioDevice() - * \param pause_on non-zero to pause, 0 to unpause - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, - int pause_on); -/* @} *//* Pause audio functions */ - -/** - * Load the audio data of a WAVE file into memory. - * - * Loading a WAVE file requires `src`, `spec`, `audio_buf` and `audio_len` to - * be valid pointers. The entire data portion of the file is then loaded into - * memory and decoded if necessary. - * - * If `freesrc` is non-zero, the data source gets automatically closed and - * freed before the function returns. - * - * Supported formats are RIFF WAVE files with the formats PCM (8, 16, 24, and - * 32 bits), IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and - * A-law and mu-law (8 bits). Other formats are currently unsupported and - * cause an error. - * - * If this function succeeds, the pointer returned by it is equal to `spec` - * and the pointer to the audio data allocated by the function is written to - * `audio_buf` and its length in bytes to `audio_len`. The SDL_AudioSpec - * members `freq`, `channels`, and `format` are set to the values of the audio - * data in the buffer. The `samples` member is set to a sane default and all - * others are set to zero. - * - * It's necessary to use SDL_FreeWAV() to free the audio data returned in - * `audio_buf` when it is no longer used. - * - * Because of the underspecification of the .WAV format, there are many - * problematic files in the wild that cause issues with strict decoders. To - * provide compatibility with these files, this decoder is lenient in regards - * to the truncation of the file, the fact chunk, and the size of the RIFF - * chunk. The hints `SDL_HINT_WAVE_RIFF_CHUNK_SIZE`, - * `SDL_HINT_WAVE_TRUNCATION`, and `SDL_HINT_WAVE_FACT_CHUNK` can be used to - * tune the behavior of the loading process. - * - * Any file that is invalid (due to truncation, corruption, or wrong values in - * the headers), too big, or unsupported causes an error. Additionally, any - * critical I/O error from the data source will terminate the loading process - * with an error. The function returns NULL on error and in all cases (with - * the exception of `src` being NULL), an appropriate error message will be - * set. - * - * It is required that the data source supports seeking. - * - * Example: - * - * ```c - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, &spec, &buf, &len); - * ``` - * - * Note that the SDL_LoadWAV macro does this same thing for you, but in a less - * messy way: - * - * ```c - * SDL_LoadWAV("sample.wav", &spec, &buf, &len); - * ``` - * - * \param src The data source for the WAVE data - * \param freesrc If non-zero, SDL will _always_ free the data source - * \param spec An SDL_AudioSpec that will be filled in with the wave file's - * format details - * \param audio_buf A pointer filled with the audio data, allocated by the - * function. - * \param audio_len A pointer filled with the length of the audio data buffer - * in bytes - * \returns This function, if successfully called, returns `spec`, which will - * be filled with the audio data format of the wave source data. - * `audio_buf` will be filled with a pointer to an allocated buffer - * containing the audio data, and `audio_len` is filled with the - * length of that audio buffer in bytes. - * - * This function returns NULL if the .WAV file cannot be opened, uses - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. - * - * When the application is done with the data returned in - * `audio_buf`, it should call SDL_FreeWAV() to dispose of it. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeWAV - * \sa SDL_LoadWAV - */ -extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, - int freesrc, - SDL_AudioSpec * spec, - Uint8 ** audio_buf, - Uint32 * audio_len); - -/** - * Loads a WAV from a file. - * Compatibility convenience function. - */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/** - * Free data previously allocated with SDL_LoadWAV() or SDL_LoadWAV_RW(). - * - * After a WAVE file has been opened with SDL_LoadWAV() or SDL_LoadWAV_RW() - * its data can eventually be freed with SDL_FreeWAV(). It is safe to call - * this function with a NULL pointer. - * - * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or - * SDL_LoadWAV_RW() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadWAV - * \sa SDL_LoadWAV_RW - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); - -/** - * Initialize an SDL_AudioCVT structure for conversion. - * - * Before an SDL_AudioCVT structure can be used to convert audio data it must - * be initialized with source and destination information. - * - * This function will zero out every field of the SDL_AudioCVT, so it must be - * called before the application fills in the final buffer information. - * - * Once this function has returned successfully, and reported that a - * conversion is necessary, the application fills in the rest of the fields in - * SDL_AudioCVT, now that it knows how large a buffer it needs to allocate, - * and then can call SDL_ConvertAudio() to complete the conversion. - * - * \param cvt an SDL_AudioCVT structure filled in with audio conversion - * information - * \param src_format the source format of the audio data; for more info see - * SDL_AudioFormat - * \param src_channels the number of channels in the source - * \param src_rate the frequency (sample-frames-per-second) of the source - * \param dst_format the destination format of the audio data; for more info - * see SDL_AudioFormat - * \param dst_channels the number of channels in the destination - * \param dst_rate the frequency (sample-frames-per-second) of the destination - * \returns 1 if the audio filter is prepared, 0 if no conversion is needed, - * or a negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ConvertAudio - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_format, - Uint8 src_channels, - int src_rate, - SDL_AudioFormat dst_format, - Uint8 dst_channels, - int dst_rate); - -/** - * Convert audio data to a desired audio format. - * - * This function does the actual audio data conversion, after the application - * has called SDL_BuildAudioCVT() to prepare the conversion information and - * then filled in the buffer details. - * - * Once the application has initialized the `cvt` structure using - * SDL_BuildAudioCVT(), allocated an audio buffer and filled it with audio - * data in the source format, this function will convert the buffer, in-place, - * to the desired format. - * - * The data conversion may go through several passes; any given pass may - * possibly temporarily increase the size of the data. For example, SDL might - * expand 16-bit data to 32 bits before resampling to a lower frequency, - * shrinking the data size after having grown it briefly. Since the supplied - * buffer will be both the source and destination, converting as necessary - * in-place, the application must allocate a buffer that will fully contain - * the data during its largest conversion pass. After SDL_BuildAudioCVT() - * returns, the application should set the `cvt->len` field to the size, in - * bytes, of the source data, and allocate a buffer that is `cvt->len * - * cvt->len_mult` bytes long for the `buf` field. - * - * The source data should be copied into this buffer before the call to - * SDL_ConvertAudio(). Upon successful return, this buffer will contain the - * converted audio, and `cvt->len_cvt` will be the size of the converted data, - * in bytes. Any bytes in the buffer past `cvt->len_cvt` are undefined once - * this function returns. - * - * \param cvt an SDL_AudioCVT structure that was previously set up by - * SDL_BuildAudioCVT(). - * \returns 0 if the conversion was completed successfully or a negative error - * code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BuildAudioCVT - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); - -/* SDL_AudioStream is a new audio conversion interface. - The benefits vs SDL_AudioCVT: - - it can handle resampling data in chunks without generating - artifacts, when it doesn't have the complete buffer available. - - it can handle incoming data in any variable size. - - You push data as you have it, and pull it when you need it - */ -/* this is opaque to the outside world. */ -struct _SDL_AudioStream; -typedef struct _SDL_AudioStream SDL_AudioStream; - -/** - * Create a new audio stream. - * - * \param src_format The format of the source audio - * \param src_channels The number of channels of the source audio - * \param src_rate The sampling rate of the source audio - * \param dst_format The format of the desired audio output - * \param dst_channels The number of channels of the desired audio output - * \param dst_rate The sampling rate of the desired audio output - * \returns 0 on success, or -1 on error. - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, - const Uint8 src_channels, - const int src_rate, - const SDL_AudioFormat dst_format, - const Uint8 dst_channels, - const int dst_rate); - -/** - * Add data to be converted/resampled to the stream. - * - * \param stream The stream the audio data is being added to - * \param buf A pointer to the audio data to add - * \param len The number of bytes to write to the stream - * \returns 0 on success, or -1 on error. - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); - -/** - * Get converted/resampled data from the stream - * - * \param stream The stream the audio is being requested from - * \param buf A buffer to fill with audio data - * \param len The maximum number of bytes to fill - * \returns the number of bytes read from the stream, or -1 on error - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); - -/** - * Get the number of converted/resampled bytes available. - * - * The stream may be buffering data behind the scenes until it has enough to - * resample correctly, so this number might be lower than what you expect, or - * even be zero. Add more data or flush the stream if you need the data now. - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); - -/** - * Tell the stream that you're done sending data, and anything being buffered - * should be converted/resampled and made available immediately. - * - * It is legal to add more data to a stream after flushing, but there will be - * audio gaps in the output. Generally this is intended to signal the end of - * input, so the complete output becomes available. - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamClear - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); - -/** - * Clear any pending data in the stream without converting it - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_FreeAudioStream - */ -extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); - -/** - * Free an audio stream - * - * \since This function is available since SDL 2.0.7. - * - * \sa SDL_NewAudioStream - * \sa SDL_AudioStreamPut - * \sa SDL_AudioStreamGet - * \sa SDL_AudioStreamAvailable - * \sa SDL_AudioStreamFlush - * \sa SDL_AudioStreamClear - */ -extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); - -#define SDL_MIX_MAXVOLUME 128 - -/** - * This function is a legacy means of mixing audio. - * - * This function is equivalent to calling... - * - * ```c - * SDL_MixAudioFormat(dst, src, format, len, volume); - * ``` - * - * ...where `format` is the obtained format of the audio device from the - * legacy SDL_OpenAudio() function. - * - * \param dst the destination for the mixed audio - * \param src the source audio buffer to be mixed - * \param len the length of the audio buffer in bytes - * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MixAudioFormat - */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, - Uint32 len, int volume); - -/** - * Mix audio data in a specified format. - * - * This takes an audio buffer `src` of `len` bytes of `format` data and mixes - * it into `dst`, performing addition, volume adjustment, and overflow - * clipping. The buffer pointed to by `dst` must also be `len` bytes of - * `format` data. - * - * This is provided for convenience -- you can mix your own audio data. - * - * Do not use this function for mixing together more than two streams of - * sample data. The output from repeated application of this function may be - * distorted by clipping, because there is no accumulator with greater range - * than the input (not to mention this being an inefficient way of doing it). - * - * It is a common misconception that this function is required to write audio - * data to an output stream in an audio callback. While you can do that, - * SDL_MixAudioFormat() is really only needed when you're mixing a single - * audio stream with a volume adjustment. - * - * \param dst the destination for the mixed audio - * \param src the source audio buffer to be mixed - * \param format the SDL_AudioFormat structure representing the desired audio - * format - * \param len the length of the audio buffer in bytes - * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, - const Uint8 * src, - SDL_AudioFormat format, - Uint32 len, int volume); - -/** - * Queue more audio on non-callback devices. - * - * If you are looking to retrieve queued audio from a non-callback capture - * device, you want SDL_DequeueAudio() instead. SDL_QueueAudio() will return - * -1 to signify an error if you use it with capture devices. - * - * SDL offers two ways to feed audio to the device: you can either supply a - * callback that SDL triggers with some frequency to obtain more audio (pull - * method), or you can supply no callback, and then SDL will expect you to - * supply data at regular intervals (push method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Queued data will drain to the device as - * necessary without further intervention from you. If the device needs audio - * but there is not enough queued, it will play silence to make up the - * difference. This means you will have skips in your audio playback if you - * aren't routinely queueing sufficient data. - * - * This function copies the supplied data, so you are safe to free it when the - * function returns. This function is thread-safe, but queueing to the same - * device from two threads at once does not promise which buffer will be - * queued first. - * - * You may not queue audio on a device that is using an application-supplied - * callback; doing so returns an error. You have to use the audio callback or - * queue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before queueing; SDL - * handles locking internally for this function. - * - * Note that SDL2 does not support planar audio. You will need to resample - * from planar audio formats into a non-planar one (see SDL_AudioFormat) - * before queuing audio. - * - * \param dev the device ID to which we will queue audio - * \param data the data to queue to the device for later playback - * \param len the number of bytes (not samples!) to which `data` points - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_ClearQueuedAudio - * \sa SDL_GetQueuedAudioSize - */ -extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); - -/** - * Dequeue more audio on non-callback devices. - * - * If you are looking to queue audio for output on a non-callback playback - * device, you want SDL_QueueAudio() instead. SDL_DequeueAudio() will always - * return 0 if you use it with playback devices. - * - * SDL offers two ways to retrieve audio from a capture device: you can either - * supply a callback that SDL triggers with some frequency as the device - * records more audio data, (push method), or you can supply no callback, and - * then SDL will expect you to retrieve data at regular intervals (pull - * method) with this function. - * - * There are no limits on the amount of data you can queue, short of - * exhaustion of address space. Data from the device will keep queuing as - * necessary without further intervention from you. This means you will - * eventually run out of memory if you aren't routinely dequeueing data. - * - * Capture devices will not queue data when paused; if you are expecting to - * not need captured audio for some length of time, use SDL_PauseAudioDevice() - * to stop the capture device from queueing more data. This can be useful - * during, say, level loading times. When unpaused, capture devices will start - * queueing data from that point, having flushed any capturable data available - * while paused. - * - * This function is thread-safe, but dequeueing from the same device from two - * threads at once does not promise which thread will dequeue data first. - * - * You may not dequeue audio from a device that is using an - * application-supplied callback; doing so returns an error. You have to use - * the audio callback, or dequeue audio with this function, but not both. - * - * You should not call SDL_LockAudio() on the device before dequeueing; SDL - * handles locking internally for this function. - * - * \param dev the device ID from which we will dequeue audio - * \param data a pointer into where audio data should be copied - * \param len the number of bytes (not samples!) to which (data) points - * \returns the number of bytes dequeued, which could be less than requested; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_ClearQueuedAudio - * \sa SDL_GetQueuedAudioSize - */ -extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len); - -/** - * Get the number of bytes of still-queued audio. - * - * For playback devices: this is the number of bytes that have been queued for - * playback with SDL_QueueAudio(), but have not yet been sent to the hardware. - * - * Once we've sent it to the hardware, this function can not decide the exact - * byte boundary of what has been played. It's possible that we just gave the - * hardware several kilobytes right before you called this function, but it - * hasn't played any of it yet, or maybe half of it, etc. - * - * For capture devices, this is the number of bytes that have been captured by - * the device and are waiting for you to dequeue. This number may grow at any - * time, so this only informs of the lower-bound of available data. - * - * You may not queue or dequeue audio on a device that is using an - * application-supplied callback; calling this function on such a device - * always returns 0. You have to use the audio callback or queue audio, but - * not both. - * - * You should not call SDL_LockAudio() on the device before querying; SDL - * handles locking internally for this function. - * - * \param dev the device ID of which we will query queued audio size - * \returns the number of bytes (not samples!) of queued audio. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_ClearQueuedAudio - * \sa SDL_QueueAudio - * \sa SDL_DequeueAudio - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); - -/** - * Drop any queued audio data waiting to be sent to the hardware. - * - * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For - * output devices, the hardware will start playing silence if more audio isn't - * queued. For capture devices, the hardware will start filling the empty - * queue with new data if the capture device isn't paused. - * - * This will not prevent playback of queued audio that's already been sent to - * the hardware, as we can not undo that, so expect there to be some fraction - * of a second of audio that might still be heard. This can be useful if you - * want to, say, drop any pending music or any unprocessed microphone input - * during a level change in your game. - * - * You may not queue or dequeue audio on a device that is using an - * application-supplied callback; calling this function on such a device - * always returns 0. You have to use the audio callback or queue audio, but - * not both. - * - * You should not call SDL_LockAudio() on the device before clearing the - * queue; SDL handles locking internally for this function. - * - * This function always succeeds and thus returns void. - * - * \param dev the device ID of which to clear the audio queue - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_GetQueuedAudioSize - * \sa SDL_QueueAudio - * \sa SDL_DequeueAudio - */ -extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); - - -/** - * \name Audio lock functions - * - * The lock manipulated by these functions protects the callback function. - * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that - * the callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -/* @{ */ - -/** - * This function is a legacy means of locking the audio device. - * - * New programs might want to use SDL_LockAudioDevice() instead. This function - * is equivalent to calling... - * - * ```c - * SDL_LockAudioDevice(1); - * ``` - * - * ...and is only useful if you used the legacy SDL_OpenAudio() function. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockAudioDevice - * \sa SDL_UnlockAudio - * \sa SDL_UnlockAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); - -/** - * Use this function to lock out the audio callback function for a specified - * device. - * - * The lock manipulated by these functions protects the audio callback - * function specified in SDL_OpenAudioDevice(). During a - * SDL_LockAudioDevice()/SDL_UnlockAudioDevice() pair, you can be guaranteed - * that the callback function for that device is not running, even if the - * device is not paused. While a device is locked, any other unpaused, - * unlocked devices may still run their callbacks. - * - * Calling this function from inside your audio callback is unnecessary. SDL - * obtains this lock before calling your function, and releases it when the - * function returns. - * - * You should not hold the lock longer than absolutely necessary. If you hold - * it too long, you'll experience dropouts in your audio playback. Ideally, - * your application locks the device, sets a few variables and unlocks again. - * Do not do heavy work while holding the lock for a device. - * - * It is safe to lock the audio device multiple times, as long as you unlock - * it an equivalent number of times. The callback will not run until the - * device has been unlocked completely in this way. If your application fails - * to unlock the device appropriately, your callback will never run, you might - * hear repeating bursts of audio, and SDL_CloseAudioDevice() will probably - * deadlock. - * - * Internally, the audio device lock is a mutex; if you lock from two threads - * at once, not only will you block the audio callback, you'll block the other - * thread. - * - * \param dev the ID of the device to be locked - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_UnlockAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); - -/** - * This function is a legacy means of unlocking the audio device. - * - * New programs might want to use SDL_UnlockAudioDevice() instead. This - * function is equivalent to calling... - * - * ```c - * SDL_UnlockAudioDevice(1); - * ``` - * - * ...and is only useful if you used the legacy SDL_OpenAudio() function. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockAudio - * \sa SDL_UnlockAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); - -/** - * Use this function to unlock the audio callback function for a specified - * device. - * - * This function should be paired with a previous SDL_LockAudioDevice() call. - * - * \param dev the ID of the device to be unlocked - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); -/* @} *//* Audio lock functions */ - -/** - * This function is a legacy means of closing the audio device. - * - * This function is equivalent to calling... - * - * ```c - * SDL_CloseAudioDevice(1); - * ``` - * - * ...and is only useful if you used the legacy SDL_OpenAudio() function. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_OpenAudio - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); - -/** - * Use this function to shut down audio processing and close the audio device. - * - * The application should close open audio devices once they are no longer - * needed. Calling this function will wait until the device's audio callback - * is not running, release the audio hardware and then clean up internal - * state. No further audio will play from this device once this function - * returns. - * - * This function may block briefly while pending audio data is played by the - * hardware, so that applications don't drop the last buffer of data they - * supplied. - * - * The device ID is invalid as soon as the device is closed, and is eligible - * for reuse in a new SDL_OpenAudioDevice() call immediately. - * - * \param dev an audio device previously opened with SDL_OpenAudioDevice() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_OpenAudioDevice - */ -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_audio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_bits.h b/libs/hwcodec/externals/SDL/include/SDL_bits.h deleted file mode 100644 index 81161ae5..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_bits.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_bits.h - * - * Functions for fiddling with bits and bitmasks. - */ - -#ifndef SDL_bits_h_ -#define SDL_bits_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_bits.h - */ - -/** - * Get the index of the most significant bit. Result is undefined when called - * with 0. This operation can also be stated as "count leading zeroes" and - * "log base 2". - * - * \return the index of the most significant bit, or -1 if the value is 0. - */ -#if defined(__WATCOMC__) && defined(__386__) -extern __inline int _SDL_bsr_watcom(Uint32); -#pragma aux _SDL_bsr_watcom = \ - "bsr eax, eax" \ - parm [eax] nomemory \ - value [eax] \ - modify exact [eax] nomemory; -#endif - -SDL_FORCE_INLINE int -SDL_MostSignificantBitIndex32(Uint32 x) -{ -#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) - /* Count Leading Zeroes builtin in GCC. - * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html - */ - if (x == 0) { - return -1; - } - return 31 - __builtin_clz(x); -#elif defined(__WATCOMC__) && defined(__386__) - if (x == 0) { - return -1; - } - return _SDL_bsr_watcom(x); -#elif defined(_MSC_VER) - unsigned long index; - if (_BitScanReverse(&index, x)) { - return index; - } - return -1; -#else - /* Based off of Bit Twiddling Hacks by Sean Eron Anderson - * , released in the public domain. - * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog - */ - const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; - const int S[] = {1, 2, 4, 8, 16}; - - int msbIndex = 0; - int i; - - if (x == 0) { - return -1; - } - - for (i = 4; i >= 0; i--) - { - if (x & b[i]) - { - x >>= S[i]; - msbIndex |= S[i]; - } - } - - return msbIndex; -#endif -} - -SDL_FORCE_INLINE SDL_bool -SDL_HasExactlyOneBitSet32(Uint32 x) -{ - if (x && !(x & (x - 1))) { - return SDL_TRUE; - } - return SDL_FALSE; -} - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_bits_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_blendmode.h b/libs/hwcodec/externals/SDL/include/SDL_blendmode.h deleted file mode 100644 index b8621165..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_blendmode.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_blendmode.h - * - * Header file declaring the SDL_BlendMode enumeration - */ - -#ifndef SDL_blendmode_h_ -#define SDL_blendmode_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< no blending - dstRGBA = srcRGBA */ - SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ - SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ - SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ - SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply - dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) - dstA = (srcA * dstA) + (dstA * (1-srcA)) */ - SDL_BLENDMODE_INVALID = 0x7FFFFFFF - - /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ - -} SDL_BlendMode; - -/** - * \brief The blend operation used when combining source and destination pixel components - */ -typedef enum -{ - SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ - SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ -} SDL_BlendOperation; - -/** - * \brief The normalized factor used to multiply pixel components - */ -typedef enum -{ - SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ - SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ - SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ - SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ - SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ - SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ - SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ - SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ -} SDL_BlendFactor; - -/** - * Compose a custom blend mode for renderers. - * - * The functions SDL_SetRenderDrawBlendMode and SDL_SetTextureBlendMode accept - * the SDL_BlendMode returned by this function if the renderer supports it. - * - * A blend mode controls how the pixels from a drawing operation (source) get - * combined with the pixels from the render target (destination). First, the - * components of the source and destination pixels get multiplied with their - * blend factors. Then, the blend operation takes the two products and - * calculates the result that will get stored in the render target. - * - * Expressed in pseudocode, it would look like this: - * - * ```c - * dstRGB = colorOperation(srcRGB * srcColorFactor, dstRGB * dstColorFactor); - * dstA = alphaOperation(srcA * srcAlphaFactor, dstA * dstAlphaFactor); - * ``` - * - * Where the functions `colorOperation(src, dst)` and `alphaOperation(src, - * dst)` can return one of the following: - * - * - `src + dst` - * - `src - dst` - * - `dst - src` - * - `min(src, dst)` - * - `max(src, dst)` - * - * The red, green, and blue components are always multiplied with the first, - * second, and third components of the SDL_BlendFactor, respectively. The - * fourth component is not used. - * - * The alpha component is always multiplied with the fourth component of the - * SDL_BlendFactor. The other components are not used in the alpha - * calculation. - * - * Support for these blend modes varies for each renderer. To check if a - * specific SDL_BlendMode is supported, create a renderer and pass it to - * either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will - * return with an error if the blend mode is not supported. - * - * This list describes the support of custom blend modes for each renderer in - * SDL 2.0.6. All renderers support the four blend modes listed in the - * SDL_BlendMode enumeration. - * - * - **direct3d**: Supports all operations with all factors. However, some - * factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and - * `SDL_BLENDOPERATION_MAXIMUM`. - * - **direct3d11**: Same as Direct3D 9. - * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all - * factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL - * 2.0.6. - * - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all - * factors. Color and alpha factors need to be the same. OpenGL ES 1 - * implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT` - * and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha - * operations being different from each other. May support color and alpha - * factors being different from each other. - * - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`, - * `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT` - * operations with all factors. - * - **psp**: No custom blend mode support. - * - **software**: No custom blend mode support. - * - * Some renderers do not provide an alpha component for the default render - * target. The `SDL_BLENDFACTOR_DST_ALPHA` and - * `SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA` factors do not have an effect in this - * case. - * - * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the source pixels - * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the destination pixels - * \param colorOperation the SDL_BlendOperation used to combine the red, - * green, and blue components of the source and - * destination pixels - * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the source pixels - * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the destination pixels - * \param alphaOperation the SDL_BlendOperation used to combine the alpha - * component of the source and destination pixels - * \returns an SDL_BlendMode that represents the chosen factors and - * operations. - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_GetRenderDrawBlendMode - * \sa SDL_SetTextureBlendMode - * \sa SDL_GetTextureBlendMode - */ -extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, - SDL_BlendFactor dstColorFactor, - SDL_BlendOperation colorOperation, - SDL_BlendFactor srcAlphaFactor, - SDL_BlendFactor dstAlphaFactor, - SDL_BlendOperation alphaOperation); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_blendmode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_clipboard.h b/libs/hwcodec/externals/SDL/include/SDL_clipboard.h deleted file mode 100644 index 7c351fbb..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_clipboard.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_clipboard.h - * - * Include file for SDL clipboard handling - */ - -#ifndef SDL_clipboard_h_ -#define SDL_clipboard_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * Put UTF-8 text into the clipboard. - * - * \param text the text to store in the clipboard - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetClipboardText - * \sa SDL_HasClipboardText - */ -extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); - -/** - * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). - * - * This functions returns empty string if there was not enough memory left for - * a copy of the clipboard's content. - * - * \returns the clipboard text on success or an empty string on failure; call - * SDL_GetError() for more information. Caller must call SDL_free() - * on the returned pointer when done with it (even if there was an - * error). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasClipboardText - * \sa SDL_SetClipboardText - */ -extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); - -/** - * Query whether the clipboard exists and contains a non-empty text string. - * - * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetClipboardText - * \sa SDL_SetClipboardText - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); - -/** - * Put UTF-8 text into the primary selection. - * - * \param text the text to store in the primary selection - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_GetPrimarySelectionText - * \sa SDL_HasPrimarySelectionText - */ -extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); - -/** - * Get UTF-8 text from the primary selection, which must be freed with - * SDL_free(). - * - * This functions returns empty string if there was not enough memory left for - * a copy of the primary selection's content. - * - * \returns the primary selection text on success or an empty string on - * failure; call SDL_GetError() for more information. Caller must - * call SDL_free() on the returned pointer when done with it (even if - * there was an error). - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_HasPrimarySelectionText - * \sa SDL_SetPrimarySelectionText - */ -extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); - -/** - * Query whether the primary selection exists and contains a non-empty text - * string. - * - * \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it - * does not. - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_GetPrimarySelectionText - * \sa SDL_SetPrimarySelectionText - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_clipboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_config.h b/libs/hwcodec/externals/SDL/include/SDL_config.h deleted file mode 100644 index 01322c18..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_config.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_windows_h_ -#define SDL_config_windows_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK, - * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence. - * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */ -#if !defined(HAVE_WINSDKVER_H) && defined(__has_include) -#if __has_include() -#define HAVE_WINSDKVER_H 1 -#endif -#endif - -#ifdef HAVE_WINSDKVER_H -#include -#endif - -/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the - * Windows 10 SDK have broken declarations for the C API for DirectX 12. */ -#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include) -#if __has_include() -#define HAVE_SDKDDKVER_H 1 -#endif -#endif - -#ifdef HAVE_SDKDDKVER_H -#include -#endif - -/* This is a set of defines to configure the SDL features */ - -#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) -/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ -#if defined(_MSC_VER) && (_MSC_VER < 1600) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -#else -#define HAVE_STDINT_H 1 -#endif /* Visual Studio 2008 */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -#ifdef __clang__ -# define HAVE_GCC_ATOMICS 1 -#endif - -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#ifndef __WATCOMC__ -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */ -#define HAVE_WINDOWS_GAMING_INPUT_H 1 -#endif -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */ -#define HAVE_D3D11_H 1 -#define HAVE_ROAPI_H 1 -#endif -#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */ -#define HAVE_D3D12_H 1 -#endif -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */ -#define HAVE_SHELLSCALINGAPI_H 1 -#endif -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 -#define HAVE_TPCSHRD_H 1 -#define HAVE_SENSORSAPI_H 1 -#endif -#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) -#define HAVE_IMMINTRIN_H 1 -#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) -# if __has_include() -# define HAVE_IMMINTRIN_H 1 -# endif -#endif - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -/* OpenWatcom requires specific calling conventions for qsort and bsearch */ -#ifndef __WATCOMC__ -#define HAVE_QSORT 1 -#define HAVE_BSEARCH 1 -#endif -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__STRUPR */ -/* #undef HAVE__STRLWR */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE__WCSICMP 1 -#define HAVE__WCSNICMP 1 -#define HAVE__WCSDUP 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_CEIL 1 -#define HAVE_COS 1 -#define HAVE_EXP 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_FMOD 1 -#define HAVE_LOG 1 -#define HAVE_LOG10 1 -#define HAVE_POW 1 -#define HAVE_SIN 1 -#define HAVE_SQRT 1 -#define HAVE_TAN 1 -#ifndef __WATCOMC__ -#define HAVE_ACOSF 1 -#define HAVE_ASINF 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COSF 1 -#define HAVE_EXPF 1 -#define HAVE_FABSF 1 -#define HAVE_FLOORF 1 -#define HAVE_FMODF 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10F 1 -#define HAVE_POWF 1 -#define HAVE_SINF 1 -#define HAVE_SQRTF 1 -#define HAVE_TANF 1 -#endif -#if defined(_MSC_VER) -/* These functions were added with the VC++ 2013 C runtime library */ -#if _MSC_VER >= 1800 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_VSSCANF 1 -#define HAVE_LROUND 1 -#define HAVE_LROUNDF 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#endif -/* This function is available with at least the VC++ 2008 C runtime library */ -#if _MSC_VER >= 1400 -#define HAVE__FSEEKI64 1 -#endif -#ifdef _USE_MATH_DEFINES -#define HAVE_M_PI 1 -#endif -#elif defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_VSSCANF 1 -#define HAVE_ROUND 1 -#define HAVE_SCALBN 1 -#define HAVE_TRUNC 1 -#else -#define HAVE_M_PI 1 -#endif -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H) -#define SDL_AUDIO_DRIVER_WASAPI 1 -#endif -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#ifndef __WINRT__ -#define SDL_JOYSTICK_RAWINPUT 1 -#endif -#define SDL_JOYSTICK_VIRTUAL 1 -#ifdef HAVE_WINDOWS_GAMING_INPUT_H -#define SDL_JOYSTICK_WGI 1 -#endif -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_DINPUT 1 -#define SDL_HAPTIC_XINPUT 1 - -/* Enable the sensor driver */ -#ifdef HAVE_SENSORSAPI_H -#define SDL_SENSOR_WINDOWS 1 -#else -#define SDL_SENSOR_DUMMY 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#define SDL_THREAD_GENERIC_COND_SUFFIX 1 -#define SDL_THREAD_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H) -#define SDL_VIDEO_RENDER_D3D11 1 -#endif -#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) -#define SDL_VIDEO_RENDER_D3D12 1 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - -/* Enable Vulkan support */ -#define SDL_VIDEO_VULKAN 1 - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -#endif /* SDL_config_windows_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_cpuinfo.h b/libs/hwcodec/externals/SDL/include/SDL_cpuinfo.h deleted file mode 100644 index ed5e9791..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_cpuinfo.h +++ /dev/null @@ -1,594 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_cpuinfo.h - * - * CPU feature detection for SDL. - */ - -#ifndef SDL_cpuinfo_h_ -#define SDL_cpuinfo_h_ - -#include "SDL_stdinc.h" - -/* Need to do this here because intrin.h has C++ code in it */ -/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ -#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) -#ifdef __clang__ -/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, - so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ - -#ifndef __PRFCHWINTRIN_H -#define __PRFCHWINTRIN_H - -static __inline__ void __attribute__((__always_inline__, __nodebug__)) -_m_prefetch(void *__P) -{ - __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); -} - -#endif /* __PRFCHWINTRIN_H */ -#endif /* __clang__ */ -#include -#ifndef _WIN64 -#ifndef __MMX__ -#define __MMX__ -#endif -#ifndef __3dNOW__ -#define __3dNOW__ -#endif -#endif -#ifndef __SSE__ -#define __SSE__ -#endif -#ifndef __SSE2__ -#define __SSE2__ -#endif -#ifndef __SSE3__ -#define __SSE3__ -#endif -#elif defined(__MINGW64_VERSION_MAJOR) -#include -#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON) -# include -#endif -#else -/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ -#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) -#include -#endif -#if !defined(SDL_DISABLE_ARM_NEON_H) -# if defined(__ARM_NEON) -# include -# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__) -/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ -# if defined(_M_ARM) -# include -# include -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# endif -# if defined (_M_ARM64) -# include -# include -# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ -# define __ARM_ARCH 8 -# endif -# endif -#endif -#endif /* compiler version */ - -#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) -#include -#endif -#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H) -#include -#define __LSX__ -#endif -#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H) -#include -#define __LASX__ -#endif -#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) -#include -#else -#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) -#include -#endif -#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H) -#include -#endif -#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H) -#include -#endif -#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H) -#include -#endif -#endif /* HAVE_IMMINTRIN_H */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* This is a guess for the cacheline size used for padding. - * Most x86 processors have a 64 byte cache line. - * The 64-bit PowerPC processors have a 128 byte cache line. - * We'll use the larger value to be generally safe. - */ -#define SDL_CACHELINE_SIZE 128 - -/** - * Get the number of CPU cores available. - * - * \returns the total number of logical CPU cores. On CPUs that include - * technologies such as hyperthreading, the number of logical cores - * may be more than the number of physical cores. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); - -/** - * Determine the L1 cache line size of the CPU. - * - * This is useful for determining multi-threaded structure padding or SIMD - * prefetch sizes. - * - * \returns the L1 cache line size of the CPU, in bytes. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); - -/** - * Determine whether the CPU has the RDTSC instruction. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has the RDTSC instruction or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/** - * Determine whether the CPU has AltiVec features. - * - * This always returns false on CPUs that aren't using PowerPC instruction - * sets. - * - * \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/** - * Determine whether the CPU has MMX features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/** - * Determine whether the CPU has 3DNow! features. - * - * This always returns false on CPUs that aren't using AMD instruction sets. - * - * \returns SDL_TRUE if the CPU has 3DNow! features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/** - * Determine whether the CPU has SSE features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/** - * Determine whether the CPU has SSE2 features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/** - * Determine whether the CPU has SSE3 features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); - -/** - * Determine whether the CPU has SSE4.1 features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); - -/** - * Determine whether the CPU has SSE4.2 features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); - -/** - * Determine whether the CPU has AVX features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX2 - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); - -/** - * Determine whether the CPU has AVX2 features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_Has3DNow - * \sa SDL_HasAltiVec - * \sa SDL_HasAVX - * \sa SDL_HasMMX - * \sa SDL_HasRDTSC - * \sa SDL_HasSSE - * \sa SDL_HasSSE2 - * \sa SDL_HasSSE3 - * \sa SDL_HasSSE41 - * \sa SDL_HasSSE42 - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); - -/** - * Determine whether the CPU has AVX-512F (foundation) features. - * - * This always returns false on CPUs that aren't using Intel instruction sets. - * - * \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_HasAVX - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); - -/** - * Determine whether the CPU has ARM SIMD (ARMv6) features. - * - * This is different from ARM NEON, which is a different instruction set. - * - * This always returns false on CPUs that aren't using ARM instruction sets. - * - * \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_HasNEON - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); - -/** - * Determine whether the CPU has NEON (ARM SIMD) features. - * - * This always returns false on CPUs that aren't using ARM instruction sets. - * - * \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); - -/** - * Determine whether the CPU has LSX (LOONGARCH SIMD) features. - * - * This always returns false on CPUs that aren't using LOONGARCH instruction - * sets. - * - * \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if - * not. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void); - -/** - * Determine whether the CPU has LASX (LOONGARCH SIMD) features. - * - * This always returns false on CPUs that aren't using LOONGARCH instruction - * sets. - * - * \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if - * not. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void); - -/** - * Get the amount of RAM configured in the system. - * - * \returns the amount of RAM configured in the system in MiB. - * - * \since This function is available since SDL 2.0.1. - */ -extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); - -/** - * Report the alignment this system needs for SIMD allocations. - * - * This will return the minimum number of bytes to which a pointer must be - * aligned to be compatible with SIMD instructions on the current machine. For - * example, if the machine supports SSE only, it will return 16, but if it - * supports AVX-512F, it'll return 64 (etc). This only reports values for - * instruction sets SDL knows about, so if your SDL build doesn't have - * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and - * not 64 for the AVX-512 instructions that exist but SDL doesn't know about. - * Plan accordingly. - * - * \returns the alignment in bytes needed for available, known SIMD - * instructions. - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); - -/** - * Allocate memory in a SIMD-friendly way. - * - * This will allocate a block of memory that is suitable for use with SIMD - * instructions. Specifically, it will be properly aligned and padded for the - * system's supported vector instructions. - * - * The memory returned will be padded such that it is safe to read or write an - * incomplete vector at the end of the memory block. This can be useful so you - * don't have to drop back to a scalar fallback at the end of your SIMD - * processing loop to deal with the final elements without overflowing the - * allocated buffer. - * - * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() or - * delete[], etc. - * - * Note that SDL will only deal with SIMD instruction sets it is aware of; for - * example, SDL 2.0.8 knows that SSE wants 16-byte vectors (SDL_HasSSE()), and - * AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't know that AVX-512 wants - * 64. To be clear: if you can't decide to use an instruction set with an - * SDL_Has*() function, don't use that instruction set with memory allocated - * through here. - * - * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't - * out of memory, but you are not allowed to dereference it (because you only - * own zero bytes of that buffer). - * - * \param len The length, in bytes, of the block to allocate. The actual - * allocated block might be larger due to padding, etc. - * \returns a pointer to the newly-allocated block, NULL if out of memory. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_SIMDGetAlignment - * \sa SDL_SIMDRealloc - * \sa SDL_SIMDFree - */ -extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); - -/** - * Reallocate memory obtained from SDL_SIMDAlloc - * - * It is not valid to use this function on a pointer from anything but - * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, - * SDL_malloc, memalign, new[], etc. - * - * \param mem The pointer obtained from SDL_SIMDAlloc. This function also - * accepts NULL, at which point this function is the same as - * calling SDL_SIMDAlloc with a NULL pointer. - * \param len The length, in bytes, of the block to allocated. The actual - * allocated block might be larger due to padding, etc. Passing 0 - * will return a non-NULL pointer, assuming the system isn't out of - * memory. - * \returns a pointer to the newly-reallocated block, NULL if out of memory. - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_SIMDGetAlignment - * \sa SDL_SIMDAlloc - * \sa SDL_SIMDFree - */ -extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); - -/** - * Deallocate memory obtained from SDL_SIMDAlloc - * - * It is not valid to use this function on a pointer from anything but - * SDL_SIMDAlloc() or SDL_SIMDRealloc(). It can't be used on pointers from - * malloc, realloc, SDL_malloc, memalign, new[], etc. - * - * However, SDL_SIMDFree(NULL) is a legal no-op. - * - * The memory pointed to by `ptr` is no longer valid for access upon return, - * and may be returned to the system or reused by a future allocation. The - * pointer passed to this function is no longer safe to dereference once this - * function returns, and should be discarded. - * - * \param ptr The pointer, returned from SDL_SIMDAlloc or SDL_SIMDRealloc, to - * deallocate. NULL is a legal no-op. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_SIMDAlloc - * \sa SDL_SIMDRealloc - */ -extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_cpuinfo_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_egl.h b/libs/hwcodec/externals/SDL/include/SDL_egl.h deleted file mode 100644 index 6f51c083..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_egl.h +++ /dev/null @@ -1,2352 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_egl.h - * - * This is a simple file to encapsulate the EGL API headers. - */ -#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) - -#if defined(__vita__) || defined(__psp2__) -#include -#endif - -#include -#include - -#else /* _MSC_VER */ - -/* EGL headers for Visual Studio */ - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * The master copy of khrplatform.h is maintained in the Khronos EGL - * Registry repository at https://github.com/KhronosGroup/EGL-Registry - * The last semantic modification to khrplatform.h was at commit ID: - * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by filing pull requests or issues on - * the EGL Registry repository linked above. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_APIENTRY - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) -# define KHRONOS_STATIC 1 -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(KHRONOS_STATIC) - /* If the preprocessor constant KHRONOS_STATIC is defined, make the - * header compatible with static linking. */ -# define KHRONOS_APICALL -#elif defined(_WIN32) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#elif defined(__ANDROID__) -# define KHRONOS_APICALL __attribute__((visibility("default"))) -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIENTRY - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 -/* - * To support platform where unsigned long cannot be used interchangeably with - * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. - * Ideally, we could just use (u)intptr_t everywhere, but this could result in - * ABI breakage if khronos_uintptr_t is changed from unsigned long to - * unsigned long long or similar (this results in different C++ name mangling). - * To avoid changes for existing platforms, we restrict usage of intptr_t to - * platforms where the size of a pointer is larger than the size of long. - */ -#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) -#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ -#define KHRONOS_USE_INTPTR_T -#endif -#endif - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef KHRONOS_USE_INTPTR_T -typedef intptr_t khronos_intptr_t; -typedef uintptr_t khronos_uintptr_t; -#elif defined(_WIN64) -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -#endif - -#if defined(_WIN64) -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - - -#ifndef __eglplatform_h_ -#define __eglplatform_h_ - -/* -** Copyright 2007-2020 The Khronos Group Inc. -** SPDX-License-Identifier: Apache-2.0 -*/ - -/* Platform-specific types and definitions for egl.h - * - * Adopters may modify khrplatform.h and this file to suit their platform. - * You are encouraged to submit all modifications to the Khronos group so that - * they can be included in future versions of this file. Please submit changes - * by filing an issue or pull request on the public Khronos EGL Registry, at - * https://www.github.com/KhronosGroup/EGL-Registry/ - */ - -/*#include */ - -/* Macros used in EGL function prototype declarations. - * - * EGL functions should be prototyped as: - * - * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); - * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); - * - * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h - */ - -#ifndef EGLAPI -#define EGLAPI KHRONOS_APICALL -#endif - -#ifndef EGLAPIENTRY -#define EGLAPIENTRY KHRONOS_APIENTRY -#endif -#define EGLAPIENTRYP EGLAPIENTRY* - -/* The types NativeDisplayType, NativeWindowType, and NativePixmapType - * are aliases of window-system-dependent types, such as X Display * or - * Windows Device Context. They must be defined in platform-specific - * code below. The EGL-prefixed versions of Native*Type are the same - * types, renamed in EGL 1.3 so all types in the API start with "EGL". - * - * Khronos STRONGLY RECOMMENDS that you use the default definitions - * provided below, since these changes affect both binary and source - * portability of applications using EGL running on different EGL - * implementations. - */ - -#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES) - -typedef void *EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include - -typedef HDC EGLNativeDisplayType; -typedef HBITMAP EGLNativePixmapType; -typedef HWND EGLNativeWindowType; - -#elif defined(__EMSCRIPTEN__) - -typedef int EGLNativeDisplayType; -typedef int EGLNativePixmapType; -typedef int EGLNativeWindowType; - -#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ - -typedef int EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(WL_EGL_PLATFORM) - -typedef struct wl_display *EGLNativeDisplayType; -typedef struct wl_egl_pixmap *EGLNativePixmapType; -typedef struct wl_egl_window *EGLNativeWindowType; - -#elif defined(__GBM__) - -typedef struct gbm_device *EGLNativeDisplayType; -typedef struct gbm_bo *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(__ANDROID__) || defined(ANDROID) - -struct ANativeWindow; -struct egl_native_pixmap_t; - -typedef void* EGLNativeDisplayType; -typedef struct egl_native_pixmap_t* EGLNativePixmapType; -typedef struct ANativeWindow* EGLNativeWindowType; - -#elif defined(USE_OZONE) - -typedef intptr_t EGLNativeDisplayType; -typedef intptr_t EGLNativePixmapType; -typedef intptr_t EGLNativeWindowType; - -#elif defined(USE_X11) - -/* X11 (tentative) */ -#include -#include - -typedef Display *EGLNativeDisplayType; -typedef Pixmap EGLNativePixmapType; -typedef Window EGLNativeWindowType; - -#elif defined(__unix__) - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#elif defined(__APPLE__) - -typedef int EGLNativeDisplayType; -typedef void *EGLNativePixmapType; -typedef void *EGLNativeWindowType; - -#elif defined(__HAIKU__) - -#include - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#elif defined(__Fuchsia__) - -typedef void *EGLNativeDisplayType; -typedef khronos_uintptr_t EGLNativePixmapType; -typedef khronos_uintptr_t EGLNativeWindowType; - -#else -#error "Platform not recognized" -#endif - -/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ -typedef EGLNativeDisplayType NativeDisplayType; -typedef EGLNativePixmapType NativePixmapType; -typedef EGLNativeWindowType NativeWindowType; - - -/* Define EGLint. This must be a signed integral type large enough to contain - * all legal attribute names and values passed into and out of EGL, whether - * their type is boolean, bitmask, enumerant (symbolic constant), integer, - * handle, or other. While in general a 32-bit integer will suffice, if - * handles are 64 bit types, then EGLint should be defined as a signed 64-bit - * integer type. - */ -typedef khronos_int32_t EGLint; - - -/* C++ / C typecast macros for special EGL handle values */ -#if defined(__cplusplus) -#define EGL_CAST(type, value) (static_cast(value)) -#else -#define EGL_CAST(type, value) ((type) (value)) -#endif - -#endif /* __eglplatform_h */ - - -#ifndef __egl_h_ -#define __egl_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: Apache-2.0 -** -** This header is generated from the Khronos EGL XML API Registry. -** The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.khronos.org/registry/egl -** -** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ -*/ - -/*#include */ - -#ifndef EGL_EGL_PROTOTYPES -#define EGL_EGL_PROTOTYPES 1 -#endif - -/* Generated on date 20220525 */ - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_VERSION_1_0 -#define EGL_VERSION_1_0 1 -typedef unsigned int EGLBoolean; -typedef void *EGLDisplay; -/*#include */ -/*#include */ -typedef void *EGLConfig; -typedef void *EGLSurface; -typedef void *EGLContext; -typedef void (*__eglMustCastToProperFunctionPointerType)(void); -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300A -#define EGL_BAD_NATIVE_WINDOW 0x300B -#define EGL_BAD_PARAMETER 0x300C -#define EGL_BAD_SURFACE 0x300D -#define EGL_BLUE_SIZE 0x3022 -#define EGL_BUFFER_SIZE 0x3020 -#define EGL_CONFIG_CAVEAT 0x3027 -#define EGL_CONFIG_ID 0x3028 -#define EGL_CORE_NATIVE_ENGINE 0x305B -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_DONT_CARE EGL_CAST(EGLint,-1) -#define EGL_DRAW 0x3059 -#define EGL_EXTENSIONS 0x3055 -#define EGL_FALSE 0 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_HEIGHT 0x3056 -#define EGL_LARGEST_PBUFFER 0x3058 -#define EGL_LEVEL 0x3029 -#define EGL_MAX_PBUFFER_HEIGHT 0x302A -#define EGL_MAX_PBUFFER_PIXELS 0x302B -#define EGL_MAX_PBUFFER_WIDTH 0x302C -#define EGL_NATIVE_RENDERABLE 0x302D -#define EGL_NATIVE_VISUAL_ID 0x302E -#define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_NONE 0x3038 -#define EGL_NON_CONFORMANT_CONFIG 0x3051 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_NO_CONTEXT EGL_CAST(EGLContext,0) -#define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0) -#define EGL_NO_SURFACE EGL_CAST(EGLSurface,0) -#define EGL_PBUFFER_BIT 0x0001 -#define EGL_PIXMAP_BIT 0x0002 -#define EGL_READ 0x305A -#define EGL_RED_SIZE 0x3024 -#define EGL_SAMPLES 0x3031 -#define EGL_SAMPLE_BUFFERS 0x3032 -#define EGL_SLOW_CONFIG 0x3050 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_SUCCESS 0x3000 -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 -#define EGL_TRANSPARENT_RED_VALUE 0x3037 -#define EGL_TRANSPARENT_RGB 0x3052 -#define EGL_TRANSPARENT_TYPE 0x3034 -#define EGL_TRUE 1 -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_WIDTH 0x3057 -#define EGL_WINDOW_BIT 0x0004 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); -typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void); -typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); -typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void); -typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine); -#if EGL_EGL_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); -EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); -EGLAPI EGLint EGLAPIENTRY eglGetError (void); -EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); -EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); -#endif -#endif /* EGL_VERSION_1_0 */ - -#ifndef EGL_VERSION_1_1 -#define EGL_VERSION_1_1 1 -#define EGL_BACK_BUFFER 0x3084 -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A -#define EGL_CONTEXT_LOST 0x300E -#define EGL_MIN_SWAP_INTERVAL 0x303B -#define EGL_MAX_SWAP_INTERVAL 0x303C -#define EGL_MIPMAP_TEXTURE 0x3082 -#define EGL_MIPMAP_LEVEL 0x3083 -#define EGL_NO_TEXTURE 0x305C -#define EGL_TEXTURE_2D 0x305F -#define EGL_TEXTURE_FORMAT 0x3080 -#define EGL_TEXTURE_RGB 0x305D -#define EGL_TEXTURE_RGBA 0x305E -#define EGL_TEXTURE_TARGET 0x3081 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); -#if EGL_EGL_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); -EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); -#endif -#endif /* EGL_VERSION_1_1 */ - -#ifndef EGL_VERSION_1_2 -#define EGL_VERSION_1_2 1 -typedef unsigned int EGLenum; -typedef void *EGLClientBuffer; -#define EGL_ALPHA_FORMAT 0x3088 -#define EGL_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_ALPHA_FORMAT_PRE 0x308C -#define EGL_ALPHA_MASK_SIZE 0x303E -#define EGL_BUFFER_PRESERVED 0x3094 -#define EGL_BUFFER_DESTROYED 0x3095 -#define EGL_CLIENT_APIS 0x308D -#define EGL_COLORSPACE 0x3087 -#define EGL_COLORSPACE_sRGB 0x3089 -#define EGL_COLORSPACE_LINEAR 0x308A -#define EGL_COLOR_BUFFER_TYPE 0x303F -#define EGL_CONTEXT_CLIENT_TYPE 0x3097 -#define EGL_DISPLAY_SCALING 10000 -#define EGL_HORIZONTAL_RESOLUTION 0x3090 -#define EGL_LUMINANCE_BUFFER 0x308F -#define EGL_LUMINANCE_SIZE 0x303D -#define EGL_OPENGL_ES_BIT 0x0001 -#define EGL_OPENVG_BIT 0x0002 -#define EGL_OPENGL_ES_API 0x30A0 -#define EGL_OPENVG_API 0x30A1 -#define EGL_OPENVG_IMAGE 0x3096 -#define EGL_PIXEL_ASPECT_RATIO 0x3092 -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_RGB_BUFFER 0x308E -#define EGL_SINGLE_BUFFER 0x3085 -#define EGL_SWAP_BEHAVIOR 0x3093 -#define EGL_UNKNOWN EGL_CAST(EGLint,-1) -#define EGL_VERTICAL_RESOLUTION 0x3091 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api); -typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void); -#if EGL_EGL_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); -EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); -#endif -#endif /* EGL_VERSION_1_2 */ - -#ifndef EGL_VERSION_1_3 -#define EGL_VERSION_1_3 1 -#define EGL_CONFORMANT 0x3042 -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 -#define EGL_MATCH_NATIVE_PIXMAP 0x3041 -#define EGL_OPENGL_ES2_BIT 0x0004 -#define EGL_VG_ALPHA_FORMAT 0x3088 -#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B -#define EGL_VG_ALPHA_FORMAT_PRE 0x308C -#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 -#define EGL_VG_COLORSPACE 0x3087 -#define EGL_VG_COLORSPACE_sRGB 0x3089 -#define EGL_VG_COLORSPACE_LINEAR 0x308A -#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 -#endif /* EGL_VERSION_1_3 */ - -#ifndef EGL_VERSION_1_4 -#define EGL_VERSION_1_4 1 -#define EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0) -#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 -#define EGL_MULTISAMPLE_RESOLVE 0x3099 -#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A -#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B -#define EGL_OPENGL_API 0x30A2 -#define EGL_OPENGL_BIT 0x0008 -#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 -typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void); -#if EGL_EGL_PROTOTYPES -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); -#endif -#endif /* EGL_VERSION_1_4 */ - -#ifndef EGL_VERSION_1_5 -#define EGL_VERSION_1_5 1 -typedef void *EGLSync; -typedef intptr_t EGLAttrib; -typedef khronos_utime_nanoseconds_t EGLTime; -typedef void *EGLImage; -#define EGL_CONTEXT_MAJOR_VERSION 0x3098 -#define EGL_CONTEXT_MINOR_VERSION 0x30FB -#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD -#define EGL_NO_RESET_NOTIFICATION 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 -#define EGL_OPENGL_ES3_BIT 0x00000040 -#define EGL_CL_EVENT_HANDLE 0x309C -#define EGL_SYNC_CL_EVENT 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 -#define EGL_SYNC_TYPE 0x30F7 -#define EGL_SYNC_STATUS 0x30F1 -#define EGL_SYNC_CONDITION 0x30F8 -#define EGL_SIGNALED 0x30F2 -#define EGL_UNSIGNALED 0x30F3 -#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 -#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull -#define EGL_TIMEOUT_EXPIRED 0x30F5 -#define EGL_CONDITION_SATISFIED 0x30F6 -#define EGL_NO_SYNC EGL_CAST(EGLSync,0) -#define EGL_SYNC_FENCE 0x30F9 -#define EGL_GL_COLORSPACE 0x309D -#define EGL_GL_COLORSPACE_SRGB 0x3089 -#define EGL_GL_COLORSPACE_LINEAR 0x308A -#define EGL_GL_RENDERBUFFER 0x30B9 -#define EGL_GL_TEXTURE_2D 0x30B1 -#define EGL_GL_TEXTURE_LEVEL 0x30BC -#define EGL_GL_TEXTURE_3D 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET 0x30BD -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 -#define EGL_IMAGE_PRESERVED 0x30D2 -#define EGL_NO_IMAGE EGL_CAST(EGLImage,0) -typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); -typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); -#if EGL_EGL_PROTOTYPES -EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); -EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); -#endif -#endif /* EGL_VERSION_1_5 */ - -#ifdef __cplusplus -} -#endif - -#endif /* __egl_h_ */ - - -#ifndef __eglext_h_ -#define __eglext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: Apache-2.0 -** -** This header is generated from the Khronos EGL XML API Registry. -** The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** http://www.khronos.org/registry/egl -** -** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ -*/ - -/*#include */ - -#define EGL_EGLEXT_VERSION 20220525 - -/* Generated C header for: - * API: egl - * Versions considered: .* - * Versions emitted: _nomatch_^ - * Default extensions included: egl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef EGL_KHR_cl_event -#define EGL_KHR_cl_event 1 -#define EGL_CL_EVENT_HANDLE_KHR 0x309C -#define EGL_SYNC_CL_EVENT_KHR 0x30FE -#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF -#endif /* EGL_KHR_cl_event */ - -#ifndef EGL_KHR_cl_event2 -#define EGL_KHR_cl_event2 1 -typedef void *EGLSyncKHR; -typedef intptr_t EGLAttribKHR; -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); -#endif -#endif /* EGL_KHR_cl_event2 */ - -#ifndef EGL_KHR_client_get_all_proc_addresses -#define EGL_KHR_client_get_all_proc_addresses 1 -#endif /* EGL_KHR_client_get_all_proc_addresses */ - -#ifndef EGL_KHR_config_attribs -#define EGL_KHR_config_attribs 1 -#define EGL_CONFORMANT_KHR 0x3042 -#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 -#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 -#endif /* EGL_KHR_config_attribs */ - -#ifndef EGL_KHR_context_flush_control -#define EGL_KHR_context_flush_control 1 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 -#endif /* EGL_KHR_context_flush_control */ - -#ifndef EGL_KHR_create_context -#define EGL_KHR_create_context 1 -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB -#define EGL_CONTEXT_FLAGS_KHR 0x30FC -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 -#endif /* EGL_KHR_create_context */ - -#ifndef EGL_KHR_create_context_no_error -#define EGL_KHR_create_context_no_error 1 -#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 -#endif /* EGL_KHR_create_context_no_error */ - -#ifndef EGL_KHR_debug -#define EGL_KHR_debug 1 -typedef void *EGLLabelKHR; -typedef void *EGLObjectKHR; -typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); -#define EGL_OBJECT_THREAD_KHR 0x33B0 -#define EGL_OBJECT_DISPLAY_KHR 0x33B1 -#define EGL_OBJECT_CONTEXT_KHR 0x33B2 -#define EGL_OBJECT_SURFACE_KHR 0x33B3 -#define EGL_OBJECT_IMAGE_KHR 0x33B4 -#define EGL_OBJECT_SYNC_KHR 0x33B5 -#define EGL_OBJECT_STREAM_KHR 0x33B6 -#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 -#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA -#define EGL_DEBUG_MSG_WARN_KHR 0x33BB -#define EGL_DEBUG_MSG_INFO_KHR 0x33BC -#define EGL_DEBUG_CALLBACK_KHR 0x33B8 -typedef EGLint (EGLAPIENTRYP PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib *value); -typedef EGLint (EGLAPIENTRYP PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglDebugMessageControlKHR (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDebugKHR (EGLint attribute, EGLAttrib *value); -EGLAPI EGLint EGLAPIENTRY eglLabelObjectKHR (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); -#endif -#endif /* EGL_KHR_debug */ - -#ifndef EGL_KHR_display_reference -#define EGL_KHR_display_reference 1 -#define EGL_TRACK_REFERENCES_KHR 0x3352 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBKHRPROC) (EGLDisplay dpy, EGLint name, EGLAttrib *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribKHR (EGLDisplay dpy, EGLint name, EGLAttrib *value); -#endif -#endif /* EGL_KHR_display_reference */ - -#ifndef EGL_KHR_fence_sync -#define EGL_KHR_fence_sync 1 -typedef khronos_utime_nanoseconds_t EGLTimeKHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 -#define EGL_SYNC_CONDITION_KHR 0x30F8 -#define EGL_SYNC_FENCE_KHR 0x30F9 -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_fence_sync */ - -#ifndef EGL_KHR_get_all_proc_addresses -#define EGL_KHR_get_all_proc_addresses 1 -#endif /* EGL_KHR_get_all_proc_addresses */ - -#ifndef EGL_KHR_gl_colorspace -#define EGL_KHR_gl_colorspace 1 -#define EGL_GL_COLORSPACE_KHR 0x309D -#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 -#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A -#endif /* EGL_KHR_gl_colorspace */ - -#ifndef EGL_KHR_gl_renderbuffer_image -#define EGL_KHR_gl_renderbuffer_image 1 -#define EGL_GL_RENDERBUFFER_KHR 0x30B9 -#endif /* EGL_KHR_gl_renderbuffer_image */ - -#ifndef EGL_KHR_gl_texture_2D_image -#define EGL_KHR_gl_texture_2D_image 1 -#define EGL_GL_TEXTURE_2D_KHR 0x30B1 -#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC -#endif /* EGL_KHR_gl_texture_2D_image */ - -#ifndef EGL_KHR_gl_texture_3D_image -#define EGL_KHR_gl_texture_3D_image 1 -#define EGL_GL_TEXTURE_3D_KHR 0x30B2 -#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD -#endif /* EGL_KHR_gl_texture_3D_image */ - -#ifndef EGL_KHR_gl_texture_cubemap_image -#define EGL_KHR_gl_texture_cubemap_image 1 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 -#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 -#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 -#endif /* EGL_KHR_gl_texture_cubemap_image */ - -#ifndef EGL_KHR_image -#define EGL_KHR_image 1 -typedef void *EGLImageKHR; -#define EGL_NATIVE_PIXMAP_KHR 0x30B0 -#define EGL_NO_IMAGE_KHR EGL_CAST(EGLImageKHR,0) -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); -#endif -#endif /* EGL_KHR_image */ - -#ifndef EGL_KHR_image_base -#define EGL_KHR_image_base 1 -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 -#endif /* EGL_KHR_image_base */ - -#ifndef EGL_KHR_image_pixmap -#define EGL_KHR_image_pixmap 1 -#endif /* EGL_KHR_image_pixmap */ - -#ifndef EGL_KHR_lock_surface -#define EGL_KHR_lock_surface 1 -#define EGL_READ_SURFACE_BIT_KHR 0x0001 -#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 -#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 -#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 -#define EGL_MATCH_FORMAT_KHR 0x3043 -#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 -#define EGL_FORMAT_RGB_565_KHR 0x30C1 -#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 -#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 -#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 -#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 -#define EGL_BITMAP_POINTER_KHR 0x30C6 -#define EGL_BITMAP_PITCH_KHR 0x30C7 -#define EGL_BITMAP_ORIGIN_KHR 0x30C8 -#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 -#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA -#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB -#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC -#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD -#define EGL_LOWER_LEFT_KHR 0x30CE -#define EGL_UPPER_LEFT_KHR 0x30CF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); -#endif -#endif /* EGL_KHR_lock_surface */ - -#ifndef EGL_KHR_lock_surface2 -#define EGL_KHR_lock_surface2 1 -#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 -#endif /* EGL_KHR_lock_surface2 */ - -#ifndef EGL_KHR_lock_surface3 -#define EGL_KHR_lock_surface3 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); -#endif -#endif /* EGL_KHR_lock_surface3 */ - -#ifndef EGL_KHR_mutable_render_buffer -#define EGL_KHR_mutable_render_buffer 1 -#define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 -#endif /* EGL_KHR_mutable_render_buffer */ - -#ifndef EGL_KHR_no_config_context -#define EGL_KHR_no_config_context 1 -#define EGL_NO_CONFIG_KHR EGL_CAST(EGLConfig,0) -#endif /* EGL_KHR_no_config_context */ - -#ifndef EGL_KHR_partial_update -#define EGL_KHR_partial_update 1 -#define EGL_BUFFER_AGE_KHR 0x313D -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_partial_update */ - -#ifndef EGL_KHR_platform_android -#define EGL_KHR_platform_android 1 -#define EGL_PLATFORM_ANDROID_KHR 0x3141 -#endif /* EGL_KHR_platform_android */ - -#ifndef EGL_KHR_platform_gbm -#define EGL_KHR_platform_gbm 1 -#define EGL_PLATFORM_GBM_KHR 0x31D7 -#endif /* EGL_KHR_platform_gbm */ - -#ifndef EGL_KHR_platform_wayland -#define EGL_KHR_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 -#endif /* EGL_KHR_platform_wayland */ - -#ifndef EGL_KHR_platform_x11 -#define EGL_KHR_platform_x11 1 -#define EGL_PLATFORM_X11_KHR 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 -#endif /* EGL_KHR_platform_x11 */ - -#ifndef EGL_KHR_reusable_sync -#define EGL_KHR_reusable_sync 1 -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_STATUS_KHR 0x30F1 -#define EGL_SIGNALED_KHR 0x30F2 -#define EGL_UNSIGNALED_KHR 0x30F3 -#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 -#define EGL_CONDITION_SATISFIED_KHR 0x30F6 -#define EGL_SYNC_TYPE_KHR 0x30F7 -#define EGL_SYNC_REUSABLE_KHR 0x30FA -#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 -#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull -#define EGL_NO_SYNC_KHR EGL_CAST(EGLSyncKHR,0) -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_reusable_sync */ - -#ifndef EGL_KHR_stream -#define EGL_KHR_stream 1 -typedef void *EGLStreamKHR; -typedef khronos_uint64_t EGLuint64KHR; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_NO_STREAM_KHR EGL_CAST(EGLStreamKHR,0) -#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 -#define EGL_PRODUCER_FRAME_KHR 0x3212 -#define EGL_CONSUMER_FRAME_KHR 0x3213 -#define EGL_STREAM_STATE_KHR 0x3214 -#define EGL_STREAM_STATE_CREATED_KHR 0x3215 -#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 -#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 -#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 -#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 -#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A -#define EGL_BAD_STREAM_KHR 0x321B -#define EGL_BAD_STATE_KHR 0x321C -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_stream */ - -#ifndef EGL_KHR_stream_attrib -#define EGL_KHR_stream_attrib 1 -#ifdef KHRONOS_SUPPORT_INT64 -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamAttribKHR (EGLDisplay dpy, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_KHR_stream_attrib */ - -#ifndef EGL_KHR_stream_consumer_gltexture -#define EGL_KHR_stream_consumer_gltexture 1 -#ifdef EGL_KHR_stream -#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_consumer_gltexture */ - -#ifndef EGL_KHR_stream_cross_process_fd -#define EGL_KHR_stream_cross_process_fd 1 -typedef int EGLNativeFileDescriptorKHR; -#ifdef EGL_KHR_stream -#define EGL_NO_FILE_DESCRIPTOR_KHR EGL_CAST(EGLNativeFileDescriptorKHR,-1) -typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); -typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); -EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_cross_process_fd */ - -#ifndef EGL_KHR_stream_fifo -#define EGL_KHR_stream_fifo 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC -#define EGL_STREAM_TIME_NOW_KHR 0x31FD -#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE -#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_fifo */ - -#ifndef EGL_KHR_stream_producer_aldatalocator -#define EGL_KHR_stream_producer_aldatalocator 1 -#ifdef EGL_KHR_stream -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_aldatalocator */ - -#ifndef EGL_KHR_stream_producer_eglsurface -#define EGL_KHR_stream_producer_eglsurface 1 -#ifdef EGL_KHR_stream -#define EGL_STREAM_BIT_KHR 0x0800 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); -#endif -#endif /* EGL_KHR_stream */ -#endif /* EGL_KHR_stream_producer_eglsurface */ - -#ifndef EGL_KHR_surfaceless_context -#define EGL_KHR_surfaceless_context 1 -#endif /* EGL_KHR_surfaceless_context */ - -#ifndef EGL_KHR_swap_buffers_with_damage -#define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_KHR_swap_buffers_with_damage */ - -#ifndef EGL_KHR_vg_parent_image -#define EGL_KHR_vg_parent_image 1 -#define EGL_VG_PARENT_IMAGE_KHR 0x30BA -#endif /* EGL_KHR_vg_parent_image */ - -#ifndef EGL_KHR_wait_sync -#define EGL_KHR_wait_sync 1 -typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif -#endif /* EGL_KHR_wait_sync */ - -#ifndef EGL_ANDROID_GLES_layers -#define EGL_ANDROID_GLES_layers 1 -#endif /* EGL_ANDROID_GLES_layers */ - -#ifndef EGL_ANDROID_blob_cache -#define EGL_ANDROID_blob_cache 1 -typedef khronos_ssize_t EGLsizeiANDROID; -typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); -typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); -typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); -#endif -#endif /* EGL_ANDROID_blob_cache */ - -#ifndef EGL_ANDROID_create_native_client_buffer -#define EGL_ANDROID_create_native_client_buffer 1 -#define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 -#define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 -#define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 -#define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 -typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLClientBuffer EGLAPIENTRY eglCreateNativeClientBufferANDROID (const EGLint *attrib_list); -#endif -#endif /* EGL_ANDROID_create_native_client_buffer */ - -#ifndef EGL_ANDROID_framebuffer_target -#define EGL_ANDROID_framebuffer_target 1 -#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 -#endif /* EGL_ANDROID_framebuffer_target */ - -#ifndef EGL_ANDROID_front_buffer_auto_refresh -#define EGL_ANDROID_front_buffer_auto_refresh 1 -#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C -#endif /* EGL_ANDROID_front_buffer_auto_refresh */ - -#ifndef EGL_ANDROID_get_frame_timestamps -#define EGL_ANDROID_get_frame_timestamps 1 -typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; -#define EGL_TIMESTAMP_PENDING_ANDROID EGL_CAST(EGLnsecsANDROID,-2) -#define EGL_TIMESTAMP_INVALID_ANDROID EGL_CAST(EGLnsecsANDROID,-1) -#define EGL_TIMESTAMPS_ANDROID 0x3430 -#define EGL_COMPOSITE_DEADLINE_ANDROID 0x3431 -#define EGL_COMPOSITE_INTERVAL_ANDROID 0x3432 -#define EGL_COMPOSITE_TO_PRESENT_LATENCY_ANDROID 0x3433 -#define EGL_REQUESTED_PRESENT_TIME_ANDROID 0x3434 -#define EGL_RENDERING_COMPLETE_TIME_ANDROID 0x3435 -#define EGL_COMPOSITION_LATCH_TIME_ANDROID 0x3436 -#define EGL_FIRST_COMPOSITION_START_TIME_ANDROID 0x3437 -#define EGL_LAST_COMPOSITION_START_TIME_ANDROID 0x3438 -#define EGL_FIRST_COMPOSITION_GPU_FINISHED_TIME_ANDROID 0x3439 -#define EGL_DISPLAY_PRESENT_TIME_ANDROID 0x343A -#define EGL_DEQUEUE_READY_TIME_ANDROID 0x343B -#define EGL_READS_DONE_TIME_ANDROID 0x343C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCOMPOSITORTIMINGSUPPORTEDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCOMPOSITORTIMINGANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numTimestamps, const EGLint *names, EGLnsecsANDROID *values); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETNEXTFRAMEIDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR *frameId); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint timestamp); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR frameId, EGLint numTimestamps, const EGLint *timestamps, EGLnsecsANDROID *values); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetCompositorTimingSupportedANDROID (EGLDisplay dpy, EGLSurface surface, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglGetCompositorTimingANDROID (EGLDisplay dpy, EGLSurface surface, EGLint numTimestamps, const EGLint *names, EGLnsecsANDROID *values); -EGLAPI EGLBoolean EGLAPIENTRY eglGetNextFrameIdANDROID (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR *frameId); -EGLAPI EGLBoolean EGLAPIENTRY eglGetFrameTimestampSupportedANDROID (EGLDisplay dpy, EGLSurface surface, EGLint timestamp); -EGLAPI EGLBoolean EGLAPIENTRY eglGetFrameTimestampsANDROID (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR frameId, EGLint numTimestamps, const EGLint *timestamps, EGLnsecsANDROID *values); -#endif -#endif /* EGL_ANDROID_get_frame_timestamps */ - -#ifndef EGL_ANDROID_get_native_client_buffer -#define EGL_ANDROID_get_native_client_buffer 1 -struct AHardwareBuffer; -typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETNATIVECLIENTBUFFERANDROIDPROC) (const struct AHardwareBuffer *buffer); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLClientBuffer EGLAPIENTRY eglGetNativeClientBufferANDROID (const struct AHardwareBuffer *buffer); -#endif -#endif /* EGL_ANDROID_get_native_client_buffer */ - -#ifndef EGL_ANDROID_image_native_buffer -#define EGL_ANDROID_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#endif /* EGL_ANDROID_image_native_buffer */ - -#ifndef EGL_ANDROID_native_fence_sync -#define EGL_ANDROID_native_fence_sync 1 -#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 -#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 -#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 -#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 -typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); -#endif -#endif /* EGL_ANDROID_native_fence_sync */ - -#ifndef EGL_ANDROID_presentation_time -#define EGL_ANDROID_presentation_time 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); -#endif -#endif /* EGL_ANDROID_presentation_time */ - -#ifndef EGL_ANDROID_recordable -#define EGL_ANDROID_recordable 1 -#define EGL_RECORDABLE_ANDROID 0x3142 -#endif /* EGL_ANDROID_recordable */ - -#ifndef EGL_ANGLE_d3d_share_handle_client_buffer -#define EGL_ANGLE_d3d_share_handle_client_buffer 1 -#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 -#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ - -#ifndef EGL_ANGLE_device_d3d -#define EGL_ANGLE_device_d3d 1 -#define EGL_D3D9_DEVICE_ANGLE 0x33A0 -#define EGL_D3D11_DEVICE_ANGLE 0x33A1 -#endif /* EGL_ANGLE_device_d3d */ - -#ifndef EGL_ANGLE_query_surface_pointer -#define EGL_ANGLE_query_surface_pointer 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); -#endif -#endif /* EGL_ANGLE_query_surface_pointer */ - -#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle -#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 -#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ - -#ifndef EGL_ANGLE_sync_control_rate -#define EGL_ANGLE_sync_control_rate 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); -#endif -#endif /* EGL_ANGLE_sync_control_rate */ - -#ifndef EGL_ANGLE_window_fixed_size -#define EGL_ANGLE_window_fixed_size 1 -#define EGL_FIXED_SIZE_ANGLE 0x3201 -#endif /* EGL_ANGLE_window_fixed_size */ - -#ifndef EGL_ARM_image_format -#define EGL_ARM_image_format 1 -#define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287 -#define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288 -#endif /* EGL_ARM_image_format */ - -#ifndef EGL_ARM_implicit_external_sync -#define EGL_ARM_implicit_external_sync 1 -#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A -#endif /* EGL_ARM_implicit_external_sync */ - -#ifndef EGL_ARM_pixmap_multisample_discard -#define EGL_ARM_pixmap_multisample_discard 1 -#define EGL_DISCARD_SAMPLES_ARM 0x3286 -#endif /* EGL_ARM_pixmap_multisample_discard */ - -#ifndef EGL_EXT_bind_to_front -#define EGL_EXT_bind_to_front 1 -#define EGL_FRONT_BUFFER_EXT 0x3464 -#endif /* EGL_EXT_bind_to_front */ - -#ifndef EGL_EXT_buffer_age -#define EGL_EXT_buffer_age 1 -#define EGL_BUFFER_AGE_EXT 0x313D -#endif /* EGL_EXT_buffer_age */ - -#ifndef EGL_EXT_client_extensions -#define EGL_EXT_client_extensions 1 -#endif /* EGL_EXT_client_extensions */ - -#ifndef EGL_EXT_client_sync -#define EGL_EXT_client_sync 1 -#define EGL_SYNC_CLIENT_EXT 0x3364 -#define EGL_SYNC_CLIENT_SIGNAL_EXT 0x3365 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCLIENTSIGNALSYNCEXTPROC) (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglClientSignalSyncEXT (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); -#endif -#endif /* EGL_EXT_client_sync */ - -#ifndef EGL_EXT_compositor -#define EGL_EXT_compositor 1 -#define EGL_PRIMARY_COMPOSITOR_CONTEXT_EXT 0x3460 -#define EGL_EXTERNAL_REF_ID_EXT 0x3461 -#define EGL_COMPOSITOR_DROP_NEWEST_FRAME_EXT 0x3462 -#define EGL_COMPOSITOR_KEEP_NEWEST_FRAME_EXT 0x3463 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETCONTEXTLISTEXTPROC) (const EGLint *external_ref_ids, EGLint num_entries); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETCONTEXTATTRIBUTESEXTPROC) (EGLint external_ref_id, const EGLint *context_attributes, EGLint num_entries); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWLISTEXTPROC) (EGLint external_ref_id, const EGLint *external_win_ids, EGLint num_entries); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWATTRIBUTESEXTPROC) (EGLint external_win_id, const EGLint *window_attributes, EGLint num_entries); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORBINDTEXWINDOWEXTPROC) (EGLint external_win_id); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETSIZEEXTPROC) (EGLint external_win_id, EGLint width, EGLint height); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSWAPPOLICYEXTPROC) (EGLint external_win_id, EGLint policy); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetContextListEXT (const EGLint *external_ref_ids, EGLint num_entries); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetContextAttributesEXT (EGLint external_ref_id, const EGLint *context_attributes, EGLint num_entries); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetWindowListEXT (EGLint external_ref_id, const EGLint *external_win_ids, EGLint num_entries); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetWindowAttributesEXT (EGLint external_win_id, const EGLint *window_attributes, EGLint num_entries); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorBindTexWindowEXT (EGLint external_win_id); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetSizeEXT (EGLint external_win_id, EGLint width, EGLint height); -EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSwapPolicyEXT (EGLint external_win_id, EGLint policy); -#endif -#endif /* EGL_EXT_compositor */ - -#ifndef EGL_EXT_config_select_group -#define EGL_EXT_config_select_group 1 -#define EGL_CONFIG_SELECT_GROUP_EXT 0x34C0 -#endif /* EGL_EXT_config_select_group */ - -#ifndef EGL_EXT_create_context_robustness -#define EGL_EXT_create_context_robustness 1 -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 -#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE -#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF -#endif /* EGL_EXT_create_context_robustness */ - -#ifndef EGL_EXT_device_base -#define EGL_EXT_device_base 1 -typedef void *EGLDeviceEXT; -#define EGL_NO_DEVICE_EXT EGL_CAST(EGLDeviceEXT,0) -#define EGL_BAD_DEVICE_EXT 0x322B -#define EGL_DEVICE_EXT 0x322C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -#endif -#endif /* EGL_EXT_device_base */ - -#ifndef EGL_EXT_device_drm -#define EGL_EXT_device_drm 1 -#define EGL_DRM_DEVICE_FILE_EXT 0x3233 -#define EGL_DRM_MASTER_FD_EXT 0x333C -#endif /* EGL_EXT_device_drm */ - -#ifndef EGL_EXT_device_drm_render_node -#define EGL_EXT_device_drm_render_node 1 -#define EGL_DRM_RENDER_NODE_FILE_EXT 0x3377 -#endif /* EGL_EXT_device_drm_render_node */ - -#ifndef EGL_EXT_device_enumeration -#define EGL_EXT_device_enumeration 1 -#endif /* EGL_EXT_device_enumeration */ - -#ifndef EGL_EXT_device_openwf -#define EGL_EXT_device_openwf 1 -#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 -#define EGL_OPENWF_DEVICE_EXT 0x333D -#endif /* EGL_EXT_device_openwf */ - -#ifndef EGL_EXT_device_persistent_id -#define EGL_EXT_device_persistent_id 1 -#define EGL_DEVICE_UUID_EXT 0x335C -#define EGL_DRIVER_UUID_EXT 0x335D -#define EGL_DRIVER_NAME_EXT 0x335E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEBINARYEXTPROC) (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); -#endif -#endif /* EGL_EXT_device_persistent_id */ - -#ifndef EGL_EXT_device_query -#define EGL_EXT_device_query 1 -#endif /* EGL_EXT_device_query */ - -#ifndef EGL_EXT_device_query_name -#define EGL_EXT_device_query_name 1 -#define EGL_RENDERER_EXT 0x335F -#endif /* EGL_EXT_device_query_name */ - -#ifndef EGL_EXT_explicit_device -#define EGL_EXT_explicit_device 1 -#endif /* EGL_EXT_explicit_device */ - -#ifndef EGL_EXT_gl_colorspace_bt2020_linear -#define EGL_EXT_gl_colorspace_bt2020_linear 1 -#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F -#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ - -#ifndef EGL_EXT_gl_colorspace_bt2020_pq -#define EGL_EXT_gl_colorspace_bt2020_pq 1 -#define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 -#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ - -#ifndef EGL_EXT_gl_colorspace_display_p3 -#define EGL_EXT_gl_colorspace_display_p3 1 -#define EGL_GL_COLORSPACE_DISPLAY_P3_EXT 0x3363 -#endif /* EGL_EXT_gl_colorspace_display_p3 */ - -#ifndef EGL_EXT_gl_colorspace_display_p3_linear -#define EGL_EXT_gl_colorspace_display_p3_linear 1 -#define EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT 0x3362 -#endif /* EGL_EXT_gl_colorspace_display_p3_linear */ - -#ifndef EGL_EXT_gl_colorspace_display_p3_passthrough -#define EGL_EXT_gl_colorspace_display_p3_passthrough 1 -#define EGL_GL_COLORSPACE_DISPLAY_P3_PASSTHROUGH_EXT 0x3490 -#endif /* EGL_EXT_gl_colorspace_display_p3_passthrough */ - -#ifndef EGL_EXT_gl_colorspace_scrgb -#define EGL_EXT_gl_colorspace_scrgb 1 -#define EGL_GL_COLORSPACE_SCRGB_EXT 0x3351 -#endif /* EGL_EXT_gl_colorspace_scrgb */ - -#ifndef EGL_EXT_gl_colorspace_scrgb_linear -#define EGL_EXT_gl_colorspace_scrgb_linear 1 -#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 -#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ - -#ifndef EGL_EXT_image_dma_buf_import -#define EGL_EXT_image_dma_buf_import 1 -#define EGL_LINUX_DMA_BUF_EXT 0x3270 -#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 -#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 -#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 -#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 -#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 -#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 -#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 -#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 -#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 -#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A -#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B -#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C -#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D -#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E -#define EGL_ITU_REC601_EXT 0x327F -#define EGL_ITU_REC709_EXT 0x3280 -#define EGL_ITU_REC2020_EXT 0x3281 -#define EGL_YUV_FULL_RANGE_EXT 0x3282 -#define EGL_YUV_NARROW_RANGE_EXT 0x3283 -#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 -#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 -#endif /* EGL_EXT_image_dma_buf_import */ - -#ifndef EGL_EXT_image_dma_buf_import_modifiers -#define EGL_EXT_image_dma_buf_import_modifiers 1 -#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 -#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 -#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 -#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 -#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 -#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 -#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 -#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 -#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 -#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 -#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDmaBufFormatsEXT (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDmaBufModifiersEXT (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); -#endif -#endif /* EGL_EXT_image_dma_buf_import_modifiers */ - -#ifndef EGL_EXT_image_gl_colorspace -#define EGL_EXT_image_gl_colorspace 1 -#define EGL_GL_COLORSPACE_DEFAULT_EXT 0x314D -#endif /* EGL_EXT_image_gl_colorspace */ - -#ifndef EGL_EXT_image_implicit_sync_control -#define EGL_EXT_image_implicit_sync_control 1 -#define EGL_IMPORT_SYNC_TYPE_EXT 0x3470 -#define EGL_IMPORT_IMPLICIT_SYNC_EXT 0x3471 -#define EGL_IMPORT_EXPLICIT_SYNC_EXT 0x3472 -#endif /* EGL_EXT_image_implicit_sync_control */ - -#ifndef EGL_EXT_multiview_window -#define EGL_EXT_multiview_window 1 -#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 -#endif /* EGL_EXT_multiview_window */ - -#ifndef EGL_EXT_output_base -#define EGL_EXT_output_base 1 -typedef void *EGLOutputLayerEXT; -typedef void *EGLOutputPortEXT; -#define EGL_NO_OUTPUT_LAYER_EXT EGL_CAST(EGLOutputLayerEXT,0) -#define EGL_NO_OUTPUT_PORT_EXT EGL_CAST(EGLOutputPortEXT,0) -#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D -#define EGL_BAD_OUTPUT_PORT_EXT 0x322E -#define EGL_SWAP_INTERVAL_EXT 0x322F -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); -EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); -EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); -EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); -#endif -#endif /* EGL_EXT_output_base */ - -#ifndef EGL_EXT_output_drm -#define EGL_EXT_output_drm 1 -#define EGL_DRM_CRTC_EXT 0x3234 -#define EGL_DRM_PLANE_EXT 0x3235 -#define EGL_DRM_CONNECTOR_EXT 0x3236 -#endif /* EGL_EXT_output_drm */ - -#ifndef EGL_EXT_output_openwf -#define EGL_EXT_output_openwf 1 -#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 -#define EGL_OPENWF_PORT_ID_EXT 0x3239 -#endif /* EGL_EXT_output_openwf */ - -#ifndef EGL_EXT_pixel_format_float -#define EGL_EXT_pixel_format_float 1 -#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 -#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A -#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B -#endif /* EGL_EXT_pixel_format_float */ - -#ifndef EGL_EXT_platform_base -#define EGL_EXT_platform_base 1 -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); -#endif -#endif /* EGL_EXT_platform_base */ - -#ifndef EGL_EXT_platform_device -#define EGL_EXT_platform_device 1 -#define EGL_PLATFORM_DEVICE_EXT 0x313F -#endif /* EGL_EXT_platform_device */ - -#ifndef EGL_EXT_platform_wayland -#define EGL_EXT_platform_wayland 1 -#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 -#endif /* EGL_EXT_platform_wayland */ - -#ifndef EGL_EXT_platform_x11 -#define EGL_EXT_platform_x11 1 -#define EGL_PLATFORM_X11_EXT 0x31D5 -#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 -#endif /* EGL_EXT_platform_x11 */ - -#ifndef EGL_EXT_platform_xcb -#define EGL_EXT_platform_xcb 1 -#define EGL_PLATFORM_XCB_EXT 0x31DC -#define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE -#endif /* EGL_EXT_platform_xcb */ - -#ifndef EGL_EXT_present_opaque -#define EGL_EXT_present_opaque 1 -#define EGL_PRESENT_OPAQUE_EXT 0x31DF -#endif /* EGL_EXT_present_opaque */ - -#ifndef EGL_EXT_protected_content -#define EGL_EXT_protected_content 1 -#define EGL_PROTECTED_CONTENT_EXT 0x32C0 -#endif /* EGL_EXT_protected_content */ - -#ifndef EGL_EXT_protected_surface -#define EGL_EXT_protected_surface 1 -#endif /* EGL_EXT_protected_surface */ - -#ifndef EGL_EXT_stream_consumer_egloutput -#define EGL_EXT_stream_consumer_egloutput 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); -#endif -#endif /* EGL_EXT_stream_consumer_egloutput */ - -#ifndef EGL_EXT_surface_CTA861_3_metadata -#define EGL_EXT_surface_CTA861_3_metadata 1 -#define EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT 0x3360 -#define EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT 0x3361 -#endif /* EGL_EXT_surface_CTA861_3_metadata */ - -#ifndef EGL_EXT_surface_SMPTE2086_metadata -#define EGL_EXT_surface_SMPTE2086_metadata 1 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 -#define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 -#define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 -#define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 -#define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 -#define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A -#define EGL_METADATA_SCALING_EXT 50000 -#endif /* EGL_EXT_surface_SMPTE2086_metadata */ - -#ifndef EGL_EXT_surface_compression -#define EGL_EXT_surface_compression 1 -#define EGL_SURFACE_COMPRESSION_EXT 0x34B0 -#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E -#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9 -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE -#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates); -#endif -#endif /* EGL_EXT_surface_compression */ - -#ifndef EGL_EXT_swap_buffers_with_damage -#define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); -#endif -#endif /* EGL_EXT_swap_buffers_with_damage */ - -#ifndef EGL_EXT_sync_reuse -#define EGL_EXT_sync_reuse 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNSIGNALSYNCEXTPROC) (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglUnsignalSyncEXT (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); -#endif -#endif /* EGL_EXT_sync_reuse */ - -#ifndef EGL_EXT_yuv_surface -#define EGL_EXT_yuv_surface 1 -#define EGL_YUV_ORDER_EXT 0x3301 -#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 -#define EGL_YUV_SUBSAMPLE_EXT 0x3312 -#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 -#define EGL_YUV_CSC_STANDARD_EXT 0x330A -#define EGL_YUV_PLANE_BPP_EXT 0x331A -#define EGL_YUV_BUFFER_EXT 0x3300 -#define EGL_YUV_ORDER_YUV_EXT 0x3302 -#define EGL_YUV_ORDER_YVU_EXT 0x3303 -#define EGL_YUV_ORDER_YUYV_EXT 0x3304 -#define EGL_YUV_ORDER_UYVY_EXT 0x3305 -#define EGL_YUV_ORDER_YVYU_EXT 0x3306 -#define EGL_YUV_ORDER_VYUY_EXT 0x3307 -#define EGL_YUV_ORDER_AYUV_EXT 0x3308 -#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 -#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 -#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 -#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 -#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 -#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B -#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C -#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D -#define EGL_YUV_PLANE_BPP_0_EXT 0x331B -#define EGL_YUV_PLANE_BPP_8_EXT 0x331C -#define EGL_YUV_PLANE_BPP_10_EXT 0x331D -#endif /* EGL_EXT_yuv_surface */ - -#ifndef EGL_HI_clientpixmap -#define EGL_HI_clientpixmap 1 -struct EGLClientPixmapHI { - void *pData; - EGLint iWidth; - EGLint iHeight; - EGLint iStride; -}; -#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 -typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); -#endif -#endif /* EGL_HI_clientpixmap */ - -#ifndef EGL_HI_colorformats -#define EGL_HI_colorformats 1 -#define EGL_COLOR_FORMAT_HI 0x8F70 -#define EGL_COLOR_RGB_HI 0x8F71 -#define EGL_COLOR_RGBA_HI 0x8F72 -#define EGL_COLOR_ARGB_HI 0x8F73 -#endif /* EGL_HI_colorformats */ - -#ifndef EGL_IMG_context_priority -#define EGL_IMG_context_priority 1 -#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 -#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 -#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 -#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 -#endif /* EGL_IMG_context_priority */ - -#ifndef EGL_IMG_image_plane_attribs -#define EGL_IMG_image_plane_attribs 1 -#define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 -#define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 -#endif /* EGL_IMG_image_plane_attribs */ - -#ifndef EGL_MESA_drm_image -#define EGL_MESA_drm_image 1 -#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 -#define EGL_DRM_BUFFER_USE_MESA 0x31D1 -#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 -#define EGL_DRM_BUFFER_MESA 0x31D3 -#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 -#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 -#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 -#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x00000004 -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); -#endif -#endif /* EGL_MESA_drm_image */ - -#ifndef EGL_MESA_image_dma_buf_export -#define EGL_MESA_image_dma_buf_export 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); -EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); -#endif -#endif /* EGL_MESA_image_dma_buf_export */ - -#ifndef EGL_MESA_platform_gbm -#define EGL_MESA_platform_gbm 1 -#define EGL_PLATFORM_GBM_MESA 0x31D7 -#endif /* EGL_MESA_platform_gbm */ - -#ifndef EGL_MESA_platform_surfaceless -#define EGL_MESA_platform_surfaceless 1 -#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD -#endif /* EGL_MESA_platform_surfaceless */ - -#ifndef EGL_MESA_query_driver -#define EGL_MESA_query_driver 1 -typedef char *(EGLAPIENTRYP PFNEGLGETDISPLAYDRIVERCONFIGPROC) (EGLDisplay dpy); -typedef const char *(EGLAPIENTRYP PFNEGLGETDISPLAYDRIVERNAMEPROC) (EGLDisplay dpy); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI char *EGLAPIENTRY eglGetDisplayDriverConfig (EGLDisplay dpy); -EGLAPI const char *EGLAPIENTRY eglGetDisplayDriverName (EGLDisplay dpy); -#endif -#endif /* EGL_MESA_query_driver */ - -#ifndef EGL_NOK_swap_region -#define EGL_NOK_swap_region 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region */ - -#ifndef EGL_NOK_swap_region2 -#define EGL_NOK_swap_region2 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); -#endif -#endif /* EGL_NOK_swap_region2 */ - -#ifndef EGL_NOK_texture_from_pixmap -#define EGL_NOK_texture_from_pixmap 1 -#define EGL_Y_INVERTED_NOK 0x307F -#endif /* EGL_NOK_texture_from_pixmap */ - -#ifndef EGL_NV_3dvision_surface -#define EGL_NV_3dvision_surface 1 -#define EGL_AUTO_STEREO_NV 0x3136 -#endif /* EGL_NV_3dvision_surface */ - -#ifndef EGL_NV_context_priority_realtime -#define EGL_NV_context_priority_realtime 1 -#define EGL_CONTEXT_PRIORITY_REALTIME_NV 0x3357 -#endif /* EGL_NV_context_priority_realtime */ - -#ifndef EGL_NV_coverage_sample -#define EGL_NV_coverage_sample 1 -#define EGL_COVERAGE_BUFFERS_NV 0x30E0 -#define EGL_COVERAGE_SAMPLES_NV 0x30E1 -#endif /* EGL_NV_coverage_sample */ - -#ifndef EGL_NV_coverage_sample_resolve -#define EGL_NV_coverage_sample_resolve 1 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 -#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 -#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 -#endif /* EGL_NV_coverage_sample_resolve */ - -#ifndef EGL_NV_cuda_event -#define EGL_NV_cuda_event 1 -#define EGL_CUDA_EVENT_HANDLE_NV 0x323B -#define EGL_SYNC_CUDA_EVENT_NV 0x323C -#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D -#endif /* EGL_NV_cuda_event */ - -#ifndef EGL_NV_depth_nonlinear -#define EGL_NV_depth_nonlinear 1 -#define EGL_DEPTH_ENCODING_NV 0x30E2 -#define EGL_DEPTH_ENCODING_NONE_NV 0 -#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 -#endif /* EGL_NV_depth_nonlinear */ - -#ifndef EGL_NV_device_cuda -#define EGL_NV_device_cuda 1 -#define EGL_CUDA_DEVICE_NV 0x323A -#endif /* EGL_NV_device_cuda */ - -#ifndef EGL_NV_native_query -#define EGL_NV_native_query 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); -#endif -#endif /* EGL_NV_native_query */ - -#ifndef EGL_NV_post_convert_rounding -#define EGL_NV_post_convert_rounding 1 -#endif /* EGL_NV_post_convert_rounding */ - -#ifndef EGL_NV_post_sub_buffer -#define EGL_NV_post_sub_buffer 1 -#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE -typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); -#endif -#endif /* EGL_NV_post_sub_buffer */ - -#ifndef EGL_NV_quadruple_buffer -#define EGL_NV_quadruple_buffer 1 -#define EGL_QUADRUPLE_BUFFER_NV 0x3231 -#endif /* EGL_NV_quadruple_buffer */ - -#ifndef EGL_NV_robustness_video_memory_purge -#define EGL_NV_robustness_video_memory_purge 1 -#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C -#endif /* EGL_NV_robustness_video_memory_purge */ - -#ifndef EGL_NV_stream_consumer_eglimage -#define EGL_NV_stream_consumer_eglimage 1 -#define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373 -#define EGL_STREAM_IMAGE_ADD_NV 0x3374 -#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375 -#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list); -typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list); -EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); -EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); -#endif -#endif /* EGL_NV_stream_consumer_eglimage */ - -#ifndef EGL_NV_stream_consumer_gltexture_yuv -#define EGL_NV_stream_consumer_gltexture_yuv 1 -#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C -#define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D -#define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); -#endif -#endif /* EGL_NV_stream_consumer_gltexture_yuv */ - -#ifndef EGL_NV_stream_cross_display -#define EGL_NV_stream_cross_display 1 -#define EGL_STREAM_CROSS_DISPLAY_NV 0x334E -#endif /* EGL_NV_stream_cross_display */ - -#ifndef EGL_NV_stream_cross_object -#define EGL_NV_stream_cross_object 1 -#define EGL_STREAM_CROSS_OBJECT_NV 0x334D -#endif /* EGL_NV_stream_cross_object */ - -#ifndef EGL_NV_stream_cross_partition -#define EGL_NV_stream_cross_partition 1 -#define EGL_STREAM_CROSS_PARTITION_NV 0x323F -#endif /* EGL_NV_stream_cross_partition */ - -#ifndef EGL_NV_stream_cross_process -#define EGL_NV_stream_cross_process 1 -#define EGL_STREAM_CROSS_PROCESS_NV 0x3245 -#endif /* EGL_NV_stream_cross_process */ - -#ifndef EGL_NV_stream_cross_system -#define EGL_NV_stream_cross_system 1 -#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F -#endif /* EGL_NV_stream_cross_system */ - -#ifndef EGL_NV_stream_dma -#define EGL_NV_stream_dma 1 -#define EGL_STREAM_DMA_NV 0x3371 -#define EGL_STREAM_DMA_SERVER_NV 0x3372 -#endif /* EGL_NV_stream_dma */ - -#ifndef EGL_NV_stream_fifo_next -#define EGL_NV_stream_fifo_next 1 -#define EGL_PENDING_FRAME_NV 0x3329 -#define EGL_STREAM_TIME_PENDING_NV 0x332A -#endif /* EGL_NV_stream_fifo_next */ - -#ifndef EGL_NV_stream_fifo_synchronous -#define EGL_NV_stream_fifo_synchronous 1 -#define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 -#endif /* EGL_NV_stream_fifo_synchronous */ - -#ifndef EGL_NV_stream_flush -#define EGL_NV_stream_flush 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMFLUSHNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglStreamFlushNV (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_NV_stream_flush */ - -#ifndef EGL_NV_stream_frame_limits -#define EGL_NV_stream_frame_limits 1 -#define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 -#define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 -#endif /* EGL_NV_stream_frame_limits */ - -#ifndef EGL_NV_stream_metadata -#define EGL_NV_stream_metadata 1 -#define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 -#define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 -#define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 -#define EGL_PRODUCER_METADATA_NV 0x3253 -#define EGL_CONSUMER_METADATA_NV 0x3254 -#define EGL_PENDING_METADATA_NV 0x3328 -#define EGL_METADATA0_SIZE_NV 0x3255 -#define EGL_METADATA1_SIZE_NV 0x3256 -#define EGL_METADATA2_SIZE_NV 0x3257 -#define EGL_METADATA3_SIZE_NV 0x3258 -#define EGL_METADATA0_TYPE_NV 0x3259 -#define EGL_METADATA1_TYPE_NV 0x325A -#define EGL_METADATA2_TYPE_NV 0x325B -#define EGL_METADATA3_TYPE_NV 0x325C -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void *data); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void *data); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribNV (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void *data); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void *data); -#endif -#endif /* EGL_NV_stream_metadata */ - -#ifndef EGL_NV_stream_origin -#define EGL_NV_stream_origin 1 -#define EGL_STREAM_FRAME_ORIGIN_X_NV 0x3366 -#define EGL_STREAM_FRAME_ORIGIN_Y_NV 0x3367 -#define EGL_STREAM_FRAME_MAJOR_AXIS_NV 0x3368 -#define EGL_CONSUMER_AUTO_ORIENTATION_NV 0x3369 -#define EGL_PRODUCER_AUTO_ORIENTATION_NV 0x336A -#define EGL_LEFT_NV 0x336B -#define EGL_RIGHT_NV 0x336C -#define EGL_TOP_NV 0x336D -#define EGL_BOTTOM_NV 0x336E -#define EGL_X_AXIS_NV 0x336F -#define EGL_Y_AXIS_NV 0x3370 -#endif /* EGL_NV_stream_origin */ - -#ifndef EGL_NV_stream_remote -#define EGL_NV_stream_remote 1 -#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 -#define EGL_STREAM_TYPE_NV 0x3241 -#define EGL_STREAM_PROTOCOL_NV 0x3242 -#define EGL_STREAM_ENDPOINT_NV 0x3243 -#define EGL_STREAM_LOCAL_NV 0x3244 -#define EGL_STREAM_PRODUCER_NV 0x3247 -#define EGL_STREAM_CONSUMER_NV 0x3248 -#define EGL_STREAM_PROTOCOL_FD_NV 0x3246 -#endif /* EGL_NV_stream_remote */ - -#ifndef EGL_NV_stream_reset -#define EGL_NV_stream_reset 1 -#define EGL_SUPPORT_RESET_NV 0x3334 -#define EGL_SUPPORT_REUSE_NV 0x3335 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglResetStreamNV (EGLDisplay dpy, EGLStreamKHR stream); -#endif -#endif /* EGL_NV_stream_reset */ - -#ifndef EGL_NV_stream_socket -#define EGL_NV_stream_socket 1 -#define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B -#define EGL_SOCKET_HANDLE_NV 0x324C -#define EGL_SOCKET_TYPE_NV 0x324D -#endif /* EGL_NV_stream_socket */ - -#ifndef EGL_NV_stream_socket_inet -#define EGL_NV_stream_socket_inet 1 -#define EGL_SOCKET_TYPE_INET_NV 0x324F -#endif /* EGL_NV_stream_socket_inet */ - -#ifndef EGL_NV_stream_socket_unix -#define EGL_NV_stream_socket_unix 1 -#define EGL_SOCKET_TYPE_UNIX_NV 0x324E -#endif /* EGL_NV_stream_socket_unix */ - -#ifndef EGL_NV_stream_sync -#define EGL_NV_stream_sync 1 -#define EGL_SYNC_NEW_FRAME_NV 0x321F -typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); -#endif -#endif /* EGL_NV_stream_sync */ - -#ifndef EGL_NV_sync -#define EGL_NV_sync 1 -typedef void *EGLSyncNV; -typedef khronos_utime_nanoseconds_t EGLTimeNV; -#ifdef KHRONOS_SUPPORT_INT64 -#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 -#define EGL_SYNC_STATUS_NV 0x30E7 -#define EGL_SIGNALED_NV 0x30E8 -#define EGL_UNSIGNALED_NV 0x30E9 -#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 -#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull -#define EGL_ALREADY_SIGNALED_NV 0x30EA -#define EGL_TIMEOUT_EXPIRED_NV 0x30EB -#define EGL_CONDITION_SATISFIED_NV 0x30EC -#define EGL_SYNC_TYPE_NV 0x30ED -#define EGL_SYNC_CONDITION_NV 0x30EE -#define EGL_SYNC_FENCE_NV 0x30EF -#define EGL_NO_SYNC_NV EGL_CAST(EGLSyncNV,0) -typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); -typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); -EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); -EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); -EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); -EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_sync */ - -#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 -typedef khronos_utime_nanoseconds_t EGLuint64NV; -#ifdef KHRONOS_SUPPORT_INT64 -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); -#endif -#endif /* KHRONOS_SUPPORT_INT64 */ -#endif /* EGL_NV_system_time */ - -#ifndef EGL_NV_triple_buffer -#define EGL_NV_triple_buffer 1 -#define EGL_TRIPLE_BUFFER_NV 0x3230 -#endif /* EGL_NV_triple_buffer */ - -#ifndef EGL_TIZEN_image_native_buffer -#define EGL_TIZEN_image_native_buffer 1 -#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 -#endif /* EGL_TIZEN_image_native_buffer */ - -#ifndef EGL_TIZEN_image_native_surface -#define EGL_TIZEN_image_native_surface 1 -#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 -#endif /* EGL_TIZEN_image_native_surface */ - -#ifndef EGL_WL_bind_wayland_display -#define EGL_WL_bind_wayland_display 1 -#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC -#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC -#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC -struct wl_display; -struct wl_resource; -#define EGL_WAYLAND_BUFFER_WL 0x31D5 -#define EGL_WAYLAND_PLANE_WL 0x31D6 -#define EGL_TEXTURE_Y_U_V_WL 0x31D7 -#define EGL_TEXTURE_Y_UV_WL 0x31D8 -#define EGL_TEXTURE_Y_XUXV_WL 0x31D9 -#define EGL_TEXTURE_EXTERNAL_WL 0x31DA -#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); -EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); -#endif -#endif /* EGL_WL_bind_wayland_display */ - -#ifndef EGL_WL_create_wayland_buffer_from_image -#define EGL_WL_create_wayland_buffer_from_image 1 -#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC -struct wl_buffer; -typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image); -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image); -#endif -#endif /* EGL_WL_create_wayland_buffer_from_image */ - -#ifdef __cplusplus -} -#endif - -#endif /* __eglext_h_ */ - -#endif /* _MSC_VER */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_endian.h b/libs/hwcodec/externals/SDL/include/SDL_endian.h deleted file mode 100644 index 582c3a8b..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_endian.h +++ /dev/null @@ -1,348 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_endian.h - * - * Functions for reading and writing endian-specific values - */ - -#ifndef SDL_endian_h_ -#define SDL_endian_h_ - -#include "SDL_stdinc.h" - -#if defined(_MSC_VER) && (_MSC_VER >= 1400) -/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, - so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ -#ifdef __clang__ -#ifndef __PRFCHWINTRIN_H -#define __PRFCHWINTRIN_H -static __inline__ void __attribute__((__always_inline__, __nodebug__)) -_m_prefetch(void *__P) -{ - __builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */); -} -#endif /* __PRFCHWINTRIN_H */ -#endif /* __clang__ */ - -#include -#endif - -/** - * \name The two types of endianness - */ -/* @{ */ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 -/* @} */ - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#ifdef __linux__ -#include -#define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) || defined(__DragonFly__) -#include -#define SDL_BYTEORDER BYTE_ORDER -#elif defined(__FreeBSD__) || defined(__NetBSD__) -#include -#define SDL_BYTEORDER BYTE_ORDER -/* predefs from newer gcc and clang versions: */ -#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__) -#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#error Unsupported endianness -#endif /**/ -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MIPSEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* __linux__ */ -#endif /* !SDL_BYTEORDER */ - -#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */ -/* predefs from newer gcc versions: */ -#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__) -#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN -#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__) -#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN -#else -#error Unsupported endianness -#endif /**/ -#elif defined(__MAVERICK__) -/* For Maverick, float words are always little-endian. */ -#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN -#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__) -/* For FPA, float words are always big-endian. */ -#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN -#else -/* By default, assume that floats words follow the memory system mode. */ -#define SDL_FLOATWORDORDER SDL_BYTEORDER -#endif /* __FLOAT_WORD_ORDER__ */ -#endif /* !SDL_FLOATWORDORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_endian.h - */ - -/* various modern compilers may have builtin swap */ -#if defined(__GNUC__) || defined(__clang__) -# define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) -# define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -# define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - - /* this one is broken */ -# define HAS_BROKEN_BSWAP (__GNUC__ == 2 && __GNUC_MINOR__ <= 95) -#else -# define HAS_BUILTIN_BSWAP16 0 -# define HAS_BUILTIN_BSWAP32 0 -# define HAS_BUILTIN_BSWAP64 0 -# define HAS_BROKEN_BSWAP 0 -#endif - -#if HAS_BUILTIN_BSWAP16 -#define SDL_Swap16(x) __builtin_bswap16(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) -#pragma intrinsic(_byteswap_ushort) -#define SDL_Swap16(x) _byteswap_ushort(x) -#elif defined(__i386__) && !HAS_BROKEN_BSWAP -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -} -#elif defined(__x86_64__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); - return x; -} -#elif (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - int result; - - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return (Uint16)result; -} -#elif (defined(__m68k__) && !defined(__mcoldfire__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern __inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ - "xchg al, ah" \ - parm [ax] \ - modify [ax]; -#else -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); -} -#endif - -#if HAS_BUILTIN_BSWAP32 -#define SDL_Swap32(x) __builtin_bswap32(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) -#pragma intrinsic(_byteswap_ulong) -#define SDL_Swap32(x) _byteswap_ulong(x) -#elif defined(__i386__) && !HAS_BROKEN_BSWAP -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__x86_64__) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0": "=r"(x):"0"(x)); - return x; -} -#elif (defined(__powerpc__) || defined(__ppc__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24), "r"(x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r"(result): "0" (result), "r"(x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r"(result): "0" (result), "r"(x)); - return result; -} -#elif (defined(__m68k__) && !defined(__mcoldfire__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern __inline Uint32 SDL_Swap32(Uint32); -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; -#else -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ - return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | - ((x >> 8) & 0x0000FF00) | (x >> 24))); -} -#endif - -#if HAS_BUILTIN_BSWAP64 -#define SDL_Swap64(x) __builtin_bswap64(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) -#pragma intrinsic(_byteswap_uint64) -#define SDL_Swap64(x) _byteswap_uint64(x) -#elif defined(__i386__) && !HAS_BROKEN_BSWAP -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - union { - struct { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r"(v.s.a), "=r"(v.s.b) - : "0" (v.s.a), "1"(v.s.b)); - return v.u; -} -#elif defined(__x86_64__) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__WATCOMC__) && defined(__386__) -extern __inline Uint64 SDL_Swap64(Uint64); -#pragma aux SDL_Swap64 = \ - "bswap eax" \ - "bswap edx" \ - "xchg eax,edx" \ - parm [eax edx] \ - modify [eax edx]; -#else -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif - - -SDL_FORCE_INLINE float -SDL_SwapFloat(float x) -{ - union { - float f; - Uint32 ui32; - } swapper; - swapper.f = x; - swapper.ui32 = SDL_Swap32(swapper.ui32); - return swapper.f; -} - -/* remove extra macros */ -#undef HAS_BROKEN_BSWAP -#undef HAS_BUILTIN_BSWAP16 -#undef HAS_BUILTIN_BSWAP32 -#undef HAS_BUILTIN_BSWAP64 - -/** - * \name Swap to native - * Byteswap item from the specified endianness to the native endianness. - */ -/* @{ */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapFloatLE(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#define SDL_SwapFloatBE(X) (X) -#endif -/* @} *//* Swap to native */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_endian_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_error.h b/libs/hwcodec/externals/SDL/include/SDL_error.h deleted file mode 100644 index 31c22616..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_error.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_error.h - * - * Simple error message routines for SDL. - */ - -#ifndef SDL_error_h_ -#define SDL_error_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Public functions */ - - -/** - * Set the SDL error message for the current thread. - * - * Calling this function will replace any previous error message that was set. - * - * This function always returns -1, since SDL frequently uses -1 to signify an - * failing result, leading to this idiom: - * - * ```c - * if (error_code) { - * return SDL_SetError("This operation has failed: %d", error_code); - * } - * ``` - * - * \param fmt a printf()-style message format string - * \param ... additional parameters matching % tokens in the `fmt` string, if - * any - * \returns always -1. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ClearError - * \sa SDL_GetError - */ -extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * Retrieve a message about the last error that occurred on the current - * thread. - * - * It is possible for multiple errors to occur before calling SDL_GetError(). - * Only the last error is returned. - * - * The message is only applicable when an SDL function has signaled an error. - * You must check the return values of SDL function calls to determine when to - * appropriately call SDL_GetError(). You should *not* use the results of - * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set - * an error string even when reporting success. - * - * SDL will *not* clear the error string for successful API calls. You *must* - * check return values for failure cases before you can assume the error - * string applies. - * - * Error strings are set per-thread, so an error set in a different thread - * will not interfere with the current thread's operation. - * - * The returned string is internally allocated and must not be freed by the - * application. - * - * \returns a message with information about the specific error that occurred, - * or an empty string if there hasn't been an error message set since - * the last call to SDL_ClearError(). The message is only applicable - * when an SDL function has signaled an error. You must check the - * return values of SDL function calls to determine when to - * appropriately call SDL_GetError(). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ClearError - * \sa SDL_SetError - */ -extern DECLSPEC const char *SDLCALL SDL_GetError(void); - -/** - * Get the last error message that was set for the current thread. - * - * This allows the caller to copy the error string into a provided buffer, but - * otherwise operates exactly the same as SDL_GetError(). - * - * \param errstr A buffer to fill with the last error message that was set for - * the current thread - * \param maxlen The size of the buffer pointed to by the errstr parameter - * \returns the pointer passed in as the `errstr` parameter. - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_GetError - */ -extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); - -/** - * Clear any previous error message for this thread. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetError - * \sa SDL_SetError - */ -extern DECLSPEC void SDLCALL SDL_ClearError(void); - -/** - * \name Internal error functions - * - * \internal - * Private error reporting function - used internally. - */ -/* @{ */ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) -typedef enum -{ - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -/* SDL_Error() unconditionally returns -1. */ -extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); -/* @} *//* Internal error functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_error_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_events.h b/libs/hwcodec/externals/SDL/include/SDL_events.h deleted file mode 100644 index 9d097031..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_events.h +++ /dev/null @@ -1,1166 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_events.h - * - * Include file for SDL event handling. - */ - -#ifndef SDL_events_h_ -#define SDL_events_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_gamecontroller.h" -#include "SDL_quit.h" -#include "SDL_gesture.h" -#include "SDL_touch.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 - -/** - * The types of events that can be delivered. - */ -typedef enum -{ - SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ - - /* Application events */ - SDL_QUIT = 0x100, /**< User-requested quit */ - - /* These application events have special meaning on iOS, see README-ios.md for details */ - SDL_APP_TERMINATING, /**< The application is being terminated by the OS - Called on iOS in applicationWillTerminate() - Called on Android in onDestroy() - */ - SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. - Called on iOS in applicationDidReceiveMemoryWarning() - Called on Android in onLowMemory() - */ - SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background - Called on iOS in applicationWillResignActive() - Called on Android in onPause() - */ - SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time - Called on iOS in applicationDidEnterBackground() - Called on Android in onPause() - */ - SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground - Called on iOS in applicationWillEnterForeground() - Called on Android in onResume() - */ - SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive - Called on iOS in applicationDidBecomeActive() - Called on Android in onResume() - */ - - SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ - - /* Display events */ - SDL_DISPLAYEVENT = 0x150, /**< Display state change */ - - /* Window events */ - SDL_WINDOWEVENT = 0x200, /**< Window state change */ - SDL_SYSWMEVENT, /**< System specific event */ - - /* Keyboard events */ - SDL_KEYDOWN = 0x300, /**< Key pressed */ - SDL_KEYUP, /**< Key released */ - SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ - SDL_TEXTINPUT, /**< Keyboard text input */ - SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an - input language or keyboard layout change. - */ - SDL_TEXTEDITING_EXT, /**< Extended keyboard text editing (composition) */ - - /* Mouse events */ - SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_MOUSEWHEEL, /**< Mouse wheel motion */ - - /* Joystick events */ - SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ - SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ - SDL_JOYBATTERYUPDATED, /**< Joystick battery level change */ - - /* Game controller events */ - SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ - SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ - SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ - SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ - SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ - SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ - SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ - SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ - SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ - SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ - - /* Touch events */ - SDL_FINGERDOWN = 0x700, - SDL_FINGERUP, - SDL_FINGERMOTION, - - /* Gesture events */ - SDL_DOLLARGESTURE = 0x800, - SDL_DOLLARRECORD, - SDL_MULTIGESTURE, - - /* Clipboard events */ - SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */ - - /* Drag and drop events */ - SDL_DROPFILE = 0x1000, /**< The system requests a file open */ - SDL_DROPTEXT, /**< text/plain drag-and-drop event */ - SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */ - SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ - - /* Audio hotplug events */ - SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ - SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ - - /* Sensor events */ - SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ - - /* Render events */ - SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ - SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ - - /* Internal events */ - SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */ - - /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, - * and should be allocated with SDL_RegisterEvents() - */ - SDL_USEREVENT = 0x8000, - - /** - * This last event is only for bounding internal arrays - */ - SDL_LASTEVENT = 0xFFFF -} SDL_EventType; - -/** - * \brief Fields shared by every event - */ -typedef struct SDL_CommonEvent -{ - Uint32 type; - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_CommonEvent; - -/** - * \brief Display state change event data (event.display.*) - */ -typedef struct SDL_DisplayEvent -{ - Uint32 type; /**< ::SDL_DISPLAYEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 display; /**< The associated display index */ - Uint8 event; /**< ::SDL_DisplayEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ -} SDL_DisplayEvent; - -/** - * \brief Window state change event data (event.window.*) - */ -typedef struct SDL_WindowEvent -{ - Uint32 type; /**< ::SDL_WINDOWEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window */ - Uint8 event; /**< ::SDL_WindowEventID */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint32 data1; /**< event dependent data */ - Sint32 data2; /**< event dependent data */ -} SDL_WindowEvent; - -/** - * \brief Keyboard button event structure (event.key.*) - */ -typedef struct SDL_KeyboardEvent -{ - Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 repeat; /**< Non-zero if this is a key repeat */ - Uint8 padding2; - Uint8 padding3; - SDL_Keysym keysym; /**< The key that was pressed or released */ -} SDL_KeyboardEvent; - -#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text editing event structure (event.edit.*) - */ -typedef struct SDL_TextEditingEvent -{ - Uint32 type; /**< ::SDL_TEXTEDITING */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ -} SDL_TextEditingEvent; - -/** - * \brief Extended keyboard text editing event structure (event.editExt.*) when text would be - * truncated if stored in the text buffer SDL_TextEditingEvent - */ -typedef struct SDL_TextEditingExtEvent -{ - Uint32 type; /**< ::SDL_TEXTEDITING_EXT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ -} SDL_TextEditingExtEvent; - -#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) -/** - * \brief Keyboard text input event structure (event.text.*) - */ -typedef struct SDL_TextInputEvent -{ - Uint32 type; /**< ::SDL_TEXTINPUT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ -} SDL_TextInputEvent; - -/** - * \brief Mouse motion event structure (event.motion.*) - */ -typedef struct SDL_MouseMotionEvent -{ - Uint32 type; /**< ::SDL_MOUSEMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint32 state; /**< The current button state */ - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ - Sint32 xrel; /**< The relative motion in the X direction */ - Sint32 yrel; /**< The relative motion in the Y direction */ -} SDL_MouseMotionEvent; - -/** - * \brief Mouse button event structure (event.button.*) - */ -typedef struct SDL_MouseButtonEvent -{ - Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ - Uint8 padding1; - Sint32 x; /**< X coordinate, relative to window */ - Sint32 y; /**< Y coordinate, relative to window */ -} SDL_MouseButtonEvent; - -/** - * \brief Mouse wheel event structure (event.wheel.*) - */ -typedef struct SDL_MouseWheelEvent -{ - Uint32 type; /**< ::SDL_MOUSEWHEEL */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The window with mouse focus, if any */ - Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ - Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ - Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ - float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */ - float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */ - Sint32 mouseX; /**< X coordinate, relative to window (added in 2.26.0) */ - Sint32 mouseY; /**< Y coordinate, relative to window (added in 2.26.0) */ -} SDL_MouseWheelEvent; - -/** - * \brief Joystick axis motion event structure (event.jaxis.*) - */ -typedef struct SDL_JoyAxisEvent -{ - Uint32 type; /**< ::SDL_JOYAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The joystick axis index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_JoyAxisEvent; - -/** - * \brief Joystick trackball motion event structure (event.jball.*) - */ -typedef struct SDL_JoyBallEvent -{ - Uint32 type; /**< ::SDL_JOYBALLMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 ball; /**< The joystick trackball index */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** - * \brief Joystick hat position change event structure (event.jhat.*) - */ -typedef struct SDL_JoyHatEvent -{ - Uint32 type; /**< ::SDL_JOYHATMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value. - * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP - * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT - * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN - * - * Note that zero means the POV is centered. - */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyHatEvent; - -/** - * \brief Joystick button event structure (event.jbutton.*) - */ -typedef struct SDL_JoyButtonEvent -{ - Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_JoyButtonEvent; - -/** - * \brief Joystick device event structure (event.jdevice.*) - */ -typedef struct SDL_JoyDeviceEvent -{ - Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ -} SDL_JoyDeviceEvent; - -/** - * \brief Joysick battery level change event structure (event.jbattery.*) - */ -typedef struct SDL_JoyBatteryEvent -{ - Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - SDL_JoystickPowerLevel level; /**< The joystick battery level */ -} SDL_JoyBatteryEvent; - -/** - * \brief Game controller axis motion event structure (event.caxis.*) - */ -typedef struct SDL_ControllerAxisEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; - Sint16 value; /**< The axis value (range: -32768 to 32767) */ - Uint16 padding4; -} SDL_ControllerAxisEvent; - - -/** - * \brief Game controller button event structure (event.cbutton.*) - */ -typedef struct SDL_ControllerButtonEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Uint8 button; /**< The controller button (SDL_GameControllerButton) */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; - Uint8 padding2; -} SDL_ControllerButtonEvent; - - -/** - * \brief Controller device event structure (event.cdevice.*) - */ -typedef struct SDL_ControllerDeviceEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ -} SDL_ControllerDeviceEvent; - -/** - * \brief Game controller touchpad event structure (event.ctouchpad.*) - */ -typedef struct SDL_ControllerTouchpadEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Sint32 touchpad; /**< The index of the touchpad */ - Sint32 finger; /**< The index of the finger on the touchpad */ - float x; /**< Normalized in the range 0...1 with 0 being on the left */ - float y; /**< Normalized in the range 0...1 with 0 being at the top */ - float pressure; /**< Normalized in the range 0...1 */ -} SDL_ControllerTouchpadEvent; - -/** - * \brief Game controller sensor event structure (event.csensor.*) - */ -typedef struct SDL_ControllerSensorEvent -{ - Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_JoystickID which; /**< The joystick instance id */ - Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ - float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ - Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */ -} SDL_ControllerSensorEvent; - -/** - * \brief Audio device event structure (event.adevice.*) - */ -typedef struct SDL_AudioDeviceEvent -{ - Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ - Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ - Uint8 padding1; - Uint8 padding2; - Uint8 padding3; -} SDL_AudioDeviceEvent; - - -/** - * \brief Touch finger event structure (event.tfinger.*) - */ -typedef struct SDL_TouchFingerEvent -{ - Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_FingerID fingerId; - float x; /**< Normalized in the range 0...1 */ - float y; /**< Normalized in the range 0...1 */ - float dx; /**< Normalized in the range -1...1 */ - float dy; /**< Normalized in the range -1...1 */ - float pressure; /**< Normalized in the range 0...1 */ - Uint32 windowID; /**< The window underneath the finger, if any */ -} SDL_TouchFingerEvent; - - -/** - * \brief Multiple Finger Gesture Event (event.mgesture.*) - */ -typedef struct SDL_MultiGestureEvent -{ - Uint32 type; /**< ::SDL_MULTIGESTURE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - float dTheta; - float dDist; - float x; - float y; - Uint16 numFingers; - Uint16 padding; -} SDL_MultiGestureEvent; - - -/** - * \brief Dollar Gesture Event (event.dgesture.*) - */ -typedef struct SDL_DollarGestureEvent -{ - Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_TouchID touchId; /**< The touch device id */ - SDL_GestureID gestureId; - Uint32 numFingers; - float error; - float x; /**< Normalized center of gesture */ - float y; /**< Normalized center of gesture */ -} SDL_DollarGestureEvent; - - -/** - * \brief An event used to request a file open by the system (event.drop.*) - * This event is enabled by default, you can disable it with SDL_EventState(). - * \note If this event is enabled, you must free the filename in the event. - */ -typedef struct SDL_DropEvent -{ - Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ - Uint32 windowID; /**< The window that was dropped on, if any */ -} SDL_DropEvent; - - -/** - * \brief Sensor event structure (event.sensor.*) - */ -typedef struct SDL_SensorEvent -{ - Uint32 type; /**< ::SDL_SENSORUPDATE */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Sint32 which; /**< The instance ID of the sensor */ - float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ - Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */ -} SDL_SensorEvent; - -/** - * \brief The "quit requested" event - */ -typedef struct SDL_QuitEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_QuitEvent; - -/** - * \brief OS Specific event - */ -typedef struct SDL_OSEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_OSEvent; - -/** - * \brief A user-defined event type (event.user.*) - */ -typedef struct SDL_UserEvent -{ - Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - Uint32 windowID; /**< The associated window if any */ - Sint32 code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ -} SDL_UserEvent; - - -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; - -/** - * \brief A video driver dependent system event (event.syswm.*) - * This event is disabled by default, you can enable it with SDL_EventState() - * - * \note If you want to use this event, you should include SDL_syswm.h. - */ -typedef struct SDL_SysWMEvent -{ - Uint32 type; /**< ::SDL_SYSWMEVENT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ - SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ -} SDL_SysWMEvent; - -/** - * \brief General event structure - */ -typedef union SDL_Event -{ - Uint32 type; /**< Event type, shared with all events */ - SDL_CommonEvent common; /**< Common event data */ - SDL_DisplayEvent display; /**< Display event data */ - SDL_WindowEvent window; /**< Window event data */ - SDL_KeyboardEvent key; /**< Keyboard event data */ - SDL_TextEditingEvent edit; /**< Text editing event data */ - SDL_TextEditingExtEvent editExt; /**< Extended text editing event data */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ - SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */ - SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ - SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ - SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ - SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ - SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ - SDL_AudioDeviceEvent adevice; /**< Audio device event data */ - SDL_SensorEvent sensor; /**< Sensor event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_MultiGestureEvent mgesture; /**< Gesture event data */ - SDL_DollarGestureEvent dgesture; /**< Gesture event data */ - SDL_DropEvent drop; /**< Drag and drop event data */ - - /* This is necessary for ABI compatibility between Visual C++ and GCC. - Visual C++ will respect the push pack pragma and use 52 bytes (size of - SDL_TextEditingEvent, the largest structure for 32-bit and 64-bit - architectures) for this union, and GCC will use the alignment of the - largest datatype within the union, which is 8 bytes on 64-bit - architectures. - - So... we'll add padding to force the size to be 56 bytes for both. - - On architectures where pointers are 16 bytes, this needs rounding up to - the next multiple of 16, 64, and on architectures where pointers are - even larger the size of SDL_UserEvent will dominate as being 3 pointers. - */ - Uint8 padding[sizeof(void *) <= 8 ? 56 : sizeof(void *) == 16 ? 64 : 3 * sizeof(void *)]; -} SDL_Event; - -/* Make sure we haven't broken binary compatibility */ -SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding)); - - -/* Function prototypes */ - -/** - * Pump the event loop, gathering events from the input devices. - * - * This function updates the event queue and internal input device state. - * - * **WARNING**: This should only be run in the thread that initialized the - * video subsystem, and for extra safety, you should consider only doing those - * things on the main thread in any case. - * - * SDL_PumpEvents() gathers all the pending input information from devices and - * places it in the event queue. Without calls to SDL_PumpEvents() no events - * would ever be placed on the queue. Often the need for calls to - * SDL_PumpEvents() is hidden from the user since SDL_PollEvent() and - * SDL_WaitEvent() implicitly call SDL_PumpEvents(). However, if you are not - * polling or waiting for events (e.g. you are filtering them), then you must - * call SDL_PumpEvents() to force an event queue update. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PollEvent - * \sa SDL_WaitEvent - */ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -/* @{ */ -typedef enum -{ - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; - -/** - * Check the event queue for messages and optionally return them. - * - * `action` may be any of the following: - * - * - `SDL_ADDEVENT`: up to `numevents` events will be added to the back of the - * event queue. - * - `SDL_PEEKEVENT`: `numevents` events at the front of the event queue, - * within the specified minimum and maximum type, will be returned to the - * caller and will _not_ be removed from the queue. - * - `SDL_GETEVENT`: up to `numevents` events at the front of the event queue, - * within the specified minimum and maximum type, will be returned to the - * caller and will be removed from the queue. - * - * You may have to call SDL_PumpEvents() before calling this function. - * Otherwise, the events may not be ready to be filtered when you call - * SDL_PeepEvents(). - * - * This function is thread-safe. - * - * \param events destination buffer for the retrieved events - * \param numevents if action is SDL_ADDEVENT, the number of events to add - * back to the event queue; if action is SDL_PEEKEVENT or - * SDL_GETEVENT, the maximum number of events to retrieve - * \param action action to take; see [[#action|Remarks]] for details - * \param minType minimum value of the event type to be considered; - * SDL_FIRSTEVENT is a safe choice - * \param maxType maximum value of the event type to be considered; - * SDL_LASTEVENT is a safe choice - * \returns the number of events actually stored or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PollEvent - * \sa SDL_PumpEvents - * \sa SDL_PushEvent - */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, - SDL_eventaction action, - Uint32 minType, Uint32 maxType); -/* @} */ - -/** - * Check for the existence of a certain event type in the event queue. - * - * If you need to check for a range of event types, use SDL_HasEvents() - * instead. - * - * \param type the type of event to be queried; see SDL_EventType for details - * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if - * events matching `type` are not present. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasEvents - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); - - -/** - * Check for the existence of certain event types in the event queue. - * - * If you need to check for a single event type, use SDL_HasEvent() instead. - * - * \param minType the low end of event type to be queried, inclusive; see - * SDL_EventType for details - * \param maxType the high end of event type to be queried, inclusive; see - * SDL_EventType for details - * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are - * present, or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasEvents - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); - -/** - * Clear events of a specific type from the event queue. - * - * This will unconditionally remove any events from the queue that match - * `type`. If you need to remove a range of event types, use SDL_FlushEvents() - * instead. - * - * It's also normal to just ignore events you don't care about in your event - * loop without calling this function. - * - * This function only affects currently queued events. If you want to make - * sure that all pending OS events are flushed, you can call SDL_PumpEvents() - * on the main thread immediately before the flush call. - * - * \param type the type of event to be cleared; see SDL_EventType for details - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FlushEvents - */ -extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); - -/** - * Clear events of a range of types from the event queue. - * - * This will unconditionally remove any events from the queue that are in the - * range of `minType` to `maxType`, inclusive. If you need to remove a single - * event type, use SDL_FlushEvent() instead. - * - * It's also normal to just ignore events you don't care about in your event - * loop without calling this function. - * - * This function only affects currently queued events. If you want to make - * sure that all pending OS events are flushed, you can call SDL_PumpEvents() - * on the main thread immediately before the flush call. - * - * \param minType the low end of event type to be cleared, inclusive; see - * SDL_EventType for details - * \param maxType the high end of event type to be cleared, inclusive; see - * SDL_EventType for details - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FlushEvent - */ -extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); - -/** - * Poll for currently pending events. - * - * If `event` is not NULL, the next event is removed from the queue and stored - * in the SDL_Event structure pointed to by `event`. The 1 returned refers to - * this event, immediately stored in the SDL Event structure -- not an event - * to follow. - * - * If `event` is NULL, it simply returns 1 if there is an event in the queue, - * but will not remove it from the queue. - * - * As this function may implicitly call SDL_PumpEvents(), you can only call - * this function in the thread that set the video mode. - * - * SDL_PollEvent() is the favored way of receiving system events since it can - * be done from the main loop and does not suspend the main loop while waiting - * on an event to be posted. - * - * The common practice is to fully process the event queue once every frame, - * usually as a first step before updating the game's state: - * - * ```c - * while (game_is_still_running) { - * SDL_Event event; - * while (SDL_PollEvent(&event)) { // poll until all events are handled! - * // decide what to do with this event. - * } - * - * // update game state, draw the current frame - * } - * ``` - * - * \param event the SDL_Event structure to be filled with the next event from - * the queue, or NULL - * \returns 1 if there is a pending event or 0 if there are none available. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetEventFilter - * \sa SDL_PeepEvents - * \sa SDL_PushEvent - * \sa SDL_SetEventFilter - * \sa SDL_WaitEvent - * \sa SDL_WaitEventTimeout - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); - -/** - * Wait indefinitely for the next available event. - * - * If `event` is not NULL, the next event is removed from the queue and stored - * in the SDL_Event structure pointed to by `event`. - * - * As this function may implicitly call SDL_PumpEvents(), you can only call - * this function in the thread that initialized the video subsystem. - * - * \param event the SDL_Event structure to be filled in with the next event - * from the queue, or NULL - * \returns 1 on success or 0 if there was an error while waiting for events; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PollEvent - * \sa SDL_PumpEvents - * \sa SDL_WaitEventTimeout - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); - -/** - * Wait until the specified timeout (in milliseconds) for the next available - * event. - * - * If `event` is not NULL, the next event is removed from the queue and stored - * in the SDL_Event structure pointed to by `event`. - * - * As this function may implicitly call SDL_PumpEvents(), you can only call - * this function in the thread that initialized the video subsystem. - * - * \param event the SDL_Event structure to be filled in with the next event - * from the queue, or NULL - * \param timeout the maximum number of milliseconds to wait for the next - * available event - * \returns 1 on success or 0 if there was an error while waiting for events; - * call SDL_GetError() for more information. This also returns 0 if - * the timeout elapsed without an event arriving. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PollEvent - * \sa SDL_PumpEvents - * \sa SDL_WaitEvent - */ -extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, - int timeout); - -/** - * Add an event to the event queue. - * - * The event queue can actually be used as a two way communication channel. - * Not only can events be read from the queue, but the user can also push - * their own events onto it. `event` is a pointer to the event structure you - * wish to push onto the queue. The event is copied into the queue, and the - * caller may dispose of the memory pointed to after SDL_PushEvent() returns. - * - * Note: Pushing device input events onto the queue doesn't modify the state - * of the device within SDL. - * - * This function is thread-safe, and can be called from other threads safely. - * - * Note: Events pushed onto the queue with SDL_PushEvent() get passed through - * the event filter but events added with SDL_PeepEvents() do not. - * - * For pushing application-specific events, please use SDL_RegisterEvents() to - * get an event type that does not conflict with other code that also wants - * its own custom event types. - * - * \param event the SDL_Event to be added to the queue - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PeepEvents - * \sa SDL_PollEvent - * \sa SDL_RegisterEvents - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); - -/** - * A function pointer used for callbacks that watch the event queue. - * - * \param userdata what was passed as `userdata` to SDL_SetEventFilter() - * or SDL_AddEventWatch, etc - * \param event the event that triggered the callback - * \returns 1 to permit event to be added to the queue, and 0 to disallow - * it. When used with SDL_AddEventWatch, the return value is ignored. - * - * \sa SDL_SetEventFilter - * \sa SDL_AddEventWatch - */ -typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); - -/** - * Set up a filter to process all events before they change internal state and - * are posted to the internal event queue. - * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. - * - * **WARNING**: Be very careful of what you do in the event filter function, - * as it may run in a different thread! - * - * On platforms that support it, if the quit event is generated by an - * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the - * application at the next event poll. - * - * There is one caveat when dealing with the ::SDL_QuitEvent event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will be - * closed, otherwise the window will remain open if possible. - * - * Note: Disabled events never make it to the event filter function; see - * SDL_EventState(). - * - * Note: If you just want to inspect events without filtering, you should use - * SDL_AddEventWatch() instead. - * - * Note: Events pushed onto the queue with SDL_PushEvent() get passed through - * the event filter, but events pushed onto the queue with SDL_PeepEvents() do - * not. - * - * \param filter An SDL_EventFilter function to call when an event happens - * \param userdata a pointer that is passed to `filter` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AddEventWatch - * \sa SDL_EventState - * \sa SDL_GetEventFilter - * \sa SDL_PeepEvents - * \sa SDL_PushEvent - */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, - void *userdata); - -/** - * Query the current event filter. - * - * This function can be used to "chain" filters, by saving the existing filter - * before replacing it with a function that will call that saved filter. - * - * \param filter the current callback function will be stored here - * \param userdata the pointer that is passed to the current event filter will - * be stored here - * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetEventFilter - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, - void **userdata); - -/** - * Add a callback to be triggered when an event is added to the event queue. - * - * `filter` will be called when an event happens, and its return value is - * ignored. - * - * **WARNING**: Be very careful of what you do in the event filter function, - * as it may run in a different thread! - * - * If the quit event is generated by a signal (e.g. SIGINT), it will bypass - * the internal queue and be delivered to the watch callback immediately, and - * arrive at the next event poll. - * - * Note: the callback is called for events posted by the user through - * SDL_PushEvent(), but not for disabled events, nor for events by a filter - * callback set with SDL_SetEventFilter(), nor for events posted by the user - * through SDL_PeepEvents(). - * - * \param filter an SDL_EventFilter function to call when an event happens. - * \param userdata a pointer that is passed to `filter` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DelEventWatch - * \sa SDL_SetEventFilter - */ -extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Remove an event watch callback added with SDL_AddEventWatch(). - * - * This function takes the same input as SDL_AddEventWatch() to identify and - * delete the corresponding callback. - * - * \param filter the function originally passed to SDL_AddEventWatch() - * \param userdata the pointer originally passed to SDL_AddEventWatch() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AddEventWatch - */ -extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, - void *userdata); - -/** - * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. - * - * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), - * this function does not change the filter permanently, it only uses the - * supplied filter until this function returns. - * - * \param filter the SDL_EventFilter function to call when an event happens - * \param userdata a pointer that is passed to `filter` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetEventFilter - * \sa SDL_SetEventFilter - */ -extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, - void *userdata); - -/* @{ */ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 - -/** - * Set the state of processing events by type. - * - * `state` may be any of the following: - * - * - `SDL_QUERY`: returns the current processing state of the specified event - * - `SDL_IGNORE` (aka `SDL_DISABLE`): the event will automatically be dropped - * from the event queue and will not be filtered - * - `SDL_ENABLE`: the event will be processed normally - * - * \param type the type of event; see SDL_EventType for details - * \param state how to process the event - * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state - * of the event before this function makes any changes to it. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetEventState - */ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); -/* @} */ -#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) - -/** - * Allocate a set of user-defined events, and return the beginning event - * number for that set of events. - * - * Calling this function with `numevents` <= 0 is an error and will return - * (Uint32)-1. - * - * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or - * 0xFFFFFFFF), but is clearer to write. - * - * \param numevents the number of events to be allocated - * \returns the beginning event number, or (Uint32)-1 if there are not enough - * user-defined events left. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PushEvent - */ -extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_events_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_filesystem.h b/libs/hwcodec/externals/SDL/include/SDL_filesystem.h deleted file mode 100644 index 4cad657e..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_filesystem.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_filesystem.h - * - * \brief Include file for filesystem SDL API functions - */ - -#ifndef SDL_filesystem_h_ -#define SDL_filesystem_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Get the directory where the application was run from. - * - * This is not necessarily a fast call, so you should call this once near - * startup and save the string if you need it. - * - * **Mac OS X and iOS Specific Functionality**: If the application is in a - * ".app" bundle, this function returns the Resource directory (e.g. - * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding - * a property to the Info.plist file. Adding a string key with the name - * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the - * behaviour. - * - * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an - * application in /Applications/SDLApp/MyApp.app): - * - * - `resource`: bundle resource directory (the default). For example: - * `/Applications/SDLApp/MyApp.app/Contents/Resources` - * - `bundle`: the Bundle directory. For example: - * `/Applications/SDLApp/MyApp.app/` - * - `parent`: the containing directory of the bundle. For example: - * `/Applications/SDLApp/` - * - * **Nintendo 3DS Specific Functionality**: This function returns "romfs" - * directory of the application as it is uncommon to store resources outside - * the executable. As such it is not a writable directory. - * - * The returned path is guaranteed to end with a path separator ('\' on - * Windows, '/' on most other platforms). - * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. - * - * \returns an absolute path in UTF-8 encoding to the application data - * directory. NULL will be returned on error or when the platform - * doesn't implement this functionality, call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.1. - * - * \sa SDL_GetPrefPath - */ -extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); - -/** - * Get the user-and-app-specific path where files can be written. - * - * Get the "pref dir". This is meant to be where users can write personal - * files (preferences and save games, etc) that are specific to your - * application. This directory is unique per user, per application. - * - * This function will decide the appropriate location in the native - * filesystem, create the directory if necessary, and return a string of the - * absolute path to the directory in UTF-8 encoding. - * - * On Windows, the string might look like: - * - * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\` - * - * On Linux, the string might look like: - * - * `/home/bob/.local/share/My Program Name/` - * - * On Mac OS X, the string might look like: - * - * `/Users/bob/Library/Application Support/My Program Name/` - * - * You should assume the path returned by this function is the only safe place - * to write files (and that SDL_GetBasePath(), while it might be writable, or - * even the parent of the returned path, isn't where you should be writing - * things). - * - * Both the org and app strings may become part of a directory name, so please - * follow these rules: - * - * - Try to use the same org string (_including case-sensitivity_) for all - * your applications that use this function. - * - Always use a unique app string for each one, and make sure it never - * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... - * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game - * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. - * - * The returned path is guaranteed to end with a path separator ('\' on - * Windows, '/' on most other platforms). - * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. - * - * \param org the name of your organization - * \param app the name of your application - * \returns a UTF-8 string of the user directory in platform-dependent - * notation. NULL if there's a problem (creating directory failed, - * etc.). - * - * \since This function is available since SDL 2.0.1. - * - * \sa SDL_GetBasePath - */ -extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_filesystem_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_gamecontroller.h b/libs/hwcodec/externals/SDL/include/SDL_gamecontroller.h deleted file mode 100644 index d66e1b06..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_gamecontroller.h +++ /dev/null @@ -1,1074 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gamecontroller.h - * - * Include file for SDL game controller event handling - */ - -#ifndef SDL_gamecontroller_h_ -#define SDL_gamecontroller_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" -#include "SDL_sensor.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_gamecontroller.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system - * for game controllers, and load appropriate drivers. - * - * If you would like to receive controller updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The gamecontroller structure used to identify an SDL game controller - */ -struct _SDL_GameController; -typedef struct _SDL_GameController SDL_GameController; - -typedef enum -{ - SDL_CONTROLLER_TYPE_UNKNOWN = 0, - SDL_CONTROLLER_TYPE_XBOX360, - SDL_CONTROLLER_TYPE_XBOXONE, - SDL_CONTROLLER_TYPE_PS3, - SDL_CONTROLLER_TYPE_PS4, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, - SDL_CONTROLLER_TYPE_VIRTUAL, - SDL_CONTROLLER_TYPE_PS5, - SDL_CONTROLLER_TYPE_AMAZON_LUNA, - SDL_CONTROLLER_TYPE_GOOGLE_STADIA, - SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR -} SDL_GameControllerType; - -typedef enum -{ - SDL_CONTROLLER_BINDTYPE_NONE = 0, - SDL_CONTROLLER_BINDTYPE_BUTTON, - SDL_CONTROLLER_BINDTYPE_AXIS, - SDL_CONTROLLER_BINDTYPE_HAT -} SDL_GameControllerBindType; - -/** - * Get the SDL joystick layer binding for this controller button/axis mapping - */ -typedef struct SDL_GameControllerButtonBind -{ - SDL_GameControllerBindType bindType; - union - { - int button; - int axis; - struct { - int hat; - int hat_mask; - } hat; - } value; - -} SDL_GameControllerButtonBind; - - -/** - * To count the number of game controllers in the system for the following: - * - * ```c - * int nJoysticks = SDL_NumJoysticks(); - * int nGameControllers = 0; - * for (int i = 0; i < nJoysticks; i++) { - * if (SDL_IsGameController(i)) { - * nGameControllers++; - * } - * } - * ``` - * - * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: - * guid,name,mappings - * - * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. - * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. - * The mapping format for joystick is: - * bX - a joystick button, index X - * hX.Y - hat X with value Y - * aX - axis X of the joystick - * Buttons can be used as a controller axis and vice versa. - * - * This string shows an example of a valid mapping for a controller - * - * ```c - * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", - * ``` - */ - -/** - * Load a set of Game Controller mappings from a seekable SDL data stream. - * - * You can call this function several times, if needed, to load different - * database files. - * - * If a new mapping is loaded for an already known controller GUID, the later - * version will overwrite the one currently loaded. - * - * Mappings not belonging to the current platform or with no platform field - * specified will be ignored (i.e. mappings for Linux will be ignored in - * Windows, etc). - * - * This function will load the text database entirely in memory before - * processing it, so take this into consideration if you are in a memory - * constrained environment. - * - * \param rw the data stream for the mappings to be added - * \param freerw non-zero to close the stream after being read - * \returns the number of mappings added or -1 on error; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_GameControllerAddMapping - * \sa SDL_GameControllerAddMappingsFromFile - * \sa SDL_GameControllerMappingForGUID - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); - -/** - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() - * - * Convenience macro. - */ -#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Add support for controllers that SDL is unaware of or to cause an existing - * controller to have a different binding. - * - * The mapping string has the format "GUID,name,mapping", where GUID is the - * string value from SDL_JoystickGetGUIDString(), name is the human readable - * string for the device and mappings are controller mappings to joystick - * ones. Under Windows there is a reserved GUID of "xinput" that covers all - * XInput devices. The mapping format for joystick is: {| |bX |a joystick - * button, index X |- |hX.Y |hat X with value Y |- |aX |axis X of the joystick - * |} Buttons can be used as a controller axes and vice versa. - * - * This string shows an example of a valid mapping for a controller: - * - * ```c - * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" - * ``` - * - * \param mappingString the mapping string - * \returns 1 if a new mapping is added, 0 if an existing mapping is updated, - * -1 on error; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerMapping - * \sa SDL_GameControllerMappingForGUID - */ -extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); - -/** - * Get the number of mappings installed. - * - * \returns the number of mappings. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); - -/** - * Get the mapping at a particular index. - * - * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if - * the index is out of range. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index); - -/** - * Get the game controller mapping string for a given GUID. - * - * The returned string must be freed with SDL_free(). - * - * \param guid a structure containing the GUID for which a mapping is desired - * \returns a mapping string or NULL on error; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetDeviceGUID - * \sa SDL_JoystickGetGUID - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); - -/** - * Get the current mapping of a Game Controller. - * - * The returned string must be freed with SDL_free(). - * - * Details about mappings are discussed with SDL_GameControllerAddMapping(). - * - * \param gamecontroller the game controller you want to get the current - * mapping for - * \returns a string that has the controller's mapping or NULL if no mapping - * is available; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerAddMapping - * \sa SDL_GameControllerMappingForGUID - */ -extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); - -/** - * Check if the given joystick is supported by the game controller interface. - * - * `joystick_index` is the same as the `device_index` passed to - * SDL_JoystickOpen(). - * - * \param joystick_index the device_index of a device, up to - * SDL_NumJoysticks() - * \returns SDL_TRUE if the given joystick is supported by the game controller - * interface, SDL_FALSE if it isn't or it's an invalid index. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerNameForIndex - * \sa SDL_GameControllerOpen - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); - -/** - * Get the implementation dependent name for the game controller. - * - * This function can be called before any controllers are opened. - * - * `joystick_index` is the same as the `device_index` passed to - * SDL_JoystickOpen(). - * - * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 - * \returns the implementation-dependent name for the game controller, or NULL - * if there is no name or the index is invalid. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerName - * \sa SDL_GameControllerOpen - * \sa SDL_IsGameController - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); - -/** - * Get the implementation dependent path for the game controller. - * - * This function can be called before any controllers are opened. - * - * `joystick_index` is the same as the `device_index` passed to - * SDL_JoystickOpen(). - * - * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 - * \returns the implementation-dependent path for the game controller, or NULL - * if there is no path or the index is invalid. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GameControllerPath - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index); - -/** - * Get the type of a game controller. - * - * This can be called before any controllers are opened. - * - * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 - * \returns the controller type. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); - -/** - * Get the mapping of a game controller. - * - * This can be called before any controllers are opened. - * - * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 - * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if - * no mapping is available. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); - -/** - * Open a game controller for use. - * - * `joystick_index` is the same as the `device_index` passed to - * SDL_JoystickOpen(). - * - * The index passed as an argument refers to the N'th game controller on the - * system. This index is not the value which will identify this controller in - * future controller events. The joystick's instance id (SDL_JoystickID) will - * be used there instead. - * - * \param joystick_index the device_index of a device, up to - * SDL_NumJoysticks() - * \returns a gamecontroller identifier or NULL if an error occurred; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerClose - * \sa SDL_GameControllerNameForIndex - * \sa SDL_IsGameController - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); - -/** - * Get the SDL_GameController associated with an instance id. - * - * \param joyid the instance id to get the SDL_GameController for - * \returns an SDL_GameController on success or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); - -/** - * Get the SDL_GameController associated with a player index. - * - * Please note that the player index is _not_ the device index, nor is it the - * instance id! - * - * \param player_index the player index, which is not the device index or the - * instance id! - * \returns the SDL_GameController associated with a player index. - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_GameControllerGetPlayerIndex - * \sa SDL_GameControllerSetPlayerIndex - */ -extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); - -/** - * Get the implementation-dependent name for an opened game controller. - * - * This is the same name as returned by SDL_GameControllerNameForIndex(), but - * it takes a controller identifier instead of the (unstable) device index. - * - * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() - * \returns the implementation dependent name for the game controller, or NULL - * if there is no name or the identifier passed is invalid. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerNameForIndex - * \sa SDL_GameControllerOpen - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); - -/** - * Get the implementation-dependent path for an opened game controller. - * - * This is the same path as returned by SDL_GameControllerNameForIndex(), but - * it takes a controller identifier instead of the (unstable) device index. - * - * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() - * \returns the implementation dependent path for the game controller, or NULL - * if there is no path or the identifier passed is invalid. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GameControllerPathForIndex - */ -extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller); - -/** - * Get the type of this currently opened controller - * - * This is the same name as returned by SDL_GameControllerTypeForIndex(), but - * it takes a controller identifier instead of the (unstable) device index. - * - * \param gamecontroller the game controller object to query. - * \returns the controller type. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); - -/** - * Get the player index of an opened game controller. - * - * For XInput controllers this returns the XInput user index. - * - * \param gamecontroller the game controller object to query. - * \returns the player index for controller, or -1 if it's not available. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); - -/** - * Set the player index of an opened game controller. - * - * \param gamecontroller the game controller object to adjust. - * \param player_index Player index to assign to this controller, or -1 to - * clear the player index and turn off player LEDs. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); - -/** - * Get the USB vendor ID of an opened controller, if available. - * - * If the vendor ID isn't available this function returns 0. - * - * \param gamecontroller the game controller object to query. - * \return the USB vendor ID, or zero if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); - -/** - * Get the USB product ID of an opened controller, if available. - * - * If the product ID isn't available this function returns 0. - * - * \param gamecontroller the game controller object to query. - * \return the USB product ID, or zero if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); - -/** - * Get the product version of an opened controller, if available. - * - * If the product version isn't available this function returns 0. - * - * \param gamecontroller the game controller object to query. - * \return the USB product version, or zero if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); - -/** - * Get the firmware version of an opened controller, if available. - * - * If the firmware version isn't available this function returns 0. - * - * \param gamecontroller the game controller object to query. - * \return the controller firmware version, or zero if unavailable. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller); - -/** - * Get the serial number of an opened controller, if available. - * - * Returns the serial number of the controller, or NULL if it is not - * available. - * - * \param gamecontroller the game controller object to query. - * \return the serial number, or NULL if unavailable. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); - -/** - * Check if a controller has been opened and is currently connected. - * - * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() - * \returns SDL_TRUE if the controller has been opened and is currently - * connected, or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerClose - * \sa SDL_GameControllerOpen - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); - -/** - * Get the Joystick ID from a Game Controller. - * - * This function will give you a SDL_Joystick object, which allows you to use - * the SDL_Joystick functions with a SDL_GameController object. This would be - * useful for getting a joystick's position at any given time, even if it - * hasn't moved (moving it would produce an event, which would have the axis' - * value). - * - * The pointer returned is owned by the SDL_GameController. You should not - * call SDL_JoystickClose() on it, for example, since doing so will likely - * cause SDL to crash. - * - * \param gamecontroller the game controller object that you want to get a - * joystick from - * \returns a SDL_Joystick object; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); - -/** - * Query or change current state of Game Controller events. - * - * If controller events are disabled, you must call SDL_GameControllerUpdate() - * yourself and check the state of the controller when you want controller - * information. - * - * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0, - * and 1 will have any effect. Other numbers will just be returned. - * - * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` - * \returns the same value passed to the function, with exception to -1 - * (SDL_QUERY), which will return the current state. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickEventState - */ -extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); - -/** - * Manually pump game controller updates if not using the loop. - * - * This function is called automatically by the event loop if events are - * enabled. Under such circumstances, it will not be necessary to call this - * function. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); - - -/** - * The list of axes available from a controller - * - * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, - * and are centered within ~8000 of zero, though advanced UI will allow users to set - * or autodetect the dead zone, which varies between controllers. - * - * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. - */ -typedef enum -{ - SDL_CONTROLLER_AXIS_INVALID = -1, - SDL_CONTROLLER_AXIS_LEFTX, - SDL_CONTROLLER_AXIS_LEFTY, - SDL_CONTROLLER_AXIS_RIGHTX, - SDL_CONTROLLER_AXIS_RIGHTY, - SDL_CONTROLLER_AXIS_TRIGGERLEFT, - SDL_CONTROLLER_AXIS_TRIGGERRIGHT, - SDL_CONTROLLER_AXIS_MAX -} SDL_GameControllerAxis; - -/** - * Convert a string into SDL_GameControllerAxis enum. - * - * This function is called internally to translate SDL_GameController mapping - * strings for the underlying joystick device into the consistent - * SDL_GameController mapping. You do not normally need to call this function - * unless you are parsing SDL_GameController mappings in your own code. - * - * Note specially that "righttrigger" and "lefttrigger" map to - * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`, - * respectively. - * - * \param str string representing a SDL_GameController axis - * \returns the SDL_GameControllerAxis enum corresponding to the input string, - * or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetStringForAxis - */ -extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str); - -/** - * Convert from an SDL_GameControllerAxis enum to a string. - * - * The caller should not SDL_free() the returned string. - * - * \param axis an enum value for a given SDL_GameControllerAxis - * \returns a string for the given axis, or NULL if an invalid axis is - * specified. The string returned is of the format used by - * SDL_GameController mapping strings. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetAxisFromString - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); - -/** - * Get the SDL joystick layer binding for a controller axis mapping. - * - * \param gamecontroller a game controller - * \param axis an axis enum value (one of the SDL_GameControllerAxis values) - * \returns a SDL_GameControllerButtonBind describing the bind. On failure - * (like the given Controller axis doesn't exist on the device), its - * `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetBindForButton - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, - SDL_GameControllerAxis axis); - -/** - * Query whether a game controller has a given axis. - * - * This merely reports whether the controller's mapping defined this axis, as - * that is all the information SDL has about the physical device. - * - * \param gamecontroller a game controller - * \param axis an axis enum value (an SDL_GameControllerAxis value) - * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL -SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); - -/** - * Get the current state of an axis control on a game controller. - * - * The axis indices start at index 0. - * - * The state is a value ranging from -32768 to 32767. Triggers, however, range - * from 0 to 32767 (they never return a negative value). - * - * \param gamecontroller a game controller - * \param axis an axis index (one of the SDL_GameControllerAxis values) - * \returns axis state (including 0) on success or 0 (also) on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetButton - */ -extern DECLSPEC Sint16 SDLCALL -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); - -/** - * The list of buttons available from a controller - */ -typedef enum -{ - SDL_CONTROLLER_BUTTON_INVALID = -1, - SDL_CONTROLLER_BUTTON_A, - SDL_CONTROLLER_BUTTON_B, - SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_BACK, - SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_START, - SDL_CONTROLLER_BUTTON_LEFTSTICK, - SDL_CONTROLLER_BUTTON_RIGHTSTICK, - SDL_CONTROLLER_BUTTON_LEFTSHOULDER, - SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, - SDL_CONTROLLER_BUTTON_DPAD_UP, - SDL_CONTROLLER_BUTTON_DPAD_DOWN, - SDL_CONTROLLER_BUTTON_DPAD_LEFT, - SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */ - SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ - SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ - SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ - SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ - SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ - SDL_CONTROLLER_BUTTON_MAX -} SDL_GameControllerButton; - -/** - * Convert a string into an SDL_GameControllerButton enum. - * - * This function is called internally to translate SDL_GameController mapping - * strings for the underlying joystick device into the consistent - * SDL_GameController mapping. You do not normally need to call this function - * unless you are parsing SDL_GameController mappings in your own code. - * - * \param str string representing a SDL_GameController axis - * \returns the SDL_GameControllerButton enum corresponding to the input - * string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *str); - -/** - * Convert from an SDL_GameControllerButton enum to a string. - * - * The caller should not SDL_free() the returned string. - * - * \param button an enum value for a given SDL_GameControllerButton - * \returns a string for the given button, or NULL if an invalid button is - * specified. The string returned is of the format used by - * SDL_GameController mapping strings. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetButtonFromString - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); - -/** - * Get the SDL joystick layer binding for a controller button mapping. - * - * \param gamecontroller a game controller - * \param button an button enum value (an SDL_GameControllerButton value) - * \returns a SDL_GameControllerButtonBind describing the bind. On failure - * (like the given Controller button doesn't exist on the device), - * its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetBindForAxis - */ -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL -SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Query whether a game controller has a given button. - * - * This merely reports whether the controller's mapping defined this button, - * as that is all the information SDL has about the physical device. - * - * \param gamecontroller a game controller - * \param button a button enum value (an SDL_GameControllerButton value) - * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Get the current state of a button on a game controller. - * - * \param gamecontroller a game controller - * \param button a button index (one of the SDL_GameControllerButton values) - * \returns 1 for pressed state or 0 for not pressed state or error; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerGetAxis - */ -extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, - SDL_GameControllerButton button); - -/** - * Get the number of touchpads on a game controller. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); - -/** - * Get the number of supported simultaneous fingers on a touchpad on a game - * controller. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); - -/** - * Get the current state of a finger on a touchpad on a game controller. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); - -/** - * Return whether a game controller has a particular sensor. - * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); - -/** - * Set whether data reporting for a game controller sensor is enabled. - * - * \param gamecontroller The controller to update - * \param type The type of sensor to enable/disable - * \param enabled Whether data reporting should be enabled - * \returns 0 or -1 if an error occurred. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); - -/** - * Query whether sensor data reporting is enabled for a game controller. - * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); - -/** - * Get the data rate (number of events per second) of a game controller - * sensor. - * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \return the data rate, or 0.0f if the data rate is not available. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type); - -/** - * Get the current state of a game controller sensor. - * - * The number of values and interpretation of the data is sensor dependent. - * See SDL_sensor.h for the details for each type of sensor. - * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * \return 0 or -1 if an error occurred. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); - -/** - * Get the current state of a game controller sensor with the timestamp of the - * last update. - * - * The number of values and interpretation of the data is sensor dependent. - * See SDL_sensor.h for the details for each type of sensor. - * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \param timestamp A pointer filled with the timestamp in microseconds of the - * current sensor reading if available, or 0 if not - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * \return 0 or -1 if an error occurred. - * - * \since This function is available since SDL 2.26.0. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values); - -/** - * Start a rumble effect on a game controller. - * - * Each call to this function cancels any previous rumble effect, and calling - * it with 0 intensity stops any rumbling. - * - * \param gamecontroller The controller to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) - * rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) - * rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if rumble isn't supported on this controller - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_GameControllerHasRumble - */ -extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Start a rumble effect in the game controller's triggers. - * - * Each call to this function cancels any previous trigger rumble effect, and - * calling it with 0 intensity stops any rumbling. - * - * Note that this is rumbling of the _triggers_ and not the game controller as - * a whole. This is currently only supported on Xbox One controllers. If you - * want the (more common) whole-controller rumble, use - * SDL_GameControllerRumble() instead. - * - * \param gamecontroller The controller to vibrate - * \param left_rumble The intensity of the left trigger rumble motor, from 0 - * to 0xFFFF - * \param right_rumble The intensity of the right trigger rumble motor, from 0 - * to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if trigger rumble isn't supported on this controller - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_GameControllerHasRumbleTriggers - */ -extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); - -/** - * Query whether a game controller has an LED. - * - * \param gamecontroller The controller to query - * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a - * modifiable LED - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); - -/** - * Query whether a game controller has rumble support. - * - * \param gamecontroller The controller to query - * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble - * support - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GameControllerRumble - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller); - -/** - * Query whether a game controller has rumble support on triggers. - * - * \param gamecontroller The controller to query - * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger - * rumble support - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GameControllerRumbleTriggers - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller); - -/** - * Update a game controller's LED color. - * - * \param gamecontroller The controller to update - * \param red The intensity of the red LED - * \param green The intensity of the green LED - * \param blue The intensity of the blue LED - * \returns 0, or -1 if this controller does not have a modifiable LED - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); - -/** - * Send a controller specific effect packet - * - * \param gamecontroller The controller to affect - * \param data The data to send to the controller - * \param size The size of the data to send to the controller - * \returns 0, or -1 if this controller or driver doesn't support effect - * packets - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size); - -/** - * Close a game controller previously opened with SDL_GameControllerOpen(). - * - * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerOpen - */ -extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); - -/** - * Return the sfSymbolsName for a given button on a game controller on Apple - * platforms. - * - * \param gamecontroller the controller to query - * \param button a button on the game controller - * \returns the sfSymbolsName or NULL if the name can't be found - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GameControllerGetAppleSFSymbolsNameForAxis - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button); - -/** - * Return the sfSymbolsName for a given axis on a game controller on Apple - * platforms. - * - * \param gamecontroller the controller to query - * \param axis an axis on the game controller - * \returns the sfSymbolsName or NULL if the name can't be found - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GameControllerGetAppleSFSymbolsNameForButton - */ -extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gamecontroller_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_gesture.h b/libs/hwcodec/externals/SDL/include/SDL_gesture.h deleted file mode 100644 index db70b4dd..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_gesture.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_gesture.h - * - * Include file for SDL gesture event handling. - */ - -#ifndef SDL_gesture_h_ -#define SDL_gesture_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "SDL_touch.h" - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_GestureID; - -/* Function prototypes */ - -/** - * Begin recording a gesture on a specified touch device or all touch devices. - * - * If the parameter `touchId` is -1 (i.e., all devices), this function will - * always return 1, regardless of whether there actually are any devices. - * - * \param touchId the touch device id, or -1 for all touch devices - * \returns 1 on success or 0 if the specified device could not be found. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchDevice - */ -extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); - - -/** - * Save all currently loaded Dollar Gesture templates. - * - * \param dst a SDL_RWops to save to - * \returns the number of saved templates on success or 0 on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadDollarTemplates - * \sa SDL_SaveDollarTemplate - */ -extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); - -/** - * Save a currently loaded Dollar Gesture template. - * - * \param gestureId a gesture id - * \param dst a SDL_RWops to save to - * \returns 1 on success or 0 on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadDollarTemplates - * \sa SDL_SaveAllDollarTemplates - */ -extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); - - -/** - * Load Dollar Gesture templates from a file. - * - * \param touchId a touch id - * \param src a SDL_RWops to load from - * \returns the number of loaded templates on success or a negative error code - * (or 0) on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SaveAllDollarTemplates - * \sa SDL_SaveDollarTemplate - */ -extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_gesture_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_guid.h b/libs/hwcodec/externals/SDL/include/SDL_guid.h deleted file mode 100644 index d964223c..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_guid.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_guid.h - * - * Include file for handling ::SDL_GUID values. - */ - -#ifndef SDL_guid_h_ -#define SDL_guid_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * An SDL_GUID is a 128-bit identifier for an input device that - * identifies that device across runs of SDL programs on the same - * platform. If the device is detached and then re-attached to a - * different port, or if the base system is rebooted, the device - * should still report the same GUID. - * - * GUIDs are as precise as possible but are not guaranteed to - * distinguish physically distinct but equivalent devices. For - * example, two game controllers from the same vendor with the same - * product ID and revision may have the same GUID. - * - * GUIDs may be platform-dependent (i.e., the same device may report - * different GUIDs on different operating systems). - */ -typedef struct { - Uint8 data[16]; -} SDL_GUID; - -/* Function prototypes */ - -/** - * Get an ASCII string representation for a given ::SDL_GUID. - * - * You should supply at least 33 bytes for pszGUID. - * - * \param guid the ::SDL_GUID you wish to convert to string - * \param pszGUID buffer in which to write the ASCII string - * \param cbGUID the size of pszGUID - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GUIDFromString - */ -extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); - -/** - * Convert a GUID string into a ::SDL_GUID structure. - * - * Performs no error checking. If this function is given a string containing - * an invalid GUID, the function will silently succeed, but the GUID generated - * will not be useful. - * - * \param pchGUID string containing an ASCII representation of a GUID - * \returns a ::SDL_GUID structure. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GUIDToString - */ -extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_guid_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_haptic.h b/libs/hwcodec/externals/SDL/include/SDL_haptic.h deleted file mode 100644 index 2462a1e4..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_haptic.h +++ /dev/null @@ -1,1341 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_haptic.h - * - * \brief The SDL haptic subsystem allows you to control haptic (force feedback) - * devices. - * - * The basic usage is as follows: - * - Initialize the subsystem (::SDL_INIT_HAPTIC). - * - Open a haptic device. - * - SDL_HapticOpen() to open from index. - * - SDL_HapticOpenFromJoystick() to open from an existing joystick. - * - Create an effect (::SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(). - * - Run the effect with SDL_HapticRunEffect(). - * - (optional) Free the effect with SDL_HapticDestroyEffect(). - * - Close the haptic device with SDL_HapticClose(). - * - * \par Simple rumble example: - * \code - * SDL_Haptic *haptic; - * - * // Open the device - * haptic = SDL_HapticOpen( 0 ); - * if (haptic == NULL) - * return -1; - * - * // Initialize simple rumble - * if (SDL_HapticRumbleInit( haptic ) != 0) - * return -1; - * - * // Play effect at 50% strength for 2 seconds - * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) - * return -1; - * SDL_Delay( 2000 ); - * - * // Clean up - * SDL_HapticClose( haptic ); - * \endcode - * - * \par Complete example: - * \code - * int test_haptic( SDL_Joystick * joystick ) { - * SDL_Haptic *haptic; - * SDL_HapticEffect effect; - * int effect_id; - * - * // Open the device - * haptic = SDL_HapticOpenFromJoystick( joystick ); - * if (haptic == NULL) return -1; // Most likely joystick isn't haptic - * - * // See if it can do sine waves - * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { - * SDL_HapticClose(haptic); // No sine effect - * return -1; - * } - * - * // Create the effect - * SDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default - * effect.type = SDL_HAPTIC_SINE; - * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates - * effect.periodic.direction.dir[0] = 18000; // Force comes from south - * effect.periodic.period = 1000; // 1000 ms - * effect.periodic.magnitude = 20000; // 20000/32767 strength - * effect.periodic.length = 5000; // 5 seconds long - * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength - * effect.periodic.fade_length = 1000; // Takes 1 second to fade away - * - * // Upload the effect - * effect_id = SDL_HapticNewEffect( haptic, &effect ); - * - * // Test the effect - * SDL_HapticRunEffect( haptic, effect_id, 1 ); - * SDL_Delay( 5000); // Wait for the effect to finish - * - * // We destroy the effect, although closing the device also does this - * SDL_HapticDestroyEffect( haptic, effect_id ); - * - * // Close the device - * SDL_HapticClose(haptic); - * - * return 0; // Success - * } - * \endcode - */ - -#ifndef SDL_haptic_h_ -#define SDL_haptic_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_joystick.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). - * - * At the moment the magnitude variables are mixed between signed/unsigned, and - * it is also not made clear that ALL of those variables expect a max of 0x7FFF. - * - * Some platforms may have higher precision than that (Linux FF, Windows XInput) - * so we should fix the inconsistency in favor of higher possible precision, - * adjusting for platforms that use different scales. - * -flibit - */ - -/** - * \typedef SDL_Haptic - * - * \brief The haptic structure used to identify an SDL haptic. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - */ -struct _SDL_Haptic; -typedef struct _SDL_Haptic SDL_Haptic; - - -/** - * \name Haptic features - * - * Different haptic features a device can have. - */ -/* @{ */ - -/** - * \name Haptic effects - */ -/* @{ */ - -/** - * \brief Constant effect supported. - * - * Constant haptic effect. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_CONSTANT (1u<<0) - -/** - * \brief Sine wave effect supported. - * - * Periodic haptic effect that simulates sine waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SINE (1u<<1) - -/** - * \brief Left/Right effect supported. - * - * Haptic effect for direct control over high/low frequency motors. - * - * \sa SDL_HapticLeftRight - * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, - * we ran out of bits, and this is important for XInput devices. - */ -#define SDL_HAPTIC_LEFTRIGHT (1u<<2) - -/* !!! FIXME: put this back when we have more bits in 2.1 */ -/* #define SDL_HAPTIC_SQUARE (1<<2) */ - -/** - * \brief Triangle wave effect supported. - * - * Periodic haptic effect that simulates triangular waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_TRIANGLE (1u<<3) - -/** - * \brief Sawtoothup wave effect supported. - * - * Periodic haptic effect that simulates saw tooth up waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHUP (1u<<4) - -/** - * \brief Sawtoothdown wave effect supported. - * - * Periodic haptic effect that simulates saw tooth down waves. - * - * \sa SDL_HapticPeriodic - */ -#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) - -/** - * \brief Ramp effect supported. - * - * Ramp haptic effect. - * - * \sa SDL_HapticRamp - */ -#define SDL_HAPTIC_RAMP (1u<<6) - -/** - * \brief Spring effect supported - uses axes position. - * - * Condition haptic effect that simulates a spring. Effect is based on the - * axes position. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_SPRING (1u<<7) - -/** - * \brief Damper effect supported - uses axes velocity. - * - * Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_DAMPER (1u<<8) - -/** - * \brief Inertia effect supported - uses axes acceleration. - * - * Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_INERTIA (1u<<9) - -/** - * \brief Friction effect supported - uses axes movement. - * - * Condition haptic effect that simulates friction. Effect is based on the - * axes movement. - * - * \sa SDL_HapticCondition - */ -#define SDL_HAPTIC_FRICTION (1u<<10) - -/** - * \brief Custom effect is supported. - * - * User defined custom haptic effect. - */ -#define SDL_HAPTIC_CUSTOM (1u<<11) - -/* @} *//* Haptic effects */ - -/* These last few are features the device has, not effects */ - -/** - * \brief Device can set global gain. - * - * Device supports setting the global gain. - * - * \sa SDL_HapticSetGain - */ -#define SDL_HAPTIC_GAIN (1u<<12) - -/** - * \brief Device can set autocenter. - * - * Device supports setting autocenter. - * - * \sa SDL_HapticSetAutocenter - */ -#define SDL_HAPTIC_AUTOCENTER (1u<<13) - -/** - * \brief Device can be queried for effect status. - * - * Device supports querying effect status. - * - * \sa SDL_HapticGetEffectStatus - */ -#define SDL_HAPTIC_STATUS (1u<<14) - -/** - * \brief Device can be paused. - * - * Devices supports being paused. - * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause - */ -#define SDL_HAPTIC_PAUSE (1u<<15) - - -/** - * \name Direction encodings - */ -/* @{ */ - -/** - * \brief Uses polar coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_POLAR 0 - -/** - * \brief Uses cartesian coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_CARTESIAN 1 - -/** - * \brief Uses spherical coordinates for the direction. - * - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_SPHERICAL 2 - -/** - * \brief Use this value to play an effect on the steering wheel axis. This - * provides better compatibility across platforms and devices as SDL will guess - * the correct axis. - * \sa SDL_HapticDirection - */ -#define SDL_HAPTIC_STEERING_AXIS 3 - -/* @} *//* Direction encodings */ - -/* @} *//* Haptic features */ - -/* - * Misc defines. - */ - -/** - * \brief Used to play a device an infinite number of times. - * - * \sa SDL_HapticRunEffect - */ -#define SDL_HAPTIC_INFINITY 4294967295U - - -/** - * \brief Structure that represents a haptic direction. - * - * This is the direction where the force comes from, - * instead of the direction in which the force is exerted. - * - * Directions can be specified by: - * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning - * of the device. North is considered to be away from the user. - * - * The following diagram represents the cardinal directions: - * \verbatim - .--. - |__| .-------. - |=.| |.-----.| - |--| || || - | | |'-----'| - |__|~')_____(' - [ COMPUTER ] - - - North (0,-1) - ^ - | - | - (-1,0) West <----[ HAPTIC ]----> East (1,0) - | - | - v - South (0,1) - - - [ USER ] - \|||/ - (o o) - ---ooO-(_)-Ooo--- - \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses - * the first \c dir parameter. The cardinal directions would be: - * - North: 0 (0 degrees) - * - East: 9000 (90 degrees) - * - South: 18000 (180 degrees) - * - West: 27000 (270 degrees) - * - * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses - * the first three \c dir parameters. The cardinal directions would be: - * - North: 0,-1, 0 - * - East: 1, 0, 0 - * - South: 0, 1, 0 - * - West: -1, 0, 0 - * - * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you - * can use any multiple you want, only the direction matters. - * - * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two \c dir parameters are used. The \c dir parameters are as - * follows (all values are in hundredths of degrees): - * - Degrees from (1, 0) rotated towards (0, 1). - * - Degrees towards (0, 0, 1) (device needs at least 3 axes). - * - * - * Example of force coming from the south with all encodings (force coming - * from the south means the user will have to pull the stick to counteract): - * \code - * SDL_HapticDirection direction; - * - * // Cartesian directions - * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. - * direction.dir[0] = 0; // X position - * direction.dir[1] = 1; // Y position - * // Assuming the device has 2 axes, we don't need to specify third parameter. - * - * // Polar directions - * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. - * direction.dir[0] = 18000; // Polar only uses first parameter - * - * // Spherical coordinates - * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding - * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode - * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HAPTIC_STEERING_AXIS - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes - */ -typedef struct SDL_HapticDirection -{ - Uint8 type; /**< The type of encoding. */ - Sint32 dir[3]; /**< The encoded direction. */ -} SDL_HapticDirection; - - -/** - * \brief A structure containing a template for a Constant effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. - * - * A constant effect applies a constant force in the specified direction - * to the joystick. - * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticConstant -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Constant */ - Sint16 level; /**< Strength of the constant effect. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticConstant; - -/** - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_LEFTRIGHT - * - ::SDL_HAPTIC_TRIANGLE - * - ::SDL_HAPTIC_SAWTOOTHUP - * - ::SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself - * over time. The type determines the shape of the wave and the parameters - * determine the dimensions of the wave. - * - * Phase is given by hundredth of a degree meaning that giving the phase a value - * of 9000 will displace it 25% of its period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of its period. - * - 18000: Displaced 50% of its period. - * - 27000: Displaced 75% of its period. - * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. - * - * Examples: - * \verbatim - SDL_HAPTIC_SINE - __ __ __ __ - / \ / \ / \ / - / \__/ \__/ \__/ - - SDL_HAPTIC_SQUARE - __ __ __ __ __ - | | | | | | | | | | - | |__| |__| |__| |__| | - - SDL_HAPTIC_TRIANGLE - /\ /\ /\ /\ /\ - / \ / \ / \ / \ / - / \/ \/ \/ \/ - - SDL_HAPTIC_SAWTOOTHUP - /| /| /| /| /| /| /| - / | / | / | / | / | / | / | - / |/ |/ |/ |/ |/ |/ | - - SDL_HAPTIC_SAWTOOTHDOWN - \ |\ |\ |\ |\ |\ |\ | - \ | \ | \ | \ | \ | \ | \ | - \| \| \| \| \| \| \| - \endverbatim - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticPeriodic -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, - ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or - ::SDL_HAPTIC_SAWTOOTHDOWN */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Periodic */ - Uint16 period; /**< Period of the wave. */ - Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ - Sint16 offset; /**< Mean value of the wave. */ - Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticPeriodic; - -/** - * \brief A structure containing a template for a Condition effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SPRING: Effect based on axes position. - * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. - * - * Direction is handled by condition internals instead of a direction member. - * The condition effect specific members have three parameters. The first - * refers to the X axis, the second refers to the Y axis and the third - * refers to the Z axis. The right terms refer to the positive side of the - * axis and the left terms refer to the negative side of the axis. Please - * refer to the ::SDL_HapticDirection diagram for which side is positive and - * which is negative. - * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCondition -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, - ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Condition */ - Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ - Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ - Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ - Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ - Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ - Sint16 center[3]; /**< Position of the dead zone. */ -} SDL_HapticCondition; - -/** - * \brief A structure containing a template for a Ramp effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. - * - * The ramp effect starts at start strength and ends at end strength. - * It augments in linear fashion. If you use attack and fade with a ramp - * the effects get added to the ramp effect making the effect become - * quadratic instead of linear. - * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticRamp -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_RAMP */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Ramp */ - Sint16 start; /**< Beginning strength level. */ - Sint16 end; /**< Ending strength level. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticRamp; - -/** - * \brief A structure containing a template for a Left/Right effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. - * - * The Left/Right effect is used to explicitly control the large and small - * motors, commonly found in modern game controllers. The small (right) motor - * is high frequency, and the large (left) motor is low frequency. - * - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticLeftRight -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ - - /* Replay */ - Uint32 length; /**< Duration of the effect in milliseconds. */ - - /* Rumble */ - Uint16 large_magnitude; /**< Control of the large controller motor. */ - Uint16 small_magnitude; /**< Control of the small controller motor. */ -} SDL_HapticLeftRight; - -/** - * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. - * - * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. - * - * A custom force feedback effect is much like a periodic effect, where the - * application can define its exact shape. You will have to allocate the - * data yourself. Data should consist of channels * samples Uint16 samples. - * - * If channels is one, the effect is rotated using the defined direction. - * Otherwise it uses the samples in data for the different axes. - * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect - */ -typedef struct SDL_HapticCustom -{ - /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ - SDL_HapticDirection direction; /**< Direction of the effect. */ - - /* Replay */ - Uint32 length; /**< Duration of the effect. */ - Uint16 delay; /**< Delay before starting the effect. */ - - /* Trigger */ - Uint16 button; /**< Button that triggers the effect. */ - Uint16 interval; /**< How soon it can be triggered again after button. */ - - /* Custom */ - Uint8 channels; /**< Axes to use, minimum of one. */ - Uint16 period; /**< Sample periods. */ - Uint16 samples; /**< Amount of samples. */ - Uint16 *data; /**< Should contain channels*samples items. */ - - /* Envelope */ - Uint16 attack_length; /**< Duration of the attack. */ - Uint16 attack_level; /**< Level at the start of the attack. */ - Uint16 fade_length; /**< Duration of the fade. */ - Uint16 fade_level; /**< Level at the end of the fade. */ -} SDL_HapticCustom; - -/** - * \brief The generic template for any haptic effect. - * - * All values max at 32767 (0x7FFF). Signed values also can be negative. - * Time values unless specified otherwise are in milliseconds. - * - * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 - * value. Neither delay, interval, attack_length nor fade_length support - * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. - * - * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of - * ::SDL_HAPTIC_INFINITY. - * - * Button triggers may not be supported on all devices, it is advised to not - * use them if possible. Buttons start at index 1 instead of index 0 like - * the joystick. - * - * If both attack_length and fade_level are 0, the envelope is not used, - * otherwise both values are used. - * - * Common parts: - * \code - * // Replay - All effects have this - * Uint32 length; // Duration of effect (ms). - * Uint16 delay; // Delay before starting effect. - * - * // Trigger - All effects have this - * Uint16 button; // Button that triggers effect. - * Uint16 interval; // How soon before effect can be triggered again. - * - * // Envelope - All effects except condition effects have this - * Uint16 attack_length; // Duration of the attack (ms). - * Uint16 attack_level; // Level at the start of the attack. - * Uint16 fade_length; // Duration of the fade out (ms). - * Uint16 fade_level; // Level at the end of the fade. - * \endcode - * - * - * Here we have an example of a constant effect evolution in time: - * \verbatim - Strength - ^ - | - | effect level --> _________________ - | / \ - | / \ - | / \ - | / \ - | attack_level --> | \ - | | | <--- fade_level - | - +--------------------------------------------------> Time - [--] [---] - attack_length fade_length - - [------------------][-----------------------] - delay length - \endverbatim - * - * Note either the attack_level or the fade_level may be above the actual - * effect level. - * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticLeftRight - * \sa SDL_HapticCustom - */ -typedef union SDL_HapticEffect -{ - /* Common for all force feedback effects */ - Uint16 type; /**< Effect type. */ - SDL_HapticConstant constant; /**< Constant effect. */ - SDL_HapticPeriodic periodic; /**< Periodic effect. */ - SDL_HapticCondition condition; /**< Condition effect. */ - SDL_HapticRamp ramp; /**< Ramp effect. */ - SDL_HapticLeftRight leftright; /**< Left/Right effect. */ - SDL_HapticCustom custom; /**< Custom effect. */ -} SDL_HapticEffect; - - -/* Function prototypes */ - -/** - * Count the number of haptic devices attached to the system. - * - * \returns the number of haptic devices detected on the system or a negative - * error code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticName - */ -extern DECLSPEC int SDLCALL SDL_NumHaptics(void); - -/** - * Get the implementation dependent name of a haptic device. - * - * This can be called before any joysticks are opened. If no name can be - * found, this function returns NULL. - * - * \param device_index index of the device to query. - * \returns the name of the device or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_NumHaptics - */ -extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); - -/** - * Open a haptic device for use. - * - * The index passed as an argument refers to the N'th haptic device on this - * system. - * - * When opening a haptic device, its gain will be set to maximum and - * autocenter will be disabled. To modify these values use SDL_HapticSetGain() - * and SDL_HapticSetAutocenter(). - * - * \param device_index index of the device to open - * \returns the device identifier or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticClose - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticPause - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticSetGain - * \sa SDL_HapticStopAll - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); - -/** - * Check if the haptic device at the designated index has been opened. - * - * \param device_index the index of the device to query - * \returns 1 if it has been opened, 0 if it hasn't or on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpen - */ -extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); - -/** - * Get the index of a haptic device. - * - * \param haptic the SDL_Haptic device to query - * \returns the index of the specified haptic device or a negative error code - * on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened - */ -extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); - -/** - * Query whether or not the current mouse has haptic capabilities. - * - * \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpenFromMouse - */ -extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); - -/** - * Try to open a haptic device from the current mouse. - * - * \returns the haptic device identifier or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_MouseIsHaptic - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); - -/** - * Query if a joystick has haptic features. - * - * \param joystick the SDL_Joystick to test for haptic capabilities - * \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpenFromJoystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); - -/** - * Open a haptic device for use from a joystick device. - * - * You must still close the haptic device separately. It will not be closed - * with the joystick. - * - * When opened from a joystick you should first close the haptic device before - * closing the joystick device. If not, on some implementations the haptic - * device will also get unallocated and you'll be unable to use force feedback - * on that device. - * - * \param joystick the SDL_Joystick to create a haptic device from - * \returns a valid haptic device identifier on success or NULL on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticClose - * \sa SDL_HapticOpen - * \sa SDL_JoystickIsHaptic - */ -extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * - joystick); - -/** - * Close a haptic device previously opened with SDL_HapticOpen(). - * - * \param haptic the SDL_Haptic device to close - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - */ -extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); - -/** - * Get the number of effects a haptic device can store. - * - * On some platforms this isn't fully supported, and therefore is an - * approximation. Always check to see if your created effect was actually - * created and do not rely solely on SDL_HapticNumEffects(). - * - * \param haptic the SDL_Haptic device to query - * \returns the number of effects the haptic device can store or a negative - * error code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); - -/** - * Get the number of effects a haptic device can play at the same time. - * - * This is not supported on all platforms, but will always return a value. - * - * \param haptic the SDL_Haptic device to query maximum playing effects - * \returns the number of effects the haptic device can play at the same time - * or a negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); - -/** - * Get the haptic device's supported features in bitwise manner. - * - * \param haptic the SDL_Haptic device to query - * \returns a list of supported haptic features in bitwise manner (OR'd), or 0 - * on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticEffectSupported - * \sa SDL_HapticNumEffects - */ -extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); - - -/** - * Get the number of haptic axes the device has. - * - * The number of haptic axes might be useful if working with the - * SDL_HapticDirection effect. - * - * \param haptic the SDL_Haptic device to query - * \returns the number of axes on success or a negative error code on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); - -/** - * Check to see if an effect is supported by a haptic device. - * - * \param haptic the SDL_Haptic device to query - * \param effect the desired effect to query - * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, - SDL_HapticEffect * - effect); - -/** - * Create a new haptic effect on a specified device. - * - * \param haptic an SDL_Haptic device to create the effect on - * \param effect an SDL_HapticEffect structure containing the properties of - * the effect to create - * \returns the ID of the effect on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticUpdateEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, - SDL_HapticEffect * effect); - -/** - * Update the properties of an effect. - * - * Can be used dynamically, although behavior when dynamically changing - * direction may be strange. Specifically the effect may re-upload itself and - * start playing from the start. You also cannot change the type either when - * running SDL_HapticUpdateEffect(). - * - * \param haptic the SDL_Haptic device that has the effect - * \param effect the identifier of the effect to update - * \param data an SDL_HapticEffect structure containing the new effect - * properties to use - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, - int effect, - SDL_HapticEffect * data); - -/** - * Run the haptic effect on its associated haptic device. - * - * To repeat the effect over and over indefinitely, set `iterations` to - * `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make - * one instance of the effect last indefinitely (so the effect does not fade), - * set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY` - * instead. - * - * \param haptic the SDL_Haptic device to run the effect on - * \param effect the ID of the haptic effect to run - * \param iterations the number of iterations to run the effect; use - * `SDL_HAPTIC_INFINITY` to repeat forever - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus - * \sa SDL_HapticStopEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, - int effect, - Uint32 iterations); - -/** - * Stop the haptic effect on its associated haptic device. - * - * * - * - * \param haptic the SDL_Haptic device to stop the effect on - * \param effect the ID of the haptic effect to stop - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticRunEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, - int effect); - -/** - * Destroy a haptic effect on the device. - * - * This will stop the effect if it's running. Effects are automatically - * destroyed when the device is closed. - * - * \param haptic the SDL_Haptic device to destroy the effect on - * \param effect the ID of the haptic effect to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNewEffect - */ -extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, - int effect); - -/** - * Get the status of the current effect on the specified haptic device. - * - * Device must support the SDL_HAPTIC_STATUS feature. - * - * \param haptic the SDL_Haptic device to query for the effect status on - * \param effect the ID of the haptic effect to query its status - * \returns 0 if it isn't playing, 1 if it is playing, or a negative error - * code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect - */ -extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, - int effect); - -/** - * Set the global gain of the specified haptic device. - * - * Device must support the SDL_HAPTIC_GAIN feature. - * - * The user may specify the maximum gain by setting the environment variable - * `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to - * SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the - * maximum. - * - * \param haptic the SDL_Haptic device to set the gain on - * \param gain value to set the gain to, should be between 0 and 100 (0 - 100) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); - -/** - * Set the global autocenter of the device. - * - * Autocenter should be between 0 and 100. Setting it to 0 will disable - * autocentering. - * - * Device must support the SDL_HAPTIC_AUTOCENTER feature. - * - * \param haptic the SDL_Haptic device to set autocentering on - * \param autocenter value to set autocenter to (0-100) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticQuery - */ -extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, - int autocenter); - -/** - * Pause a haptic device. - * - * Device must support the `SDL_HAPTIC_PAUSE` feature. Call - * SDL_HapticUnpause() to resume playback. - * - * Do not modify the effects nor add new ones while the device is paused. That - * can cause all sorts of weird errors. - * - * \param haptic the SDL_Haptic device to pause - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticUnpause - */ -extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); - -/** - * Unpause a haptic device. - * - * Call to unpause after SDL_HapticPause(). - * - * \param haptic the SDL_Haptic device to unpause - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticPause - */ -extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); - -/** - * Stop all the currently playing effects on a haptic device. - * - * \param haptic the SDL_Haptic device to stop - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); - -/** - * Check whether rumble is supported on a haptic device. - * - * \param haptic haptic device to check for rumble support - * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); - -/** - * Initialize a haptic device for simple rumble playback. - * - * \param haptic the haptic device to initialize for simple rumble playback - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - * \sa SDL_HapticRumbleSupported - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); - -/** - * Run a simple rumble effect on a haptic device. - * - * \param haptic the haptic device to play the rumble effect on - * \param strength strength of the rumble to play as a 0-1 float value - * \param length length of the rumble to play in milliseconds - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumbleStop - * \sa SDL_HapticRumbleSupported - */ -extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); - -/** - * Stop the simple rumble on a haptic device. - * - * \param haptic the haptic device to stop the rumble effect on - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleSupported - */ -extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_haptic_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_hidapi.h b/libs/hwcodec/externals/SDL/include/SDL_hidapi.h deleted file mode 100644 index 05751003..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_hidapi.h +++ /dev/null @@ -1,451 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_hidapi.h - * - * Header file for SDL HIDAPI functions. - * - * This is an adaptation of the original HIDAPI interface by Alan Ott, - * and includes source code licensed under the following BSD license: - * - Copyright (c) 2010, Alan Ott, Signal 11 Software - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Signal 11 Software nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - * - * If you would like a version of SDL without this code, you can build SDL - * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example - * on iOS or tvOS to avoid a dependency on the CoreBluetooth framework. - */ - -#ifndef SDL_hidapi_h_ -#define SDL_hidapi_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A handle representing an open HID device - */ -struct SDL_hid_device_; -typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */ - -/** hidapi info structure */ -/** - * \brief Information about a connected HID device - */ -typedef struct SDL_hid_device_info -{ - /** Platform-specific device path */ - char *path; - /** Device Vendor ID */ - unsigned short vendor_id; - /** Device Product ID */ - unsigned short product_id; - /** Serial Number */ - wchar_t *serial_number; - /** Device Release Number in binary-coded decimal, - also known as Device Version Number */ - unsigned short release_number; - /** Manufacturer String */ - wchar_t *manufacturer_string; - /** Product string */ - wchar_t *product_string; - /** Usage Page for this Device/Interface - (Windows/Mac only). */ - unsigned short usage_page; - /** Usage for this Device/Interface - (Windows/Mac only).*/ - unsigned short usage; - /** The USB interface which this logical device - represents. - - * Valid on both Linux implementations in all cases. - * Valid on the Windows implementation only if the device - contains more than one interface. */ - int interface_number; - - /** Additional information about the USB interface. - Valid on libusb and Android implementations. */ - int interface_class; - int interface_subclass; - int interface_protocol; - - /** Pointer to the next device */ - struct SDL_hid_device_info *next; -} SDL_hid_device_info; - - -/** - * Initialize the HIDAPI library. - * - * This function initializes the HIDAPI library. Calling it is not strictly - * necessary, as it will be called automatically by SDL_hid_enumerate() and - * any of the SDL_hid_open_*() functions if it is needed. This function should - * be called at the beginning of execution however, if there is a chance of - * HIDAPI handles being opened by different threads simultaneously. - * - * Each call to this function should have a matching call to SDL_hid_exit() - * - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_hid_exit - */ -extern DECLSPEC int SDLCALL SDL_hid_init(void); - -/** - * Finalize the HIDAPI library. - * - * This function frees all of the static data associated with HIDAPI. It - * should be called at the end of execution to avoid memory leaks. - * - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_hid_init - */ -extern DECLSPEC int SDLCALL SDL_hid_exit(void); - -/** - * Check to see if devices may have been added or removed. - * - * Enumerating the HID devices is an expensive operation, so you can call this - * to see if there have been any system device changes since the last call to - * this function. A change in the counter returned doesn't necessarily mean - * that anything has changed, but you can call SDL_hid_enumerate() to get an - * updated device list. - * - * Calling this function for the first time may cause a thread or other system - * resource to be allocated to track device change notifications. - * - * \returns a change counter that is incremented with each potential device - * change, or 0 if device change detection isn't available. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_hid_enumerate - */ -extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void); - -/** - * Enumerate the HID Devices. - * - * This function returns a linked list of all the HID devices attached to the - * system which match vendor_id and product_id. If `vendor_id` is set to 0 - * then any vendor matches. If `product_id` is set to 0 then any product - * matches. If `vendor_id` and `product_id` are both set to 0, then all HID - * devices will be returned. - * - * \param vendor_id The Vendor ID (VID) of the types of device to open. - * \param product_id The Product ID (PID) of the types of device to open. - * \returns a pointer to a linked list of type SDL_hid_device_info, containing - * information about the HID devices attached to the system, or NULL - * in the case of failure. Free this linked list by calling - * SDL_hid_free_enumeration(). - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_hid_device_change_count - */ -extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id); - -/** - * Free an enumeration Linked List - * - * This function frees a linked list created by SDL_hid_enumerate(). - * - * \param devs Pointer to a list of struct_device returned from - * SDL_hid_enumerate(). - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs); - -/** - * Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally - * a serial number. - * - * If `serial_number` is NULL, the first device with the specified VID and PID - * is opened. - * - * \param vendor_id The Vendor ID (VID) of the device to open. - * \param product_id The Product ID (PID) of the device to open. - * \param serial_number The Serial Number of the device to open (Optionally - * NULL). - * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number); - -/** - * Open a HID device by its path name. - * - * The path name be determined by calling SDL_hid_enumerate(), or a - * platform-specific path name can be used (eg: /dev/hidraw0 on Linux). - * - * \param path The path name of the device to open - * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */); - -/** - * Write an Output report to a HID device. - * - * The first byte of `data` must contain the Report ID. For devices which only - * support a single report, this must be set to 0x0. The remaining bytes - * contain the report data. Since the Report ID is mandatory, calls to - * SDL_hid_write() will always contain one more byte than the report contains. - * For example, if a hid report is 16 bytes long, 17 bytes must be passed to - * SDL_hid_write(), the Report ID (or 0x0, for devices with a single report), - * followed by the report data (16 bytes). In this example, the length passed - * in would be 17. - * - * SDL_hid_write() will send the data on the first OUT endpoint, if one - * exists. If it does not, it will send the data through the Control Endpoint - * (Endpoint 0). - * - * \param dev A device handle returned from SDL_hid_open(). - * \param data The data to send, including the report number as the first - * byte. - * \param length The length in bytes of the data to send. - * \returns the actual number of bytes written and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length); - -/** - * Read an Input report from a HID device with timeout. - * - * Input reports are returned to the host through the INTERRUPT IN endpoint. - * The first byte will contain the Report number if the device uses numbered - * reports. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param data A buffer to put the read data into. - * \param length The number of bytes to read. For devices with multiple - * reports, make sure to read an extra byte for the report - * number. - * \param milliseconds timeout in milliseconds or -1 for blocking wait. - * \returns the actual number of bytes read and -1 on error. If no packet was - * available to be read within the timeout period, this function - * returns 0. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds); - -/** - * Read an Input report from a HID device. - * - * Input reports are returned to the host through the INTERRUPT IN endpoint. - * The first byte will contain the Report number if the device uses numbered - * reports. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param data A buffer to put the read data into. - * \param length The number of bytes to read. For devices with multiple - * reports, make sure to read an extra byte for the report - * number. - * \returns the actual number of bytes read and -1 on error. If no packet was - * available to be read and the handle is in non-blocking mode, this - * function returns 0. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length); - -/** - * Set the device handle to be non-blocking. - * - * In non-blocking mode calls to SDL_hid_read() will return immediately with a - * value of 0 if there is no data to be read. In blocking mode, SDL_hid_read() - * will wait (block) until there is data to read before returning. - * - * Nonblocking can be turned on and off at any time. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param nonblock enable or not the nonblocking reads - 1 to enable - * nonblocking - 0 to disable nonblocking. - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock); - -/** - * Send a Feature report to the device. - * - * Feature reports are sent over the Control endpoint as a Set_Report - * transfer. The first byte of `data` must contain the Report ID. For devices - * which only support a single report, this must be set to 0x0. The remaining - * bytes contain the report data. Since the Report ID is mandatory, calls to - * SDL_hid_send_feature_report() will always contain one more byte than the - * report contains. For example, if a hid report is 16 bytes long, 17 bytes - * must be passed to SDL_hid_send_feature_report(): the Report ID (or 0x0, for - * devices which do not use numbered reports), followed by the report data (16 - * bytes). In this example, the length passed in would be 17. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param data The data to send, including the report number as the first - * byte. - * \param length The length in bytes of the data to send, including the report - * number. - * \returns the actual number of bytes written and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length); - -/** - * Get a feature report from a HID device. - * - * Set the first byte of `data` to the Report ID of the report to be read. - * Make sure to allow space for this extra byte in `data`. Upon return, the - * first byte will still contain the Report ID, and the report data will start - * in data[1]. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param data A buffer to put the read data into, including the Report ID. - * Set the first byte of `data` to the Report ID of the report to - * be read, or set it to zero if your device does not use numbered - * reports. - * \param length The number of bytes to read, including an extra byte for the - * report ID. The buffer can be longer than the actual report. - * \returns the number of bytes read plus one for the report ID (which is - * still in the first byte), or -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length); - -/** - * Close a HID device. - * - * \param dev A device handle returned from SDL_hid_open(). - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev); - -/** - * Get The Manufacturer String from a HID device. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param string A wide string buffer to put the data into. - * \param maxlen The length of the buffer in multiples of wchar_t. - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); - -/** - * Get The Product String from a HID device. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param string A wide string buffer to put the data into. - * \param maxlen The length of the buffer in multiples of wchar_t. - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); - -/** - * Get The Serial Number String from a HID device. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param string A wide string buffer to put the data into. - * \param maxlen The length of the buffer in multiples of wchar_t. - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); - -/** - * Get a string from a HID device, based on its string index. - * - * \param dev A device handle returned from SDL_hid_open(). - * \param string_index The index of the string to get. - * \param string A wide string buffer to put the data into. - * \param maxlen The length of the buffer in multiples of wchar_t. - * \returns 0 on success and -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen); - -/** - * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers - * - * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_hidapi_h_ */ - -/* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_hints.h b/libs/hwcodec/externals/SDL/include/SDL_hints.h deleted file mode 100644 index 1317924e..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_hints.h +++ /dev/null @@ -1,2569 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_hints.h - * - * Official documentation for SDL configuration variables - * - * This file contains functions to set and get configuration hints, - * as well as listing each of them alphabetically. - * - * The convention for naming hints is SDL_HINT_X, where "SDL_X" is - * the environment variable that can be used to override the default. - * - * In general these hints are just that - they may or may not be - * supported or applicable on any given platform, but they provide - * a way for an application or user to give the library a hint as - * to how they would like the library to work. - */ - -#ifndef SDL_hints_h_ -#define SDL_hints_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A variable controlling whether the Android / iOS built-in - * accelerometer should be listed as a joystick device. - * - * This variable can be set to the following values: - * "0" - The accelerometer is not listed as a joystick - * "1" - The accelerometer is available as a 3 axis joystick (the default). - */ -#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" - -/** - * \brief Specify the behavior of Alt+Tab while the keyboard is grabbed. - * - * By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed - * and your window is full-screen. This prevents the user from getting stuck in - * your application if you've enabled keyboard grab. - * - * The variable can be set to the following values: - * "0" - SDL will not handle Alt+Tab. Your application is responsible - for handling Alt+Tab while the keyboard is grabbed. - * "1" - SDL will minimize your window when Alt+Tab is pressed (default) -*/ -#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED" - -/** - * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. - * This is a debugging aid for developers and not expected to be used by end users. The default is "1" - * - * This variable can be set to the following values: - * "0" - don't allow topmost - * "1" - allow topmost - */ -#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" - -/** - * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" - -/** - * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. - * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. - * - * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. - * - * By default this hint is not set and the APK expansion files are not searched. - */ -#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" - -/** - * \brief A variable to control whether the event loop will block itself when the app is paused. - * - * The variable can be set to the following values: - * "0" - Non blocking. - * "1" - Blocking. (default) - * - * The value should be set before SDL is initialized. - */ -#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" - -/** - * \brief A variable to control whether SDL will pause audio in background - * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") - * - * The variable can be set to the following values: - * "0" - Non paused. - * "1" - Paused. (default) - * - * The value should be set before SDL is initialized. - */ -#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" - -/** - * \brief A variable to control whether we trap the Android back button to handle it manually. - * This is necessary for the right mouse button to work on some Android devices, or - * to be able to trap the back button for use in your code reliably. If set to true, - * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of - * SDL_SCANCODE_AC_BACK. - * - * The variable can be set to the following values: - * "0" - Back button will be handled as usual for system. (default) - * "1" - Back button will be trapped, allowing you to handle the key press - * manually. (This will also let right mouse click work on systems - * where the right mouse button functions as back.) - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" - -/** - * \brief Specify an application name. - * - * This hint lets you specify the application name sent to the OS when - * required. For example, this will often appear in volume control applets for - * audio streams, and in lists of applications which are inhibiting the - * screensaver. You should use a string that describes your program ("My Game - * 2: The Revenge") - * - * Setting this to "" or leaving it unset will have SDL use a reasonable - * default: probably the application's name or "SDL Application" if SDL - * doesn't have any better information. - * - * Note that, for audio streams, this can be overridden with - * SDL_HINT_AUDIO_DEVICE_APP_NAME. - * - * On targets where this is not supported, this hint does nothing. - */ -#define SDL_HINT_APP_NAME "SDL_APP_NAME" - -/** - * \brief A variable controlling whether controllers used with the Apple TV - * generate UI events. - * - * When UI events are generated by controller input, the app will be - * backgrounded when the Apple TV remote's menu button is pressed, and when the - * pause or B buttons on gamepads are pressed. - * - * More information about properly making use of controllers for the Apple TV - * can be found here: - * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ - * - * This variable can be set to the following values: - * "0" - Controller input does not generate UI events (the default). - * "1" - Controller input generates UI events. - */ -#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" - -/** - * \brief A variable controlling whether the Apple TV remote's joystick axes - * will automatically match the rotation of the remote. - * - * This variable can be set to the following values: - * "0" - Remote orientation does not affect joystick axes (the default). - * "1" - Joystick axes are based on the orientation of the remote. - */ -#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" - -/** - * \brief A variable controlling the audio category on iOS and Mac OS X - * - * This variable can be set to the following values: - * - * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) - * "playback" - Use the AVAudioSessionCategoryPlayback category - * - * For more information, see Apple's documentation: - * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html - */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" - -/** - * \brief Specify an application name for an audio device. - * - * Some audio backends (such as PulseAudio) allow you to describe your audio - * stream. Among other things, this description might show up in a system - * control panel that lets the user adjust the volume on specific audio - * streams instead of using one giant master volume slider. - * - * This hints lets you transmit that information to the OS. The contents of - * this hint are used while opening an audio device. You should use a string - * that describes your program ("My Game 2: The Revenge") - * - * Setting this to "" or leaving it unset will have SDL use a reasonable - * default: this will be the name set with SDL_HINT_APP_NAME, if that hint is - * set. Otherwise, it'll probably the application's name or "SDL Application" - * if SDL doesn't have any better information. - * - * On targets where this is not supported, this hint does nothing. - */ -#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" - -/** - * \brief Specify an application name for an audio device. - * - * Some audio backends (such as PulseAudio) allow you to describe your audio - * stream. Among other things, this description might show up in a system - * control panel that lets the user adjust the volume on specific audio - * streams instead of using one giant master volume slider. - * - * This hints lets you transmit that information to the OS. The contents of - * this hint are used while opening an audio device. You should use a string - * that describes your what your program is playing ("audio stream" is - * probably sufficient in many cases, but this could be useful for something - * like "team chat" if you have a headset playing VoIP audio separately). - * - * Setting this to "" or leaving it unset will have SDL use a reasonable - * default: "audio stream" or something similar. - * - * On targets where this is not supported, this hint does nothing. - */ -#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" - -/** - * \brief Specify an application role for an audio device. - * - * Some audio backends (such as Pipewire) allow you to describe the role of - * your audio stream. Among other things, this description might show up in - * a system control panel or software for displaying and manipulating media - * playback/capture graphs. - * - * This hints lets you transmit that information to the OS. The contents of - * this hint are used while opening an audio device. You should use a string - * that describes your what your program is playing (Game, Music, Movie, - * etc...). - * - * Setting this to "" or leaving it unset will have SDL use a reasonable - * default: "Game" or something similar. - * - * On targets where this is not supported, this hint does nothing. - */ -#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" - -/** - * \brief A variable controlling speed/quality tradeoff of audio resampling. - * - * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) - * to handle audio resampling. There are different resampling modes available - * that produce different levels of quality, using more CPU. - * - * If this hint isn't specified to a valid setting, or libsamplerate isn't - * available, SDL will use the default, internal resampling algorithm. - * - * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available. - * - * This hint is currently only checked at audio subsystem initialization. - * - * This variable can be set to the following values: - * - * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) - * "1" or "fast" - Use fast, slightly higher quality resampling, if available - * "2" or "medium" - Use medium quality resampling, if available - * "3" or "best" - Use high quality resampling, if available - */ -#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" - -/** - * \brief A variable controlling whether SDL updates joystick state when getting input events - * - * This variable can be set to the following values: - * - * "0" - You'll call SDL_JoystickUpdate() manually - * "1" - SDL will automatically call SDL_JoystickUpdate() (default) - * - * This hint can be toggled on and off at runtime. - */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" - -/** - * \brief A variable controlling whether SDL updates sensor state when getting input events - * - * This variable can be set to the following values: - * - * "0" - You'll call SDL_SensorUpdate() manually - * "1" - SDL will automatically call SDL_SensorUpdate() (default) - * - * This hint can be toggled on and off at runtime. - */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" - -/** - * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. - * - * The bitmap header version 4 is required for proper alpha channel support and - * SDL will use it when required. Should this not be desired, this hint can - * force the use of the 40 byte header version which is supported everywhere. - * - * The variable can be set to the following values: - * "0" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file with an alpha mask. SDL will use the bitmap - * header version 4 and set the alpha mask accordingly. - * "1" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file without an alpha mask. The alpha channel data - * will be in the file, but applications are going to ignore it. - * - * The default value is "0". - */ -#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" - -/** - * \brief Override for SDL_GetDisplayUsableBounds() - * - * If set, this hint will override the expected results for - * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want - * to do this, but this allows an embedded system to request that some of the - * screen be reserved for other uses when paired with a well-behaved - * application. - * - * The contents of this hint must be 4 comma-separated integers, the first - * is the bounds x, then y, width and height, in that order. - */ -#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" - -/** - * \brief Disable giving back control to the browser automatically - * when running with asyncify - * - * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations - * such as refreshing the screen or polling events. - * - * This hint only applies to the emscripten platform - * - * The variable can be set to the following values: - * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) - * "1" - Enable emscripten_sleep calls (the default) - */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" - -/** - * \brief override the binding element for keyboard inputs for Emscripten builds - * - * This hint only applies to the emscripten platform - * - * The variable can be one of - * "#window" - The javascript window object (this is the default) - * "#document" - The javascript document object - * "#screen" - the javascript window.screen object - * "#canvas" - the WebGL canvas element - * any other string without a leading # sign applies to the element on the page with that ID. - */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" - -/** - * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs - * - * The variable can be set to the following values: - * "0" - Do not scan for Steam Controllers - * "1" - Scan for Steam Controllers (the default) - * - * The default value is "1". This hint must be set before initializing the joystick subsystem. - */ -#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" - -/** - * \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue. - * - * This variable can be set to the following values, from least to most verbose: - * - * "0" - Don't log any events (default) - * "1" - Log most events (other than the really spammy ones). - * "2" - Include mouse and finger motion events. - * "3" - Include SDL_SysWMEvent events. - * - * This is generally meant to be used to debug SDL itself, but can be useful - * for application developers that need better visibility into what is going - * on in the event queue. Logged events are sent through SDL_Log(), which - * means by default they appear on stdout on most platforms or maybe - * OutputDebugString() on Windows, and can be funneled by the app with - * SDL_LogSetOutputFunction(), etc. - * - * This hint can be toggled on and off at runtime, if you only need to log - * events for a small subset of program execution. - */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" - -/** - * \brief A variable controlling whether raising the window should be done more forcefully - * - * This variable can be set to the following values: - * "0" - No forcing (the default) - * "1" - Extra level of forcing - * - * At present, this is only an issue under MS Windows, which makes it nearly impossible to - * programmatically move a window to the foreground, for "security" reasons. See - * http://stackoverflow.com/a/34414846 for a discussion. - */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_HINT_FORCE_RAISEWINDOW" - -/** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. - * - * SDL can try to accelerate the SDL screen surface by using streaming - * textures with a 3D rendering engine. This variable controls whether and - * how this is done. - * - * This variable can be set to the following values: - * "0" - Disable 3D acceleration - * "1" - Enable 3D acceleration, using the default renderer. - * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) - * - * By default SDL tries to make a best guess for each platform whether - * to use acceleration or not. - */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" - -/** - * \brief A variable that lets you manually hint extra gamecontroller db entries. - * - * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" - -/** - * \brief A variable that lets you provide a file with extra gamecontroller db entries. - * - * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() - */ -#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" - -/** - * \brief A variable that overrides the automatic controller type detection - * - * The variable should be comma separated entries, in the form: VID/PID=type - * - * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd - * - * The type should be one of: - * Xbox360 - * XboxOne - * PS3 - * PS4 - * PS5 - * SwitchPro - * - * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - */ -#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" - -/** - * \brief A variable containing a list of devices to skip when scanning for game controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" - -/** - * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" - -/** - * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. - * - * For example, on Nintendo Switch controllers, normally you'd get: - * - * (Y) - * (X) (B) - * (A) - * - * but if this hint is set, you'll get: - * - * (X) - * (Y) (A) - * (B) - * - * The variable can be set to the following values: - * "0" - Report the face buttons by position, as though they were on an Xbox controller. - * "1" - Report the face buttons by label instead of position - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" - -/** - * \brief A variable controlling whether grabbing input grabs the keyboard - * - * This variable can be set to the following values: - * "0" - Grab will affect only the mouse - * "1" - Grab will affect mouse and keyboard - * - * By default SDL will not grab the keyboard so system shortcuts still work. - */ -#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" - -/** - * \brief A variable containing a list of devices to ignore in SDL_hid_enumerate() - * - * For example, to ignore the Shanwan DS3 controller and any Valve controller, you might - * have the string "0x2563/0x0523,0x28de/0x0000" - */ -#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" - -/** - * \brief A variable controlling whether the idle timer is disabled on iOS. - * - * When an iOS app does not receive touches for some time, the screen is - * dimmed automatically. For games where the accelerometer is the only input - * this is problematic. This functionality can be disabled by setting this - * hint. - * - * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() - * accomplish the same thing on iOS. They should be preferred over this hint. - * - * This variable can be set to the following values: - * "0" - Enable idle timer - * "1" - Disable idle timer - */ -#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" - -/** - * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. - * - * The variable can be set to the following values: - * "0" - SDL_TEXTEDITING events are sent, and it is the application's - * responsibility to render the text from these events and - * differentiate it somehow from committed text. (default) - * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, - * and text that is being composed will be rendered in its own UI. - */ -#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" - -/** - * \brief A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them. - * - * The variable can be set to the following values: - * "0" - Native UI components are not display. (default) - * "1" - Native UI components are displayed. - */ -#define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI" - -/** - * \brief A variable to control if extended IME text support is enabled. - * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise. - * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated. - * - * The variable can be set to the following values: - * "0" - Legacy behavior. Text can be truncated, no heap allocations. (default) - * "1" - Modern behavior. - */ -#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT" - -/** - * \brief A variable controlling whether the home indicator bar on iPhone X - * should be hidden. - * - * This variable can be set to the following values: - * "0" - The indicator bar is not hidden (default for windowed applications) - * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) - * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) - */ -#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" - -/** - * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. - * - * The variable can be set to the following values: - * "0" - Disable joystick & gamecontroller input events when the - * application is in the background. - * "1" - Enable joystick & gamecontroller input events when the - * application is in the background. - * - * The default value is "0". This hint may be set at any time. - */ -#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" - -/** - * \brief A variable controlling whether the HIDAPI joystick drivers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI drivers are not used - * "1" - HIDAPI drivers are used (the default) - * - * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. - */ -#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" - -/** - * \brief A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement - * the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2) - * this is useful for applications that need full compatibility for things like ADSR envelopes. - * Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0" - * Rumble is both at any arbitrary value, - * StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0" - * - * This variable can be set to the following values: - * "0" - Normal rumble behavior is behavior is used (default) - * "1" - Proper GameCube controller rumble behavior is used - * - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS" - -/** - * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver - * - * This variable can be set to the following values: - * "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad - * "1" - Left and right Joy-Con controllers will be combined into a single controller (the default) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS" - -/** - * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver - * - * This variable can be set to the following values: - * "0" - Left and right Joy-Con controllers will not be in vertical mode (the default) - * "1" - Left and right Joy-Con controllers will be in vertical mode - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS" - -/** - * \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC" - -/** - * \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD" - -/** - * \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms. - * - * It is not possible to use this driver on Windows, due to limitations in the default drivers - * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3" - -/** - * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" - -/** - * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. - * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports - * - * Extended input reports allow rumble on Bluetooth PS4 controllers, but - * break DirectInput handling for applications that don't use SDL. - * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. - * - * For compatibility with applications written for versions of SDL prior - * to the introduction of PS5 controller support, this value will also - * control the state of extended reports on PS5 controllers when the - * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" - -/** - * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" - -/** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller. - * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED" - -/** - * \brief A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver. - * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports - * - * Extended input reports allow rumble on Bluetooth PS5 controllers, but - * break DirectInput handling for applications that don't use SDL. - * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. - * - * For compatibility with applications written for versions of SDL prior - * to the introduction of PS5 controller support, this value defaults to - * the value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE" - -/** - * \brief A variable controlling whether the HIDAPI driver for Google Stadia controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA" - -/** - * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access - * and may prompt the user for permission on iOS and Android. - * - * The default is "0" - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" - -/** - * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened - * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on - * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED" - -/** - * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened - * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on - * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED" - -/** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller. - * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED" - -/** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII" - -/** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller. - * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" - -/** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller. - * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" - -/** - * \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened - * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on - * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4. - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" - -/** - * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. - * - * This variable can be set to the following values: - * "0" - RAWINPUT drivers are not used - * "1" - RAWINPUT drivers are used (the default) - */ -#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" - -/** - * \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput. - * - * This variable can be set to the following values: - * "0" - RAWINPUT driver will only use data from raw input APIs - * "1" - RAWINPUT driver will also pull data from XInput, providing - * better trigger axes, guide button presses, and rumble support - * for Xbox controllers - * - * The default is "1". This hint applies to any joysticks opened after setting the hint. - */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" - -/** - * \brief A variable controlling whether the ROG Chakram mice should show up as joysticks - * - * This variable can be set to the following values: - * "0" - ROG Chakram mice do not show up as joysticks (the default) - * "1" - ROG Chakram mice show up as joysticks - */ -#define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM" - -/** - * \brief A variable controlling whether a separate thread should be used - * for handling joystick detection and raw input messages on Windows - * - * This variable can be set to the following values: - * "0" - A separate thread is not used (the default) - * "1" - A separate thread is used for handling raw input messages - * - */ -#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" - -/** - * \brief Determines whether SDL enforces that DRM master is required in order - * to initialize the KMSDRM video backend. - * - * The DRM subsystem has a concept of a "DRM master" which is a DRM client that - * has the ability to set planes, set cursor, etc. When SDL is DRM master, it - * can draw to the screen using the SDL rendering APIs. Without DRM master, SDL - * is still able to process input and query attributes of attached displays, - * but it cannot change display state or draw to the screen directly. - * - * In some cases, it can be useful to have the KMSDRM backend even if it cannot - * be used for rendering. An app may want to use SDL for input processing while - * using another rendering API (such as an MMAL overlay on Raspberry Pi) or - * using its own code to render to DRM overlays that SDL doesn't support. - * - * This hint must be set before initializing the video subsystem. - * - * This variable can be set to the following values: - * "0" - SDL will allow usage of the KMSDRM backend without DRM master - * "1" - SDL Will require DRM master to use the KMSDRM backend (default) - */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" - -/** - * \brief A comma separated list of devices to open as joysticks - * - * This variable is currently only used by the Linux joystick driver. - */ -#define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE" - -/** - * \brief A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog. - * - * This variable can be set to the following values: - * "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default) - * "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats - */ -#define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS" - -/** - * \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values. - * - * This variable can be set to the following values: - * "0" - Return digital hat values based on unfiltered input axis values - * "1" - Return digital hat values with deadzones on the input axes taken into account (the default) - */ -#define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES" - -/** - * \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux - * - * This variable can be set to the following values: - * "0" - Use /dev/input/event* - * "1" - Use /dev/input/js* - * - * By default the /dev/input/event* interfaces are used - */ -#define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC" - -/** - * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. - * - * This variable can be set to the following values: - * "0" - Return unfiltered joystick axis values (the default) - * "1" - Return axis values with deadzones taken into account - */ -#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" - -/** -* \brief When set don't force the SDL app to become a foreground process -* -* This hint only applies to Mac OS X. -* -*/ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" - -/** - * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac - * - * If present, holding ctrl while left clicking will generate a right click - * event when on Mac. - */ -#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" - -/** - * \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing - * - * This variable can be set to the following values: - * "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default). - * "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution. - * - * Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread - * hangs because it's waiting for that background thread, but that background thread is also hanging because it's - * waiting for the main thread to do an update, this might fix your issue. - * - * This hint only applies to macOS. - * - * This hint is available since SDL 2.24.0. - * - */ -#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH" - -/** - * \brief A variable setting the double click radius, in pixels. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" - -/** - * \brief A variable setting the double click time, in milliseconds. - */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" - -/** - * \brief Allow mouse click events when clicking to focus an SDL window - * - * This variable can be set to the following values: - * "0" - Ignore mouse clicks that activate a window - * "1" - Generate events for mouse clicks that activate a window - * - * By default SDL will ignore mouse clicks that activate a window - */ -#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" - -/** - * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode - */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" - -/** - * \brief A variable controlling whether relative mouse mode constrains the mouse to the center of the window - * - * This variable can be set to the following values: - * "0" - Relative mouse mode constrains the mouse to the window - * "1" - Relative mouse mode constrains the mouse to the center of the window - * - * Constraining to the center of the window works better for FPS games and when the - * application is running over RDP. Constraining to the whole window works better - * for 2D games and increases the chance that the mouse will be in the correct - * position when using high DPI mice. - * - * By default SDL will constrain the mouse to the center of the window - */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" - -/** - * \brief A variable controlling whether relative mouse mode is implemented using mouse warping - * - * This variable can be set to the following values: - * "0" - Relative mouse mode uses raw input - * "1" - Relative mouse mode uses mouse warping - * - * By default SDL will use raw input for relative mouse mode - */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" - -/** - * \brief A variable controlling whether relative mouse motion is affected by renderer scaling - * - * This variable can be set to the following values: - * "0" - Relative motion is unaffected by DPI or renderer's logical size - * "1" - Relative motion is scaled according to DPI scaling and logical size - * - * By default relative mouse deltas are affected by DPI and renderer scaling - */ -#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" - -/** - * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode - */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" - -/** - * \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion. - * - * This variable can be set to the following values: - * "0" - Relative mouse motion will be unscaled (the default) - * "1" - Relative mouse motion will be scaled using the system mouse acceleration curve. - * - * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale. - */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" - -/** - * \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode. - * - * This variable can be set to the following values: - * "0" - Warping the mouse will not generate a motion event in relative mode - * "1" - Warping the mouse will generate a motion event in relative mode - * - * By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping. - */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" - -/** - * \brief A variable controlling whether mouse events should generate synthetic touch events - * - * This variable can be set to the following values: - * "0" - Mouse events will not generate touch events (default for desktop platforms) - * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) - */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" - -/** - * \brief A variable controlling whether the mouse is captured while mouse buttons are pressed - * - * This variable can be set to the following values: - * "0" - The mouse is not captured while mouse buttons are pressed - * "1" - The mouse is captured while mouse buttons are pressed - * - * By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged - * outside the window, the application continues to receive mouse events until the button is - * released. - */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" - -/** - * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. - * - * This hint only applies to Unix-like platforms, and should set before - * any calls to SDL_Init() - * - * The variable can be set to the following values: - * "0" - SDL will install a SIGINT and SIGTERM handler, and when it - * catches a signal, convert it into an SDL_QUIT event. - * "1" - SDL will not install a signal handler at all. - */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" - -/** - * \brief A variable controlling what driver to use for OpenGL ES contexts. - * - * On some platforms, currently Windows and X11, OpenGL drivers may support - * creating contexts with an OpenGL ES profile. By default SDL uses these - * profiles, when available, otherwise it attempts to load an OpenGL ES - * library, e.g. that provided by the ANGLE project. This variable controls - * whether SDL follows this default behaviour or will always load an - * OpenGL ES library. - * - * Circumstances where this is useful include - * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, - * or emulator, e.g. those from ARM, Imagination or Qualcomm. - * - Resolving OpenGL ES function addresses at link time by linking with - * the OpenGL ES library instead of querying them at run time with - * SDL_GL_GetProcAddress(). - * - * Caution: for an application to work with the default behaviour across - * different OpenGL drivers it must query the OpenGL ES function - * addresses at run time using SDL_GL_GetProcAddress(). - * - * This variable is ignored on most platforms because OpenGL ES is native - * or not supported. - * - * This variable can be set to the following values: - * "0" - Use ES profile of OpenGL, if available. (Default when not set.) - * "1" - Load OpenGL ES library using the default library names. - * - */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" - -/** - * \brief A variable controlling which orientations are allowed on iOS/Android. - * - * In some circumstances it is necessary to be able to explicitly control - * which UI orientations are allowed. - * - * This variable is a space delimited list of the following values: - * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" - */ -#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" - -/** - * \brief A variable controlling the use of a sentinel event when polling the event queue - * - * This variable can be set to the following values: - * "0" - Disable poll sentinels - * "1" - Enable poll sentinels - * - * When polling for events, SDL_PumpEvents is used to gather new events from devices. - * If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will - * become stuck until the new events stop. - * This is most noticeable when moving a high frequency mouse. - * - * By default, poll sentinels are enabled. - */ -#define SDL_HINT_POLL_SENTINEL "SDL_POLL_SENTINEL" - -/** - * \brief Override for SDL_GetPreferredLocales() - * - * If set, this will be favored over anything the OS might report for the - * user's preferred locales. Changing this hint at runtime will not generate - * a SDL_LOCALECHANGED event (but if you can change the hint, you can push - * your own event, if you want). - * - * The format of this hint is a comma-separated list of language and locale, - * combined with an underscore, as is a common format: "en_GB". Locale is - * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" - */ -#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" - -/** - * \brief A variable describing the content orientation on QtWayland-based platforms. - * - * On QtWayland platforms, windows are rotated client-side to allow for custom - * transitions. In order to correctly position overlays (e.g. volume bar) and - * gestures (e.g. events view, close/minimize gestures), the system needs to - * know in which orientation the application is currently drawing its contents. - * - * This does not cause the window to be rotated or resized, the application - * needs to take care of drawing the content in the right orientation (the - * framebuffer is always in portrait mode). - * - * This variable can be one of the following values: - * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" - */ -#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" - -/** - * \brief Flags to set on QtWayland windows to integrate with the native window manager. - * - * On QtWayland platforms, this hint controls the flags to set on the windows. - * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. - * - * This variable is a space-separated list of the following values (empty = no flags): - * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" - */ -#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" - -/** - * \brief A variable controlling whether the 2D render API is compatible or efficient. - * - * This variable can be set to the following values: - * - * "0" - Don't use batching to make rendering more efficient. - * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. - * - * Up to SDL 2.0.9, the render API would draw immediately when requested. Now - * it batches up draw requests and sends them all to the GPU only when forced - * to (during SDL_RenderPresent, when changing render targets, by updating a - * texture that the batch needs, etc). This is significantly more efficient, - * but it can cause problems for apps that expect to render on top of the - * render API's output. As such, SDL will disable batching if a specific - * render backend is requested (since this might indicate that the app is - * planning to use the underlying graphics API directly). This hint can - * be used to explicitly request batching in this instance. It is a contract - * that you will either never use the underlying graphics API directly, or - * if you do, you will call SDL_RenderFlush() before you do so any current - * batch goes to the GPU before your work begins. Not following this contract - * will result in undefined behavior. - */ -#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" - -/** - * \brief A variable controlling how the 2D render API renders lines - * - * This variable can be set to the following values: - * "0" - Use the default line drawing method (Bresenham's line algorithm as of SDL 2.0.20) - * "1" - Use the driver point API using Bresenham's line algorithm (correct, draws many points) - * "2" - Use the driver line API (occasionally misses line endpoints based on hardware driver quirks, was the default before 2.0.20) - * "3" - Use the driver geometry API (correct, draws thicker diagonal lines) - * - * This variable should be set when the renderer is created. - */ -#define SDL_HINT_RENDER_LINE_METHOD "SDL_RENDER_LINE_METHOD" - -/** - * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. - * - * This variable does not have any effect on the Direct3D 9 based renderer. - * - * This variable can be set to the following values: - * "0" - Disable Debug Layer use - * "1" - Enable Debug Layer use - * - * By default, SDL does not use Direct3D Debug Layer. - */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" - -/** - * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. - * - * This variable can be set to the following values: - * "0" - Thread-safety is not enabled (faster) - * "1" - Thread-safety is enabled - * - * By default the Direct3D device is created with thread-safety disabled. - */ -#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" - -/** - * \brief A variable specifying which render driver to use. - * - * If the application doesn't pick a specific renderer to use, this variable - * specifies the name of the preferred renderer. If the preferred renderer - * can't be initialized, the normal default renderer is used. - * - * This variable is case insensitive and can be set to the following values: - * "direct3d" - * "direct3d11" - * "direct3d12" - * "opengl" - * "opengles2" - * "opengles" - * "metal" - * "software" - * - * The default varies by platform, but it's the first one in the list that - * is available on the current platform. - */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" - -/** - * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. - * - * This variable can be set to the following values: - * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen - * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen - * - * By default letterbox is used - */ -#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" - -/** - * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. - * - * This variable can be set to the following values: - * "0" - Disable shaders - * "1" - Enable shaders - * - * By default shaders are used if OpenGL supports them. - */ -#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" - -/** - * \brief A variable controlling the scaling quality - * - * This variable can be set to the following values: - * "0" or "nearest" - Nearest pixel sampling - * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) - * "2" or "best" - Currently this is the same as "linear" - * - * By default nearest pixel sampling is used - */ -#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" - -/** - * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. - * - * This variable can be set to the following values: - * "0" - Disable vsync - * "1" - Enable vsync - * - * By default SDL does not sync screen surface updates with vertical refresh. - */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" - -/** - * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS - * - * This variable can be set to the following values: - * "0" - It will be using VSYNC as defined in the main flag. Default - * "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed - * - * By default SDL does not enable the automatic VSYNC - */ -#define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC" - -/** - * \brief A variable to control whether the return key on the soft keyboard - * should hide the soft keyboard on Android and iOS. - * - * The variable can be set to the following values: - * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) - * "1" - The return key will hide the keyboard. - * - * The value of this hint is used at runtime, so it can be changed at any time. - */ -#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" - -/** - * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI - * - * Also known as Z-order. The variable can take a negative or positive value. - * The default is 10000. - */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" - -/** - * \brief Specify an "activity name" for screensaver inhibition. - * - * Some platforms, notably Linux desktops, list the applications which are - * inhibiting the screensaver or other power-saving features. - * - * This hint lets you specify the "activity name" sent to the OS when - * SDL_DisableScreenSaver() is used (or the screensaver is automatically - * disabled). The contents of this hint are used when the screensaver is - * disabled. You should use a string that describes what your program is doing - * (and, therefore, why the screensaver is disabled). For example, "Playing a - * game" or "Watching a video". - * - * Setting this to "" or leaving it unset will have SDL use a reasonable - * default: "Playing a game" or something similar. - * - * On targets where this is not supported, this hint does nothing. - */ -#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME" - -/** - * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. - * - * On some platforms, like Linux, a realtime priority thread may be subject to restrictions - * that require special handling by the application. This hint exists to let SDL know that - * the app is prepared to handle said restrictions. - * - * On Linux, SDL will apply the following configuration to any thread that becomes realtime: - * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, - * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. - * * Exceeding this limit will result in the kernel sending SIGKILL to the app, - * * Refer to the man pages for more information. - * - * This variable can be set to the following values: - * "0" - default platform specific behaviour - * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy - */ -#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" - -/** -* \brief A string specifying additional information to use with SDL_SetThreadPriority. -* -* By default SDL_SetThreadPriority will make appropriate system changes in order to -* apply a thread priority. For example on systems using pthreads the scheduler policy -* is changed automatically to a policy that works well with a given priority. -* Code which has specific requirements can override SDL's default behavior with this hint. -* -* pthread hint values are "current", "other", "fifo" and "rr". -* Currently no other platform hint values are defined but may be in the future. -* -* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro -* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME -* after calling SDL_SetThreadPriority(). -*/ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" - -/** -* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size -* -* Use this hint in case you need to set SDL's threads stack size to other than the default. -* This is specially useful if you build SDL against a non glibc libc library (such as musl) which -* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). -* Support for this hint is currently available only in the pthread, Windows, and PSP backend. -* -* Instead of this hint, in 2.0.9 and later, you can use -* SDL_CreateThreadWithStackSize(). This hint only works with the classic -* SDL_CreateThread(). -*/ -#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" - -/** - * \brief A variable that controls the timer resolution, in milliseconds. - * - * The higher resolution the timer, the more frequently the CPU services - * timer interrupts, and the more precise delays are, but this takes up - * power and CPU time. This hint is only used on Windows. - * - * See this blog post for more information: - * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ - * - * If this variable is set to "0", the system timer resolution is not set. - * - * The default value is "1". This hint may be set at any time. - */ -#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" - -/** - * \brief A variable controlling whether touch events should generate synthetic mouse events - * - * This variable can be set to the following values: - * "0" - Touch events will not generate mouse events - * "1" - Touch events will generate mouse events - * - * By default SDL will generate mouse events for touch events - */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" - -/** - * \brief A variable controlling which touchpad should generate synthetic mouse events - * - * This variable can be set to the following values: - * "0" - Only front touchpad should generate mouse events. Default - * "1" - Only back touchpad should generate mouse events. - * "2" - Both touchpads should generate mouse events. - * - * By default SDL will generate mouse events for all touch devices - */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE" - -/** - * \brief A variable controlling whether the Android / tvOS remotes - * should be listed as joystick devices, instead of sending keyboard events. - * - * This variable can be set to the following values: - * "0" - Remotes send enter/escape/arrow key events - * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). - */ -#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" - -/** - * \brief A variable controlling whether the screensaver is enabled. - * - * This variable can be set to the following values: - * "0" - Disable screensaver - * "1" - Enable screensaver - * - * By default SDL will disable the screensaver. - */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" - -/** - * \brief Tell the video driver that we only want a double buffer. - * - * By default, most lowlevel 2D APIs will use a triple buffer scheme that - * wastes no CPU time on waiting for vsync after issuing a flip, but - * introduces a frame of latency. On the other hand, using a double buffer - * scheme instead is recommended for cases where low latency is an important - * factor because we save a whole frame of latency. - * We do so by waiting for vsync immediately after issuing a flip, usually just - * after eglSwapBuffers call in the backend's *_SwapWindow function. - * - * Since it's driver-specific, it's only supported where possible and - * implemented. Currently supported the following drivers: - * - * - KMSDRM (kmsdrm) - * - Raspberry Pi (raspberrypi) - */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" - -/** - * \brief A variable controlling whether the EGL window is allowed to be - * composited as transparent, rather than opaque. - * - * Most window systems will always render windows opaque, even if the surface - * format has an alpha channel. This is not always true, however, so by default - * SDL will try to enforce opaque composition. To override this behavior, you - * can set this hint to "1". - */ -#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY" - -/** - * \brief A variable controlling whether the graphics context is externally managed. - * - * This variable can be set to the following values: - * "0" - SDL will manage graphics contexts that are attached to windows. - * "1" - Disable graphics context management on windows. - * - * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the - * context will be automatically saved and restored when pausing the application. Additionally, some - * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this - * behavior, which is desireable when the application manages the graphics context, such as - * an externally managed OpenGL context or attaching a Vulkan surface to the window. - */ -#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" - -/** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) - */ -#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" - -/** - * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. - * - * This hint only applies to Mac OS X. - * - * The variable can be set to the following values: - * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and - * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" - * button on their titlebars). - * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and - * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" - * button on their titlebars). - * - * The default value is "1". This hint must be set before any windows are created. - */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" - -/** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. - * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're - * seeing if "true" causes more problems than it solves in modern times. - * - */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" - -/** - * \brief A variable controlling whether the libdecor Wayland backend is allowed to be used. - * - * This variable can be set to the following values: - * "0" - libdecor use is disabled. - * "1" - libdecor use is enabled (default). - * - * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. - */ -#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR" - -/** - * \brief A variable controlling whether the libdecor Wayland backend is preferred over native decrations. - * - * When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is - * available. (Note that, by default, libdecor will use xdg-decoration itself if available). - * - * This variable can be set to the following values: - * "0" - libdecor is enabled only if server-side decorations are unavailable. - * "1" - libdecor is always enabled if available. - * - * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. - */ -#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR" - -/** - * \brief A variable controlling whether video mode emulation is enabled under Wayland. - * - * When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application. - * If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled - * desktop, the native display resolution. - * - * This variable can be set to the following values: - * "0" - Video mode emulation is disabled. - * "1" - Video mode emulation is enabled. - * - * By default video mode emulation is enabled. - */ -#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION" - -/** - * \brief Enable or disable mouse pointer warp emulation, needed by some older games. - * - * When this hint is set, any SDL will emulate mouse warps using relative mouse mode. - * This is required for some older games (such as Source engine games), which warp the - * mouse to the centre of the screen rather than using relative mouse motion. Note that - * relative mouse mode may have different mouse acceleration behaviour than pointer warps. - * - * This variable can be set to the following values: - * "0" - All mouse warps fail, as mouse warping is not available under wayland. - * "1" - Some mouse warps will be emulated by forcing relative mouse mode. - * - * If not set, this is automatically enabled unless an application uses relative mouse - * mode directly. - */ -#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP" - -/** -* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). -* -* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has -* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly -* created SDL_Window: -* -* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is -* needed for example when sharing an OpenGL context across multiple windows. -* -* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for -* OpenGL rendering. -* -* This variable can be set to the following values: -* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should -* share a pixel format with. -*/ -#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" - -/** - * \brief When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL. - * - * This variable can be set to the following values: - * "0" - Don't add any graphics flags to the SDL_WindowFlags - * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags - * - * By default SDL will not make the foreign window compatible with OpenGL. - */ -#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL" - -/** - * \brief When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan. - * - * This variable can be set to the following values: - * "0" - Don't add any graphics flags to the SDL_WindowFlags - * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags - * - * By default SDL will not make the foreign window compatible with Vulkan. - */ -#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN" - -/** -* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries -* -* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It -* can use two different sets of binaries, those compiled by the user from source -* or those provided by the Chrome browser. In the later case, these binaries require -* that SDL loads a DLL providing the shader compiler. -* -* This variable can be set to the following values: -* "d3dcompiler_46.dll" - default, best for Vista or later. -* "d3dcompiler_43.dll" - for XP support. -* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. -* -*/ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" - -/** - * \brief A variable controlling whether X11 should use GLX or EGL by default - * - * This variable can be set to the following values: - * "0" - Use GLX - * "1" - Use EGL - * - * By default SDL will use GLX when both are present. - */ -#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" - -/** - * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_BYPASS_COMPOSITOR - * "1" - Enable _NET_WM_BYPASS_COMPOSITOR - * - * By default SDL will use _NET_WM_BYPASS_COMPOSITOR - * - */ -#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" - -/** - * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. - * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_PING - * "1" - Enable _NET_WM_PING - * - * By default SDL will use _NET_WM_PING, but for applications that know they - * will not always be able to respond to ping requests in a timely manner they can - * turn it off to avoid the window manager thinking the app is hung. - * The hint is checked in CreateWindow. - */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" - -/** - * \brief A variable forcing the visual ID chosen for new X11 windows - * - */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" - -/** - * \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used. - * - * Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11. - * Now SDL never uses Xinerama, and does not check for this hint at all. - * The preprocessor define is left here for source compatibility. - */ -#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" - -/** - * \brief A variable controlling whether the X11 XRandR extension should be used. - * - * This variable can be set to the following values: - * "0" - Disable XRandR - * "1" - Enable XRandR - * - * By default SDL will use XRandR. - */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" - -/** - * \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used. - * - * Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11. - * Now SDL never uses XVidMode, and does not check for this hint at all. - * The preprocessor define is left here for source compatibility. - */ -#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" - -/** - * \brief Controls how the fact chunk affects the loading of a WAVE file. - * - * The fact chunk stores information about the number of samples of a WAVE - * file. The Standards Update from Microsoft notes that this value can be used - * to 'determine the length of the data in seconds'. This is especially useful - * for compressed formats (for which this is a mandatory chunk) if they produce - * multiple sample frames per block and truncating the block is not allowed. - * The fact chunk can exactly specify how many sample frames there should be - * in this case. - * - * Unfortunately, most application seem to ignore the fact chunk and so SDL - * ignores it by default as well. - * - * This variable can be set to the following values: - * - * "truncate" - Use the number of samples to truncate the wave data if - * the fact chunk is present and valid - * "strict" - Like "truncate", but raise an error if the fact chunk - * is invalid, not present for non-PCM formats, or if the - * data chunk doesn't have that many samples - * "ignorezero" - Like "truncate", but ignore fact chunk if the number of - * samples is zero - * "ignore" - Ignore fact chunk entirely (default) - */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" - -/** - * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. - * - * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE - * file) is not always reliable. In case the size is wrong, it's possible to - * just ignore it and step through the chunks until a fixed limit is reached. - * - * Note that files that have trailing data unrelated to the WAVE file or - * corrupt files may slow down the loading process without a reliable boundary. - * By default, SDL stops after 10000 chunks to prevent wasting time. Use the - * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. - * - * This variable can be set to the following values: - * - * "force" - Always use the RIFF chunk size as a boundary for the chunk search - * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) - * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB - * "maximum" - Search for chunks until the end of file (not recommended) - */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" - -/** - * \brief Controls how a truncated WAVE file is handled. - * - * A WAVE file is considered truncated if any of the chunks are incomplete or - * the data chunk size is not a multiple of the block size. By default, SDL - * decodes until the first incomplete block, as most applications seem to do. - * - * This variable can be set to the following values: - * - * "verystrict" - Raise an error if the file is truncated - * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored - * "dropframe" - Decode until the first incomplete sample frame - * "dropblock" - Decode until the first incomplete block (default) - */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" - -/** - * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. - * The 0x406D1388 Exception is a trick used to inform Visual Studio of a - * thread's name, but it tends to cause problems with other debuggers, - * and the .NET runtime. Note that SDL 2.0.6 and later will still use - * the (safer) SetThreadDescription API, introduced in the Windows 10 - * Creators Update, if available. - * - * The variable can be set to the following values: - * "0" - SDL will raise the 0x406D1388 Exception to name threads. - * This is the default behavior of SDL <= 2.0.4. - * "1" - SDL will not raise this exception, and threads will be unnamed. (default) - * This is necessary with .NET languages or debuggers that aren't Visual Studio. - */ -#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" - -/** - * \brief A variable controlling whether the windows message loop is processed by SDL - * - * This variable can be set to the following values: - * "0" - The window message loop is not run - * "1" - The window message loop is processed in SDL_PumpEvents() - * - * By default SDL will process the windows message loop - */ -#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" - -/** - * \brief Force SDL to use Critical Sections for mutexes on Windows. - * On Windows 7 and newer, Slim Reader/Writer Locks are available. - * They offer better performance, allocate no kernel ressources and - * use less memory. SDL will fall back to Critical Sections on older - * OS versions or if forced to by this hint. - * - * This variable can be set to the following values: - * "0" - Use SRW Locks when available. If not, fall back to Critical Sections. (default) - * "1" - Force the use of Critical Sections in all cases. - * - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" - -/** - * \brief Force SDL to use Kernel Semaphores on Windows. - * Kernel Semaphores are inter-process and require a context - * switch on every interaction. On Windows 8 and newer, the - * WaitOnAddress API is available. Using that and atomics to - * implement semaphores increases performance. - * SDL will fall back to Kernel Objects on older OS versions - * or if forced to by this hint. - * - * This variable can be set to the following values: - * "0" - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default) - * "1" - Force the use of Kernel Objects in all cases. - * - */ -#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL" - -/** - * \brief A variable to specify custom icon resource id from RC file on Windows platform - */ -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" -#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" - -/** - * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. - * - * The variable can be set to the following values: - * "0" - SDL will generate a window-close event when it sees Alt+F4. - * "1" - SDL will only do normal key handling for Alt+F4. - */ -#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" - -/** - * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9. - * Direct3D 9Ex contains changes to state management that can eliminate device - * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require - * some changes to your application to cope with the new behavior, so this - * is disabled by default. - * - * This hint must be set before initializing the video subsystem. - * - * For more information on Direct3D 9Ex, see: - * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex - * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements - * - * This variable can be set to the following values: - * "0" - Use the original Direct3D 9 API (default) - * "1" - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable) - * - */ -#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX" - -/** - * \brief Controls whether SDL will declare the process to be DPI aware. - * - * This hint must be set before initializing the video subsystem. - * - * The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with - * a DPI scale factor. - * - * This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext) - * and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel - * even on high-DPI displays. - * - * For more information, see: - * https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows - * - * This variable can be set to the following values: - * "" - Do not change the DPI awareness (default). - * "unaware" - Declare the process as DPI unaware. (Windows 8.1 and later). - * "system" - Request system DPI awareness. (Vista and later). - * "permonitor" - Request per-monitor DPI awareness. (Windows 8.1 and later). - * "permonitorv2" - Request per-monitor V2 DPI awareness. (Windows 10, version 1607 and later). - * The most visible difference from "permonitor" is that window title bar will be scaled - * to the visually correct size when dragging between monitors with different scale factors. - * This is the preferred DPI awareness level. - * - * If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best - * available match. - */ -#define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS" - -/** - * \brief Uses DPI-scaled points as the SDL coordinate system on Windows. - * - * This changes the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere. - * This means windows will be appropriately sized, even when created on high-DPI displays with scaling. - * - * e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings, - * will create a window with an 800x600 client area (in pixels). - * - * Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary), - * and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows. - * - * This variable can be set to the following values: - * "0" - SDL coordinates equal Windows coordinates. No automatic window resizing when dragging - * between monitors with different scale factors (unless this is performed by - * Windows itself, which is the case when the process is DPI unaware). - * "1" - SDL coordinates are in DPI-scaled points. Automatically resize windows as needed on - * displays with non-100% scale factors. - */ -#define SDL_HINT_WINDOWS_DPI_SCALING "SDL_WINDOWS_DPI_SCALING" - -/** - * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden - * - * This variable can be set to the following values: - * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) - * "1" - The window frame is interactive when the cursor is hidden - * - * By default SDL will allow interaction with the window frame when the cursor is hidden - */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" - -/** -* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called -* -* This variable can be set to the following values: -* "0" - The window is activated when the SDL_ShowWindow function is called -* "1" - The window is not activated when the SDL_ShowWindow function is called -* -* By default SDL will activate the window when the SDL_ShowWindow function is called -*/ -#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN" - -/** \brief Allows back-button-press events on Windows Phone to be marked as handled - * - * Windows Phone devices typically feature a Back button. When pressed, - * the OS will emit back-button-press events, which apps are expected to - * handle in an appropriate manner. If apps do not explicitly mark these - * events as 'Handled', then the OS will invoke its default behavior for - * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to - * terminate the app (and attempt to switch to the previous app, or to the - * device's home screen). - * - * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL - * to mark back-button-press events as Handled, if and when one is sent to - * the app. - * - * Internally, Windows Phone sends back button events as parameters to - * special back-button-press callback functions. Apps that need to respond - * to back-button-press events are expected to register one or more - * callback functions for such, shortly after being launched (during the - * app's initialization phase). After the back button is pressed, the OS - * will invoke these callbacks. If the app's callback(s) do not explicitly - * mark the event as handled by the time they return, or if the app never - * registers one of these callback, the OS will consider the event - * un-handled, and it will apply its default back button behavior (terminate - * the app). - * - * SDL registers its own back-button-press callback with the Windows Phone - * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN - * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which - * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. - * If the hint's value is set to "1", the back button event's Handled - * property will get set to 'true'. If the hint's value is set to something - * else, or if it is unset, SDL will leave the event's Handled property - * alone. (By default, the OS sets this property to 'false', to note.) - * - * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a - * back button is pressed, or can set it in direct-response to a back button - * being pressed. - * - * In order to get notified when a back button is pressed, SDL apps should - * register a callback function with SDL_AddEventWatch(), and have it listen - * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. - * (Alternatively, SDL_KEYUP events can be listened-for. Listening for - * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON - * set by such a callback, will be applied to the OS' current - * back-button-press event. - * - * More details on back button behavior in Windows Phone apps can be found - * at the following page, on Microsoft's developer site: - * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx - */ -#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" - -/** \brief Label text for a WinRT app's privacy policy link - * - * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, - * Microsoft mandates that this policy be available via the Windows Settings charm. - * SDL provides code to add a link there, with its label text being set via the - * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that a privacy policy's contents are not set via this hint. A separate - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the - * policy. - * - * The contents of this hint should be encoded as a UTF8 string. - * - * The default value is "Privacy Policy". This hint should only be set during app - * initialization, preferably before any calls to SDL_Init(). - * - * For additional information on linking to a privacy policy, see the documentation for - * SDL_HINT_WINRT_PRIVACY_POLICY_URL. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" - -/** - * \brief A URL to a WinRT app's privacy policy - * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * be available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the app's - * privacy policy. - * - * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL - * before calling any SDL_Init() functions. The contents of the hint should - * be a valid URL. For example, "http://www.example.com". - * - * The default value is "", which will prevent SDL from adding a privacy policy - * link to the Settings charm. This hint should only be set during app init. - * - * The label text of an app's "Privacy Policy" link may be customized via another - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL - * will not get used on that platform. Network-enabled phone apps should display - * their privacy policy through some other, in-app means. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" - -/** - * \brief Mark X11 windows as override-redirect. - * - * If set, this _might_ increase framerate at the expense of the desktop - * not working as expected. Override-redirect windows aren't noticed by the - * window manager at all. - * - * You should probably only use this for fullscreen windows, and you probably - * shouldn't even use it for that. But it's here if you want to try! - */ -#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT "SDL_X11_FORCE_OVERRIDE_REDIRECT" - -/** - * \brief A variable that lets you disable the detection and use of Xinput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable XInput detection (only uses direct input) - * "1" - Enable XInput detection (the default) - */ -#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" - - /** - * \brief A variable that lets you disable the detection and use of DirectInput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable DirectInput detection (only uses XInput) - * "1" - Enable DirectInput detection (the default) - */ -#define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED" - -/** - * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. - * - * This hint is for backwards compatibility only and will be removed in SDL 2.1 - * - * The default value is "0". This hint must be set before SDL_Init() - */ -#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" - -/** - * \brief A variable that causes SDL to not ignore audio "monitors" - * - * This is currently only used for PulseAudio and ignored elsewhere. - * - * By default, SDL ignores audio devices that aren't associated with physical - * hardware. Changing this hint to "1" will expose anything SDL sees that - * appears to be an audio source or sink. This will add "devices" to the list - * that the user probably doesn't want or need, but it can be useful in - * scenarios where you want to hook up SDL to some sort of virtual device, - * etc. - * - * The default value is "0". This hint must be set before SDL_Init(). - * - * This hint is available since SDL 2.0.16. Before then, virtual devices are - * always ignored. - */ -#define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS" - -/** - * \brief A variable that forces X11 windows to create as a custom type. - * - * This is currently only used for X11 and ignored elsewhere. - * - * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property - * to report to the window manager the type of window it wants to create. - * This might be set to various things if SDL_WINDOW_TOOLTIP or - * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that - * haven't set a specific type, this hint can be used to specify a custom - * type. For example, a dock window might set this to - * "_NET_WM_WINDOW_TYPE_DOCK". - * - * If not set or set to "", this hint is ignored. This hint must be set - * before the SDL_CreateWindow() call that it is intended to affect. - * - * This hint is available since SDL 2.0.22. - */ -#define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" - -/** - * \brief A variable that decides whether to send SDL_QUIT when closing the final window. - * - * By default, SDL sends an SDL_QUIT event when there is only one window - * and it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most - * apps would also take the loss of this window as a signal to terminate the - * program. - * - * However, it's not unreasonable in some cases to have the program continue - * to live on, perhaps to create new windows later. - * - * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event - * when the final window is requesting to close. Note that in this case, - * there are still other legitimate reasons one might get an SDL_QUIT - * event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c) - * on Unix, etc. - * - * The default value is "1". This hint can be changed at any time. - * - * This hint is available since SDL 2.0.22. Before then, you always get - * an SDL_QUIT event when closing the final window. - */ -#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE" - - -/** - * \brief A variable that decides what video backend to use. - * - * By default, SDL will try all available video backends in a reasonable - * order until it finds one that can work, but this hint allows the app - * or user to force a specific target, such as "x11" if, say, you are - * on Wayland but want to try talking to the X server instead. - * - * This functionality has existed since SDL 2.0.0 (indeed, before that) - * but before 2.0.22 this was an environment variable only. In 2.0.22, - * it was upgraded to a full SDL hint, so you can set the environment - * variable as usual or programatically set the hint with SDL_SetHint, - * which won't propagate to child processes. - * - * The default value is unset, in which case SDL will try to figure out - * the best video backend on your behalf. This hint needs to be set - * before SDL_Init() is called to be useful. - * - * This hint is available since SDL 2.0.22. Before then, you could set - * the environment variable to get the same effect. - */ -#define SDL_HINT_VIDEODRIVER "SDL_VIDEODRIVER" - -/** - * \brief A variable that decides what audio backend to use. - * - * By default, SDL will try all available audio backends in a reasonable - * order until it finds one that can work, but this hint allows the app - * or user to force a specific target, such as "alsa" if, say, you are - * on PulseAudio but want to try talking to the lower level instead. - * - * This functionality has existed since SDL 2.0.0 (indeed, before that) - * but before 2.0.22 this was an environment variable only. In 2.0.22, - * it was upgraded to a full SDL hint, so you can set the environment - * variable as usual or programatically set the hint with SDL_SetHint, - * which won't propagate to child processes. - * - * The default value is unset, in which case SDL will try to figure out - * the best audio backend on your behalf. This hint needs to be set - * before SDL_Init() is called to be useful. - * - * This hint is available since SDL 2.0.22. Before then, you could set - * the environment variable to get the same effect. - */ -#define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER" - -/** - * \brief A variable that decides what KMSDRM device to use. - * - * Internally, SDL might open something like "/dev/dri/cardNN" to - * access KMSDRM functionality, where "NN" is a device index number. - * - * SDL makes a guess at the best index to use (usually zero), but the - * app or user can set this hint to a number between 0 and 99 to - * force selection. - * - * This hint is available since SDL 2.24.0. - */ -#define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX" - - -/** - * \brief A variable that treats trackpads as touch devices. - * - * On macOS (and possibly other platforms in the future), SDL will report - * touches on a trackpad as mouse input, which is generally what users - * expect from this device; however, these are often actually full - * multitouch-capable touch devices, so it might be preferable to some apps - * to treat them as such. - * - * Setting this hint to true will make the trackpad input report as a - * multitouch device instead of a mouse. The default is false. - * - * Note that most platforms don't support this hint. As of 2.24.0, it - * only supports MacBooks' trackpads on macOS. Others may follow later. - * - * This hint is checked during SDL_Init and can not be changed after. - * - * This hint is available since SDL 2.24.0. - */ -#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" - - -/** - * \brief An enumeration of hint priorities - */ -typedef enum -{ - SDL_HINT_DEFAULT, - SDL_HINT_NORMAL, - SDL_HINT_OVERRIDE -} SDL_HintPriority; - - -/** - * Set a hint with a specific priority. - * - * The priority controls the behavior when setting a hint that already has a - * value. Hints will replace existing hints of their priority and lower. - * Environment variables are considered to have override priority. - * - * \param name the hint to set - * \param value the value of the hint variable - * \param priority the SDL_HintPriority level for the hint - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetHint - * \sa SDL_SetHint - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); - -/** - * Set a hint with normal priority. - * - * Hints will not be set if there is an existing override hint or environment - * variable that takes precedence. You can use SDL_SetHintWithPriority() to - * set the hint with override priority instead. - * - * \param name the hint to set - * \param value the value of the hint variable - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetHint - * \sa SDL_SetHintWithPriority - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, - const char *value); - -/** - * Reset a hint to the default value. - * - * This will reset a hint to the value of the environment variable, or NULL if - * the environment isn't set. Callbacks will be called normally with this - * change. - * - * \param name the hint to set - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GetHint - * \sa SDL_SetHint - */ -extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); - -/** - * Reset all hints to the default values. - * - * This will reset all hints to the value of the associated environment - * variable, or NULL if the environment isn't set. Callbacks will be called - * normally with this change. - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_GetHint - * \sa SDL_SetHint - * \sa SDL_ResetHint - */ -extern DECLSPEC void SDLCALL SDL_ResetHints(void); - -/** - * Get the value of a hint. - * - * \param name the hint to query - * \returns the string value of a hint or NULL if the hint isn't set. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetHint - * \sa SDL_SetHintWithPriority - */ -extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); - -/** - * Get the boolean value of a hint variable. - * - * \param name the name of the hint to get the boolean value from - * \param default_value the value to return if the hint does not exist - * \returns the boolean value of a hint or the provided default value if the - * hint does not exist. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_GetHint - * \sa SDL_SetHint - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); - -/** - * Type definition of the hint callback function. - * - * \param userdata what was passed as `userdata` to SDL_AddHintCallback() - * \param name what was passed as `name` to SDL_AddHintCallback() - * \param oldValue the previous hint value - * \param newValue the new value hint is to be set to - */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); - -/** - * Add a function to watch a particular hint. - * - * \param name the hint to watch - * \param callback An SDL_HintCallback function that will be called when the - * hint value changes - * \param userdata a pointer to pass to the callback function - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DelHintCallback - */ -extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * Remove a function watching a particular hint. - * - * \param name the hint being watched - * \param callback An SDL_HintCallback function that will be called when the - * hint value changes - * \param userdata a pointer being passed to the callback function - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AddHintCallback - */ -extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); - -/** - * Clear all hints. - * - * This function is automatically called during SDL_Quit(), and deletes all - * callbacks without calling them and frees all memory associated with hints. - * If you're calling this from application code you probably want to call - * SDL_ResetHints() instead. - * - * This function will be removed from the API the next time we rev the ABI. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ResetHints - */ -extern DECLSPEC void SDLCALL SDL_ClearHints(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_hints_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_joystick.h b/libs/hwcodec/externals/SDL/include/SDL_joystick.h deleted file mode 100644 index 07d6a2e0..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_joystick.h +++ /dev/null @@ -1,1066 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_joystick.h - * - * Include file for SDL joystick event handling - * - * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick - * behind a device_index changing as joysticks are plugged and unplugged. - * - * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted - * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. - * - * The term "player_index" is the number assigned to a player on a specific - * controller. For XInput controllers this returns the XInput user index. - * Many joysticks will not be able to supply this information. - * - * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of - * the device (a X360 wired controller for example). This identifier is platform dependent. - */ - -#ifndef SDL_joystick_h_ -#define SDL_joystick_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_guid.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \file SDL_joystick.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. - * - * If you would like to receive joystick updates while the application - * is in the background, you should set the following hint before calling - * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS - */ - -/** - * The joystick structure used to identify an SDL joystick - */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - -/* A structure that encodes the stable unique id for a joystick device */ -typedef SDL_GUID SDL_JoystickGUID; - -/** - * This is a unique ID for a joystick for the time it is connected to the system, - * and is never reused for the lifetime of the application. If the joystick is - * disconnected and reconnected, it will get a new ID. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_JoystickID; - -typedef enum -{ - SDL_JOYSTICK_TYPE_UNKNOWN, - SDL_JOYSTICK_TYPE_GAMECONTROLLER, - SDL_JOYSTICK_TYPE_WHEEL, - SDL_JOYSTICK_TYPE_ARCADE_STICK, - SDL_JOYSTICK_TYPE_FLIGHT_STICK, - SDL_JOYSTICK_TYPE_DANCE_PAD, - SDL_JOYSTICK_TYPE_GUITAR, - SDL_JOYSTICK_TYPE_DRUM_KIT, - SDL_JOYSTICK_TYPE_ARCADE_PAD, - SDL_JOYSTICK_TYPE_THROTTLE -} SDL_JoystickType; - -typedef enum -{ - SDL_JOYSTICK_POWER_UNKNOWN = -1, - SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */ - SDL_JOYSTICK_POWER_LOW, /* <= 20% */ - SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */ - SDL_JOYSTICK_POWER_FULL, /* <= 100% */ - SDL_JOYSTICK_POWER_WIRED, - SDL_JOYSTICK_POWER_MAX -} SDL_JoystickPowerLevel; - -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - - -/* Function prototypes */ - -/** - * Locking for multi-threaded access to the joystick API - * - * If you are using the joystick API or handling events from multiple threads - * you should use these locking functions to protect access to the joysticks. - * - * In particular, you are guaranteed that the joystick list won't change, so - * the API functions that take a joystick index will be valid, and joystick - * and game controller events will not be delivered. - * - * As of SDL 2.26.0, you can take the joystick lock around reinitializing the - * joystick subsystem, to prevent other threads from seeing joysticks in an - * uninitialized state. However, all open joysticks will be closed and SDL - * functions called with them will fail. - * - * \since This function is available since SDL 2.0.7. - */ -extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); - - -/** - * Unlocking for multi-threaded access to the joystick API - * - * If you are using the joystick API or handling events from multiple threads - * you should use these locking functions to protect access to the joysticks. - * - * In particular, you are guaranteed that the joystick list won't change, so - * the API functions that take a joystick index will be valid, and joystick - * and game controller events will not be delivered. - * - * \since This function is available since SDL 2.0.7. - */ -extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); - -/** - * Count the number of joysticks attached to the system. - * - * \returns the number of attached joysticks on success or a negative error - * code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickName - * \sa SDL_JoystickPath - * \sa SDL_JoystickOpen - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/** - * Get the implementation dependent name of a joystick. - * - * This can be called before any joysticks are opened. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system) - * \returns the name of the selected joystick. If no name can be found, this - * function returns NULL; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickName - * \sa SDL_JoystickOpen - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); - -/** - * Get the implementation dependent path of a joystick. - * - * This can be called before any joysticks are opened. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system) - * \returns the path of the selected joystick. If no path can be found, this - * function returns NULL; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_JoystickPath - * \sa SDL_JoystickOpen - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index); - -/** - * Get the player index of a joystick, or -1 if it's not available This can be - * called before any joysticks are opened. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); - -/** - * Get the implementation-dependent GUID for the joystick at a given device - * index. - * - * This function can be called before any joysticks are opened. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the GUID of the selected joystick. If called on an invalid index, - * this function returns a zero GUID - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetGUID - * \sa SDL_JoystickGetGUIDString - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); - -/** - * Get the USB vendor ID of a joystick, if available. - * - * This can be called before any joysticks are opened. If the vendor ID isn't - * available this function returns 0. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the USB vendor ID of the selected joystick. If called on an - * invalid index, this function returns zero - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); - -/** - * Get the USB product ID of a joystick, if available. - * - * This can be called before any joysticks are opened. If the product ID isn't - * available this function returns 0. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the USB product ID of the selected joystick. If called on an - * invalid index, this function returns zero - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); - -/** - * Get the product version of a joystick, if available. - * - * This can be called before any joysticks are opened. If the product version - * isn't available this function returns 0. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the product version of the selected joystick. If called on an - * invalid index, this function returns zero - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); - -/** - * Get the type of a joystick, if available. - * - * This can be called before any joysticks are opened. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the SDL_JoystickType of the selected joystick. If called on an - * invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN` - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); - -/** - * Get the instance ID of a joystick. - * - * This can be called before any joysticks are opened. If the index is out of - * range, this function will return -1. - * - * \param device_index the index of the joystick to query (the N'th joystick - * on the system - * \returns the instance id of the selected joystick. If called on an invalid - * index, this function returns zero - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); - -/** - * Open a joystick for use. - * - * The `device_index` argument refers to the N'th joystick presently - * recognized by SDL on the system. It is **NOT** the same as the instance ID - * used to identify the joystick in future events. See - * SDL_JoystickInstanceID() for more details about instance IDs. - * - * The joystick subsystem must be initialized before a joystick can be opened - * for use. - * - * \param device_index the index of the joystick to query - * \returns a joystick identifier or NULL if an error occurred; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickClose - * \sa SDL_JoystickInstanceID - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); - -/** - * Get the SDL_Joystick associated with an instance id. - * - * \param instance_id the instance id to get the SDL_Joystick for - * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.4. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); - -/** - * Get the SDL_Joystick associated with a player index. - * - * \param player_index the player index to get the SDL_Joystick for - * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); - -/** - * Attach a new virtual joystick. - * - * \returns the joystick's device index, or -1 if an error occurred. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, - int naxes, - int nbuttons, - int nhats); - -/** - * The structure that defines an extended virtual joystick description - * - * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx() - * All other elements of this structure are optional and can be left 0. - * - * \sa SDL_JoystickAttachVirtualEx - */ -typedef struct SDL_VirtualJoystickDesc -{ - Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */ - Uint16 type; /**< `SDL_JoystickType` */ - Uint16 naxes; /**< the number of axes on this joystick */ - Uint16 nbuttons; /**< the number of buttons on this joystick */ - Uint16 nhats; /**< the number of hats on this joystick */ - Uint16 vendor_id; /**< the USB vendor ID of this joystick */ - Uint16 product_id; /**< the USB product ID of this joystick */ - Uint16 padding; /**< unused */ - Uint32 button_mask; /**< A mask of which buttons are valid for this controller - e.g. (1 << SDL_CONTROLLER_BUTTON_A) */ - Uint32 axis_mask; /**< A mask of which axes are valid for this controller - e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */ - const char *name; /**< the name of the joystick */ - - void *userdata; /**< User data pointer passed to callbacks */ - void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */ - void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */ - int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */ - int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */ - int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */ - int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */ - -} SDL_VirtualJoystickDesc; - -/** - * \brief The current version of the SDL_VirtualJoystickDesc structure - */ -#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1 - -/** - * Attach a new virtual joystick with extended properties. - * - * \returns the joystick's device index, or -1 if an error occurred. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc); - -/** - * Detach a virtual joystick. - * - * \param device_index a value previously returned from - * SDL_JoystickAttachVirtual() - * \returns 0 on success, or -1 if an error occurred. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); - -/** - * Query whether or not the joystick at a given device index is virtual. - * - * \param device_index a joystick device index. - * \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); - -/** - * Set values on an opened, virtual-joystick's axis. - * - * Please note that values set here will not be applied until the next call to - * SDL_JoystickUpdate, which can either be called directly, or can be called - * indirectly through various other SDL APIs, including, but not limited to - * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, - * SDL_WaitEvent. - * - * Note that when sending trigger axes, you should scale the value to the full - * range of Sint16. For example, a trigger at rest would have the value of - * `SDL_JOYSTICK_AXIS_MIN`. - * - * \param joystick the virtual joystick on which to set state. - * \param axis the specific axis on the virtual joystick to set. - * \param value the new value for the specified axis. - * \returns 0 on success, -1 on error. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); - -/** - * Set values on an opened, virtual-joystick's button. - * - * Please note that values set here will not be applied until the next call to - * SDL_JoystickUpdate, which can either be called directly, or can be called - * indirectly through various other SDL APIs, including, but not limited to - * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, - * SDL_WaitEvent. - * - * \param joystick the virtual joystick on which to set state. - * \param button the specific button on the virtual joystick to set. - * \param value the new value for the specified button. - * \returns 0 on success, -1 on error. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); - -/** - * Set values on an opened, virtual-joystick's hat. - * - * Please note that values set here will not be applied until the next call to - * SDL_JoystickUpdate, which can either be called directly, or can be called - * indirectly through various other SDL APIs, including, but not limited to - * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, - * SDL_WaitEvent. - * - * \param joystick the virtual joystick on which to set state. - * \param hat the specific hat on the virtual joystick to set. - * \param value the new value for the specified hat. - * \returns 0 on success, -1 on error. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); - -/** - * Get the implementation dependent name of a joystick. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the name of the selected joystick. If no name can be found, this - * function returns NULL; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickNameForIndex - * \sa SDL_JoystickOpen - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); - -/** - * Get the implementation dependent path of a joystick. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the path of the selected joystick. If no path can be found, this - * function returns NULL; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_JoystickPathForIndex - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick); - -/** - * Get the player index of an opened joystick. - * - * For XInput controllers this returns the XInput user index. Many joysticks - * will not be able to supply this information. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the player index, or -1 if it's not available. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); - -/** - * Set the player index of an opened joystick. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \param player_index Player index to assign to this joystick, or -1 to clear - * the player index and turn off player LEDs. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); - -/** - * Get the implementation-dependent GUID for the joystick. - * - * This function requires an open joystick. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the GUID of the given joystick. If called on an invalid index, - * this function returns a zero GUID; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetDeviceGUID - * \sa SDL_JoystickGetGUIDString - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); - -/** - * Get the USB vendor ID of an opened joystick, if available. - * - * If the vendor ID isn't available this function returns 0. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the USB vendor ID of the selected joystick, or 0 if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); - -/** - * Get the USB product ID of an opened joystick, if available. - * - * If the product ID isn't available this function returns 0. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the USB product ID of the selected joystick, or 0 if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); - -/** - * Get the product version of an opened joystick, if available. - * - * If the product version isn't available this function returns 0. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the product version of the selected joystick, or 0 if unavailable. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); - -/** - * Get the firmware version of an opened joystick, if available. - * - * If the firmware version isn't available this function returns 0. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the firmware version of the selected joystick, or 0 if - * unavailable. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick); - -/** - * Get the serial number of an opened joystick, if available. - * - * Returns the serial number of the joystick, or NULL if it is not available. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the serial number of the selected joystick, or NULL if - * unavailable. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); - -/** - * Get the type of an opened joystick. - * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() - * \returns the SDL_JoystickType of the selected joystick. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); - -/** - * Get an ASCII string representation for a given SDL_JoystickGUID. - * - * You should supply at least 33 bytes for pszGUID. - * - * \param guid the SDL_JoystickGUID you wish to convert to string - * \param pszGUID buffer in which to write the ASCII string - * \param cbGUID the size of pszGUID - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetDeviceGUID - * \sa SDL_JoystickGetGUID - * \sa SDL_JoystickGetGUIDFromString - */ -extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); - -/** - * Convert a GUID string into a SDL_JoystickGUID structure. - * - * Performs no error checking. If this function is given a string containing - * an invalid GUID, the function will silently succeed, but the GUID generated - * will not be useful. - * - * \param pchGUID string containing an ASCII representation of a GUID - * \returns a SDL_JoystickGUID structure. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetGUIDString - */ -extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); - -/** - * Get the device information encoded in a SDL_JoystickGUID structure - * - * \param guid the SDL_JoystickGUID you wish to get info about - * \param vendor A pointer filled in with the device VID, or 0 if not - * available - * \param product A pointer filled in with the device PID, or 0 if not - * available - * \param version A pointer filled in with the device version, or 0 if not - * available - * \param crc16 A pointer filled in with a CRC used to distinguish different - * products with the same VID/PID, or 0 if not available - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_JoystickGetDeviceGUID - */ -extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); - -/** - * Get the status of a specified joystick. - * - * \param joystick the joystick to query - * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickClose - * \sa SDL_JoystickOpen - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); - -/** - * Get the instance ID of an opened joystick. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \returns the instance ID of the specified joystick on success or a negative - * error code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickOpen - */ -extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); - -/** - * Get the number of general axis controls on a joystick. - * - * Often, the directional pad on a game controller will either look like 4 - * separate buttons or a POV hat, and not axes, but all of this is up to the - * device and platform. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \returns the number of axis controls/number of axes on success or a - * negative error code on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetAxis - * \sa SDL_JoystickOpen - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); - -/** - * Get the number of trackballs on a joystick. - * - * Joystick trackballs have only relative motion events associated with them - * and their state cannot be polled. - * - * Most joysticks do not have trackballs. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \returns the number of trackballs on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetBall - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); - -/** - * Get the number of POV hats on a joystick. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \returns the number of POV hats on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetHat - * \sa SDL_JoystickOpen - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); - -/** - * Get the number of buttons on a joystick. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \returns the number of buttons on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickGetButton - * \sa SDL_JoystickOpen - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); - -/** - * Update the current state of the open joysticks. - * - * This is called automatically by the event loop if any joystick events are - * enabled. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickEventState - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/** - * Enable/disable joystick event polling. - * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and manually check the state of the joystick when you want - * joystick information. - * - * It is recommended that you leave joystick event handling enabled. - * - * **WARNING**: Calling this function may delete all events currently in SDL's - * event queue. - * - * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` - * \returns 1 if enabled, 0 if disabled, or a negative error code on failure; - * call SDL_GetError() for more information. - * - * If `state` is `SDL_QUERY` then the current state is returned, - * otherwise the new processing state is returned. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GameControllerEventState - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -#define SDL_JOYSTICK_AXIS_MAX 32767 -#define SDL_JOYSTICK_AXIS_MIN -32768 - -/** - * Get the current state of an axis control on a joystick. - * - * SDL makes no promises about what part of the joystick any given axis refers - * to. Your game should have some sort of configuration UI to let users - * specify what each axis should be bound to. Alternately, SDL's higher-level - * Game Controller API makes a great effort to apply order to this lower-level - * interface, so you know that a specific axis is the "left thumb stick," etc. - * - * The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to - * 32767) representing the current position of the axis. It may be necessary - * to impose certain tolerances on these values to account for jitter. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \param axis the axis to query; the axis indices start at index 0 - * \returns a 16-bit signed integer representing the current position of the - * axis or 0 on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickNumAxes - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, - int axis); - -/** - * Get the initial state of an axis control on a joystick. - * - * The state is a value ranging from -32768 to 32767. - * - * The axis indices start at index 0. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \param axis the axis to query; the axis indices start at index 0 - * \param state Upon return, the initial value is supplied here. - * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, - int axis, Sint16 *state); - -/** - * \name Hat positions - */ -/* @{ */ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/* @} */ - -/** - * Get the current state of a POV hat on a joystick. - * - * The returned value will be one of the following positions: - * - * - `SDL_HAT_CENTERED` - * - `SDL_HAT_UP` - * - `SDL_HAT_RIGHT` - * - `SDL_HAT_DOWN` - * - `SDL_HAT_LEFT` - * - `SDL_HAT_RIGHTUP` - * - `SDL_HAT_RIGHTDOWN` - * - `SDL_HAT_LEFTUP` - * - `SDL_HAT_LEFTDOWN` - * - * \param joystick an SDL_Joystick structure containing joystick information - * \param hat the hat index to get the state from; indices start at index 0 - * \returns the current hat position. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickNumHats - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, - int hat); - -/** - * Get the ball axis change since the last poll. - * - * Trackballs can only return relative motion since the last call to - * SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`. - * - * Most joysticks do not have trackballs. - * - * \param joystick the SDL_Joystick to query - * \param ball the ball index to query; ball indices start at index 0 - * \param dx stores the difference in the x axis position since the last poll - * \param dy stores the difference in the y axis position since the last poll - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickNumBalls - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, - int ball, int *dx, int *dy); - -/** - * Get the current state of a button on a joystick. - * - * \param joystick an SDL_Joystick structure containing joystick information - * \param button the button index to get the state from; indices start at - * index 0 - * \returns 1 if the specified button is pressed, 0 otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickNumButtons - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, - int button); - -/** - * Start a rumble effect. - * - * Each call to this function cancels any previous rumble effect, and calling - * it with 0 intensity stops any rumbling. - * - * \param joystick The joystick to vibrate - * \param low_frequency_rumble The intensity of the low frequency (left) - * rumble motor, from 0 to 0xFFFF - * \param high_frequency_rumble The intensity of the high frequency (right) - * rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if rumble isn't supported on this joystick - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_JoystickHasRumble - */ -extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); - -/** - * Start a rumble effect in the joystick's triggers - * - * Each call to this function cancels any previous trigger rumble effect, and - * calling it with 0 intensity stops any rumbling. - * - * Note that this is rumbling of the _triggers_ and not the game controller as - * a whole. This is currently only supported on Xbox One controllers. If you - * want the (more common) whole-controller rumble, use SDL_JoystickRumble() - * instead. - * - * \param joystick The joystick to vibrate - * \param left_rumble The intensity of the left trigger rumble motor, from 0 - * to 0xFFFF - * \param right_rumble The intensity of the right trigger rumble motor, from 0 - * to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if trigger rumble isn't supported on this joystick - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_JoystickHasRumbleTriggers - */ -extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); - -/** - * Query whether a joystick has an LED. - * - * An example of a joystick LED is the light on the back of a PlayStation 4's - * DualShock 4 controller. - * - * \param joystick The joystick to query - * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); - -/** - * Query whether a joystick has rumble support. - * - * \param joystick The joystick to query - * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_JoystickRumble - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick); - -/** - * Query whether a joystick has rumble support on triggers. - * - * \param joystick The joystick to query - * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_JoystickRumbleTriggers - */ -extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick); - -/** - * Update a joystick's LED color. - * - * An example of a joystick LED is the light on the back of a PlayStation 4's - * DualShock 4 controller. - * - * \param joystick The joystick to update - * \param red The intensity of the red LED - * \param green The intensity of the green LED - * \param blue The intensity of the blue LED - * \returns 0 on success, -1 if this joystick does not have a modifiable LED - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); - -/** - * Send a joystick specific effect packet - * - * \param joystick The joystick to affect - * \param data The data to send to the joystick - * \param size The size of the data to send to the joystick - * \returns 0, or -1 if this joystick or driver doesn't support effect packets - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size); - -/** - * Close a joystick previously opened with SDL_JoystickOpen(). - * - * \param joystick The joystick device to close - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_JoystickOpen - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); - -/** - * Get the battery level of a joystick as SDL_JoystickPowerLevel. - * - * \param joystick the SDL_Joystick to query - * \returns the current battery level as SDL_JoystickPowerLevel on success or - * `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown - * - * \since This function is available since SDL 2.0.4. - */ -extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_joystick_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_keyboard.h b/libs/hwcodec/externals/SDL/include/SDL_keyboard.h deleted file mode 100644 index 86a37ad1..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_keyboard.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keyboard.h - * - * Include file for SDL keyboard event handling - */ - -#ifndef SDL_keyboard_h_ -#define SDL_keyboard_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keycode.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The SDL keysym structure, used in key events. - * - * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. - */ -typedef struct SDL_Keysym -{ - SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ - Uint16 mod; /**< current key modifiers */ - Uint32 unused; -} SDL_Keysym; - -/* Function prototypes */ - -/** - * Query the window which currently has keyboard focus. - * - * \returns the window with keyboard focus. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); - -/** - * Get a snapshot of the current state of the keyboard. - * - * The pointer returned is a pointer to an internal SDL array. It will be - * valid for the whole lifetime of the application and should not be freed by - * the caller. - * - * A array element with a value of 1 means that the key is pressed and a value - * of 0 means that it is not. Indexes into this array are obtained by using - * SDL_Scancode values. - * - * Use SDL_PumpEvents() to update the state array. - * - * This function gives you the current state after all events have been - * processed, so if a key or button has been pressed and released before you - * process events, then the pressed state will never show up in the - * SDL_GetKeyboardState() calls. - * - * Note: This function doesn't take into account whether shift has been - * pressed or not. - * - * \param numkeys if non-NULL, receives the length of the returned array - * \returns a pointer to an array of key states. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PumpEvents - * \sa SDL_ResetKeyboard - */ -extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); - -/** - * Clear the state of the keyboard - * - * This function will generate key up events for all pressed keys. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GetKeyboardState - */ -extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void); - -/** - * Get the current key modifier state for the keyboard. - * - * \returns an OR'd combination of the modifier keys for the keyboard. See - * SDL_Keymod for details. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyboardState - * \sa SDL_SetModState - */ -extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); - -/** - * Set the current key modifier state for the keyboard. - * - * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose - * modifier key states on your application. Simply pass your desired modifier - * states into `modstate`. This value may be a bitwise, OR'd combination of - * SDL_Keymod values. - * - * This does not change the keyboard state, only the key modifier flags that - * SDL reports. - * - * \param modstate the desired SDL_Keymod for the keyboard - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetModState - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); - -/** - * Get the key code corresponding to the given scancode according to the - * current keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); - -/** - * Get the scancode corresponding to the given key code according to the - * current keyboard layout. - * - * See SDL_Scancode for details. - * - * \param key the desired SDL_Keycode to query - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetScancodeName - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); - -/** - * Get a human-readable name for a scancode. - * - * See SDL_Scancode for details. - * - * **Warning**: The returned name is by design not stable across platforms, - * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left - * Windows" under Microsoft Windows, and some scancodes like - * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even - * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and - * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore - * unsuitable for creating a stable cross-platform two-way mapping between - * strings and scancodes. - * - * \param scancode the desired SDL_Scancode to query - * \returns a pointer to the name for the scancode. If the scancode doesn't - * have a name this function returns an empty string (""). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeFromName - */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); - -/** - * Get a scancode from a human-readable name. - * - * \param name the human-readable scancode name - * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't - * recognized; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyFromName - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); - -/** - * Get a human-readable name for a key. - * - * See SDL_Scancode and SDL_Keycode for details. - * - * \param key the desired SDL_Keycode to query - * \returns a pointer to a UTF-8 string that stays valid at least until the - * next call to this function. If you need it around any longer, you - * must copy it. If the key doesn't have a name, this function - * returns an empty string (""). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyFromName - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetScancodeFromKey - */ -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); - -/** - * Get a key code from a human-readable name. - * - * \param name the human-readable key name - * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromName - */ -extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); - -/** - * Start accepting Unicode text input events. - * - * This function will start accepting Unicode text input events in the focused - * SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and - * SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in - * pair with SDL_StopTextInput(). - * - * On some platforms using this function activates the screen keyboard. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetTextInputRect - * \sa SDL_StopTextInput - */ -extern DECLSPEC void SDLCALL SDL_StartTextInput(void); - -/** - * Check whether or not Unicode text input events are enabled. - * - * \returns SDL_TRUE if text input events are enabled else SDL_FALSE. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_StartTextInput - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); - -/** - * Stop receiving any text input events. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_StartTextInput - */ -extern DECLSPEC void SDLCALL SDL_StopTextInput(void); - -/** - * Dismiss the composition window/IME without disabling the subsystem. - * - * \since This function is available since SDL 2.0.22. - * - * \sa SDL_StartTextInput - * \sa SDL_StopTextInput - */ -extern DECLSPEC void SDLCALL SDL_ClearComposition(void); - -/** - * Returns if an IME Composite or Candidate window is currently shown. - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); - -/** - * Set the rectangle used to type Unicode text inputs. - * - * To start text input in a given location, this function is intended to be - * called before SDL_StartTextInput, although some platforms support moving - * the rectangle even while text input (and a composition) is active. - * - * Note: If you want to use the system native IME window, try setting hint - * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you - * any feedback. - * - * \param rect the SDL_Rect structure representing the rectangle to receive - * text (ignored if NULL) - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_StartTextInput - */ -extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect); - -/** - * Check whether the platform has screen keyboard support. - * - * \returns SDL_TRUE if the platform has some screen keyboard support or - * SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_StartTextInput - * \sa SDL_IsScreenKeyboardShown - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); - -/** - * Check whether the screen keyboard is shown for given window. - * - * \param window the window for which screen keyboard should be queried - * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasScreenKeyboardSupport - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_keyboard_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_keycode.h b/libs/hwcodec/externals/SDL/include/SDL_keycode.h deleted file mode 100644 index 2523506d..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_keycode.h +++ /dev/null @@ -1,358 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_keycode.h - * - * Defines constants which identify keyboard keys and modifiers. - */ - -#ifndef SDL_keycode_h_ -#define SDL_keycode_h_ - -#include "SDL_stdinc.h" -#include "SDL_scancode.h" - -/** - * \brief The SDL virtual key representation. - * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. - * - * A special exception is the number keys at the top of the keyboard which - * always map to SDLK_0...SDLK_9, regardless of layout. - */ -typedef Sint32 SDL_Keycode; - -#define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) - -typedef enum -{ - SDLK_UNKNOWN = 0, - - SDLK_RETURN = '\r', - SDLK_ESCAPE = '\x1B', - SDLK_BACKSPACE = '\b', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - SDLK_EXCLAIM = '!', - SDLK_QUOTEDBL = '"', - SDLK_HASH = '#', - SDLK_PERCENT = '%', - SDLK_DOLLAR = '$', - SDLK_AMPERSAND = '&', - SDLK_QUOTE = '\'', - SDLK_LEFTPAREN = '(', - SDLK_RIGHTPAREN = ')', - SDLK_ASTERISK = '*', - SDLK_PLUS = '+', - SDLK_COMMA = ',', - SDLK_MINUS = '-', - SDLK_PERIOD = '.', - SDLK_SLASH = '/', - SDLK_0 = '0', - SDLK_1 = '1', - SDLK_2 = '2', - SDLK_3 = '3', - SDLK_4 = '4', - SDLK_5 = '5', - SDLK_6 = '6', - SDLK_7 = '7', - SDLK_8 = '8', - SDLK_9 = '9', - SDLK_COLON = ':', - SDLK_SEMICOLON = ';', - SDLK_LESS = '<', - SDLK_EQUALS = '=', - SDLK_GREATER = '>', - SDLK_QUESTION = '?', - SDLK_AT = '@', - - /* - Skip uppercase letters - */ - - SDLK_LEFTBRACKET = '[', - SDLK_BACKSLASH = '\\', - SDLK_RIGHTBRACKET = ']', - SDLK_CARET = '^', - SDLK_UNDERSCORE = '_', - SDLK_BACKQUOTE = '`', - SDLK_a = 'a', - SDLK_b = 'b', - SDLK_c = 'c', - SDLK_d = 'd', - SDLK_e = 'e', - SDLK_f = 'f', - SDLK_g = 'g', - SDLK_h = 'h', - SDLK_i = 'i', - SDLK_j = 'j', - SDLK_k = 'k', - SDLK_l = 'l', - SDLK_m = 'm', - SDLK_n = 'n', - SDLK_o = 'o', - SDLK_p = 'p', - SDLK_q = 'q', - SDLK_r = 'r', - SDLK_s = 's', - SDLK_t = 't', - SDLK_u = 'u', - SDLK_v = 'v', - SDLK_w = 'w', - SDLK_x = 'x', - SDLK_y = 'y', - SDLK_z = 'z', - - SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), - - SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), - SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), - SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), - SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), - SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), - SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), - SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), - SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), - SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), - SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), - SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), - SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), - - SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), - SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), - SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), - SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), - SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), - SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), - SDLK_DELETE = '\x7F', - SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), - SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), - SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), - SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), - SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), - SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), - - SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), - SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), - SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), - SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), - SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), - SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), - SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), - SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), - SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), - SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), - SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), - SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), - SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), - SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), - SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), - SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), - SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), - - SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), - SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), - SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), - SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), - SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), - SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), - SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), - SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), - SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), - SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), - SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), - SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), - SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), - SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), - SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), - SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), - SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), - SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), - SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), - SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), - SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), - SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), - SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), - SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), - SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), - SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), - SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), - SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), - SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), - SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), - SDLK_KP_EQUALSAS400 = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), - - SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), - SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), - SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), - SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), - SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), - SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), - SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), - SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), - SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), - SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), - SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), - SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), - - SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), - SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), - SDLK_THOUSANDSSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), - SDLK_DECIMALSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), - SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), - SDLK_CURRENCYSUBUNIT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), - SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), - SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), - SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), - SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), - SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), - SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), - SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), - SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), - SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), - SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), - SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), - SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), - SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), - SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), - SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), - SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), - SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), - SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), - SDLK_KP_DBLAMPERSAND = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), - SDLK_KP_VERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), - SDLK_KP_DBLVERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), - SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), - SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), - SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), - SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), - SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), - SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), - SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), - SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), - SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), - SDLK_KP_MEMSUBTRACT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), - SDLK_KP_MEMMULTIPLY = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), - SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), - SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), - SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), - SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), - SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), - SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), - SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), - SDLK_KP_HEXADECIMAL = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), - - SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), - SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), - SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), - SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), - SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), - SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), - SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), - SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), - - SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), - - SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), - SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), - SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), - SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), - SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), - SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), - SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), - SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), - SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), - SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), - SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), - SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), - SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), - SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), - SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), - SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), - SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), - - SDLK_BRIGHTNESSDOWN = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), - SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), - SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), - SDLK_KBDILLUMTOGGLE = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), - SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), - SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), - SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), - SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), - SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1), - SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2), - - SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), - SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD), - - SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT), - SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT), - SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL), - SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) -} SDL_KeyCode; - -/** - * \brief Enumeration of valid key mods (possibly OR'd together). - */ -typedef enum -{ - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_SCROLL = 0x8000, - - KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, - KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, - KMOD_ALT = KMOD_LALT | KMOD_RALT, - KMOD_GUI = KMOD_LGUI | KMOD_RGUI, - - KMOD_RESERVED = KMOD_SCROLL /* This is for source-level compatibility with SDL 2.0.0. */ -} SDL_Keymod; - -#endif /* SDL_keycode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_loadso.h b/libs/hwcodec/externals/SDL/include/SDL_loadso.h deleted file mode 100644 index ca59b681..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_loadso.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * \li These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * \li Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * \li Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - -#ifndef SDL_loadso_h_ -#define SDL_loadso_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Dynamically load a shared object. - * - * \param sofile a system-dependent name of the object file - * \returns an opaque pointer to the object handle or NULL if there was an - * error; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadFunction - * \sa SDL_UnloadObject - */ -extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); - -/** - * Look up the address of the named function in a shared object. - * - * This function pointer is no longer valid after calling SDL_UnloadObject(). - * - * This function can only look up C function names. Other languages may have - * name mangling and intrinsic language support that varies from compiler to - * compiler. - * - * Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - * If the requested function doesn't exist, NULL is returned. - * - * \param handle a valid shared object handle returned by SDL_LoadObject() - * \param name the name of the function to look up - * \returns a pointer to the function or NULL if there was an error; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadObject - * \sa SDL_UnloadObject - */ -extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, - const char *name); - -/** - * Unload a shared object from memory. - * - * \param handle a valid shared object handle returned by SDL_LoadObject() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadFunction - * \sa SDL_LoadObject - */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_loadso_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_locale.h b/libs/hwcodec/externals/SDL/include/SDL_locale.h deleted file mode 100644 index 482dbefe..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_locale.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_locale.h - * - * Include file for SDL locale services - */ - -#ifndef _SDL_locale_h -#define _SDL_locale_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - - -typedef struct SDL_Locale -{ - const char *language; /**< A language name, like "en" for English. */ - const char *country; /**< A country, like "US" for America. Can be NULL. */ -} SDL_Locale; - -/** - * Report the user's preferred locale. - * - * This returns an array of SDL_Locale structs, the final item zeroed out. - * When the caller is done with this array, it should call SDL_free() on the - * returned value; all the memory involved is allocated in a single block, so - * a single SDL_free() will suffice. - * - * Returned language strings are in the format xx, where 'xx' is an ISO-639 - * language specifier (such as "en" for English, "de" for German, etc). - * Country strings are in the format YY, where "YY" is an ISO-3166 country - * code (such as "US" for the United States, "CA" for Canada, etc). Country - * might be NULL if there's no specific guidance on them (so you might get { - * "en", "US" } for American English, but { "en", NULL } means "English - * language, generically"). Language strings are never NULL, except to - * terminate the array. - * - * Please note that not all of these strings are 2 characters; some are three - * or more. - * - * The returned list of locales are in the order of the user's preference. For - * example, a German citizen that is fluent in US English and knows enough - * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", - * "jp", NULL }. Someone from England might prefer British English (where - * "color" is spelled "colour", etc), but will settle for anything like it: { - * "en_GB", "en", NULL }. - * - * This function returns NULL on error, including when the platform does not - * supply this information at all. - * - * This might be a "slow" call that has to query the operating system. It's - * best to ask for this once and save the results. However, this list can - * change, usually because the user has changed a system preference outside of - * your program; SDL will send an SDL_LOCALECHANGED event in this case, if - * possible, and you can call this function again to get an updated copy of - * preferred locales. - * - * \return array of locales, terminated with a locale with a NULL language - * field. Will return NULL on error. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_locale_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_log.h b/libs/hwcodec/externals/SDL/include/SDL_log.h deleted file mode 100644 index da733c40..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_log.h +++ /dev/null @@ -1,404 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_log.h - * - * Simple log messages with categories and priorities. - * - * By default logs are quiet, but if you're debugging SDL you might want: - * - * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); - * - * Here's where the messages go on different platforms: - * Windows: debug output stream - * Android: log output - * Others: standard error output (stderr) - */ - -#ifndef SDL_log_h_ -#define SDL_log_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief The maximum size of a log message prior to SDL 2.0.24 - * - * As of 2.0.24 there is no limit to the length of SDL log messages. - */ -#define SDL_MAX_LOG_MESSAGE 4096 - -/** - * \brief The predefined log categories - * - * By default the application category is enabled at the INFO level, - * the assert category is enabled at the WARN level, test is enabled - * at the VERBOSE level and all other categories are enabled at the - * CRITICAL level. - */ -typedef enum -{ - SDL_LOG_CATEGORY_APPLICATION, - SDL_LOG_CATEGORY_ERROR, - SDL_LOG_CATEGORY_ASSERT, - SDL_LOG_CATEGORY_SYSTEM, - SDL_LOG_CATEGORY_AUDIO, - SDL_LOG_CATEGORY_VIDEO, - SDL_LOG_CATEGORY_RENDER, - SDL_LOG_CATEGORY_INPUT, - SDL_LOG_CATEGORY_TEST, - - /* Reserved for future SDL library use */ - SDL_LOG_CATEGORY_RESERVED1, - SDL_LOG_CATEGORY_RESERVED2, - SDL_LOG_CATEGORY_RESERVED3, - SDL_LOG_CATEGORY_RESERVED4, - SDL_LOG_CATEGORY_RESERVED5, - SDL_LOG_CATEGORY_RESERVED6, - SDL_LOG_CATEGORY_RESERVED7, - SDL_LOG_CATEGORY_RESERVED8, - SDL_LOG_CATEGORY_RESERVED9, - SDL_LOG_CATEGORY_RESERVED10, - - /* Beyond this point is reserved for application use, e.g. - enum { - MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, - MYAPP_CATEGORY_AWESOME2, - MYAPP_CATEGORY_AWESOME3, - ... - }; - */ - SDL_LOG_CATEGORY_CUSTOM -} SDL_LogCategory; - -/** - * \brief The predefined log priorities - */ -typedef enum -{ - SDL_LOG_PRIORITY_VERBOSE = 1, - SDL_LOG_PRIORITY_DEBUG, - SDL_LOG_PRIORITY_INFO, - SDL_LOG_PRIORITY_WARN, - SDL_LOG_PRIORITY_ERROR, - SDL_LOG_PRIORITY_CRITICAL, - SDL_NUM_LOG_PRIORITIES -} SDL_LogPriority; - - -/** - * Set the priority of all log categories. - * - * \param priority the SDL_LogPriority to assign - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogSetPriority - */ -extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); - -/** - * Set the priority of a particular log category. - * - * \param category the category to assign a priority to - * \param priority the SDL_LogPriority to assign - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogGetPriority - * \sa SDL_LogSetAllPriority - */ -extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, - SDL_LogPriority priority); - -/** - * Get the priority of a particular log category. - * - * \param category the category to query - * \returns the SDL_LogPriority for the requested category - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogSetPriority - */ -extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); - -/** - * Reset all priorities to default. - * - * This is called by SDL_Quit(). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogSetAllPriority - * \sa SDL_LogSetPriority - */ -extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); - -/** - * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. - * - * = * \param fmt a printf() style message format string - * - * \param ... additional parameters matching % tokens in the `fmt` string, if - * any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * Log a message with SDL_LOG_PRIORITY_VERBOSE. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with SDL_LOG_PRIORITY_DEBUG. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with SDL_LOG_PRIORITY_INFO. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with SDL_LOG_PRIORITY_WARN. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - */ -extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with SDL_LOG_PRIORITY_ERROR. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with SDL_LOG_PRIORITY_CRITICAL. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * Log a message with the specified category and priority. - * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogMessage(int category, - SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); - -/** - * Log a message with the specified category and priority. - * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string - * \param ap a variable argument list - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogVerbose - * \sa SDL_LogWarn - */ -extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, - SDL_LogPriority priority, - const char *fmt, va_list ap); - -/** - * The prototype for the log output callback function. - * - * This function is called by SDL when there is new text to be logged. - * - * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction() - * \param category the category of the message - * \param priority the priority of the message - * \param message the message being output - */ -typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); - -/** - * Get the current log output function. - * - * \param callback an SDL_LogOutputFunction filled in with the current log - * callback - * \param userdata a pointer filled in with the pointer that is passed to - * `callback` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogSetOutputFunction - */ -extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); - -/** - * Replace the default log output function with one of your own. - * - * \param callback an SDL_LogOutputFunction to call instead of the default - * \param userdata a pointer that is passed to `callback` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LogGetOutputFunction - */ -extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_log_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_main.h b/libs/hwcodec/externals/SDL/include/SDL_main.h deleted file mode 100644 index 14d39f1e..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_main.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_main_h_ -#define SDL_main_h_ - -#include "SDL_stdinc.h" - -/** - * \file SDL_main.h - * - * Redefine main() on some platforms so that it is called by SDL. - */ - -#ifndef SDL_MAIN_HANDLED -#if defined(__WIN32__) -/* On Windows SDL provides WinMain(), which parses the command line and passes - the arguments to your main function. - - If you provide your own WinMain(), you may define SDL_MAIN_HANDLED - */ -#define SDL_MAIN_AVAILABLE - -#elif defined(__WINRT__) -/* On WinRT, SDL provides a main function that initializes CoreApplication, - creating an instance of IFrameworkView in the process. - - Please note that #include'ing SDL_main.h is not enough to get a main() - function working. In non-XAML apps, the file, - src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled - into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be - called, with a pointer to the Direct3D-hosted XAML control passed in. -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__GDK__) -/* On GDK, SDL provides a main function that initializes the game runtime. - - Please note that #include'ing SDL_main.h is not enough to get a main() - function working. You must either link against SDL2main or, if not possible, - call the SDL_GDKRunApp function from your entry point. -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__IPHONEOS__) -/* On iOS SDL provides a main function that creates an application delegate - and starts the iOS application run loop. - - If you link with SDL dynamically on iOS, the main function can't be in a - shared library, so you need to link with libSDLmain.a, which includes a - stub main function that calls into the shared library to start execution. - - See src/video/uikit/SDL_uikitappdelegate.m for more details. - */ -#define SDL_MAIN_NEEDED - -#elif defined(__ANDROID__) -/* On Android SDL provides a Java class in SDLActivity.java that is the - main activity entry point. - - See docs/README-android.md for more details on extending that class. - */ -#define SDL_MAIN_NEEDED - -/* We need to export SDL_main so it can be launched from Java */ -#define SDLMAIN_DECLSPEC DECLSPEC - -#elif defined(__NACL__) -/* On NACL we use ppapi_simple to set up the application helper code, - then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before - starting the user main function. - All user code is run in a separate thread by ppapi_simple, thus - allowing for blocking io to take place via nacl_io -*/ -#define SDL_MAIN_NEEDED - -#elif defined(__PSP__) -/* On PSP SDL provides a main function that sets the module info, - activates the GPU and starts the thread required to be able to exit - the software. - - If you provide this yourself, you may define SDL_MAIN_HANDLED - */ -#define SDL_MAIN_AVAILABLE - -#elif defined(__PS2__) -#define SDL_MAIN_AVAILABLE - -#define SDL_PS2_SKIP_IOP_RESET() \ - void reset_IOP(); \ - void reset_IOP() {} - -#elif defined(__3DS__) -/* - On N3DS, SDL provides a main function that sets up the screens - and storage. - - If you provide this yourself, you may define SDL_MAIN_HANDLED -*/ -#define SDL_MAIN_AVAILABLE - -#endif -#endif /* SDL_MAIN_HANDLED */ - -#ifndef SDLMAIN_DECLSPEC -#define SDLMAIN_DECLSPEC -#endif - -/** - * \file SDL_main.h - * - * The application's main() function must be called with C linkage, - * and should be declared like this: - * \code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * \endcode - */ - -#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) -#define main SDL_main -#endif - -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The prototype for the application's main() function - */ -typedef int (*SDL_main_func)(int argc, char *argv[]); -extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); - - -/** - * Circumvent failure of SDL_Init() when not using SDL_main() as an entry - * point. - * - * This function is defined in SDL_main.h, along with the preprocessor rule to - * redefine main() as SDL_main(). Thus to ensure that your main() function - * will not be changed it is necessary to define SDL_MAIN_HANDLED before - * including SDL.h. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Init - */ -extern DECLSPEC void SDLCALL SDL_SetMainReady(void); - -#if defined(__WIN32__) || defined(__GDK__) - -/** - * Register a win32 window class for SDL's use. - * - * This can be called to set the application window class at startup. It is - * safe to call this multiple times, as long as every call is eventually - * paired with a call to SDL_UnregisterApp, but a second registration attempt - * while a previous registration is still active will be ignored, other than - * to increment a counter. - * - * Most applications do not need to, and should not, call this directly; SDL - * will call it when initializing the video subsystem. - * - * \param name the window class name, in UTF-8 encoding. If NULL, SDL - * currently uses "SDL_app" but this isn't guaranteed. - * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL - * currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of - * what is specified here. - * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL - * will use `GetModuleHandle(NULL)` instead. - * \returns 0 on success, -1 on error. SDL_GetError() may have details. - * - * \since This function is available since SDL 2.0.2. - */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); - -/** - * Deregister the win32 window class from an SDL_RegisterApp call. - * - * This can be called to undo the effects of SDL_RegisterApp. - * - * Most applications do not need to, and should not, call this directly; SDL - * will call it when deinitializing the video subsystem. - * - * It is safe to call this multiple times, as long as every call is eventually - * paired with a prior call to SDL_RegisterApp. The window class will only be - * deregistered when the registration counter in SDL_RegisterApp decrements to - * zero through calls to this function. - * - * \since This function is available since SDL 2.0.2. - */ -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); - -#endif /* defined(__WIN32__) || defined(__GDK__) */ - - -#ifdef __WINRT__ - -/** - * Initialize and launch an SDL/WinRT application. - * - * \param mainFunction the SDL app's C-style main(), an SDL_main_func - * \param reserved reserved for future use; should be NULL - * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve - * more information on the failure. - * - * \since This function is available since SDL 2.0.3. - */ -extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); - -#endif /* __WINRT__ */ - -#if defined(__IPHONEOS__) - -/** - * Initializes and launches an SDL application. - * - * \param argc The argc parameter from the application's main() function - * \param argv The argv parameter from the application's main() function - * \param mainFunction The SDL app's C-style main(), an SDL_main_func - * \return the return value from mainFunction - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); - -#endif /* __IPHONEOS__ */ - -#ifdef __GDK__ - -/** - * Initialize and launch an SDL GDK application. - * - * \param mainFunction the SDL app's C-style main(), an SDL_main_func - * \param reserved reserved for future use; should be NULL - * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve - * more information on the failure. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved); - -#endif /* __GDK__ */ - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_main_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_messagebox.h b/libs/hwcodec/externals/SDL/include/SDL_messagebox.h deleted file mode 100644 index 7896fd12..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_messagebox.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_messagebox_h_ -#define SDL_messagebox_h_ - -#include "SDL_stdinc.h" -#include "SDL_video.h" /* For SDL_Window */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * SDL_MessageBox flags. If supported will display warning icon, etc. - */ -typedef enum -{ - SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ - SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ - SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ - SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ - SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ -} SDL_MessageBoxFlags; - -/** - * Flags for SDL_MessageBoxButtonData. - */ -typedef enum -{ - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ -} SDL_MessageBoxButtonFlags; - -/** - * Individual button data. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ - int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ - const char * text; /**< The UTF-8 button text */ -} SDL_MessageBoxButtonData; - -/** - * RGB value used in a message box color scheme - */ -typedef struct -{ - Uint8 r, g, b; -} SDL_MessageBoxColor; - -typedef enum -{ - SDL_MESSAGEBOX_COLOR_BACKGROUND, - SDL_MESSAGEBOX_COLOR_TEXT, - SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, - SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, - SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, - SDL_MESSAGEBOX_COLOR_MAX -} SDL_MessageBoxColorType; - -/** - * A set of colors to use for message box dialogs - */ -typedef struct -{ - SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; -} SDL_MessageBoxColorScheme; - -/** - * MessageBox structure containing title, text, window, etc. - */ -typedef struct -{ - Uint32 flags; /**< ::SDL_MessageBoxFlags */ - SDL_Window *window; /**< Parent window, can be NULL */ - const char *title; /**< UTF-8 title */ - const char *message; /**< UTF-8 message text */ - - int numbuttons; - const SDL_MessageBoxButtonData *buttons; - - const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ -} SDL_MessageBoxData; - -/** - * Create a modal message box. - * - * If your needs aren't complex, it might be easier to use - * SDL_ShowSimpleMessageBox. - * - * This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or closes the - * messagebox. - * - * This function may be called at any time, even before SDL_Init(). This makes - * it useful for reporting errors like a failure to create a renderer or - * OpenGL context. - * - * On X11, SDL rolls its own dialog box with X11 primitives instead of a - * formal toolkit like GTK+ or Qt. - * - * Note that if SDL_Init() would fail because there isn't any available video - * target, this function is likely to fail for the same reasons. If this is a - * concern, check the return value from this function and fall back to writing - * to stderr if you can. - * - * \param messageboxdata the SDL_MessageBoxData structure with title, text and - * other options - * \param buttonid the pointer to which user id of hit button should be copied - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ShowSimpleMessageBox - */ -extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); - -/** - * Display a simple modal message box. - * - * If your needs aren't complex, this function is preferred over - * SDL_ShowMessageBox. - * - * `flags` may be any of the following: - * - * - `SDL_MESSAGEBOX_ERROR`: error dialog - * - `SDL_MESSAGEBOX_WARNING`: warning dialog - * - `SDL_MESSAGEBOX_INFORMATION`: informational dialog - * - * This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or closes the - * messagebox. - * - * This function may be called at any time, even before SDL_Init(). This makes - * it useful for reporting errors like a failure to create a renderer or - * OpenGL context. - * - * On X11, SDL rolls its own dialog box with X11 primitives instead of a - * formal toolkit like GTK+ or Qt. - * - * Note that if SDL_Init() would fail because there isn't any available video - * target, this function is likely to fail for the same reasons. If this is a - * concern, check the return value from this function and fall back to writing - * to stderr if you can. - * - * \param flags an SDL_MessageBoxFlags value - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window the parent window, or NULL for no parent - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ShowMessageBox - */ -extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_messagebox_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_metal.h b/libs/hwcodec/externals/SDL/include/SDL_metal.h deleted file mode 100644 index f36e3487..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_metal.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_metal.h - * - * Header file for functions to creating Metal layers and views on SDL windows. - */ - -#ifndef SDL_metal_h_ -#define SDL_metal_h_ - -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). - * - * \note This can be cast directly to an NSView or UIView. - */ -typedef void *SDL_MetalView; - -/** - * \name Metal support functions - */ -/* @{ */ - -/** - * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified - * window. - * - * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on - * its own. It is up to user code to do that. - * - * The returned handle can be casted directly to a NSView or UIView. To access - * the backing CAMetalLayer, call SDL_Metal_GetLayer(). - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_Metal_DestroyView - * \sa SDL_Metal_GetLayer - */ -extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); - -/** - * Destroy an existing SDL_MetalView object. - * - * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was - * called after SDL_CreateWindow. - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_Metal_CreateView - */ -extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); - -/** - * Get a pointer to the backing CAMetalLayer for the given view. - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_Metal_CreateView - */ -extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); - -/** - * Get the size of a window's underlying drawable in pixels (for use with - * setting viewport, scissor & etc). - * - * \param window SDL_Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL - * \param h Pointer to variable for storing the height in pixels, may be NULL - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_GetWindowSize - * \sa SDL_CreateWindow - */ -extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, - int *h); - -/* @} *//* Metal support functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_metal_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_misc.h b/libs/hwcodec/externals/SDL/include/SDL_misc.h deleted file mode 100644 index 13ed9c77..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_misc.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_misc.h - * - * \brief Include file for SDL API functions that don't fit elsewhere. - */ - -#ifndef SDL_misc_h_ -#define SDL_misc_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Open a URL/URI in the browser or other appropriate external application. - * - * Open a URL in a separate, system-provided application. How this works will - * vary wildly depending on the platform. This will likely launch what makes - * sense to handle a specific URL's protocol (a web browser for `http://`, - * etc), but it might also be able to launch file managers for directories and - * other things. - * - * What happens when you open a URL varies wildly as well: your game window - * may lose focus (and may or may not lose focus if your game was fullscreen - * or grabbing input at the time). On mobile devices, your app will likely - * move to the background or your process might be paused. Any given platform - * may or may not handle a given URL. - * - * If this is unimplemented (or simply unavailable) for a platform, this will - * fail with an error. A successful result does not mean the URL loaded, just - * that we launched _something_ to handle it (or at least believe we did). - * - * All this to say: this function can be useful, but you should definitely - * test it on every platform you target. - * - * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for - * local files, if supported. - * \returns 0 on success, or -1 on error; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_misc_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_mouse.h b/libs/hwcodec/externals/SDL/include/SDL_mouse.h deleted file mode 100644 index c5712efc..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_mouse.h +++ /dev/null @@ -1,465 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_mouse.h - * - * Include file for SDL mouse event handling. - */ - -#ifndef SDL_mouse_h_ -#define SDL_mouse_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ - -/** - * \brief Cursor types for SDL_CreateSystemCursor(). - */ -typedef enum -{ - SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ - SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ - SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ - SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ - SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ - SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ - SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ - SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ - SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ - SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ - SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ - SDL_SYSTEM_CURSOR_HAND, /**< Hand */ - SDL_NUM_SYSTEM_CURSORS -} SDL_SystemCursor; - -/** - * \brief Scroll direction types for the Scroll event - */ -typedef enum -{ - SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ - SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ -} SDL_MouseWheelDirection; - -/* Function prototypes */ - -/** - * Get the window which currently has mouse focus. - * - * \returns the window with mouse focus. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); - -/** - * Retrieve the current state of the mouse. - * - * The current button state is returned as a button bitmask, which can be - * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the - * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the - * mouse cursor position relative to the focus window. You can pass NULL for - * either `x` or `y`. - * - * \param x the x coordinate of the mouse cursor position relative to the - * focus window - * \param y the y coordinate of the mouse cursor position relative to the - * focus window - * \returns a 32-bit button bitmask of the current button state. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetGlobalMouseState - * \sa SDL_GetRelativeMouseState - * \sa SDL_PumpEvents - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); - -/** - * Get the current state of the mouse in relation to the desktop. - * - * This works similarly to SDL_GetMouseState(), but the coordinates will be - * reported relative to the top-left of the desktop. This can be useful if you - * need to track the mouse outside of a specific window and SDL_CaptureMouse() - * doesn't fit your needs. For example, it could be useful if you need to - * track the mouse while dragging a window, where coordinates relative to a - * window might not be in sync at all times. - * - * Note: SDL_GetMouseState() returns the mouse position as SDL understands it - * from the last pump of the event queue. This function, however, queries the - * OS for the current mouse position, and as such, might be a slightly less - * efficient function. Unless you know what you're doing and have a good - * reason to use this function, you probably want SDL_GetMouseState() instead. - * - * \param x filled in with the current X coord relative to the desktop; can be - * NULL - * \param y filled in with the current Y coord relative to the desktop; can be - * NULL - * \returns the current button state as a bitmask which can be tested using - * the SDL_BUTTON(X) macros. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_CaptureMouse - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); - -/** - * Retrieve the relative state of the mouse. - * - * The current button state is returned as a button bitmask, which can be - * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the - * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState() or since - * event initialization. You can pass NULL for either `x` or `y`. - * - * \param x a pointer filled with the last recorded x coordinate of the mouse - * \param y a pointer filled with the last recorded y coordinate of the mouse - * \returns a 32-bit button bitmask of the relative button state. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetMouseState - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); - -/** - * Move the mouse cursor to the given position within the window. - * - * This function generates a mouse motion event if relative mode is not - * enabled. If relative mode is enabled, you can force mouse events for the - * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint. - * - * Note that this function will appear to succeed, but not actually move the - * mouse when used over Microsoft Remote Desktop. - * - * \param window the window to move the mouse into, or NULL for the current - * mouse focus - * \param x the x coordinate within the window - * \param y the y coordinate within the window - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WarpMouseGlobal - */ -extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, - int x, int y); - -/** - * Move the mouse to the given position in global screen space. - * - * This function generates a mouse motion event. - * - * A failure of this function usually means that it is unsupported by a - * platform. - * - * Note that this function will appear to succeed, but not actually move the - * mouse when used over Microsoft Remote Desktop. - * - * \param x the x coordinate - * \param y the y coordinate - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_WarpMouseInWindow - */ -extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); - -/** - * Set relative mouse mode. - * - * While the mouse is in relative mode, the cursor is hidden, and the driver - * will try to report continuous motion in the current window. Only relative - * motion events will be delivered, the mouse position will not change. - * - * Note that this function will not be able to provide continuous relative - * motion when used over Microsoft Remote Desktop, instead motion is limited - * to the bounds of the screen. - * - * This function will flush any pending mouse motion. - * - * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * If relative mode is not supported, this returns -1. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRelativeMouseMode - */ -extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); - -/** - * Capture the mouse and to track input outside an SDL window. - * - * Capturing enables your app to obtain mouse events globally, instead of just - * within your window. Not all video targets support this function. When - * capturing is enabled, the current window will get all mouse events, but - * unlike relative mode, no change is made to the cursor and it is not - * restrained to your window. - * - * This function may also deny mouse input to other windows--both those in - * your application and others on the system--so you should use this function - * sparingly, and in small bursts. For example, you might want to track the - * mouse while the user is dragging something, until the user releases a mouse - * button. It is not recommended that you capture the mouse for long periods - * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowGrab(), depending - * on your goals. - * - * While captured, mouse events still report coordinates relative to the - * current (foreground) window, but those coordinates may be outside the - * bounds of the window (including negative values). Capturing is only allowed - * for the foreground window. If the window loses focus while capturing, the - * capture will be disabled automatically. - * - * While capturing is enabled, the current window will have the - * `SDL_WINDOW_MOUSE_CAPTURE` flag set. - * - * Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the - * mouse while the user is pressing a button; this is to try and make mouse - * behavior more consistent between platforms, and deal with the common case - * of a user dragging the mouse outside of the window. This means that if you - * are calling SDL_CaptureMouse() only to deal with this situation, you no - * longer have to (although it is safe to do so). If this causes problems for - * your app, you can disable auto capture by setting the - * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero. - * - * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable. - * \returns 0 on success or -1 if not supported; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_GetGlobalMouseState - */ -extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); - -/** - * Create a cursor using the specified bitmap data and mask (in MSB format). - * - * `mask` has to be in MSB (Most Significant Bit) format. - * - * The cursor width (`w`) must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * - * - data=0, mask=1: white - * - data=1, mask=1: black - * - data=0, mask=0: transparent - * - data=1, mask=0: inverted color if possible, black if not. - * - * Cursors created with this function must be freed with SDL_FreeCursor(). - * - * If you want to have a color cursor, or create your cursor from an - * SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can - * hide the cursor and draw your own as part of your game's rendering, but it - * will be bound to the framerate. - * - * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which - * provides twelve readily available system cursors to pick from. - * - * \param data the color value for each pixel of the cursor - * \param mask the mask value for each pixel of the cursor - * \param w the width of the cursor - * \param h the height of the cursor - * \param hot_x the X-axis location of the upper left corner of the cursor - * relative to the actual mouse position - * \param hot_y the Y-axis location of the upper left corner of the cursor - * relative to the actual mouse position - * \returns a new cursor with the specified parameters on success or NULL on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeCursor - * \sa SDL_SetCursor - * \sa SDL_ShowCursor - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, - const Uint8 * mask, - int w, int h, int hot_x, - int hot_y); - -/** - * Create a color cursor. - * - * \param surface an SDL_Surface structure representing the cursor image - * \param hot_x the x position of the cursor hot spot - * \param hot_y the y position of the cursor hot spot - * \returns the new cursor on success or NULL on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateCursor - * \sa SDL_FreeCursor - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, - int hot_x, - int hot_y); - -/** - * Create a system cursor. - * - * \param id an SDL_SystemCursor enum value - * \returns a cursor on success or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeCursor - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); - -/** - * Set the active cursor. - * - * This function sets the currently active cursor to the specified one. If the - * cursor is currently visible, the change will be immediately represented on - * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if - * this is desired for any reason. - * - * \param cursor a cursor to make active - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateCursor - * \sa SDL_GetCursor - * \sa SDL_ShowCursor - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); - -/** - * Get the active cursor. - * - * This function returns a pointer to the current cursor which is owned by the - * library. It is not necessary to free the cursor with SDL_FreeCursor(). - * - * \returns the active cursor or NULL if there is no mouse. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetCursor - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); - -/** - * Get the default cursor. - * - * \returns the default cursor on success or NULL on failure. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSystemCursor - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); - -/** - * Free a previously-created cursor. - * - * Use this function to free cursor resources created with SDL_CreateCursor(), - * SDL_CreateColorCursor() or SDL_CreateSystemCursor(). - * - * \param cursor the cursor to free - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateColorCursor - * \sa SDL_CreateCursor - * \sa SDL_CreateSystemCursor - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); - -/** - * Toggle whether or not the cursor is shown. - * - * The cursor starts off displayed but can be turned off. Passing `SDL_ENABLE` - * displays the cursor and passing `SDL_DISABLE` hides it. - * - * The current state of the mouse cursor can be queried by passing - * `SDL_QUERY`; either `SDL_DISABLE` or `SDL_ENABLE` will be returned. - * - * \param toggle `SDL_ENABLE` to show the cursor, `SDL_DISABLE` to hide it, - * `SDL_QUERY` to query the current state without changing it. - * \returns `SDL_ENABLE` if the cursor is shown, or `SDL_DISABLE` if the - * cursor is hidden, or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateCursor - * \sa SDL_SetCursor - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/** - * Used as a mask when testing buttons in buttonstate. - * - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_X1 4 -#define SDL_BUTTON_X2 5 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mouse_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_mutex.h b/libs/hwcodec/externals/SDL/include/SDL_mutex.h deleted file mode 100644 index 54b6a53a..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_mutex.h +++ /dev/null @@ -1,471 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_mutex_h_ -#define SDL_mutex_h_ - -/** - * \file SDL_mutex.h - * - * Functions to provide thread synchronization primitives. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Synchronization functions which can time out return this value - * if they time out. - */ -#define SDL_MUTEX_TIMEDOUT 1 - -/** - * This is the timeout value which corresponds to never time out. - */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/** - * \name Mutex functions - */ -/* @{ */ - -/* The SDL mutex structure, defined in SDL_sysmutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/** - * Create a new mutex. - * - * All newly-created mutexes begin in the _unlocked_ state. - * - * Calls to SDL_LockMutex() will not return while the mutex is locked by - * another thread. See SDL_TryLockMutex() to attempt to lock without blocking. - * - * SDL mutexes are reentrant. - * - * \returns the initialized and unlocked mutex or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DestroyMutex - * \sa SDL_LockMutex - * \sa SDL_TryLockMutex - * \sa SDL_UnlockMutex - */ -extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); - -/** - * Lock the mutex. - * - * This will block until the mutex is available, which is to say it is in the - * unlocked state and the OS has chosen the caller as the next thread to lock - * it. Of all threads waiting to lock the mutex, only one may do so at a time. - * - * It is legal for the owning thread to lock an already-locked mutex. It must - * unlock it the same number of times before it is actually made available for - * other threads in the system (this is known as a "recursive mutex"). - * - * \param mutex the mutex to lock - * \return 0, or -1 on error. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); -#define SDL_mutexP(m) SDL_LockMutex(m) - -/** - * Try to lock a mutex without blocking. - * - * This works just like SDL_LockMutex(), but if the mutex is not available, - * this function returns `SDL_MUTEX_TIMEOUT` immediately. - * - * This technique is useful if you need exclusive access to a resource but - * don't want to wait for it, and will return to it to try again later. - * - * \param mutex the mutex to try to lock - * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateMutex - * \sa SDL_DestroyMutex - * \sa SDL_LockMutex - * \sa SDL_UnlockMutex - */ -extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); - -/** - * Unlock the mutex. - * - * It is legal for the owning thread to lock an already-locked mutex. It must - * unlock it the same number of times before it is actually made available for - * other threads in the system (this is known as a "recursive mutex"). - * - * It is an error to unlock a mutex that has not been locked by the current - * thread, and doing so results in undefined behavior. - * - * It is also an error to unlock a mutex that isn't locked at all. - * - * \param mutex the mutex to unlock. - * \returns 0, or -1 on error. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); -#define SDL_mutexV(m) SDL_UnlockMutex(m) - -/** - * Destroy a mutex created with SDL_CreateMutex(). - * - * This function must be called on any mutex that is no longer needed. Failure - * to destroy a mutex will result in a system memory or resource leak. While - * it is safe to destroy a mutex that is _unlocked_, it is not safe to attempt - * to destroy a locked mutex, and may result in undefined behavior depending - * on the platform. - * - * \param mutex the mutex to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateMutex - * \sa SDL_LockMutex - * \sa SDL_TryLockMutex - * \sa SDL_UnlockMutex - */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); - -/* @} *//* Mutex functions */ - - -/** - * \name Semaphore functions - */ -/* @{ */ - -/* The SDL semaphore structure, defined in SDL_syssem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/** - * Create a semaphore. - * - * This function creates a new semaphore and initializes it with the value - * `initial_value`. Each wait operation on the semaphore will atomically - * decrement the semaphore value and potentially block if the semaphore value - * is 0. Each post operation will atomically increment the semaphore value and - * wake waiting threads and allow them to retry the wait operation. - * - * \param initial_value the starting value of the semaphore - * \returns a new semaphore or NULL on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DestroySemaphore - * \sa SDL_SemPost - * \sa SDL_SemTryWait - * \sa SDL_SemValue - * \sa SDL_SemWait - * \sa SDL_SemWaitTimeout - */ -extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/** - * Destroy a semaphore. - * - * It is not safe to destroy a semaphore if there are threads currently - * waiting on it. - * - * \param sem the semaphore to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - * \sa SDL_SemPost - * \sa SDL_SemTryWait - * \sa SDL_SemValue - * \sa SDL_SemWait - * \sa SDL_SemWaitTimeout - */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); - -/** - * Wait until a semaphore has a positive value and then decrements it. - * - * This function suspends the calling thread until either the semaphore - * pointed to by `sem` has a positive value or the call is interrupted by a - * signal or error. If the call is successful it will atomically decrement the - * semaphore value. - * - * This function is the equivalent of calling SDL_SemWaitTimeout() with a time - * length of `SDL_MUTEX_MAXWAIT`. - * - * \param sem the semaphore wait on - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - * \sa SDL_DestroySemaphore - * \sa SDL_SemPost - * \sa SDL_SemTryWait - * \sa SDL_SemValue - * \sa SDL_SemWait - * \sa SDL_SemWaitTimeout - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); - -/** - * See if a semaphore has a positive value and decrement it if it does. - * - * This function checks to see if the semaphore pointed to by `sem` has a - * positive value and atomically decrements the semaphore value if it does. If - * the semaphore doesn't have a positive value, the function immediately - * returns SDL_MUTEX_TIMEDOUT. - * - * \param sem the semaphore to wait on - * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would - * block, or a negative error code on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - * \sa SDL_DestroySemaphore - * \sa SDL_SemPost - * \sa SDL_SemValue - * \sa SDL_SemWait - * \sa SDL_SemWaitTimeout - */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); - -/** - * Wait until a semaphore has a positive value and then decrements it. - * - * This function suspends the calling thread until either the semaphore - * pointed to by `sem` has a positive value, the call is interrupted by a - * signal or error, or the specified time has elapsed. If the call is - * successful it will atomically decrement the semaphore value. - * - * \param sem the semaphore to wait on - * \param ms the length of the timeout, in milliseconds - * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not - * succeed in the allotted time, or a negative error code on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - * \sa SDL_DestroySemaphore - * \sa SDL_SemPost - * \sa SDL_SemTryWait - * \sa SDL_SemValue - * \sa SDL_SemWait - */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); - -/** - * Atomically increment a semaphore's value and wake waiting threads. - * - * \param sem the semaphore to increment - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - * \sa SDL_DestroySemaphore - * \sa SDL_SemTryWait - * \sa SDL_SemValue - * \sa SDL_SemWait - * \sa SDL_SemWaitTimeout - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); - -/** - * Get the current value of a semaphore. - * - * \param sem the semaphore to query - * \returns the current value of the semaphore. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSemaphore - */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); - -/* @} *//* Semaphore functions */ - - -/** - * \name Condition variable functions - */ -/* @{ */ - -/* The SDL condition variable structure, defined in SDL_syscond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; - -/** - * Create a condition variable. - * - * \returns a new condition variable or NULL on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondBroadcast - * \sa SDL_CondSignal - * \sa SDL_CondWait - * \sa SDL_CondWaitTimeout - * \sa SDL_DestroyCond - */ -extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); - -/** - * Destroy a condition variable. - * - * \param cond the condition variable to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondBroadcast - * \sa SDL_CondSignal - * \sa SDL_CondWait - * \sa SDL_CondWaitTimeout - * \sa SDL_CreateCond - */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); - -/** - * Restart one of the threads that are waiting on the condition variable. - * - * \param cond the condition variable to signal - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondBroadcast - * \sa SDL_CondWait - * \sa SDL_CondWaitTimeout - * \sa SDL_CreateCond - * \sa SDL_DestroyCond - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); - -/** - * Restart all threads that are waiting on the condition variable. - * - * \param cond the condition variable to signal - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondSignal - * \sa SDL_CondWait - * \sa SDL_CondWaitTimeout - * \sa SDL_CreateCond - * \sa SDL_DestroyCond - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); - -/** - * Wait until a condition variable is signaled. - * - * This function unlocks the specified `mutex` and waits for another thread to - * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable - * `cond`. Once the condition variable is signaled, the mutex is re-locked and - * the function returns. - * - * The mutex must be locked before calling this function. - * - * This function is the equivalent of calling SDL_CondWaitTimeout() with a - * time length of `SDL_MUTEX_MAXWAIT`. - * - * \param cond the condition variable to wait on - * \param mutex the mutex used to coordinate thread access - * \returns 0 when it is signaled or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondBroadcast - * \sa SDL_CondSignal - * \sa SDL_CondWaitTimeout - * \sa SDL_CreateCond - * \sa SDL_DestroyCond - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); - -/** - * Wait until a condition variable is signaled or a certain time has passed. - * - * This function unlocks the specified `mutex` and waits for another thread to - * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable - * `cond`, or for the specified time to elapse. Once the condition variable is - * signaled or the time elapsed, the mutex is re-locked and the function - * returns. - * - * The mutex must be locked before calling this function. - * - * \param cond the condition variable to wait on - * \param mutex the mutex used to coordinate thread access - * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT` - * to wait indefinitely - * \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if - * the condition is not signaled in the allotted time, or a negative - * error code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CondBroadcast - * \sa SDL_CondSignal - * \sa SDL_CondWait - * \sa SDL_CreateCond - * \sa SDL_DestroyCond - */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); - -/* @} *//* Condition variable functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_mutex_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_name.h b/libs/hwcodec/externals/SDL/include/SDL_name.h deleted file mode 100644 index 5c3e07ab..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_name.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDLname_h_ -#define SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* SDLname_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengl.h b/libs/hwcodec/externals/SDL/include/SDL_opengl.h deleted file mode 100644 index 0ba89127..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengl.h +++ /dev/null @@ -1,2132 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengl.h - * - * This is a simple file to encapsulate the OpenGL API headers. - */ - -/** - * \def NO_SDL_GLEXT - * - * Define this if you have your own version of glext.h and want to disable the - * version included in SDL_opengl.h. - */ - -#ifndef SDL_opengl_h_ -#define SDL_opengl_h_ - -#include "SDL_config.h" - -#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ - -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef __gl_h_ -#define __gl_h_ - -#if defined(USE_MGL_NAMESPACE) -#include "gl_mangle.h" -#endif - - -/********************************************************************** - * Begin system-specific stuff. - */ - -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) -#define __WIN32__ -#endif - -#if defined(__WIN32__) && !defined(__CYGWIN__) -# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# endif /* _STATIC_MESA support */ -# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ -# define GLAPIENTRY -# else -# define GLAPIENTRY __stdcall -# endif -#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ -# define GLAPI extern -# define GLAPIENTRY __stdcall -#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ -# define GLAPI extern -# define GLAPIENTRY _System -# define APIENTRY _System -# if defined(__GNUC__) && !defined(_System) -# define _System -# endif -#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define GLAPI __attribute__((visibility("default"))) -# define GLAPIENTRY -#endif /* WIN32 && !CYGWIN */ - -/* - * WINDOWS: Include windows.h here to define APIENTRY. - * It is also useful when applications include this file by - * including only glut.h, since glut.h depends on windows.h. - * Applications needing to include windows.h with parms other - * than "WIN32_LEAN_AND_MEAN" may include windows.h before - * glut.h or gl.h. - */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include -#endif - -#ifndef GLAPI -#define GLAPI extern -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef APIENTRY -#define APIENTRY GLAPIENTRY -#endif - -/* "P" suffix to be used for a pointer to a function */ -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifndef GLAPIENTRYP -#define GLAPIENTRYP GLAPIENTRY * -#endif - -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export on -#endif - -/* - * End system-specific stuff. - **********************************************************************/ - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 - - -/* - * Datatypes - */ -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; /* 1-byte signed */ -typedef short GLshort; /* 2-byte signed */ -typedef int GLint; /* 4-byte signed */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -typedef double GLclampd; /* double precision float in [0,1] */ - - - -/* - * Constants - */ - -/* Boolean values */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* Data types */ -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A - -/* Primitives */ -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON 0x0009 - -/* Vertex Arrays */ -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D - -/* Matrix Mode */ -#define GL_MATRIX_MODE 0x0BA0 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 - -/* Points */ -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_POINT_SIZE_RANGE 0x0B12 - -/* Lines */ -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_WIDTH_RANGE 0x0B22 - -/* Polygons */ -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 - -/* Display Lists */ -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_LIST_MODE 0x0B30 - -/* Depth buffer */ -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_COMPONENT 0x1902 - -/* Lighting */ -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_SHININESS 0x1601 -#define GL_EMISSION 0x1600 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_SHADE_MODEL 0x0B54 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_NORMALIZE 0x0BA1 - -/* User clipping planes */ -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 - -/* Accumulation buffer */ -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_ACCUM 0x0100 -#define GL_ADD 0x0104 -#define GL_LOAD 0x0101 -#define GL_MULT 0x0103 -#define GL_RETURN 0x0102 - -/* Alpha testing */ -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_ALPHA_TEST_FUNC 0x0BC1 - -/* Blending */ -#define GL_BLEND 0x0BE2 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND_DST 0x0BE0 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 - -/* Render Mode */ -#define GL_FEEDBACK 0x1C01 -#define GL_RENDER 0x1C00 -#define GL_SELECT 0x1C02 - -/* Feedback */ -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 - -/* Selection */ -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 - -/* Fog */ -#define GL_FOG 0x0B60 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_COLOR 0x0B66 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_LINEAR 0x2601 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 - -/* Logic Ops */ -#define GL_LOGIC_OP 0x0BF1 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_CLEAR 0x1500 -#define GL_SET 0x150F -#define GL_COPY 0x1503 -#define GL_COPY_INVERTED 0x150C -#define GL_NOOP 0x1505 -#define GL_INVERT 0x150A -#define GL_AND 0x1501 -#define GL_NAND 0x150E -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_XOR 0x1506 -#define GL_EQUIV 0x1509 -#define GL_AND_REVERSE 0x1502 -#define GL_AND_INVERTED 0x1504 -#define GL_OR_REVERSE 0x150B -#define GL_OR_INVERTED 0x150D - -/* Stencil */ -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_INDEX 0x1901 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 - -/* Buffers, Pixel Drawing/Reading */ -#define GL_NONE 0 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -/*GL_FRONT 0x0404 */ -/*GL_BACK 0x0405 */ -/*GL_FRONT_AND_BACK 0x0408 */ -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_COLOR_INDEX 0x1900 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_ALPHA_BITS 0x0D55 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_INDEX_BITS 0x0D51 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_READ_BUFFER 0x0C02 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_BITMAP 0x1A00 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_DITHER 0x0BD0 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 - -/* Implementation limits */ -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B - -/* Gets */ -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_MODE 0x0C30 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_RENDER_MODE 0x0C40 -#define GL_RGBA_MODE 0x0C31 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_VIEWPORT 0x0BA2 - -/* Evaluators */ -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 - -/* Hints */ -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 - -/* Scissor box */ -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 - -/* Pixel Mode / Transfer */ -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 - -/* Texture mapping */ -#define GL_TEXTURE_ENV 0x2300 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_LINEAR 0x2400 -#define GL_EYE_PLANE 0x2502 -#define GL_SPHERE_MAP 0x2402 -#define GL_DECAL 0x2101 -#define GL_MODULATE 0x2100 -#define GL_NEAREST 0x2600 -#define GL_REPEAT 0x2901 -#define GL_CLAMP 0x2900 -#define GL_S 0x2000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 - -/* Utility */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* Errors */ -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 - -/* glPush/PopAttrib bits */ -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000FFFFF - - -/* OpenGL 1.1 */ -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - - - -/* - * Miscellaneous - */ - -GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); - -GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glClear( GLbitfield mask ); - -GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); - -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); - -GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); - -GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); - -GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); - -GLAPI void GLAPIENTRY glCullFace( GLenum mode ); - -GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); - -GLAPI void GLAPIENTRY glPointSize( GLfloat size ); - -GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); - -GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); - -GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); - -GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); - -GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); - -GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); - -GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); - -GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); - -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); - -GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); - -GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); - -GLAPI void GLAPIENTRY glEnable( GLenum cap ); - -GLAPI void GLAPIENTRY glDisable( GLenum cap ); - -GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); - - -GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ - -GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ - - -GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); - -GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); - -GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); - -GLAPI void GLAPIENTRY glPopAttrib( void ); - - -GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ - -GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ - - -GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); - -GLAPI GLenum GLAPIENTRY glGetError( void ); - -GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); - -GLAPI void GLAPIENTRY glFinish( void ); - -GLAPI void GLAPIENTRY glFlush( void ); - -GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - - -/* - * Depth Buffer - */ - -GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); - -GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); - -GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); - -GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); - - -/* - * Accumulation Buffer - */ - -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); - -GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - - -/* - * Transformation - */ - -GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); - -GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble near_val, GLdouble far_val ); - -GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, - GLsizei width, GLsizei height ); - -GLAPI void GLAPIENTRY glPushMatrix( void ); - -GLAPI void GLAPIENTRY glPopMatrix( void ); - -GLAPI void GLAPIENTRY glLoadIdentity( void ); - -GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); -GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); - -GLAPI void GLAPIENTRY glRotated( GLdouble angle, - GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRotatef( GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); - -GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - - -/* - * Display Lists - */ - -GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); - -GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); - -GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); - -GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); - -GLAPI void GLAPIENTRY glEndList( void ); - -GLAPI void GLAPIENTRY glCallList( GLuint list ); - -GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, - const GLvoid *lists ); - -GLAPI void GLAPIENTRY glListBase( GLuint base ); - - -/* - * Drawing Functions - */ - -GLAPI void GLAPIENTRY glBegin( GLenum mode ); - -GLAPI void GLAPIENTRY glEnd( void ); - - -GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); -GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); -GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); -GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); -GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); -GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); - -GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); -GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glIndexd( GLdouble c ); -GLAPI void GLAPIENTRY glIndexf( GLfloat c ); -GLAPI void GLAPIENTRY glIndexi( GLint c ); -GLAPI void GLAPIENTRY glIndexs( GLshort c ); -GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); -GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); -GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); -GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); -GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ - -GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); -GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); -GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); -GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); -GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); -GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); -GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); -GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); - -GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, - GLbyte blue, GLbyte alpha ); -GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, - GLdouble blue, GLdouble alpha ); -GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); -GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, - GLint blue, GLint alpha ); -GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, - GLshort blue, GLshort alpha ); -GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha ); -GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, - GLuint blue, GLuint alpha ); -GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, - GLushort blue, GLushort alpha ); - - -GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); - -GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); -GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); -GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); -GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); -GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); -GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); - - -GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); -GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); -GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); -GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); - -GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); -GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); -GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); -GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); -GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); -GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); -GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); -GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); -GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); -GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); -GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); -GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); - -GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); - -GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); -GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); - -GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); - -GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); -GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); -GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); -GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); - - -GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); -GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); -GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); -GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); - - -GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); -GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); -GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); -GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - - -/* - * Vertex Arrays (1.1) - */ - -GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElement( GLint i ); - -GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); - -GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, - const GLvoid *pointer ); - -/* - * Lighting - */ - -GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); - -GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, - GLfloat *params ); -GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - -/* - * Raster functions - */ - -GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); - -GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, - const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, - const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, - const GLushort *values ); - -GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); -GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); -GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); - -GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, - GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); - -GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - GLvoid *pixels ); - -GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type ); - -/* - * Stenciling - */ - -GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); - -GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); - -GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); - -GLAPI void GLAPIENTRY glClearStencil( GLint s ); - - - -/* - * Texture mapping - */ - -GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); -GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); -GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); -GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, - GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, - GLenum pname, GLint *params ); - -GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, - GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, - GLenum pname, GLint *params ); - - -GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, - GLenum format, GLenum type, - GLvoid *pixels ); - - -/* 1.1 functions */ - -GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); - - -GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, - GLint xoffset, - GLsizei width, GLenum format, - GLenum type, const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); - - -GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); - - -GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -/* - * Evaluators - */ - -GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, - GLint stride, - GLint order, const GLdouble *points ); -GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, - GLint stride, - GLint order, const GLfloat *points ); - -GLAPI void GLAPIENTRY glMap2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); -GLAPI void GLAPIENTRY glMap2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); -GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); -GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); - -GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); -GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); - -GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); -GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); - -GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); -GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); - -GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); - -GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); -GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); - -GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); - -GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); - -GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); - -GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - - -/* - * Fog - */ - -GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); - -GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); - -GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); - -GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - - -/* - * Selection and Feedback - */ - -GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); - -GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); - -GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); - -GLAPI void GLAPIENTRY glInitNames( void ); - -GLAPI void GLAPIENTRY glLoadName( GLuint name ); - -GLAPI void GLAPIENTRY glPushName( GLuint name ); - -GLAPI void GLAPIENTRY glPopName( void ); - - - -/* - * OpenGL 1.2 - */ - -#define GL_RESCALE_NORMAL 0x803A -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - - -/* - * GL_ARB_imaging - */ - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ); - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ); - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ); - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ); - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ); - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ); - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ); - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height); - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ); - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ); - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ); - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); - - - - -/* - * OpenGL 1.3 - */ - -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - -GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); - -GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); - -GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); - -GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); - -GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); - -GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); - -GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); - -GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); - - -GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); - -GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); - -GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); - - -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); - - - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - - - -/* - * Define this token if you want "old-style" header file behaviour (extensions - * defined in gl.h). Otherwise, extensions will be included from glext.h. - */ -#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) -#include "SDL_opengl_glext.h" -#endif /* GL_GLEXT_LEGACY */ - - - -/********************************************************************** - * Begin system-specific stuff - */ -#if defined(PRAGMA_EXPORT_SUPPORTED) -#pragma export off -#endif - -/* - * End system-specific stuff - **********************************************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_h_ */ - -#endif /* !__IPHONEOS__ */ - -#endif /* SDL_opengl_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengl_glext.h b/libs/hwcodec/externals/SDL/include/SDL_opengl_glext.h deleted file mode 100644 index 8527e174..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengl_glext.h +++ /dev/null @@ -1,13209 +0,0 @@ -#ifndef __gl_glext_h_ -#define __gl_glext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: MIT -** -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** https://github.com/KhronosGroup/OpenGL-Registry -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -#define GL_GLEXT_VERSION 20220530 - -/*#include */ -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * The master copy of khrplatform.h is maintained in the Khronos EGL - * Registry repository at https://github.com/KhronosGroup/EGL-Registry - * The last semantic modification to khrplatform.h was at commit ID: - * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by filing pull requests or issues on - * the EGL Registry repository linked above. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_APIENTRY - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) -# define KHRONOS_STATIC 1 -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(KHRONOS_STATIC) - /* If the preprocessor constant KHRONOS_STATIC is defined, make the - * header compatible with static linking. */ -# define KHRONOS_APICALL -#elif defined(_WIN32) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#elif defined(__ANDROID__) -# define KHRONOS_APICALL __attribute__((visibility("default"))) -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIENTRY - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 -/* - * To support platform where unsigned long cannot be used interchangeably with - * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. - * Ideally, we could just use (u)intptr_t everywhere, but this could result in - * ABI breakage if khronos_uintptr_t is changed from unsigned long to - * unsigned long long or similar (this results in different C++ name mangling). - * To avoid changes for existing platforms, we restrict usage of intptr_t to - * platforms where the size of a pointer is larger than the size of long. - */ -#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) -#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ -#define KHRONOS_USE_INTPTR_T -#endif -#endif - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef KHRONOS_USE_INTPTR_T -typedef intptr_t khronos_intptr_t; -typedef uintptr_t khronos_uintptr_t; -#elif defined(_WIN64) -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -#endif - -#if defined(_WIN64) -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - -/* Generated C header for: - * API: gl - * Profile: compatibility - * Versions considered: .* - * Versions emitted: 1\.[2-9]|[234]\.[0-9] - * Default extensions included: gl - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_RESCALE_NORMAL 0x803A -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_VERSION_1_2 */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum texture); -GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); -GLAPI void APIENTRY glClientActiveTexture (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); -#endif -#endif /* GL_VERSION_1_3 */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_EQUATION 0x8009 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_FUNC_SUBTRACT 0x800A -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); -GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFogCoordf (GLfloat coord); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); -GLAPI void APIENTRY glFogCoordd (GLdouble coord); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2iv (const GLint *v); -GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); -GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3iv (const GLint *v); -GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); -GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glBlendEquation (GLenum mode); -#endif -#endif /* GL_VERSION_1_4 */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -typedef khronos_ssize_t GLsizeiptr; -typedef khronos_intptr_t GLintptr; -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_FOG_COORD_SRC 0x8450 -#define GL_FOG_COORD 0x8451 -#define GL_CURRENT_FOG_COORD 0x8453 -#define GL_FOG_COORD_ARRAY_TYPE 0x8454 -#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORD_ARRAY_POINTER 0x8456 -#define GL_FOG_COORD_ARRAY 0x8457 -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D -#define GL_SRC0_RGB 0x8580 -#define GL_SRC1_RGB 0x8581 -#define GL_SRC2_RGB 0x8582 -#define GL_SRC0_ALPHA 0x8588 -#define GL_SRC2_ALPHA 0x858A -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQuery (GLuint id); -GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQuery (GLenum target); -GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); -GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_VERSION_1_5 */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -typedef char GLchar; -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_TEXTURE_COORDS 0x8871 -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GLAPI void APIENTRY glCompileShader (GLuint shader); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum type); -GLAPI void APIENTRY glDeleteProgram (GLuint program); -GLAPI void APIENTRY glDeleteShader (GLuint shader); -GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgram (GLuint program); -GLAPI GLboolean APIENTRY glIsShader (GLuint shader); -GLAPI void APIENTRY glLinkProgram (GLuint program); -GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GLAPI void APIENTRY glUseProgram (GLuint program); -GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glValidateProgram (GLuint program); -GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -#endif -#endif /* GL_VERSION_2_0 */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_VERSION_2_1 */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -typedef khronos_uint16_t GLhalf; -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_COLOR_ATTACHMENT16 0x8CF0 -#define GL_COLOR_ATTACHMENT17 0x8CF1 -#define GL_COLOR_ATTACHMENT18 0x8CF2 -#define GL_COLOR_ATTACHMENT19 0x8CF3 -#define GL_COLOR_ATTACHMENT20 0x8CF4 -#define GL_COLOR_ATTACHMENT21 0x8CF5 -#define GL_COLOR_ATTACHMENT22 0x8CF6 -#define GL_COLOR_ATTACHMENT23 0x8CF7 -#define GL_COLOR_ATTACHMENT24 0x8CF8 -#define GL_COLOR_ATTACHMENT25 0x8CF9 -#define GL_COLOR_ATTACHMENT26 0x8CFA -#define GL_COLOR_ATTACHMENT27 0x8CFB -#define GL_COLOR_ATTACHMENT28 0x8CFC -#define GL_COLOR_ATTACHMENT29 0x8CFD -#define GL_COLOR_ATTACHMENT30 0x8CFE -#define GL_COLOR_ATTACHMENT31 0x8CFF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_ALPHA_INTEGER 0x8D97 -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); -GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); -GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); -GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmap (GLenum target); -GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glBindVertexArray (GLuint array); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); -#endif -#endif /* GL_VERSION_3_0 */ - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFFu -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); -GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif -#endif /* GL_VERSION_3_1 */ - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -typedef struct __GLsync *GLsync; -typedef khronos_uint64_t GLuint64; -typedef khronos_int64_t GLint64; -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); -typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -GLAPI void APIENTRY glProvokingVertex (GLenum mode); -GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); -GLAPI GLboolean APIENTRY glIsSync (GLsync sync); -GLAPI void APIENTRY glDeleteSync (GLsync sync); -GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); -GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); -#endif -#endif /* GL_VERSION_3_2 */ - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_RGB10_A2UI 0x906F -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 -#define GL_INT_2_10_10_10_REV 0x8D9F -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); -GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); -GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); -GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); -GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); -GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); -GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); -GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); -GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); -GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); -GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); -GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); -#endif -#endif /* GL_VERSION_3_3 */ - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MAX_VERTEX_STREAMS 0x8E71 -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); -typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); -typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShading (GLfloat value); -GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); -GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); -GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); -GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); -GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); -GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); -GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); -GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); -GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedback (void); -GLAPI void APIENTRY glResumeTransformFeedback (void); -GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); -GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); -GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); -GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); -GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_VERSION_4_0 */ - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_ALL_SHADER_BITS 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GLAPI void APIENTRY glClearDepthf (GLfloat d); -GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); -GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); -GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); -GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); -GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); -GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); -GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); -#endif -#endif /* GL_VERSION_4_1 */ - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 -#define GL_COPY_READ_BUFFER_BINDING 0x8F36 -#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); -GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); -GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); -GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -#endif -#endif /* GL_VERSION_4_2 */ - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 -#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F -#define GL_IS_PER_PATCH 0x92E7 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF -#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_VERTEX_BINDING_BUFFER 0x8F4F -#define GL_DISPLAY_LIST 0x82E7 -typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); -typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); -GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); -GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); -GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); -GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); -GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); -GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); -GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); -GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GLAPI void APIENTRY glPopDebugGroup (void); -GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_VERSION_4_3 */ - -#ifndef GL_VERSION_4_4 -#define GL_VERSION_4_4 1 -#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_TEXTURE_BUFFER_BINDING 0x8C2A -#define GL_MAP_PERSISTENT_BIT 0x0040 -#define GL_MAP_COHERENT_BIT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_CLEAR_TEXTURE 0x9365 -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); -typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); -GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); -GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); -GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -#endif -#endif /* GL_VERSION_4_4 */ - -#ifndef GL_VERSION_4_5 -#define GL_VERSION_4_5 1 -#define GL_CONTEXT_LOST 0x0507 -#define GL_NEGATIVE_ONE_TO_ONE 0x935E -#define GL_ZERO_TO_ONE 0x935F -#define GL_CLIP_ORIGIN 0x935C -#define GL_CLIP_DEPTH_MODE 0x935D -#define GL_QUERY_WAIT_INVERTED 0x8E17 -#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 -#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 -#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A -#define GL_MAX_CULL_DISTANCES 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA -#define GL_TEXTURE_TARGET 0x1006 -#define GL_QUERY_TARGET 0x82EA -#define GL_GUILTY_CONTEXT_RESET 0x8253 -#define GL_INNOCENT_CONTEXT_RESET 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET 0x8252 -#define GL_NO_RESET_NOTIFICATION 0x8261 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_MINMAX 0x802E -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); -typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); -typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src); -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); -typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers); -typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); -typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth); -GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param); -GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); -GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers); -GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access); -GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer); -GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param); -GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf); -GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src); -GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); -GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures); -GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param); -GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture); -GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture); -GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays); -GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer); -GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); -GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers); -GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids); -GLAPI void APIENTRY glGetQueryBufferObjecti64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI void APIENTRY glGetQueryBufferObjectiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI void APIENTRY glGetQueryBufferObjectui64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI void APIENTRY glGetQueryBufferObjectuiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers); -GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); -GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void); -GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glTextureBarrier (void); -#endif -#endif /* GL_VERSION_4_5 */ - -#ifndef GL_VERSION_4_6 -#define GL_VERSION_4_6 1 -#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 -#define GL_SPIR_V_BINARY 0x9552 -#define GL_PARAMETER_BUFFER 0x80EE -#define GL_PARAMETER_BUFFER_BINDING 0x80EF -#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 -#define GL_VERTICES_SUBMITTED 0x82EE -#define GL_PRIMITIVES_SUBMITTED 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 -#define GL_POLYGON_OFFSET_CLAMP 0x8E1B -#define GL_SPIR_V_EXTENSIONS 0x9553 -#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 -#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF -#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED -typedef void (APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpecializeShader (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); -GLAPI void APIENTRY glMultiDrawArraysIndirectCount (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectCount (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI void APIENTRY glPolygonOffsetClamp (GLfloat factor, GLfloat units, GLfloat clamp); -#endif -#endif /* GL_VERSION_4_6 */ - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -#endif /* GL_ARB_ES2_compatibility */ - -#ifndef GL_ARB_ES3_1_compatibility -#define GL_ARB_ES3_1_compatibility 1 -#endif /* GL_ARB_ES3_1_compatibility */ - -#ifndef GL_ARB_ES3_2_compatibility -#define GL_ARB_ES3_2_compatibility 1 -#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE -#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 -#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 -typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveBoundingBoxARB (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#endif -#endif /* GL_ARB_ES3_2_compatibility */ - -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -#endif /* GL_ARB_ES3_compatibility */ - -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 -#endif /* GL_ARB_arrays_of_arrays */ - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -#endif /* GL_ARB_base_instance */ - -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 -typedef khronos_uint64_t GLuint64EXT; -#define GL_UNSIGNED_INT64_ARB 0x140F -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); -GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_ARB_bindless_texture */ - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -#endif /* GL_ARB_blend_func_extended */ - -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -#endif /* GL_ARB_buffer_storage */ - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -struct _cl_context; -struct _cl_event; -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); -#endif -#endif /* GL_ARB_cl_event */ - -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 -#endif /* GL_ARB_clear_buffer_object */ - -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 -#endif /* GL_ARB_clear_texture */ - -#ifndef GL_ARB_clip_control -#define GL_ARB_clip_control 1 -#endif /* GL_ARB_clip_control */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); -#endif -#endif /* GL_ARB_color_buffer_float */ - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -#endif /* GL_ARB_compatibility */ - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -#endif /* GL_ARB_compute_shader */ - -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -#endif -#endif /* GL_ARB_compute_variable_group_size */ - -#ifndef GL_ARB_conditional_render_inverted -#define GL_ARB_conditional_render_inverted 1 -#endif /* GL_ARB_conditional_render_inverted */ - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -#endif /* GL_ARB_conservative_depth */ - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -#endif /* GL_ARB_copy_buffer */ - -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 -#endif /* GL_ARB_copy_image */ - -#ifndef GL_ARB_cull_distance -#define GL_ARB_cull_distance 1 -#endif /* GL_ARB_cull_distance */ - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#endif -#endif /* GL_ARB_debug_output */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif /* GL_ARB_depth_buffer_float */ - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -#endif /* GL_ARB_depth_clamp */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif /* GL_ARB_depth_texture */ - -#ifndef GL_ARB_derivative_control -#define GL_ARB_derivative_control 1 -#endif /* GL_ARB_derivative_control */ - -#ifndef GL_ARB_direct_state_access -#define GL_ARB_direct_state_access 1 -#endif /* GL_ARB_direct_state_access */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ARB_draw_buffers */ - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif -#endif /* GL_ARB_draw_buffers_blend */ - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -#endif /* GL_ARB_draw_elements_base_vertex */ - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -#endif /* GL_ARB_draw_indirect */ - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_ARB_draw_instanced */ - -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 -#endif /* GL_ARB_enhanced_layouts */ - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -#endif /* GL_ARB_explicit_attrib_location */ - -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -#endif /* GL_ARB_explicit_uniform_location */ - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -#endif /* GL_ARB_fragment_coord_conventions */ - -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 -#endif /* GL_ARB_fragment_layer_viewport */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); -#endif -#endif /* GL_ARB_fragment_program */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif /* GL_ARB_fragment_program_shadow */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif /* GL_ARB_fragment_shader */ - -#ifndef GL_ARB_fragment_shader_interlock -#define GL_ARB_fragment_shader_interlock 1 -#endif /* GL_ARB_fragment_shader_interlock */ - -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 -#endif /* GL_ARB_framebuffer_no_attachments */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#endif /* GL_ARB_framebuffer_object */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif /* GL_ARB_framebuffer_sRGB */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_ARB_geometry_shader4 */ - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -#endif /* GL_ARB_get_program_binary */ - -#ifndef GL_ARB_get_texture_sub_image -#define GL_ARB_get_texture_sub_image 1 -#endif /* GL_ARB_get_texture_sub_image */ - -#ifndef GL_ARB_gl_spirv -#define GL_ARB_gl_spirv 1 -#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 -#define GL_SPIR_V_BINARY_ARB 0x9552 -typedef void (APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpecializeShaderARB (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); -#endif -#endif /* GL_ARB_gl_spirv */ - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -#endif /* GL_ARB_gpu_shader5 */ - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -#endif /* GL_ARB_gpu_shader_fp64 */ - -#ifndef GL_ARB_gpu_shader_int64 -#define GL_ARB_gpu_shader_int64 1 -#define GL_INT64_ARB 0x140E -#define GL_INT64_VEC2_ARB 0x8FE9 -#define GL_INT64_VEC3_ARB 0x8FEA -#define GL_INT64_VEC4_ARB 0x8FEB -#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 -typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); -typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); -typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); -typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64 *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64 *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64 *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64ARB (GLint location, GLint64 x); -GLAPI void APIENTRY glUniform2i64ARB (GLint location, GLint64 x, GLint64 y); -GLAPI void APIENTRY glUniform3i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI void APIENTRY glUniform4i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI void APIENTRY glUniform1i64vARB (GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glUniform2i64vARB (GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glUniform3i64vARB (GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glUniform4i64vARB (GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glUniform1ui64ARB (GLint location, GLuint64 x); -GLAPI void APIENTRY glUniform2ui64ARB (GLint location, GLuint64 x, GLuint64 y); -GLAPI void APIENTRY glUniform3ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI void APIENTRY glUniform4ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI void APIENTRY glUniform1ui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glUniform2ui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glUniform3ui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glUniform4ui64vARB (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glGetUniformi64vARB (GLuint program, GLint location, GLint64 *params); -GLAPI void APIENTRY glGetUniformui64vARB (GLuint program, GLint location, GLuint64 *params); -GLAPI void APIENTRY glGetnUniformi64vARB (GLuint program, GLint location, GLsizei bufSize, GLint64 *params); -GLAPI void APIENTRY glGetnUniformui64vARB (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params); -GLAPI void APIENTRY glProgramUniform1i64ARB (GLuint program, GLint location, GLint64 x); -GLAPI void APIENTRY glProgramUniform2i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y); -GLAPI void APIENTRY glProgramUniform3i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI void APIENTRY glProgramUniform4i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI void APIENTRY glProgramUniform1i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glProgramUniform2i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glProgramUniform3i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glProgramUniform4i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); -GLAPI void APIENTRY glProgramUniform1ui64ARB (GLuint program, GLint location, GLuint64 x); -GLAPI void APIENTRY glProgramUniform2ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y); -GLAPI void APIENTRY glProgramUniform3ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI void APIENTRY glProgramUniform4ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI void APIENTRY glProgramUniform1ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniform2ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniform3ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniform4ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); -#endif -#endif /* GL_ARB_gpu_shader_int64 */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -typedef khronos_uint16_t GLhalfARB; -#define GL_HALF_FLOAT_ARB 0x140B -#endif /* GL_ARB_half_float_pixel */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif /* GL_ARB_half_float_vertex */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogram (GLenum target); -GLAPI void APIENTRY glResetMinmax (GLenum target); -#endif -#endif /* GL_ARB_imaging */ - -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_ARB_indirect_parameters */ - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); -#endif -#endif /* GL_ARB_instanced_arrays */ - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -#endif /* GL_ARB_internalformat_query */ - -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 -#define GL_SRGB_DECODE_ARB 0x8299 -#define GL_VIEW_CLASS_EAC_R11 0x9383 -#define GL_VIEW_CLASS_EAC_RG11 0x9384 -#define GL_VIEW_CLASS_ETC2_RGB 0x9385 -#define GL_VIEW_CLASS_ETC2_RGBA 0x9386 -#define GL_VIEW_CLASS_ETC2_EAC_RGBA 0x9387 -#define GL_VIEW_CLASS_ASTC_4x4_RGBA 0x9388 -#define GL_VIEW_CLASS_ASTC_5x4_RGBA 0x9389 -#define GL_VIEW_CLASS_ASTC_5x5_RGBA 0x938A -#define GL_VIEW_CLASS_ASTC_6x5_RGBA 0x938B -#define GL_VIEW_CLASS_ASTC_6x6_RGBA 0x938C -#define GL_VIEW_CLASS_ASTC_8x5_RGBA 0x938D -#define GL_VIEW_CLASS_ASTC_8x6_RGBA 0x938E -#define GL_VIEW_CLASS_ASTC_8x8_RGBA 0x938F -#define GL_VIEW_CLASS_ASTC_10x5_RGBA 0x9390 -#define GL_VIEW_CLASS_ASTC_10x6_RGBA 0x9391 -#define GL_VIEW_CLASS_ASTC_10x8_RGBA 0x9392 -#define GL_VIEW_CLASS_ASTC_10x10_RGBA 0x9393 -#define GL_VIEW_CLASS_ASTC_12x10_RGBA 0x9394 -#define GL_VIEW_CLASS_ASTC_12x12_RGBA 0x9395 -#endif /* GL_ARB_internalformat_query2 */ - -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 -#endif /* GL_ARB_invalidate_subdata */ - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -#endif /* GL_ARB_map_buffer_alignment */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#endif /* GL_ARB_map_buffer_range */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_ARB_matrix_palette */ - -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 -#endif /* GL_ARB_multi_bind */ - -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 -#endif /* GL_ARB_multi_draw_indirect */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); -#endif -#endif /* GL_ARB_multisample */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); -#endif -#endif /* GL_ARB_multitexture */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); -GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQueryARB (GLenum target); -GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_ARB_occlusion_query */ - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -#endif /* GL_ARB_occlusion_query2 */ - -#ifndef GL_ARB_parallel_shader_compile -#define GL_ARB_parallel_shader_compile 1 -#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 -#define GL_COMPLETION_STATUS_ARB 0x91B1 -typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMaxShaderCompilerThreadsARB (GLuint count); -#endif -#endif /* GL_ARB_parallel_shader_compile */ - -#ifndef GL_ARB_pipeline_statistics_query -#define GL_ARB_pipeline_statistics_query 1 -#define GL_VERTICES_SUBMITTED_ARB 0x82EE -#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 -#endif /* GL_ARB_pipeline_statistics_query */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif /* GL_ARB_pixel_buffer_object */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_ARB_point_parameters */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif /* GL_ARB_point_sprite */ - -#ifndef GL_ARB_polygon_offset_clamp -#define GL_ARB_polygon_offset_clamp 1 -#endif /* GL_ARB_polygon_offset_clamp */ - -#ifndef GL_ARB_post_depth_coverage -#define GL_ARB_post_depth_coverage 1 -#endif /* GL_ARB_post_depth_coverage */ - -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 -#endif /* GL_ARB_program_interface_query */ - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -#endif /* GL_ARB_provoking_vertex */ - -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 -#endif /* GL_ARB_query_buffer_object */ - -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 -#endif /* GL_ARB_robust_buffer_access_behavior */ - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); -GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); -GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -#endif -#endif /* GL_ARB_robustness */ - -#ifndef GL_ARB_robustness_isolation -#define GL_ARB_robustness_isolation 1 -#endif /* GL_ARB_robustness_isolation */ - -#ifndef GL_ARB_sample_locations -#define GL_ARB_sample_locations 1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 -#define GL_SAMPLE_LOCATION_ARB 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferSampleLocationsfvARB (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvARB (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glEvaluateDepthValuesARB (void); -#endif -#endif /* GL_ARB_sample_locations */ - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); -#endif -#endif /* GL_ARB_sample_shading */ - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -#endif /* GL_ARB_sampler_objects */ - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -#endif /* GL_ARB_seamless_cube_map */ - -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 -#endif /* GL_ARB_seamless_cubemap_per_texture */ - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -#endif /* GL_ARB_separate_shader_objects */ - -#ifndef GL_ARB_shader_atomic_counter_ops -#define GL_ARB_shader_atomic_counter_ops 1 -#endif /* GL_ARB_shader_atomic_counter_ops */ - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -#endif /* GL_ARB_shader_atomic_counters */ - -#ifndef GL_ARB_shader_ballot -#define GL_ARB_shader_ballot 1 -#endif /* GL_ARB_shader_ballot */ - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -#endif /* GL_ARB_shader_bit_encoding */ - -#ifndef GL_ARB_shader_clock -#define GL_ARB_shader_clock 1 -#endif /* GL_ARB_shader_clock */ - -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 -#endif /* GL_ARB_shader_draw_parameters */ - -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 -#endif /* GL_ARB_shader_group_vote */ - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -#endif /* GL_ARB_shader_image_load_store */ - -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 -#endif /* GL_ARB_shader_image_size */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef char GLcharARB; -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif -#endif /* GL_ARB_shader_objects */ - -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 -#endif /* GL_ARB_shader_precision */ - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -#endif /* GL_ARB_shader_stencil_export */ - -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 -#endif /* GL_ARB_shader_storage_buffer_object */ - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -#endif /* GL_ARB_shader_subroutine */ - -#ifndef GL_ARB_shader_texture_image_samples -#define GL_ARB_shader_texture_image_samples 1 -#endif /* GL_ARB_shader_texture_image_samples */ - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -#endif /* GL_ARB_shader_texture_lod */ - -#ifndef GL_ARB_shader_viewport_layer_array -#define GL_ARB_shader_viewport_layer_array 1 -#endif /* GL_ARB_shader_viewport_layer_array */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif /* GL_ARB_shading_language_100 */ - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -#endif /* GL_ARB_shading_language_420pack */ - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); -GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#endif -#endif /* GL_ARB_shading_language_include */ - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -#endif /* GL_ARB_shading_language_packing */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif /* GL_ARB_shadow */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif /* GL_ARB_shadow_ambient */ - -#ifndef GL_ARB_sparse_buffer -#define GL_ARB_sparse_buffer 1 -#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 -#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 -typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -#endif -#endif /* GL_ARB_sparse_buffer */ - -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#endif -#endif /* GL_ARB_sparse_texture */ - -#ifndef GL_ARB_sparse_texture2 -#define GL_ARB_sparse_texture2 1 -#endif /* GL_ARB_sparse_texture2 */ - -#ifndef GL_ARB_sparse_texture_clamp -#define GL_ARB_sparse_texture_clamp 1 -#endif /* GL_ARB_sparse_texture_clamp */ - -#ifndef GL_ARB_spirv_extensions -#define GL_ARB_spirv_extensions 1 -#endif /* GL_ARB_spirv_extensions */ - -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 -#endif /* GL_ARB_stencil_texturing */ - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -#endif /* GL_ARB_sync */ - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -#endif /* GL_ARB_tessellation_shader */ - -#ifndef GL_ARB_texture_barrier -#define GL_ARB_texture_barrier 1 -#endif /* GL_ARB_texture_barrier */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif /* GL_ARB_texture_border_clamp */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_ARB_texture_buffer_object */ - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 -#endif /* GL_ARB_texture_buffer_range */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); -#endif -#endif /* GL_ARB_texture_compression */ - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#endif /* GL_ARB_texture_compression_bptc */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif /* GL_ARB_texture_compression_rgtc */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif /* GL_ARB_texture_cube_map */ - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#endif /* GL_ARB_texture_cube_map_array */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif /* GL_ARB_texture_env_add */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif /* GL_ARB_texture_env_combine */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif /* GL_ARB_texture_env_crossbar */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif /* GL_ARB_texture_env_dot3 */ - -#ifndef GL_ARB_texture_filter_anisotropic -#define GL_ARB_texture_filter_anisotropic 1 -#endif /* GL_ARB_texture_filter_anisotropic */ - -#ifndef GL_ARB_texture_filter_minmax -#define GL_ARB_texture_filter_minmax 1 -#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 -#define GL_WEIGHTED_AVERAGE_ARB 0x9367 -#endif /* GL_ARB_texture_filter_minmax */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif /* GL_ARB_texture_float */ - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F -#endif /* GL_ARB_texture_gather */ - -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 -#endif /* GL_ARB_texture_mirror_clamp_to_edge */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif /* GL_ARB_texture_mirrored_repeat */ - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -#endif /* GL_ARB_texture_multisample */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif /* GL_ARB_texture_non_power_of_two */ - -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 -#endif /* GL_ARB_texture_query_levels */ - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -#endif /* GL_ARB_texture_query_lod */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif /* GL_ARB_texture_rectangle */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif /* GL_ARB_texture_rg */ - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -#endif /* GL_ARB_texture_rgb10_a2ui */ - -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 -#endif /* GL_ARB_texture_stencil8 */ - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -#endif /* GL_ARB_texture_storage */ - -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 -#endif /* GL_ARB_texture_storage_multisample */ - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -#endif /* GL_ARB_texture_swizzle */ - -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 -#endif /* GL_ARB_texture_view */ - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -#endif /* GL_ARB_timer_query */ - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -#endif /* GL_ARB_transform_feedback2 */ - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -#endif /* GL_ARB_transform_feedback3 */ - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -#endif /* GL_ARB_transform_feedback_instanced */ - -#ifndef GL_ARB_transform_feedback_overflow_query -#define GL_ARB_transform_feedback_overflow_query 1 -#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED -#endif /* GL_ARB_transform_feedback_overflow_query */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); -#endif -#endif /* GL_ARB_transpose_matrix */ - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -#endif /* GL_ARB_uniform_buffer_object */ - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -#endif /* GL_ARB_vertex_array_bgra */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#endif /* GL_ARB_vertex_array_object */ - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -#endif /* GL_ARB_vertex_attrib_64bit */ - -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -#endif /* GL_ARB_vertex_attrib_binding */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); -GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); -GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); -GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); -GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); -GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); -GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); -GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); -GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexBlendARB (GLint count); -#endif -#endif /* GL_ARB_vertex_blend */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -typedef khronos_ssize_t GLsizeiptrARB; -typedef khronos_intptr_t GLintptrARB; -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_ARB_vertex_buffer_object */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); -#endif -#endif /* GL_ARB_vertex_program */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); -#endif -#endif /* GL_ARB_vertex_shader */ - -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 -#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f); -#endif -#endif /* GL_ARB_viewport_array */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); -#endif -#endif /* GL_ARB_window_pos */ - -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendBarrierKHR (void); -#endif -#endif /* GL_KHR_blend_equation_advanced */ - -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#endif /* GL_KHR_blend_equation_advanced_coherent */ - -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -#endif /* GL_KHR_context_flush_control */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#endif /* GL_KHR_debug */ - -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 -#endif /* GL_KHR_no_error */ - -#ifndef GL_KHR_parallel_shader_compile -#define GL_KHR_parallel_shader_compile 1 -#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 -#define GL_COMPLETION_STATUS_KHR 0x91B1 -typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); -#endif -#endif /* GL_KHR_parallel_shader_compile */ - -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -#endif /* GL_KHR_robust_buffer_access_behavior */ - -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 -#endif /* GL_KHR_robustness */ - -#ifndef GL_KHR_shader_subgroup -#define GL_KHR_shader_subgroup 1 -#define GL_SUBGROUP_SIZE_KHR 0x9532 -#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 -#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 -#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 -#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 -#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 -#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 -#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 -#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 -#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 -#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 -#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 -#endif /* GL_KHR_shader_subgroup */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifndef GL_KHR_texture_compression_astc_sliced_3d -#define GL_KHR_texture_compression_astc_sliced_3d 1 -#endif /* GL_KHR_texture_compression_astc_sliced_3d */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); -typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); -typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); -typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y); -typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z); -typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w); -typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); -GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); -GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); -GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); -GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); -GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); -GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y); -GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z); -GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w); -GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); -#endif -#endif /* GL_OES_byte_coordinates */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif /* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_fixed_point -#define GL_OES_fixed_point 1 -typedef khronos_int32_t GLfixed; -#define GL_FIXED_OES 0x140C -typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); -typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); -typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); -typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); -typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); -typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); -typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); -typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); -typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); -typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); -typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); -typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); -typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); -typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); -typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); -typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); -typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); -typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); -typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); -typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); -typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); -typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); -typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); -typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); -typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); -typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); -typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); -typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); -typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); -typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); -typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); -typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); -GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); -GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); -GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); -GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); -GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); -GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glLineWidthxOES (GLfixed width); -GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); -GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); -GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glPointSizexOES (GLfixed size); -GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); -GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); -GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); -GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); -GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); -GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); -GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); -GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); -GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); -GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); -GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); -GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); -GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); -GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); -GLAPI void APIENTRY glIndexxOES (GLfixed component); -GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); -GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); -GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); -GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); -GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); -GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); -GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glPassThroughxOES (GLfixed token); -GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); -GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); -GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); -GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); -GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); -GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); -GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); -GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); -GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); -GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); -GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); -GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); -GLAPI void APIENTRY glVertex2xOES (GLfixed x); -GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); -GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); -GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); -GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); -#endif -#endif /* GL_OES_fixed_point */ - -#ifndef GL_OES_query_matrix -#define GL_OES_query_matrix 1 -typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); -#endif -#endif /* GL_OES_query_matrix */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif /* GL_OES_read_format */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); -typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); -typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); -typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); -GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); -GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); -GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); -GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -#endif -#endif /* GL_OES_single_precision */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif /* GL_3DFX_multisample */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); -#endif -#endif /* GL_3DFX_tbuffer */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif /* GL_3DFX_texture_compression_FXT1 */ - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif /* GL_AMD_blend_minmax_factor */ - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -#endif /* GL_AMD_conservative_depth */ - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#endif -#endif /* GL_AMD_debug_output */ - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#endif /* GL_AMD_depth_clamp_separate */ - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_AMD_draw_buffers_blend */ - -#ifndef GL_AMD_framebuffer_multisample_advanced -#define GL_AMD_framebuffer_multisample_advanced 1 -#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 -#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 -#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 -#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 -#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 -#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_AMD_framebuffer_multisample_advanced */ - -#ifndef GL_AMD_framebuffer_sample_positions -#define GL_AMD_framebuffer_sample_positions 1 -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE -#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF -#define GL_ALL_PIXELS_AMD 0xFFFFFFFF -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferSamplePositionsfvAMD (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values); -GLAPI void APIENTRY glNamedFramebufferSamplePositionsfvAMD (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values); -GLAPI void APIENTRY glGetFramebufferParameterfvAMD (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); -GLAPI void APIENTRY glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); -#endif -#endif /* GL_AMD_framebuffer_sample_positions */ - -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -#endif /* GL_AMD_gcn_shader */ - -#ifndef GL_AMD_gpu_shader_half_float -#define GL_AMD_gpu_shader_half_float 1 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -#define GL_FLOAT16_MAT2_AMD 0x91C5 -#define GL_FLOAT16_MAT3_AMD 0x91C6 -#define GL_FLOAT16_MAT4_AMD 0x91C7 -#define GL_FLOAT16_MAT2x3_AMD 0x91C8 -#define GL_FLOAT16_MAT2x4_AMD 0x91C9 -#define GL_FLOAT16_MAT3x2_AMD 0x91CA -#define GL_FLOAT16_MAT3x4_AMD 0x91CB -#define GL_FLOAT16_MAT4x2_AMD 0x91CC -#define GL_FLOAT16_MAT4x3_AMD 0x91CD -#endif /* GL_AMD_gpu_shader_half_float */ - -#ifndef GL_AMD_gpu_shader_int16 -#define GL_AMD_gpu_shader_int16 1 -#endif /* GL_AMD_gpu_shader_int16 */ - -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -typedef khronos_int64_t GLint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); -GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_AMD_gpu_shader_int64 */ - -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 -typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); -#endif -#endif /* GL_AMD_interleaved_elements */ - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); -#endif -#endif /* GL_AMD_multi_draw_indirect */ - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); -GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); -GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); -#endif -#endif /* GL_AMD_name_gen_delete */ - -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); -#endif -#endif /* GL_AMD_occlusion_query_event */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -#endif /* GL_AMD_performance_monitor */ - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#endif /* GL_AMD_pinned_memory */ - -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#endif /* GL_AMD_query_buffer_object */ - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); -#endif -#endif /* GL_AMD_sample_positions */ - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -#endif /* GL_AMD_shader_atomic_counter_ops */ - -#ifndef GL_AMD_shader_ballot -#define GL_AMD_shader_ballot 1 -#endif /* GL_AMD_shader_ballot */ - -#ifndef GL_AMD_shader_explicit_vertex_parameter -#define GL_AMD_shader_explicit_vertex_parameter 1 -#endif /* GL_AMD_shader_explicit_vertex_parameter */ - -#ifndef GL_AMD_shader_gpu_shader_half_float_fetch -#define GL_AMD_shader_gpu_shader_half_float_fetch 1 -#endif /* GL_AMD_shader_gpu_shader_half_float_fetch */ - -#ifndef GL_AMD_shader_image_load_store_lod -#define GL_AMD_shader_image_load_store_lod 1 -#endif /* GL_AMD_shader_image_load_store_lod */ - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -#endif /* GL_AMD_shader_stencil_export */ - -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 -#endif /* GL_AMD_shader_trinary_minmax */ - -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -#endif -#endif /* GL_AMD_sparse_texture */ - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); -#endif -#endif /* GL_AMD_stencil_operation_extended */ - -#ifndef GL_AMD_texture_gather_bias_lod -#define GL_AMD_texture_gather_bias_lod 1 -#endif /* GL_AMD_texture_gather_bias_lod */ - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -#endif /* GL_AMD_texture_texture4 */ - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#endif /* GL_AMD_transform_feedback4 */ - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -#endif /* GL_AMD_vertex_shader_layer */ - -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); -GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); -#endif -#endif /* GL_AMD_vertex_shader_tessellator */ - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -#endif /* GL_AMD_vertex_shader_viewport_index */ - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#endif /* GL_APPLE_aux_depth_stencil */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif /* GL_APPLE_client_storage */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif -#endif /* GL_APPLE_element_array */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); -#endif -#endif /* GL_APPLE_fence */ - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#endif /* GL_APPLE_float_pixels */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_APPLE_flush_buffer_range */ - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#endif -#endif /* GL_APPLE_object_purgeable */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 -#endif /* GL_APPLE_rgb_422 */ - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#endif /* GL_APPLE_row_bytes */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif /* GL_APPLE_specular_vector */ - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_APPLE_texture_range */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif /* GL_APPLE_transform_hint */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); -#endif -#endif /* GL_APPLE_vertex_array_object */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); -#endif -#endif /* GL_APPLE_vertex_array_range */ - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#endif -#endif /* GL_APPLE_vertex_program_evaluators */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#define GL_YCBCR_422_APPLE 0x85B9 -#endif /* GL_APPLE_ycbcr_422 */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_ATI_draw_buffers */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif -#endif /* GL_ATI_element_array */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); -#endif -#endif /* GL_ATI_envmap_bumpmap */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); -GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); -#endif -#endif /* GL_ATI_fragment_shader */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); -#endif -#endif /* GL_ATI_map_object_buffer */ - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#endif /* GL_ATI_meminfo */ - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif /* GL_ATI_pixel_format_float */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_pn_triangles */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif -#endif /* GL_ATI_separate_stencil */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif /* GL_ATI_text_fragment_shader */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif /* GL_ATI_texture_env_combine3 */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif /* GL_ATI_texture_float */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif /* GL_ATI_texture_mirror_once */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_array_object */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); -#endif -#endif /* GL_ATI_vertex_attrib_array_object */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); -GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); -GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); -#endif -#endif /* GL_ATI_vertex_streams */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif /* GL_EXT_422_pixels */ - -#ifndef GL_EXT_EGL_image_storage -#define GL_EXT_EGL_image_storage 1 -typedef void *GLeglImageOES; -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); -GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#endif -#endif /* GL_EXT_EGL_image_storage */ - -#ifndef GL_EXT_EGL_sync -#define GL_EXT_EGL_sync 1 -#endif /* GL_EXT_EGL_sync */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#define GL_ABGR_EXT 0x8000 -#endif /* GL_EXT_abgr */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif /* GL_EXT_bgra */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); -#endif -#endif /* GL_EXT_bindable_uniform */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#endif -#endif /* GL_EXT_blend_color */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); -#endif -#endif /* GL_EXT_blend_equation_separate */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_EXT_blend_func_separate */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif /* GL_EXT_blend_logic_op */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_BLEND_EQUATION_EXT 0x8009 -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); -#endif -#endif /* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif /* GL_EXT_blend_subtract */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif /* GL_EXT_clip_volume_hint */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif /* GL_EXT_cmyka */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif -#endif /* GL_EXT_color_subtable */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif -#endif /* GL_EXT_compiled_vertex_array */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -#endif -#endif /* GL_EXT_convolution */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); -GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); -GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_coordinate_frame */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_copy_texture */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_cull_vertex */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); -#endif -#endif /* GL_EXT_depth_bounds_test */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); -GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); -GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); -GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); -GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); -GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); -GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); -#endif -#endif /* GL_EXT_direct_state_access */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -#endif -#endif /* GL_EXT_draw_buffers2 */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_EXT_draw_instanced */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -#endif -#endif /* GL_EXT_draw_range_elements */ - -#ifndef GL_EXT_external_buffer -#define GL_EXT_external_buffer 1 -typedef void *GLeglClientBufferEXT; -typedef void (APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -GLAPI void APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#endif -#endif /* GL_EXT_external_buffer */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_fog_coord */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_EXT_framebuffer_blit */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_EXT_framebuffer_multisample */ - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); -#endif -#endif /* GL_EXT_framebuffer_object */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif /* GL_EXT_framebuffer_sRGB */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -#endif -#endif /* GL_EXT_geometry_shader4 */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif -#endif /* GL_EXT_gpu_program_parameters */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); -#endif -#endif /* GL_EXT_gpu_shader4 */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogramEXT (GLenum target); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); -#endif -#endif /* GL_EXT_histogram */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif /* GL_EXT_index_array_formats */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); -#endif -#endif /* GL_EXT_index_func */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_index_material */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif /* GL_EXT_index_texture */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); -GLAPI void APIENTRY glTextureLightEXT (GLenum pname); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); -#endif -#endif /* GL_EXT_light_texture */ - -#ifndef GL_EXT_memory_object -#define GL_EXT_memory_object 1 -#define GL_TEXTURE_TILING_EXT 0x9580 -#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 -#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B -#define GL_NUM_TILING_TYPES_EXT 0x9582 -#define GL_TILING_TYPES_EXT 0x9583 -#define GL_OPTIMAL_TILING_EXT 0x9584 -#define GL_LINEAR_TILING_EXT 0x9585 -#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 -#define GL_DEVICE_UUID_EXT 0x9597 -#define GL_DRIVER_UUID_EXT 0x9598 -#define GL_UUID_SIZE_EXT 16 -typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); -typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); -typedef void (APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); -typedef GLboolean (APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); -typedef void (APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); -typedef void (APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); -GLAPI void APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); -GLAPI void APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); -GLAPI GLboolean APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); -GLAPI void APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); -GLAPI void APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); -GLAPI void APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTexStorageMem1DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureStorageMem1DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_EXT_memory_object */ - -#ifndef GL_EXT_memory_object_fd -#define GL_EXT_memory_object_fd 1 -#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 -typedef void (APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_memory_object_fd */ - -#ifndef GL_EXT_memory_object_win32 -#define GL_EXT_memory_object_win32 1 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 -#define GL_DEVICE_LUID_EXT 0x9599 -#define GL_DEVICE_NODE_MASK_EXT 0x959A -#define GL_LUID_SIZE_EXT 8 -#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 -#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A -#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B -#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C -typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -GLAPI void APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_memory_object_win32 */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif /* GL_EXT_misc_attribute */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#endif -#endif /* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); -#endif -#endif /* GL_EXT_multisample */ - -#ifndef GL_EXT_multiview_tessellation_geometry_shader -#define GL_EXT_multiview_tessellation_geometry_shader 1 -#endif /* GL_EXT_multiview_tessellation_geometry_shader */ - -#ifndef GL_EXT_multiview_texture_multisample -#define GL_EXT_multiview_texture_multisample 1 -#endif /* GL_EXT_multiview_texture_multisample */ - -#ifndef GL_EXT_multiview_timer_query -#define GL_EXT_multiview_timer_query 1 -#endif /* GL_EXT_multiview_timer_query */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif /* GL_EXT_packed_depth_stencil */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif /* GL_EXT_packed_float */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif /* GL_EXT_packed_pixels */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_paletted_texture */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif /* GL_EXT_pixel_buffer_object */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_EXT_pixel_transform */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif /* GL_EXT_pixel_transform_color_table */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_EXT_point_parameters */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); -#endif -#endif /* GL_EXT_polygon_offset */ - -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B -typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); -#endif -#endif /* GL_EXT_polygon_offset_clamp */ - -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 -#endif /* GL_EXT_post_depth_coverage */ - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); -#endif -#endif /* GL_EXT_provoking_vertex */ - -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); -#endif -#endif /* GL_EXT_raster_multisample */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif /* GL_EXT_rescale_normal */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_secondary_color */ - -#ifndef GL_EXT_semaphore -#define GL_EXT_semaphore 1 -#define GL_LAYOUT_GENERAL_EXT 0x958D -#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E -#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F -#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 -#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 -#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 -#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 -#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 -#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 -typedef void (APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); -typedef void (APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); -typedef GLboolean (APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); -typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); -typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); -GLAPI void APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); -GLAPI GLboolean APIENTRY glIsSemaphoreEXT (GLuint semaphore); -GLAPI void APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); -GLAPI void APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); -GLAPI void APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -GLAPI void APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#endif -#endif /* GL_EXT_semaphore */ - -#ifndef GL_EXT_semaphore_fd -#define GL_EXT_semaphore_fd 1 -typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_semaphore_fd */ - -#ifndef GL_EXT_semaphore_win32 -#define GL_EXT_semaphore_win32 1 -#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 -#define GL_D3D12_FENCE_VALUE_EXT 0x9595 -typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); -typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); -GLAPI void APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_semaphore_win32 */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); -GLAPI void APIENTRY glActiveProgramEXT (GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); -#endif -#endif /* GL_EXT_separate_shader_objects */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif /* GL_EXT_separate_specular_color */ - -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_EXT_shader_framebuffer_fetch 1 -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif /* GL_EXT_shader_framebuffer_fetch */ - -#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent -#define GL_EXT_shader_framebuffer_fetch_non_coherent 1 -typedef void (APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void); -#endif -#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ - -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -#endif /* GL_EXT_shader_image_load_formatted */ - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); -#endif -#endif /* GL_EXT_shader_image_load_store */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - -#ifndef GL_EXT_shader_samples_identical -#define GL_EXT_shader_samples_identical 1 -#endif /* GL_EXT_shader_samples_identical */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif /* GL_EXT_shadow_funcs */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif /* GL_EXT_shared_texture_palette */ - -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 -#endif /* GL_EXT_sparse_texture2 */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif -#endif /* GL_EXT_stencil_clear_tag */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); -#endif -#endif /* GL_EXT_stencil_two_side */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif /* GL_EXT_stencil_wrap */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_subtexture */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif /* GL_EXT_texture */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_EXT_texture3D */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif -#endif /* GL_EXT_texture_array */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -#endif -#endif /* GL_EXT_texture_buffer_object */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif /* GL_EXT_texture_compression_latc */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif /* GL_EXT_texture_cube_map */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif /* GL_EXT_texture_env_add */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif /* GL_EXT_texture_env_combine */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif /* GL_EXT_texture_env_dot3 */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 -#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 -#define GL_WEIGHTED_AVERAGE_EXT 0x9367 -#endif /* GL_EXT_texture_filter_minmax */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif -#endif /* GL_EXT_texture_integer */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif /* GL_EXT_texture_lod_bias */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif /* GL_EXT_texture_mirror_clamp */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif -#endif /* GL_EXT_texture_object */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); -#endif -#endif /* GL_EXT_texture_perturb_normal */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif /* GL_EXT_texture_sRGB */ - -#ifndef GL_EXT_texture_sRGB_R8 -#define GL_EXT_texture_sRGB_R8 1 -#define GL_SR8_EXT 0x8FBD -#endif /* GL_EXT_texture_sRGB_R8 */ - -#ifndef GL_EXT_texture_sRGB_RG8 -#define GL_EXT_texture_sRGB_RG8 1 -#define GL_SRG8_EXT 0x8FBE -#endif /* GL_EXT_texture_sRGB_RG8 */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifndef GL_EXT_texture_shadow_lod -#define GL_EXT_texture_shadow_lod 1 -#endif /* GL_EXT_texture_shadow_lod */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif /* GL_EXT_texture_shared_exponent */ - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#endif /* GL_EXT_texture_snorm */ - -#ifndef GL_EXT_texture_storage -#define GL_EXT_texture_storage 1 -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_BGRA8_EXT 0x93A1 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -#define GL_R16F_EXT 0x822D -#define GL_RG16F_EXT 0x822F -typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_EXT_texture_storage */ - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif /* GL_EXT_texture_swizzle */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#define GL_TIME_ELAPSED_EXT 0x88BF -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -#endif -#endif /* GL_EXT_timer_query */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif -#endif /* GL_EXT_transform_feedback */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint i); -GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); -GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); -GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -#endif -#endif /* GL_EXT_vertex_array */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif /* GL_EXT_vertex_array_bgra */ - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); -#endif -#endif /* GL_EXT_vertex_attrib_64bit */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); -GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); -GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); -GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); -GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); -GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); -GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); -GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); -GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); -GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); -GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -#endif -#endif /* GL_EXT_vertex_shader */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif -#endif /* GL_EXT_vertex_weighting */ - -#ifndef GL_EXT_win32_keyed_mutex -#define GL_EXT_win32_keyed_mutex 1 -typedef GLboolean (APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); -typedef GLboolean (APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); -GLAPI GLboolean APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); -#endif -#endif /* GL_EXT_win32_keyed_mutex */ - -#ifndef GL_EXT_window_rectangles -#define GL_EXT_window_rectangles 1 -#define GL_INCLUSIVE_EXT 0x8F10 -#define GL_EXCLUSIVE_EXT 0x8F11 -#define GL_WINDOW_RECTANGLE_EXT 0x8F12 -#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 -#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 -#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 -typedef void (APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); -#endif -#endif /* GL_EXT_window_rectangles */ - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#endif -#endif /* GL_EXT_x11_sync_object */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif -#endif /* GL_GREMEDY_frame_terminator */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); -#endif -#endif /* GL_GREMEDY_string_marker */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif /* GL_HP_convolution_border_modes */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); -#endif -#endif /* GL_HP_image_transform */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif /* GL_HP_occlusion_test */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif /* GL_HP_texture_lighting */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#define GL_CULL_VERTEX_IBM 103050 -#endif /* GL_IBM_cull_vertex */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); -#endif -#endif /* GL_IBM_multimode_draw_arrays */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif /* GL_IBM_rasterpos_clip */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); -#endif -#endif /* GL_IBM_static_data */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif /* GL_IBM_texture_mirrored_repeat */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -#endif -#endif /* GL_IBM_vertex_array_lists */ - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif -#endif /* GL_INGR_blend_func_separate */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif /* GL_INGR_color_clamp */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#define GL_INTERLACE_READ_INGR 0x8568 -#endif /* GL_INGR_interlace_read */ - -#ifndef GL_INTEL_blackhole_render -#define GL_INTEL_blackhole_render 1 -#define GL_BLACKHOLE_RENDER_INTEL 0x83FC -#endif /* GL_INTEL_blackhole_render */ - -#ifndef GL_INTEL_conservative_rasterization -#define GL_INTEL_conservative_rasterization 1 -#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE -#endif /* GL_INTEL_conservative_rasterization */ - -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -#endif /* GL_INTEL_fragment_shader_ordering */ - -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 -typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); -#endif -#endif /* GL_INTEL_framebuffer_CMAA */ - -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); -typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); -GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); -GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); -#endif -#endif /* GL_INTEL_map_texture */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); -GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); -#endif -#endif /* GL_INTEL_parallel_arrays */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif /* GL_MESAX_texture_stack */ - -#ifndef GL_MESA_framebuffer_flip_x -#define GL_MESA_framebuffer_flip_x 1 -#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC -#endif /* GL_MESA_framebuffer_flip_x */ - -#ifndef GL_MESA_framebuffer_flip_y -#define GL_MESA_framebuffer_flip_y 1 -#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_MESA_framebuffer_flip_y */ - -#ifndef GL_MESA_framebuffer_swap_xy -#define GL_MESA_framebuffer_swap_xy 1 -#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD -#endif /* GL_MESA_framebuffer_swap_xy */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#define GL_PACK_INVERT_MESA 0x8758 -#endif /* GL_MESA_pack_invert */ - -#ifndef GL_MESA_program_binary_formats -#define GL_MESA_program_binary_formats 1 -#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F -#endif /* GL_MESA_program_binary_formats */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif -#endif /* GL_MESA_resize_buffers */ - -#ifndef GL_MESA_shader_integer_functions -#define GL_MESA_shader_integer_functions 1 -#endif /* GL_MESA_shader_integer_functions */ - -#ifndef GL_MESA_tile_raster_order -#define GL_MESA_tile_raster_order 1 -#define GL_TILE_RASTER_ORDER_FIXED_MESA 0x8BB8 -#define GL_TILE_RASTER_ORDER_INCREASING_X_MESA 0x8BB9 -#define GL_TILE_RASTER_ORDER_INCREASING_Y_MESA 0x8BBA -#endif /* GL_MESA_tile_raster_order */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); -#endif -#endif /* GL_MESA_window_pos */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif /* GL_MESA_ycbcr_texture */ - -#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers -#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 -#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ - -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); -GLAPI void APIENTRY glEndConditionalRenderNVX (void); -#endif -#endif /* GL_NVX_conditional_render */ - -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif /* GL_NVX_gpu_memory_info */ - -#ifndef GL_NVX_gpu_multicast2 -#define GL_NVX_gpu_multicast2 1 -#define GL_UPLOAD_GPU_MASK_NVX 0x954A -typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); -typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); -GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); -GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -#endif -#endif /* GL_NVX_gpu_multicast2 */ - -#ifndef GL_NVX_linked_gpu_multicast -#define GL_NVX_linked_gpu_multicast 1 -#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 -#define GL_MAX_LGPU_GPUS_NVX 0x92BA -typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glLGPUInterlockNVX (void); -#endif -#endif /* GL_NVX_linked_gpu_multicast */ - -#ifndef GL_NVX_progress_fence -#define GL_NVX_progress_fence 1 -typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -#endif -#endif /* GL_NVX_progress_fence */ - -#ifndef GL_NV_alpha_to_coverage_dither_control -#define GL_NV_alpha_to_coverage_dither_control 1 -#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D -#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E -#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F -#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF -typedef void (APIENTRYP PFNGLALPHATOCOVERAGEDITHERCONTROLNVPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAlphaToCoverageDitherControlNV (GLenum mode); -#endif -#endif /* GL_NV_alpha_to_coverage_dither_control */ - -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -#endif -#endif /* GL_NV_bindless_multi_draw_indirect */ - -#ifndef GL_NV_bindless_multi_draw_indirect_count -#define GL_NV_bindless_multi_draw_indirect_count 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -#endif -#endif /* GL_NV_bindless_multi_draw_indirect_count */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif -#endif /* GL_NV_bindless_texture */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); -GLAPI void APIENTRY glBlendBarrierNV (void); -#endif -#endif /* GL_NV_blend_equation_advanced */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#endif /* GL_NV_blend_equation_advanced_coherent */ - -#ifndef GL_NV_blend_minmax_factor -#define GL_NV_blend_minmax_factor 1 -#endif /* GL_NV_blend_minmax_factor */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif /* GL_NV_blend_square */ - -#ifndef GL_NV_clip_space_w_scaling -#define GL_NV_clip_space_w_scaling 1 -#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C -#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D -#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E -typedef void (APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#endif -#endif /* GL_NV_clip_space_w_scaling */ - -#ifndef GL_NV_command_list -#define GL_NV_command_list 1 -#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 -#define GL_NOP_COMMAND_NV 0x0001 -#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 -#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 -#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 -#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 -#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 -#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 -#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 -#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 -#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A -#define GL_BLEND_COLOR_COMMAND_NV 0x000B -#define GL_STENCIL_REF_COMMAND_NV 0x000C -#define GL_LINE_WIDTH_COMMAND_NV 0x000D -#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E -#define GL_ALPHA_REF_COMMAND_NV 0x000F -#define GL_VIEWPORT_COMMAND_NV 0x0010 -#define GL_SCISSOR_COMMAND_NV 0x0011 -#define GL_FRONT_FACE_COMMAND_NV 0x0012 -typedef void (APIENTRYP PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint *states); -typedef void (APIENTRYP PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint *states); -typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC) (GLuint state); -typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); -typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); -typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); -typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); -typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint *lists); -typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint *lists); -typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC) (GLuint list); -typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); -typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); -typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCreateStatesNV (GLsizei n, GLuint *states); -GLAPI void APIENTRY glDeleteStatesNV (GLsizei n, const GLuint *states); -GLAPI GLboolean APIENTRY glIsStateNV (GLuint state); -GLAPI void APIENTRY glStateCaptureNV (GLuint state, GLenum mode); -GLAPI GLuint APIENTRY glGetCommandHeaderNV (GLenum tokenID, GLuint size); -GLAPI GLushort APIENTRY glGetStageIndexNV (GLenum shadertype); -GLAPI void APIENTRY glDrawCommandsNV (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); -GLAPI void APIENTRY glDrawCommandsAddressNV (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); -GLAPI void APIENTRY glDrawCommandsStatesNV (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -GLAPI void APIENTRY glDrawCommandsStatesAddressNV (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -GLAPI void APIENTRY glCreateCommandListsNV (GLsizei n, GLuint *lists); -GLAPI void APIENTRY glDeleteCommandListsNV (GLsizei n, const GLuint *lists); -GLAPI GLboolean APIENTRY glIsCommandListNV (GLuint list); -GLAPI void APIENTRY glListDrawCommandsStatesClientNV (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); -GLAPI void APIENTRY glCommandListSegmentsNV (GLuint list, GLuint segments); -GLAPI void APIENTRY glCompileCommandListNV (GLuint list); -GLAPI void APIENTRY glCallCommandListNV (GLuint list); -#endif -#endif /* GL_NV_command_list */ - -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC -#endif /* GL_NV_compute_program5 */ - -#ifndef GL_NV_compute_shader_derivatives -#define GL_NV_compute_shader_derivatives 1 -#endif /* GL_NV_compute_shader_derivatives */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif -#endif /* GL_NV_conditional_render */ - -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 -typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); -#endif -#endif /* GL_NV_conservative_raster */ - -#ifndef GL_NV_conservative_raster_dilate -#define GL_NV_conservative_raster_dilate 1 -#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 -#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A -#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B -typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat value); -#endif -#endif /* GL_NV_conservative_raster_dilate */ - -#ifndef GL_NV_conservative_raster_pre_snap -#define GL_NV_conservative_raster_pre_snap 1 -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 -#endif /* GL_NV_conservative_raster_pre_snap */ - -#ifndef GL_NV_conservative_raster_pre_snap_triangles -#define GL_NV_conservative_raster_pre_snap_triangles 1 -#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D -#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F -typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); -#endif -#endif /* GL_NV_conservative_raster_pre_snap_triangles */ - -#ifndef GL_NV_conservative_raster_underestimation -#define GL_NV_conservative_raster_underestimation 1 -#endif /* GL_NV_conservative_raster_underestimation */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif /* GL_NV_copy_depth_to_color */ - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_NV_copy_image */ - -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 -#endif /* GL_NV_deep_texture3D */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); -#endif -#endif /* GL_NV_depth_buffer_float */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#define GL_DEPTH_CLAMP_NV 0x864F -#endif /* GL_NV_depth_clamp */ - -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 -typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -#endif -#endif /* GL_NV_draw_texture */ - -#ifndef GL_NV_draw_vulkan_image -#define GL_NV_draw_vulkan_image 1 -typedef void (APIENTRY *GLVULKANPROCNV)(void); -typedef void (APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -typedef GLVULKANPROCNV (APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); -typedef void (APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -GLAPI GLVULKANPROCNV APIENTRY glGetVkProcAddrNV (const GLchar *name); -GLAPI void APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); -GLAPI void APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); -GLAPI void APIENTRY glSignalVkFenceNV (GLuint64 vkFence); -#endif -#endif /* GL_NV_draw_vulkan_image */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); -#endif -#endif /* GL_NV_evaluators */ - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); -#endif -#endif /* GL_NV_explicit_multisample */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); -GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GLAPI void APIENTRY glFinishFenceNV (GLuint fence); -GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -#endif /* GL_NV_fence */ - -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 -#define GL_FILL_RECTANGLE_NV 0x933C -#endif /* GL_NV_fill_rectangle */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif /* GL_NV_float_buffer */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#endif /* GL_NV_fog_distance */ - -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE -typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentCoverageColorNV (GLuint color); -#endif -#endif /* GL_NV_fragment_coverage_to_color */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif -#endif /* GL_NV_fragment_program */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif /* GL_NV_fragment_program2 */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif /* GL_NV_fragment_program4 */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif /* GL_NV_fragment_program_option */ - -#ifndef GL_NV_fragment_shader_barycentric -#define GL_NV_fragment_shader_barycentric 1 -#endif /* GL_NV_fragment_shader_barycentric */ - -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 -#endif /* GL_NV_fragment_shader_interlock */ - -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glCoverageModulationNV (GLenum components); -#endif -#endif /* GL_NV_framebuffer_mixed_samples */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_NV_framebuffer_multisample_coverage */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif -#endif /* GL_NV_geometry_program4 */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif /* GL_NV_geometry_shader4 */ - -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 -#endif /* GL_NV_geometry_shader_passthrough */ - -#ifndef GL_NV_gpu_multicast -#define GL_NV_gpu_multicast 1 -#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 -#define GL_MULTICAST_GPUS_NV 0x92BA -#define GL_RENDER_GPU_MASK_NV 0x9558 -#define GL_PER_GPU_STORAGE_NV 0x9548 -#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 -typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); -typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); -GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); -GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glMulticastGetQueryObjectui64vNV (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); -#endif -#endif /* GL_NV_gpu_multicast */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); -#endif -#endif /* GL_NV_gpu_program4 */ - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F -#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 -#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); -#endif -#endif /* GL_NV_gpu_program5 */ - -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 -#endif /* GL_NV_gpu_program5_mem_extended */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -#endif /* GL_NV_gpu_shader5 */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -typedef unsigned short GLhalfNV; -#define GL_HALF_FLOAT_NV 0x140B -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -#endif -#endif /* GL_NV_half_float */ - -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 -typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#endif -#endif /* GL_NV_internalformat_sample_query */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif /* GL_NV_light_max_exponent */ - -#ifndef GL_NV_memory_attachment -#define GL_NV_memory_attachment 1 -#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 -#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 -#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 -#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 -#define GL_MEMORY_ATTACHABLE_NV 0x95A8 -#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 -#define GL_DETACHED_TEXTURES_NV 0x95AA -#define GL_DETACHED_BUFFERS_NV 0x95AB -#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC -#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD -typedef void (APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -typedef void (APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); -typedef void (APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); -typedef void (APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -GLAPI void APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); -GLAPI void APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); -GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_NV_memory_attachment */ - -#ifndef GL_NV_memory_object_sparse -#define GL_NV_memory_object_sparse 1 -typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GLAPI void APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -GLAPI void APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GLAPI void APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#endif -#endif /* GL_NV_memory_object_sparse */ - -#ifndef GL_NV_mesh_shader -#define GL_NV_mesh_shader 1 -#define GL_MESH_SHADER_NV 0x9559 -#define GL_TASK_SHADER_NV 0x955A -#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 -#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 -#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 -#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 -#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 -#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 -#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 -#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 -#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 -#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 -#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A -#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B -#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C -#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D -#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E -#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F -#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 -#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 -#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 -#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 -#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 -#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 -#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A -#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D -#define GL_MAX_MESH_VIEWS_NV 0x9557 -#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF -#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 -#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B -#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C -#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E -#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F -#define GL_MESH_VERTICES_OUT_NV 0x9579 -#define GL_MESH_PRIMITIVES_OUT_NV 0x957A -#define GL_MESH_OUTPUT_TYPE_NV 0x957B -#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D -#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 -#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 -#define GL_MESH_SHADER_BIT_NV 0x00000040 -#define GL_TASK_SHADER_BIT_NV 0x00000080 -#define GL_MESH_SUBROUTINE_NV 0x957C -#define GL_TASK_SUBROUTINE_NV 0x957D -#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E -#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F -typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); -typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); -typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); -GLAPI void APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); -GLAPI void APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_NV_mesh_shader */ - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -#endif /* GL_NV_multisample_coverage */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif /* GL_NV_multisample_filter_hint */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); -#endif -#endif /* GL_NV_occlusion_query */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif /* GL_NV_packed_depth_stencil */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); -#endif -#endif /* GL_NV_parameter_buffer_object */ - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -#endif /* GL_NV_parameter_buffer_object2 */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_2_BYTES_NV 0x1407 -#define GL_3_BYTES_NV 0x1408 -#define GL_4_BYTES_NV 0x1409 -#define GL_EYE_LINEAR_NV 0x2400 -#define GL_OBJECT_LINEAR_NV 0x2401 -#define GL_CONSTANT_NV 0x8576 -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); -GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); -GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); -GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); -GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); -#endif -#endif /* GL_NV_path_rendering */ - -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 -#define GL_SHARED_EDGE_NV 0xC0 -#endif /* GL_NV_path_rendering_shared_edge */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); -#endif -#endif /* GL_NV_pixel_data_range */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); -#endif -#endif /* GL_NV_point_sprite */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#endif -#endif /* GL_NV_present_video */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); -#endif -#endif /* GL_NV_primitive_restart */ - -#ifndef GL_NV_primitive_shading_rate -#define GL_NV_primitive_shading_rate 1 -#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 -#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 -#endif /* GL_NV_primitive_shading_rate */ - -#ifndef GL_NV_query_resource -#define GL_NV_query_resource 1 -#define GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV 0x9540 -#define GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV 0x9542 -#define GL_QUERY_RESOURCE_SYS_RESERVED_NV 0x9544 -#define GL_QUERY_RESOURCE_TEXTURE_NV 0x9545 -#define GL_QUERY_RESOURCE_RENDERBUFFER_NV 0x9546 -#define GL_QUERY_RESOURCE_BUFFEROBJECT_NV 0x9547 -typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); -#endif -#endif /* GL_NV_query_resource */ - -#ifndef GL_NV_query_resource_tag -#define GL_NV_query_resource_tag 1 -typedef void (APIENTRYP PFNGLGENQUERYRESOURCETAGNVPROC) (GLsizei n, GLint *tagIds); -typedef void (APIENTRYP PFNGLDELETEQUERYRESOURCETAGNVPROC) (GLsizei n, const GLint *tagIds); -typedef void (APIENTRYP PFNGLQUERYRESOURCETAGNVPROC) (GLint tagId, const GLchar *tagString); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueryResourceTagNV (GLsizei n, GLint *tagIds); -GLAPI void APIENTRY glDeleteQueryResourceTagNV (GLsizei n, const GLint *tagIds); -GLAPI void APIENTRY glQueryResourceTagNV (GLint tagId, const GLchar *tagString); -#endif -#endif /* GL_NV_query_resource_tag */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_register_combiners */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); -#endif -#endif /* GL_NV_register_combiners2 */ - -#ifndef GL_NV_representative_fragment_test -#define GL_NV_representative_fragment_test 1 -#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F -#endif /* GL_NV_representative_fragment_test */ - -#ifndef GL_NV_robustness_video_memory_purge -#define GL_NV_robustness_video_memory_purge 1 -#define GL_PURGED_CONTEXT_RESET_NV 0x92BB -#endif /* GL_NV_robustness_video_memory_purge */ - -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glResolveDepthValuesNV (void); -#endif -#endif /* GL_NV_sample_locations */ - -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 -#endif /* GL_NV_sample_mask_override_coverage */ - -#ifndef GL_NV_scissor_exclusive -#define GL_NV_scissor_exclusive 1 -#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 -#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 -typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); -#endif -#endif /* GL_NV_scissor_exclusive */ - -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 -#endif /* GL_NV_shader_atomic_counters */ - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -#endif /* GL_NV_shader_atomic_float */ - -#ifndef GL_NV_shader_atomic_float64 -#define GL_NV_shader_atomic_float64 1 -#endif /* GL_NV_shader_atomic_float64 */ - -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 -#endif /* GL_NV_shader_atomic_fp16_vector */ - -#ifndef GL_NV_shader_atomic_int64 -#define GL_NV_shader_atomic_int64 1 -#endif /* GL_NV_shader_atomic_int64 */ - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); -GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); -GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); -GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); -GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); -GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); -GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); -GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); -GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); -GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_NV_shader_buffer_load */ - -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -#endif /* GL_NV_shader_buffer_store */ - -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 -#endif /* GL_NV_shader_storage_buffer_object */ - -#ifndef GL_NV_shader_subgroup_partitioned -#define GL_NV_shader_subgroup_partitioned 1 -#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 -#endif /* GL_NV_shader_subgroup_partitioned */ - -#ifndef GL_NV_shader_texture_footprint -#define GL_NV_shader_texture_footprint 1 -#endif /* GL_NV_shader_texture_footprint */ - -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#endif /* GL_NV_shader_thread_group */ - -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -#endif /* GL_NV_shader_thread_shuffle */ - -#ifndef GL_NV_shading_rate_image -#define GL_NV_shading_rate_image 1 -#define GL_SHADING_RATE_IMAGE_NV 0x9563 -#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 -#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 -#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 -#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A -#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B -#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C -#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D -#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E -#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F -#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B -#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C -#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D -#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E -#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F -#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE -#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF -#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 -typedef void (APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); -typedef void (APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); -typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); -typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindShadingRateImageNV (GLuint texture); -GLAPI void APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); -GLAPI void APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); -GLAPI void APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); -GLAPI void APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -GLAPI void APIENTRY glShadingRateSampleOrderNV (GLenum order); -GLAPI void APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); -#endif -#endif /* GL_NV_shading_rate_image */ - -#ifndef GL_NV_stereo_view_rendering -#define GL_NV_stereo_view_rendering 1 -#endif /* GL_NV_stereo_view_rendering */ - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 -#endif /* GL_NV_tessellation_program5 */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif /* GL_NV_texgen_emboss */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif /* GL_NV_texgen_reflection */ - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureBarrierNV (void); -#endif -#endif /* GL_NV_texture_barrier */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif /* GL_NV_texture_compression_vtc */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif /* GL_NV_texture_env_combine4 */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif /* GL_NV_texture_expand_normal */ - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#endif -#endif /* GL_NV_texture_multisample */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif /* GL_NV_texture_rectangle */ - -#ifndef GL_NV_texture_rectangle_compressed -#define GL_NV_texture_rectangle_compressed 1 -#endif /* GL_NV_texture_rectangle_compressed */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif /* GL_NV_texture_shader */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif /* GL_NV_texture_shader2 */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif /* GL_NV_texture_shader3 */ - -#ifndef GL_NV_timeline_semaphore -#define GL_NV_timeline_semaphore 1 -#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 -#define GL_SEMAPHORE_TYPE_NV 0x95B3 -#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 -#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 -#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 -typedef void (APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); -typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); -GLAPI void APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_timeline_semaphore */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); -GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#endif -#endif /* GL_NV_transform_feedback */ - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); -#endif -#endif /* GL_NV_transform_feedback2 */ - -#ifndef GL_NV_uniform_buffer_unified_memory -#define GL_NV_uniform_buffer_unified_memory 1 -#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E -#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F -#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 -#endif /* GL_NV_uniform_buffer_unified_memory */ - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -typedef GLintptr GLvdpauSurfaceNV; -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); -typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); -GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); -GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#endif -#endif /* GL_NV_vdpau_interop */ - -#ifndef GL_NV_vdpau_interop2 -#define GL_NV_vdpau_interop2 1 -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure); -#endif -#endif /* GL_NV_vdpau_interop2 */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); -#endif -#endif /* GL_NV_vertex_array_range */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif /* GL_NV_vertex_array_range2 */ - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); -GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -#endif -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); -GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); -#endif -#endif /* GL_NV_vertex_buffer_unified_memory */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); -GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); -GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); -GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); -#endif -#endif /* GL_NV_vertex_program */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif /* GL_NV_vertex_program1_1 */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif /* GL_NV_vertex_program2 */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif /* GL_NV_vertex_program2_option */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif /* GL_NV_vertex_program3 */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#endif /* GL_NV_vertex_program4 */ - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#endif -#endif /* GL_NV_video_capture */ - -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 -#endif /* GL_NV_viewport_array2 */ - -#ifndef GL_NV_viewport_swizzle -#define GL_NV_viewport_swizzle 1 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 -#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 -#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 -#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A -#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B -typedef void (APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#endif -#endif /* GL_NV_viewport_swizzle */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif /* GL_OML_interlace */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif /* GL_OML_resample */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif /* GL_OML_subsample */ - -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#endif -#endif /* GL_OVR_multiview */ - -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 -#endif /* GL_OVR_multiview2 */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); -#endif -#endif /* GL_PGI_misc_hints */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif /* GL_PGI_vertex_hints */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif /* GL_REND_screen_coordinates */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 -#endif /* GL_S3_s3tc */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_detail_texture */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); -#endif -#endif /* GL_SGIS_fog_function */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif /* GL_SGIS_generate_mipmap */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); -#endif -#endif /* GL_SGIS_multisample */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); -#endif -#endif /* GL_SGIS_pixel_texture */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif /* GL_SGIS_point_line_texgen */ - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); -#endif -#endif /* GL_SGIS_point_parameters */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); -#endif -#endif /* GL_SGIS_sharpen_texture */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); -#endif -#endif /* GL_SGIS_texture4D */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif /* GL_SGIS_texture_border_clamp */ - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif -#endif /* GL_SGIS_texture_color_mask */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif /* GL_SGIS_texture_edge_clamp */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif -#endif /* GL_SGIS_texture_filter4 */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif /* GL_SGIS_texture_lod */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif /* GL_SGIS_texture_select */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#define GL_ASYNC_MARKER_SGIX 0x8329 -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); -#endif -#endif /* GL_SGIX_async */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif /* GL_SGIX_async_histogram */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif /* GL_SGIX_async_pixel */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif /* GL_SGIX_blend_alpha_minmax */ - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif /* GL_SGIX_calligraphic_fragment */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif /* GL_SGIX_clipmap */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif /* GL_SGIX_convolution_accuracy */ - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif /* GL_SGIX_depth_pass_instrument */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif /* GL_SGIX_depth_texture */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif -#endif /* GL_SGIX_flush_raster */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif /* GL_SGIX_fog_offset */ - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); -GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); -#endif -#endif /* GL_SGIX_fragment_lighting */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); -#endif -#endif /* GL_SGIX_framezoom */ - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); -#endif -#endif /* GL_SGIX_igloo_interface */ - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); -#endif -#endif /* GL_SGIX_instruments */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#define GL_INTERLACE_SGIX 0x8094 -#endif /* GL_SGIX_interlace */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif /* GL_SGIX_ir_instrument1 */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#define GL_LIST_PRIORITY_SGIX 0x8182 -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); -GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); -GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_list_priority */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); -#endif -#endif /* GL_SGIX_pixel_texture */ - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif /* GL_SGIX_pixel_tiles */ - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); -#endif -#endif /* GL_SGIX_polynomial_ffd */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); -#endif -#endif /* GL_SGIX_reference_plane */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif /* GL_SGIX_resample */ - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif /* GL_SGIX_scalebias_hint */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif /* GL_SGIX_shadow */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif /* GL_SGIX_shadow_ambient */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); -#endif -#endif /* GL_SGIX_sprite */ - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif /* GL_SGIX_subsample */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif -#endif /* GL_SGIX_tag_sample_buffer */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif /* GL_SGIX_texture_add_env */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif /* GL_SGIX_texture_coordinate_clamp */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif /* GL_SGIX_texture_lod_bias */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif /* GL_SGIX_texture_multi_buffer */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif /* GL_SGIX_texture_scale_bias */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif /* GL_SGIX_vertex_preclip */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif /* GL_SGIX_ycrcb */ - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif /* GL_SGIX_ycrcb_subsample */ - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif /* GL_SGIX_ycrcba */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif /* GL_SGI_color_matrix */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_SGI_color_table */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif /* GL_SGI_texture_color_table */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif -#endif /* GL_SUNX_constant_data */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif /* GL_SUN_convolution_border_modes */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); -#endif -#endif /* GL_SUN_global_alpha */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif -#endif /* GL_SUN_mesh_array */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif /* GL_SUN_slice_accum */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); -#endif -#endif /* GL_SUN_triangle_list */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif -#endif /* GL_SUN_vertex */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif /* GL_WIN_phong_shading */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif /* GL_WIN_specular_fog */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles.h b/libs/hwcodec/externals/SDL/include/SDL_opengles.h deleted file mode 100644 index f4465eaa..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles.h - * - * This is a simple file to encapsulate the OpenGL ES 1.X API headers. - */ -#include "SDL_config.h" - -#ifdef __IPHONEOS__ -#include -#include -#else -#include -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles2.h b/libs/hwcodec/externals/SDL/include/SDL_opengles2.h deleted file mode 100644 index 5e3b717d..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles2.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_opengles2.h - * - * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. - */ -#include "SDL_config.h" - -#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) - -#ifdef __IPHONEOS__ -#include -#include -#else -#include -#include -#include -#endif - -#else /* _MSC_VER */ - -/* OpenGL ES2 headers for Visual Studio */ -#include "SDL_opengles2_khrplatform.h" -#include "SDL_opengles2_gl2platform.h" -#include "SDL_opengles2_gl2.h" -#include "SDL_opengles2_gl2ext.h" - -#endif /* _MSC_VER */ - -#ifndef APIENTRY -#define APIENTRY GL_APIENTRY -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2.h b/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2.h deleted file mode 100644 index d13622aa..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2.h +++ /dev/null @@ -1,656 +0,0 @@ -#ifndef __gles2_gl2_h_ -#define __gles2_gl2_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: MIT -** -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** https://github.com/KhronosGroup/OpenGL-Registry -*/ - -/*#include */ - -#ifndef GL_APIENTRYP -#define GL_APIENTRYP GL_APIENTRY* -#endif - -#ifndef GL_GLES_PROTOTYPES -#define GL_GLES_PROTOTYPES 1 -#endif - -/* Generated on date 20220530 */ - -/* Generated C header for: - * API: gles2 - * Profile: common - * Versions considered: 2\.[0-9] - * Versions emitted: .* - * Default extensions included: None - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_ES_VERSION_2_0 -#define GL_ES_VERSION_2_0 1 -/*#include */ -typedef khronos_int8_t GLbyte; -typedef khronos_float_t GLclampf; -typedef khronos_int32_t GLfixed; -typedef khronos_int16_t GLshort; -typedef khronos_uint16_t GLushort; -typedef void GLvoid; -typedef struct __GLsync *GLsync; -typedef khronos_int64_t GLint64; -typedef khronos_uint64_t GLuint64; -typedef unsigned int GLenum; -typedef unsigned int GLuint; -typedef char GLchar; -typedef khronos_float_t GLfloat; -typedef khronos_ssize_t GLsizeiptr; -typedef khronos_intptr_t GLintptr; -typedef unsigned int GLbitfield; -typedef int GLint; -typedef unsigned char GLboolean; -typedef int GLsizei; -typedef khronos_uint8_t GLubyte; -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_FALSE 0 -#define GL_TRUE 1 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_FUNC_ADD 0x8006 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_CULL_FACE 0x0B44 -#define GL_BLEND 0x0BE2 -#define GL_DITHER 0x0BD0 -#define GL_STENCIL_TEST 0x0B90 -#define GL_DEPTH_TEST 0x0B71 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_LINE_WIDTH 0x0B21 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_FIXED 0x140C -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_SHADER_TYPE 0x8B4F -#define GL_DELETE_STATUS 0x8B80 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_INVERT 0x150A -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TEXTURE 0x1702 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_COMPILE_STATUS 0x8B81 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGB565 0x8D62 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_NONE 0 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); -typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask); -typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s); -typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures); -typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func); -typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap); -typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices); -typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap); -typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void); -typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures); -typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void); -typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); -typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode); -typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap); -typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture); -typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width); -typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); -typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); -typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -#if GL_GLES_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); -GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); -GL_APICALL void GL_APIENTRY glClearStencil (GLint s); -GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); -GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); -GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); -GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); -GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisable (GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); -GL_APICALL void GL_APIENTRY glEnable (GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); -GL_APICALL void GL_APIENTRY glFinish (void); -GL_APICALL void GL_APIENTRY glFlush (void); -GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); -GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data); -GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL GLenum GL_APIENTRY glGetError (void); -GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data); -GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); -GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); -GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); -GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); -#endif -#endif /* GL_ES_VERSION_2_0 */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2ext.h b/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2ext.h deleted file mode 100644 index 9448ce09..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2ext.h +++ /dev/null @@ -1,4033 +0,0 @@ -#ifndef __gles2_gl2ext_h_ -#define __gles2_gl2ext_h_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright 2013-2020 The Khronos Group Inc. -** SPDX-License-Identifier: MIT -** -** This header is generated from the Khronos OpenGL / OpenGL ES XML -** API Registry. The current version of the Registry, generator scripts -** used to make the header, and the header can be found at -** https://github.com/KhronosGroup/OpenGL-Registry -*/ - -#ifndef GL_APIENTRYP -#define GL_APIENTRYP GL_APIENTRY* -#endif - -/* Generated on date 20220530 */ - -/* Generated C header for: - * API: gles2 - * Profile: common - * Versions considered: 2\.[0-9] - * Versions emitted: _nomatch_^ - * Default extensions included: gles2 - * Additional extensions included: _nomatch_^ - * Extensions removed: _nomatch_^ - */ - -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void); -#endif -#endif /* GL_KHR_blend_equation_advanced */ - -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#endif /* GL_KHR_blend_equation_advanced_coherent */ - -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC -#endif /* GL_KHR_context_flush_control */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -#define GL_SAMPLER 0x82E6 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_VERTEX_ARRAY_KHR 0x8074 -#define GL_QUERY_KHR 0x82E3 -#define GL_PROGRAM_PIPELINE_KHR 0x82E4 -#define GL_SAMPLER_KHR 0x82E6 -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); -GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); -#endif -#endif /* GL_KHR_debug */ - -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 -#endif /* GL_KHR_no_error */ - -#ifndef GL_KHR_parallel_shader_compile -#define GL_KHR_parallel_shader_compile 1 -#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 -#define GL_COMPLETION_STATUS_KHR 0x91B1 -typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); -#endif -#endif /* GL_KHR_parallel_shader_compile */ - -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -#endif /* GL_KHR_robust_buffer_access_behavior */ - -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 -#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 -#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 -#define GL_CONTEXT_LOST_KHR 0x0507 -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void); -GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -#endif -#endif /* GL_KHR_robustness */ - -#ifndef GL_KHR_shader_subgroup -#define GL_KHR_shader_subgroup 1 -#define GL_SUBGROUP_SIZE_KHR 0x9532 -#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 -#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 -#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 -#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 -#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 -#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 -#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 -#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 -#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 -#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 -#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 -#endif /* GL_KHR_shader_subgroup */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -#endif /* GL_KHR_texture_compression_astc_ldr */ - -#ifndef GL_KHR_texture_compression_astc_sliced_3d -#define GL_KHR_texture_compression_astc_sliced_3d 1 -#endif /* GL_KHR_texture_compression_astc_sliced_3d */ - -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -typedef void *GLeglImageOES; -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -#endif /* GL_OES_EGL_image */ - -#ifndef GL_OES_EGL_image_external -#define GL_OES_EGL_image_external 1 -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 -#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 -#define GL_SAMPLER_EXTERNAL_OES 0x8D66 -#endif /* GL_OES_EGL_image_external */ - -#ifndef GL_OES_EGL_image_external_essl3 -#define GL_OES_EGL_image_external_essl3 1 -#endif /* GL_OES_EGL_image_external_essl3 */ - -#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture -#define GL_OES_compressed_ETC1_RGB8_sub_texture 1 -#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */ - -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_OES_compressed_ETC1_RGB8_texture 1 -#define GL_ETC1_RGB8_OES 0x8D64 -#endif /* GL_OES_compressed_ETC1_RGB8_texture */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#endif /* GL_OES_compressed_paletted_texture */ - -#ifndef GL_OES_copy_image -#define GL_OES_copy_image 1 -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#endif -#endif /* GL_OES_copy_image */ - -#ifndef GL_OES_depth24 -#define GL_OES_depth24 1 -#define GL_DEPTH_COMPONENT24_OES 0x81A6 -#endif /* GL_OES_depth24 */ - -#ifndef GL_OES_depth32 -#define GL_OES_depth32 1 -#define GL_DEPTH_COMPONENT32_OES 0x81A7 -#endif /* GL_OES_depth32 */ - -#ifndef GL_OES_depth_texture -#define GL_OES_depth_texture 1 -#endif /* GL_OES_depth_texture */ - -#ifndef GL_OES_draw_buffers_indexed -#define GL_OES_draw_buffers_indexed 1 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index); -#endif -#endif /* GL_OES_draw_buffers_indexed */ - -#ifndef GL_OES_draw_elements_base_vertex -#define GL_OES_draw_elements_base_vertex 1 -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); -#endif -#endif /* GL_OES_draw_elements_base_vertex */ - -#ifndef GL_OES_element_index_uint -#define GL_OES_element_index_uint 1 -#endif /* GL_OES_element_index_uint */ - -#ifndef GL_OES_fbo_render_mipmap -#define GL_OES_fbo_render_mipmap 1 -#endif /* GL_OES_fbo_render_mipmap */ - -#ifndef GL_OES_fragment_precision_high -#define GL_OES_fragment_precision_high 1 -#endif /* GL_OES_fragment_precision_high */ - -#ifndef GL_OES_geometry_point_size -#define GL_OES_geometry_point_size 1 -#endif /* GL_OES_geometry_point_size */ - -#ifndef GL_OES_geometry_shader -#define GL_OES_geometry_shader 1 -#define GL_GEOMETRY_SHADER_OES 0x8DD9 -#define GL_GEOMETRY_SHADER_BIT_OES 0x00000004 -#define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916 -#define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917 -#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918 -#define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F -#define GL_LAYER_PROVOKING_VERTEX_OES 0x825E -#define GL_LINES_ADJACENCY_OES 0x000A -#define GL_LINE_STRIP_ADJACENCY_OES 0x000B -#define GL_TRIANGLES_ADJACENCY_OES 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_OES 0x000D -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124 -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5 -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7 -#define GL_FIRST_VERTEX_CONVENTION_OES 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_OES 0x8E4E -#define GL_UNDEFINED_VERTEX_OES 0x8260 -#define GL_PRIMITIVES_GENERATED_OES 0x8C87 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312 -#define GL_MAX_FRAMEBUFFER_LAYERS_OES 0x9317 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7 -#define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif -#endif /* GL_OES_geometry_shader */ - -#ifndef GL_OES_get_program_binary -#define GL_OES_get_program_binary 1 -#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE -#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); -#endif -#endif /* GL_OES_get_program_binary */ - -#ifndef GL_OES_gpu_shader5 -#define GL_OES_gpu_shader5 1 -#endif /* GL_OES_gpu_shader5 */ - -#ifndef GL_OES_mapbuffer -#define GL_OES_mapbuffer 1 -#define GL_WRITE_ONLY_OES 0x88B9 -#define GL_BUFFER_ACCESS_OES 0x88BB -#define GL_BUFFER_MAPPED_OES 0x88BC -#define GL_BUFFER_MAP_POINTER_OES 0x88BD -typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); -#endif -#endif /* GL_OES_mapbuffer */ - -#ifndef GL_OES_packed_depth_stencil -#define GL_OES_packed_depth_stencil 1 -#define GL_DEPTH_STENCIL_OES 0x84F9 -#define GL_UNSIGNED_INT_24_8_OES 0x84FA -#define GL_DEPTH24_STENCIL8_OES 0x88F0 -#endif /* GL_OES_packed_depth_stencil */ - -#ifndef GL_OES_primitive_bounding_box -#define GL_OES_primitive_bounding_box 1 -#define GL_PRIMITIVE_BOUNDING_BOX_OES 0x92BE -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#endif -#endif /* GL_OES_primitive_bounding_box */ - -#ifndef GL_OES_required_internalformat -#define GL_OES_required_internalformat 1 -#define GL_ALPHA8_OES 0x803C -#define GL_DEPTH_COMPONENT16_OES 0x81A5 -#define GL_LUMINANCE4_ALPHA4_OES 0x8043 -#define GL_LUMINANCE8_ALPHA8_OES 0x8045 -#define GL_LUMINANCE8_OES 0x8040 -#define GL_RGBA4_OES 0x8056 -#define GL_RGB5_A1_OES 0x8057 -#define GL_RGB565_OES 0x8D62 -#define GL_RGB8_OES 0x8051 -#define GL_RGBA8_OES 0x8058 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB10_A2_EXT 0x8059 -#endif /* GL_OES_required_internalformat */ - -#ifndef GL_OES_rgb8_rgba8 -#define GL_OES_rgb8_rgba8 1 -#endif /* GL_OES_rgb8_rgba8 */ - -#ifndef GL_OES_sample_shading -#define GL_OES_sample_shading 1 -#define GL_SAMPLE_SHADING_OES 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 -typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value); -#endif -#endif /* GL_OES_sample_shading */ - -#ifndef GL_OES_sample_variables -#define GL_OES_sample_variables 1 -#endif /* GL_OES_sample_variables */ - -#ifndef GL_OES_shader_image_atomic -#define GL_OES_shader_image_atomic 1 -#endif /* GL_OES_shader_image_atomic */ - -#ifndef GL_OES_shader_io_blocks -#define GL_OES_shader_io_blocks 1 -#endif /* GL_OES_shader_io_blocks */ - -#ifndef GL_OES_shader_multisample_interpolation -#define GL_OES_shader_multisample_interpolation 1 -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D -#endif /* GL_OES_shader_multisample_interpolation */ - -#ifndef GL_OES_standard_derivatives -#define GL_OES_standard_derivatives 1 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B -#endif /* GL_OES_standard_derivatives */ - -#ifndef GL_OES_stencil1 -#define GL_OES_stencil1 1 -#define GL_STENCIL_INDEX1_OES 0x8D46 -#endif /* GL_OES_stencil1 */ - -#ifndef GL_OES_stencil4 -#define GL_OES_stencil4 1 -#define GL_STENCIL_INDEX4_OES 0x8D47 -#endif /* GL_OES_stencil4 */ - -#ifndef GL_OES_surfaceless_context -#define GL_OES_surfaceless_context 1 -#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 -#endif /* GL_OES_surfaceless_context */ - -#ifndef GL_OES_tessellation_point_size -#define GL_OES_tessellation_point_size 1 -#endif /* GL_OES_tessellation_point_size */ - -#ifndef GL_OES_tessellation_shader -#define GL_OES_tessellation_shader 1 -#define GL_PATCHES_OES 0x000E -#define GL_PATCH_VERTICES_OES 0x8E72 -#define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75 -#define GL_TESS_GEN_MODE_OES 0x8E76 -#define GL_TESS_GEN_SPACING_OES 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER_OES 0x8E78 -#define GL_TESS_GEN_POINT_MODE_OES 0x8E79 -#define GL_ISOLINES_OES 0x8E7A -#define GL_QUADS_OES 0x0007 -#define GL_FRACTIONAL_ODD_OES 0x8E7B -#define GL_FRACTIONAL_EVEN_OES 0x8E7C -#define GL_MAX_PATCH_VERTICES_OES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL_OES 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS_OES 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4 -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221 -#define GL_IS_PER_PATCH_OES 0x92E7 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308 -#define GL_TESS_CONTROL_SHADER_OES 0x8E88 -#define GL_TESS_EVALUATION_SHADER_OES 0x8E87 -#define GL_TESS_CONTROL_SHADER_BIT_OES 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010 -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value); -#endif -#endif /* GL_OES_tessellation_shader */ - -#ifndef GL_OES_texture_3D -#define GL_OES_texture_3D 1 -#define GL_TEXTURE_WRAP_R_OES 0x8072 -#define GL_TEXTURE_3D_OES 0x806F -#define GL_TEXTURE_BINDING_3D_OES 0x806A -#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 -#define GL_SAMPLER_3D_OES 0x8B5F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -#endif -#endif /* GL_OES_texture_3D */ - -#ifndef GL_OES_texture_border_clamp -#define GL_OES_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_OES 0x1004 -#define GL_CLAMP_TO_BORDER_OES 0x812D -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params); -#endif -#endif /* GL_OES_texture_border_clamp */ - -#ifndef GL_OES_texture_buffer -#define GL_OES_texture_buffer 1 -#define GL_TEXTURE_BUFFER_OES 0x8C2A -#define GL_TEXTURE_BUFFER_BINDING_OES 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_OES 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_OES 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F -#define GL_SAMPLER_BUFFER_OES 0x8DC2 -#define GL_INT_SAMPLER_BUFFER_OES 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8 -#define GL_IMAGE_BUFFER_OES 0x9051 -#define GL_INT_IMAGE_BUFFER_OES 0x905C -#define GL_UNSIGNED_INT_IMAGE_BUFFER_OES 0x9067 -#define GL_TEXTURE_BUFFER_OFFSET_OES 0x919D -#define GL_TEXTURE_BUFFER_SIZE_OES 0x919E -typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_OES_texture_buffer */ - -#ifndef GL_OES_texture_compression_astc -#define GL_OES_texture_compression_astc 1 -#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0 -#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1 -#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2 -#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3 -#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4 -#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5 -#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6 -#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7 -#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8 -#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9 -#endif /* GL_OES_texture_compression_astc */ - -#ifndef GL_OES_texture_cube_map_array -#define GL_OES_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A -#define GL_SAMPLER_CUBE_MAP_ARRAY_OES 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F -#define GL_IMAGE_CUBE_MAP_ARRAY_OES 0x9054 -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x905F -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A -#endif /* GL_OES_texture_cube_map_array */ - -#ifndef GL_OES_texture_float -#define GL_OES_texture_float 1 -#endif /* GL_OES_texture_float */ - -#ifndef GL_OES_texture_float_linear -#define GL_OES_texture_float_linear 1 -#endif /* GL_OES_texture_float_linear */ - -#ifndef GL_OES_texture_half_float -#define GL_OES_texture_half_float 1 -#define GL_HALF_FLOAT_OES 0x8D61 -#endif /* GL_OES_texture_half_float */ - -#ifndef GL_OES_texture_half_float_linear -#define GL_OES_texture_half_float_linear 1 -#endif /* GL_OES_texture_half_float_linear */ - -#ifndef GL_OES_texture_npot -#define GL_OES_texture_npot 1 -#endif /* GL_OES_texture_npot */ - -#ifndef GL_OES_texture_stencil8 -#define GL_OES_texture_stencil8 1 -#define GL_STENCIL_INDEX_OES 0x1901 -#define GL_STENCIL_INDEX8_OES 0x8D48 -#endif /* GL_OES_texture_stencil8 */ - -#ifndef GL_OES_texture_storage_multisample_2d_array -#define GL_OES_texture_storage_multisample_2d_array 1 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105 -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#endif -#endif /* GL_OES_texture_storage_multisample_2d_array */ - -#ifndef GL_OES_texture_view -#define GL_OES_texture_view 1 -#define GL_TEXTURE_VIEW_MIN_LEVEL_OES 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS_OES 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER_OES 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS_OES 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#endif -#endif /* GL_OES_texture_view */ - -#ifndef GL_OES_vertex_array_object -#define GL_OES_vertex_array_object 1 -#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); -#endif -#endif /* GL_OES_vertex_array_object */ - -#ifndef GL_OES_vertex_half_float -#define GL_OES_vertex_half_float 1 -#endif /* GL_OES_vertex_half_float */ - -#ifndef GL_OES_vertex_type_10_10_10_2 -#define GL_OES_vertex_type_10_10_10_2 1 -#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 -#define GL_INT_10_10_10_2_OES 0x8DF7 -#endif /* GL_OES_vertex_type_10_10_10_2 */ - -#ifndef GL_OES_viewport_array -#define GL_OES_viewport_array 1 -#define GL_MAX_VIEWPORTS_OES 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS_OES 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE_OES 0x825D -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_OES 0x825F -typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFOESPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVOESPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVOESPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDOESPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVOESPROC) (GLuint index, const GLint *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFOESPROC) (GLuint index, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLGETFLOATI_VOESPROC) (GLenum target, GLuint index, GLfloat *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportArrayvOES (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glViewportIndexedfOES (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GL_APICALL void GL_APIENTRY glViewportIndexedfvOES (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glScissorArrayvOES (GLuint first, GLsizei count, const GLint *v); -GL_APICALL void GL_APIENTRY glScissorIndexedOES (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorIndexedvOES (GLuint index, const GLint *v); -GL_APICALL void GL_APIENTRY glDepthRangeArrayfvOES (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glDepthRangeIndexedfOES (GLuint index, GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLfloat *data); -#endif -#endif /* GL_OES_viewport_array */ - -#ifndef GL_AMD_compressed_3DC_texture -#define GL_AMD_compressed_3DC_texture 1 -#define GL_3DC_X_AMD 0x87F9 -#define GL_3DC_XY_AMD 0x87FA -#endif /* GL_AMD_compressed_3DC_texture */ - -#ifndef GL_AMD_compressed_ATC_texture -#define GL_AMD_compressed_ATC_texture 1 -#define GL_ATC_RGB_AMD 0x8C92 -#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 -#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE -#endif /* GL_AMD_compressed_ATC_texture */ - -#ifndef GL_AMD_framebuffer_multisample_advanced -#define GL_AMD_framebuffer_multisample_advanced 1 -#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 -#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 -#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 -#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 -#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 -#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_AMD_framebuffer_multisample_advanced */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); -GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif -#endif /* GL_AMD_performance_monitor */ - -#ifndef GL_AMD_program_binary_Z400 -#define GL_AMD_program_binary_Z400 1 -#define GL_Z400_BINARY_AMD 0x8740 -#endif /* GL_AMD_program_binary_Z400 */ - -#ifndef GL_ANDROID_extension_pack_es31a -#define GL_ANDROID_extension_pack_es31a 1 -#endif /* GL_ANDROID_extension_pack_es31a */ - -#ifndef GL_ANGLE_depth_texture -#define GL_ANGLE_depth_texture 1 -#endif /* GL_ANGLE_depth_texture */ - -#ifndef GL_ANGLE_framebuffer_blit -#define GL_ANGLE_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_ANGLE_framebuffer_blit */ - -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_ANGLE_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_ANGLE_framebuffer_multisample */ - -#ifndef GL_ANGLE_instanced_arrays -#define GL_ANGLE_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); -#endif -#endif /* GL_ANGLE_instanced_arrays */ - -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_ANGLE_pack_reverse_row_order 1 -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 -#endif /* GL_ANGLE_pack_reverse_row_order */ - -#ifndef GL_ANGLE_program_binary -#define GL_ANGLE_program_binary 1 -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 -#endif /* GL_ANGLE_program_binary */ - -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_ANGLE_texture_compression_dxt3 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#endif /* GL_ANGLE_texture_compression_dxt3 */ - -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_ANGLE_texture_compression_dxt5 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 -#endif /* GL_ANGLE_texture_compression_dxt5 */ - -#ifndef GL_ANGLE_texture_usage -#define GL_ANGLE_texture_usage 1 -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 -#endif /* GL_ANGLE_texture_usage */ - -#ifndef GL_ANGLE_translated_shader_source -#define GL_ANGLE_translated_shader_source 1 -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -#endif -#endif /* GL_ANGLE_translated_shader_source */ - -#ifndef GL_APPLE_clip_distance -#define GL_APPLE_clip_distance 1 -#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 -#define GL_CLIP_DISTANCE0_APPLE 0x3000 -#define GL_CLIP_DISTANCE1_APPLE 0x3001 -#define GL_CLIP_DISTANCE2_APPLE 0x3002 -#define GL_CLIP_DISTANCE3_APPLE 0x3003 -#define GL_CLIP_DISTANCE4_APPLE 0x3004 -#define GL_CLIP_DISTANCE5_APPLE 0x3005 -#define GL_CLIP_DISTANCE6_APPLE 0x3006 -#define GL_CLIP_DISTANCE7_APPLE 0x3007 -#endif /* GL_APPLE_clip_distance */ - -#ifndef GL_APPLE_color_buffer_packed_float -#define GL_APPLE_color_buffer_packed_float 1 -#endif /* GL_APPLE_color_buffer_packed_float */ - -#ifndef GL_APPLE_copy_texture_levels -#define GL_APPLE_copy_texture_levels 1 -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); -#endif -#endif /* GL_APPLE_copy_texture_levels */ - -#ifndef GL_APPLE_framebuffer_multisample -#define GL_APPLE_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 -#define GL_MAX_SAMPLES_APPLE 0x8D57 -#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); -#endif -#endif /* GL_APPLE_framebuffer_multisample */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 -#endif /* GL_APPLE_rgb_422 */ - -#ifndef GL_APPLE_sync -#define GL_APPLE_sync 1 -#define GL_SYNC_OBJECT_APPLE 0x8A53 -#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 -#define GL_OBJECT_TYPE_APPLE 0x9112 -#define GL_SYNC_CONDITION_APPLE 0x9113 -#define GL_SYNC_STATUS_APPLE 0x9114 -#define GL_SYNC_FLAGS_APPLE 0x9115 -#define GL_SYNC_FENCE_APPLE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 -#define GL_UNSIGNALED_APPLE 0x9118 -#define GL_SIGNALED_APPLE 0x9119 -#define GL_ALREADY_SIGNALED_APPLE 0x911A -#define GL_TIMEOUT_EXPIRED_APPLE 0x911B -#define GL_CONDITION_SATISFIED_APPLE 0x911C -#define GL_WAIT_FAILED_APPLE 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 -#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); -GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); -GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); -#endif -#endif /* GL_APPLE_sync */ - -#ifndef GL_APPLE_texture_format_BGRA8888 -#define GL_APPLE_texture_format_BGRA8888 1 -#define GL_BGRA_EXT 0x80E1 -#define GL_BGRA8_EXT 0x93A1 -#endif /* GL_APPLE_texture_format_BGRA8888 */ - -#ifndef GL_APPLE_texture_max_level -#define GL_APPLE_texture_max_level 1 -#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D -#endif /* GL_APPLE_texture_max_level */ - -#ifndef GL_APPLE_texture_packed_float -#define GL_APPLE_texture_packed_float 1 -#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B -#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E -#define GL_R11F_G11F_B10F_APPLE 0x8C3A -#define GL_RGB9_E5_APPLE 0x8C3D -#endif /* GL_APPLE_texture_packed_float */ - -#ifndef GL_ARM_mali_program_binary -#define GL_ARM_mali_program_binary 1 -#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 -#endif /* GL_ARM_mali_program_binary */ - -#ifndef GL_ARM_mali_shader_binary -#define GL_ARM_mali_shader_binary 1 -#define GL_MALI_SHADER_BINARY_ARM 0x8F60 -#endif /* GL_ARM_mali_shader_binary */ - -#ifndef GL_ARM_rgba8 -#define GL_ARM_rgba8 1 -#endif /* GL_ARM_rgba8 */ - -#ifndef GL_ARM_shader_framebuffer_fetch -#define GL_ARM_shader_framebuffer_fetch 1 -#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 -#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 -#endif /* GL_ARM_shader_framebuffer_fetch */ - -#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil -#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 -#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ - -#ifndef GL_ARM_texture_unnormalized_coordinates -#define GL_ARM_texture_unnormalized_coordinates 1 -#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A -#endif /* GL_ARM_texture_unnormalized_coordinates */ - -#ifndef GL_DMP_program_binary -#define GL_DMP_program_binary 1 -#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251 -#define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252 -#define GL_DMP_PROGRAM_BINARY_DMP 0x9253 -#endif /* GL_DMP_program_binary */ - -#ifndef GL_DMP_shader_binary -#define GL_DMP_shader_binary 1 -#define GL_SHADER_BINARY_DMP 0x9250 -#endif /* GL_DMP_shader_binary */ - -#ifndef GL_EXT_EGL_image_array -#define GL_EXT_EGL_image_array 1 -#endif /* GL_EXT_EGL_image_array */ - -#ifndef GL_EXT_EGL_image_storage -#define GL_EXT_EGL_image_storage 1 -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); -GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); -#endif -#endif /* GL_EXT_EGL_image_storage */ - -#ifndef GL_EXT_EGL_image_storage_compression -#define GL_EXT_EGL_image_storage_compression 1 -#define GL_SURFACE_COMPRESSION_EXT 0x96C0 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2 -#endif /* GL_EXT_EGL_image_storage_compression */ - -#ifndef GL_EXT_YUV_target -#define GL_EXT_YUV_target 1 -#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 -#endif /* GL_EXT_YUV_target */ - -#ifndef GL_EXT_base_instance -#define GL_EXT_base_instance 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -#endif -#endif /* GL_EXT_base_instance */ - -#ifndef GL_EXT_blend_func_extended -#define GL_EXT_blend_func_extended 1 -#define GL_SRC1_COLOR_EXT 0x88F9 -#define GL_SRC1_ALPHA_EXT 0x8589 -#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB -#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 -#define GL_LOCATION_INDEX_EXT 0x930F -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name); -GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name); -#endif -#endif /* GL_EXT_blend_func_extended */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#endif /* GL_EXT_blend_minmax */ - -#ifndef GL_EXT_buffer_storage -#define GL_EXT_buffer_storage 1 -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 -#define GL_MAP_COHERENT_BIT_EXT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 -#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F -#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -#endif -#endif /* GL_EXT_buffer_storage */ - -#ifndef GL_EXT_clear_texture -#define GL_EXT_clear_texture 1 -typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -#endif -#endif /* GL_EXT_clear_texture */ - -#ifndef GL_EXT_clip_control -#define GL_EXT_clip_control 1 -#define GL_LOWER_LEFT_EXT 0x8CA1 -#define GL_UPPER_LEFT_EXT 0x8CA2 -#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E -#define GL_ZERO_TO_ONE_EXT 0x935F -#define GL_CLIP_ORIGIN_EXT 0x935C -#define GL_CLIP_DEPTH_MODE_EXT 0x935D -typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth); -#endif -#endif /* GL_EXT_clip_control */ - -#ifndef GL_EXT_clip_cull_distance -#define GL_EXT_clip_cull_distance 1 -#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 -#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA -#define GL_CLIP_DISTANCE0_EXT 0x3000 -#define GL_CLIP_DISTANCE1_EXT 0x3001 -#define GL_CLIP_DISTANCE2_EXT 0x3002 -#define GL_CLIP_DISTANCE3_EXT 0x3003 -#define GL_CLIP_DISTANCE4_EXT 0x3004 -#define GL_CLIP_DISTANCE5_EXT 0x3005 -#define GL_CLIP_DISTANCE6_EXT 0x3006 -#define GL_CLIP_DISTANCE7_EXT 0x3007 -#endif /* GL_EXT_clip_cull_distance */ - -#ifndef GL_EXT_color_buffer_float -#define GL_EXT_color_buffer_float 1 -#endif /* GL_EXT_color_buffer_float */ - -#ifndef GL_EXT_color_buffer_half_float -#define GL_EXT_color_buffer_half_float 1 -#define GL_RGBA16F_EXT 0x881A -#define GL_RGB16F_EXT 0x881B -#define GL_RG16F_EXT 0x822F -#define GL_R16F_EXT 0x822D -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 -#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 -#endif /* GL_EXT_color_buffer_half_float */ - -#ifndef GL_EXT_conservative_depth -#define GL_EXT_conservative_depth 1 -#endif /* GL_EXT_conservative_depth */ - -#ifndef GL_EXT_copy_image -#define GL_EXT_copy_image 1 -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -#endif -#endif /* GL_EXT_copy_image */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - -#ifndef GL_EXT_depth_clamp -#define GL_EXT_depth_clamp 1 -#define GL_DEPTH_CLAMP_EXT 0x864F -#endif /* GL_EXT_depth_clamp */ - -#ifndef GL_EXT_discard_framebuffer -#define GL_EXT_discard_framebuffer 1 -#define GL_COLOR_EXT 0x1800 -#define GL_DEPTH_EXT 0x1801 -#define GL_STENCIL_EXT 0x1802 -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); -#endif -#endif /* GL_EXT_discard_framebuffer */ - -#ifndef GL_EXT_disjoint_timer_query -#define GL_EXT_disjoint_timer_query 1 -#define GL_QUERY_COUNTER_BITS_EXT 0x8864 -#define GL_CURRENT_QUERY_EXT 0x8865 -#define GL_QUERY_RESULT_EXT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_TIMESTAMP_EXT 0x8E28 -#define GL_GPU_DISJOINT_EXT 0x8FBB -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); -GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); -GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); -GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data); -#endif -#endif /* GL_EXT_disjoint_timer_query */ - -#ifndef GL_EXT_draw_buffers -#define GL_EXT_draw_buffers 1 -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 -#define GL_DRAW_BUFFER0_EXT 0x8825 -#define GL_DRAW_BUFFER1_EXT 0x8826 -#define GL_DRAW_BUFFER2_EXT 0x8827 -#define GL_DRAW_BUFFER3_EXT 0x8828 -#define GL_DRAW_BUFFER4_EXT 0x8829 -#define GL_DRAW_BUFFER5_EXT 0x882A -#define GL_DRAW_BUFFER6_EXT 0x882B -#define GL_DRAW_BUFFER7_EXT 0x882C -#define GL_DRAW_BUFFER8_EXT 0x882D -#define GL_DRAW_BUFFER9_EXT 0x882E -#define GL_DRAW_BUFFER10_EXT 0x882F -#define GL_DRAW_BUFFER11_EXT 0x8830 -#define GL_DRAW_BUFFER12_EXT 0x8831 -#define GL_DRAW_BUFFER13_EXT 0x8832 -#define GL_DRAW_BUFFER14_EXT 0x8833 -#define GL_DRAW_BUFFER15_EXT 0x8834 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_EXT_draw_buffers */ - -#ifndef GL_EXT_draw_buffers_indexed -#define GL_EXT_draw_buffers_indexed 1 -typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index); -#endif -#endif /* GL_EXT_draw_buffers_indexed */ - -#ifndef GL_EXT_draw_elements_base_vertex -#define GL_EXT_draw_elements_base_vertex 1 -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -#endif -#endif /* GL_EXT_draw_elements_base_vertex */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_EXT_draw_instanced */ - -#ifndef GL_EXT_draw_transform_feedback -#define GL_EXT_draw_transform_feedback 1 -typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKEXTPROC) (GLenum mode, GLuint id); -typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDEXTPROC) (GLenum mode, GLuint id, GLsizei instancecount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawTransformFeedbackEXT (GLenum mode, GLuint id); -GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GLuint id, GLsizei instancecount); -#endif -#endif /* GL_EXT_draw_transform_feedback */ - -#ifndef GL_EXT_external_buffer -#define GL_EXT_external_buffer 1 -typedef void *GLeglClientBufferEXT; -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -#endif -#endif /* GL_EXT_external_buffer */ - -#ifndef GL_EXT_float_blend -#define GL_EXT_float_blend 1 -#endif /* GL_EXT_float_blend */ - -#ifndef GL_EXT_fragment_shading_rate -#define GL_EXT_fragment_shading_rate 1 -#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6 -#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7 -#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8 -#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9 -#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA -#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB -#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC -#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD -#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE -#define GL_SHADING_RATE_EXT 0x96D0 -#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1 -#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2 -#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3 -#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4 -#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5 -#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6 -#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7 -#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8 -#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9 -#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA -#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB -#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC -#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD -#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE -#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF -#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F -typedef void (GL_APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); -typedef void (GL_APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate); -typedef void (GL_APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); -GL_APICALL void GL_APIENTRY glShadingRateEXT (GLenum rate); -GL_APICALL void GL_APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1); -GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); -#endif -#endif /* GL_EXT_fragment_shading_rate */ - -#ifndef GL_EXT_geometry_point_size -#define GL_EXT_geometry_point_size 1 -#endif /* GL_EXT_geometry_point_size */ - -#ifndef GL_EXT_geometry_shader -#define GL_EXT_geometry_shader 1 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 -#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 -#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 -#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 -#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F -#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_UNDEFINED_VERTEX_EXT 0x8260 -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 -#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif -#endif /* GL_EXT_geometry_shader */ - -#ifndef GL_EXT_gpu_shader5 -#define GL_EXT_gpu_shader5 1 -#endif /* GL_EXT_gpu_shader5 */ - -#ifndef GL_EXT_instanced_arrays -#define GL_EXT_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor); -#endif -#endif /* GL_EXT_instanced_arrays */ - -#ifndef GL_EXT_map_buffer_range -#define GL_EXT_map_buffer_range 1 -#define GL_MAP_READ_BIT_EXT 0x0001 -#define GL_MAP_WRITE_BIT_EXT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 -typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); -#endif -#endif /* GL_EXT_map_buffer_range */ - -#ifndef GL_EXT_memory_object -#define GL_EXT_memory_object 1 -#define GL_TEXTURE_TILING_EXT 0x9580 -#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 -#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B -#define GL_NUM_TILING_TYPES_EXT 0x9582 -#define GL_TILING_TYPES_EXT 0x9583 -#define GL_OPTIMAL_TILING_EXT 0x9584 -#define GL_LINEAR_TILING_EXT 0x9585 -#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 -#define GL_DEVICE_UUID_EXT 0x9597 -#define GL_DRIVER_UUID_EXT 0x9598 -#define GL_UUID_SIZE_EXT 16 -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); -typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); -typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); -typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); -GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); -GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); -GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); -GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); -GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_EXT_memory_object */ - -#ifndef GL_EXT_memory_object_fd -#define GL_EXT_memory_object_fd 1 -#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_memory_object_fd */ - -#ifndef GL_EXT_memory_object_win32 -#define GL_EXT_memory_object_win32 1 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 -#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 -#define GL_DEVICE_LUID_EXT 0x9599 -#define GL_DEVICE_NODE_MASK_EXT 0x959A -#define GL_LUID_SIZE_EXT 8 -#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 -#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A -#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B -#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); -GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_memory_object_win32 */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); -#endif -#endif /* GL_EXT_multi_draw_arrays */ - -#ifndef GL_EXT_multi_draw_indirect -#define GL_EXT_multi_draw_indirect 1 -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); -GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); -#endif -#endif /* GL_EXT_multi_draw_indirect */ - -#ifndef GL_EXT_multisampled_compatibility -#define GL_EXT_multisampled_compatibility 1 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#endif /* GL_EXT_multisampled_compatibility */ - -#ifndef GL_EXT_multisampled_render_to_texture -#define GL_EXT_multisampled_render_to_texture 1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -#endif /* GL_EXT_multisampled_render_to_texture */ - -#ifndef GL_EXT_multisampled_render_to_texture2 -#define GL_EXT_multisampled_render_to_texture2 1 -#endif /* GL_EXT_multisampled_render_to_texture2 */ - -#ifndef GL_EXT_multiview_draw_buffers -#define GL_EXT_multiview_draw_buffers 1 -#define GL_COLOR_ATTACHMENT_EXT 0x90F0 -#define GL_MULTIVIEW_EXT 0x90F1 -#define GL_DRAW_BUFFER_EXT 0x0C01 -#define GL_READ_BUFFER_EXT 0x0C02 -#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 -typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); -GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); -GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); -#endif -#endif /* GL_EXT_multiview_draw_buffers */ - -#ifndef GL_EXT_multiview_tessellation_geometry_shader -#define GL_EXT_multiview_tessellation_geometry_shader 1 -#endif /* GL_EXT_multiview_tessellation_geometry_shader */ - -#ifndef GL_EXT_multiview_texture_multisample -#define GL_EXT_multiview_texture_multisample 1 -#endif /* GL_EXT_multiview_texture_multisample */ - -#ifndef GL_EXT_multiview_timer_query -#define GL_EXT_multiview_timer_query 1 -#endif /* GL_EXT_multiview_timer_query */ - -#ifndef GL_EXT_occlusion_query_boolean -#define GL_EXT_occlusion_query_boolean 1 -#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A -#endif /* GL_EXT_occlusion_query_boolean */ - -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); -#endif -#endif /* GL_EXT_polygon_offset_clamp */ - -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 -#endif /* GL_EXT_post_depth_coverage */ - -#ifndef GL_EXT_primitive_bounding_box -#define GL_EXT_primitive_bounding_box 1 -#define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -#endif -#endif /* GL_EXT_primitive_bounding_box */ - -#ifndef GL_EXT_protected_textures -#define GL_EXT_protected_textures 1 -#define GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT 0x00000010 -#define GL_TEXTURE_PROTECTED_EXT 0x8BFA -#endif /* GL_EXT_protected_textures */ - -#ifndef GL_EXT_pvrtc_sRGB -#define GL_EXT_pvrtc_sRGB 1 -#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 -#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 -#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 -#endif /* GL_EXT_pvrtc_sRGB */ - -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); -#endif -#endif /* GL_EXT_raster_multisample */ - -#ifndef GL_EXT_read_format_bgra -#define GL_EXT_read_format_bgra 1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 -#endif /* GL_EXT_read_format_bgra */ - -#ifndef GL_EXT_render_snorm -#define GL_EXT_render_snorm 1 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM_EXT 0x8F98 -#define GL_RG16_SNORM_EXT 0x8F99 -#define GL_RGBA16_SNORM_EXT 0x8F9B -#endif /* GL_EXT_render_snorm */ - -#ifndef GL_EXT_robustness -#define GL_EXT_robustness 1 -#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 -#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 -#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 -#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); -GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); -#endif -#endif /* GL_EXT_robustness */ - -#ifndef GL_EXT_sRGB -#define GL_EXT_sRGB 1 -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 -#endif /* GL_EXT_sRGB */ - -#ifndef GL_EXT_sRGB_write_control -#define GL_EXT_sRGB_write_control 1 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#endif /* GL_EXT_sRGB_write_control */ - -#ifndef GL_EXT_semaphore -#define GL_EXT_semaphore 1 -#define GL_LAYOUT_GENERAL_EXT 0x958D -#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E -#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F -#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 -#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 -#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 -#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 -#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 -#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 -typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); -typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); -typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); -GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); -GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore); -GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -#endif -#endif /* GL_EXT_semaphore */ - -#ifndef GL_EXT_semaphore_fd -#define GL_EXT_semaphore_fd 1 -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); -#endif -#endif /* GL_EXT_semaphore_fd */ - -#ifndef GL_EXT_semaphore_win32 -#define GL_EXT_semaphore_win32 1 -#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 -#define GL_D3D12_FENCE_VALUE_EXT 0x9595 -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); -GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); -#endif -#endif /* GL_EXT_semaphore_win32 */ - -#ifndef GL_EXT_separate_depth_stencil -#define GL_EXT_separate_depth_stencil 1 -#endif /* GL_EXT_separate_depth_stencil */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#define GL_ACTIVE_PROGRAM_EXT 0x8259 -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); -GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); -GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_EXT_separate_shader_objects */ - -#ifndef GL_EXT_shader_framebuffer_fetch -#define GL_EXT_shader_framebuffer_fetch 1 -#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 -#endif /* GL_EXT_shader_framebuffer_fetch */ - -#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent -#define GL_EXT_shader_framebuffer_fetch_non_coherent 1 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void); -#endif -#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ - -#ifndef GL_EXT_shader_group_vote -#define GL_EXT_shader_group_vote 1 -#endif /* GL_EXT_shader_group_vote */ - -#ifndef GL_EXT_shader_implicit_conversions -#define GL_EXT_shader_implicit_conversions 1 -#endif /* GL_EXT_shader_implicit_conversions */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - -#ifndef GL_EXT_shader_io_blocks -#define GL_EXT_shader_io_blocks 1 -#endif /* GL_EXT_shader_io_blocks */ - -#ifndef GL_EXT_shader_non_constant_global_initializers -#define GL_EXT_shader_non_constant_global_initializers 1 -#endif /* GL_EXT_shader_non_constant_global_initializers */ - -#ifndef GL_EXT_shader_pixel_local_storage -#define GL_EXT_shader_pixel_local_storage 1 -#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 -#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 -#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 -#endif /* GL_EXT_shader_pixel_local_storage */ - -#ifndef GL_EXT_shader_pixel_local_storage2 -#define GL_EXT_shader_pixel_local_storage2 1 -#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 -#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 -#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); -typedef GLsizei (GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); -typedef void (GL_APIENTRYP PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size); -GL_APICALL GLsizei GL_APIENTRY glGetFramebufferPixelLocalStorageSizeEXT (GLuint target); -GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint *values); -#endif -#endif /* GL_EXT_shader_pixel_local_storage2 */ - -#ifndef GL_EXT_shader_samples_identical -#define GL_EXT_shader_samples_identical 1 -#endif /* GL_EXT_shader_samples_identical */ - -#ifndef GL_EXT_shader_texture_lod -#define GL_EXT_shader_texture_lod 1 -#endif /* GL_EXT_shader_texture_lod */ - -#ifndef GL_EXT_shadow_samplers -#define GL_EXT_shadow_samplers 1 -#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C -#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D -#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E -#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 -#endif /* GL_EXT_shadow_samplers */ - -#ifndef GL_EXT_sparse_texture -#define GL_EXT_sparse_texture 1 -#define GL_TEXTURE_SPARSE_EXT 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 -#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA -#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_TEXTURE_3D 0x806F -#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 -typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -#endif -#endif /* GL_EXT_sparse_texture */ - -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 -#endif /* GL_EXT_sparse_texture2 */ - -#ifndef GL_EXT_tessellation_point_size -#define GL_EXT_tessellation_point_size 1 -#endif /* GL_EXT_tessellation_point_size */ - -#ifndef GL_EXT_tessellation_shader -#define GL_EXT_tessellation_shader 1 -#define GL_PATCHES_EXT 0x000E -#define GL_PATCH_VERTICES_EXT 0x8E72 -#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75 -#define GL_TESS_GEN_MODE_EXT 0x8E76 -#define GL_TESS_GEN_SPACING_EXT 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78 -#define GL_TESS_GEN_POINT_MODE_EXT 0x8E79 -#define GL_ISOLINES_EXT 0x8E7A -#define GL_QUADS_EXT 0x0007 -#define GL_FRACTIONAL_ODD_EXT 0x8E7B -#define GL_FRACTIONAL_EVEN_EXT 0x8E7C -#define GL_MAX_PATCH_VERTICES_EXT 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4 -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_IS_PER_PATCH_EXT 0x92E7 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308 -#define GL_TESS_CONTROL_SHADER_EXT 0x8E88 -#define GL_TESS_EVALUATION_SHADER_EXT 0x8E87 -#define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010 -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value); -#endif -#endif /* GL_EXT_tessellation_shader */ - -#ifndef GL_EXT_texture_border_clamp -#define GL_EXT_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_EXT 0x1004 -#define GL_CLAMP_TO_BORDER_EXT 0x812D -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params); -#endif -#endif /* GL_EXT_texture_border_clamp */ - -#ifndef GL_EXT_texture_buffer -#define GL_EXT_texture_buffer 1 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D -#define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E -typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -#endif -#endif /* GL_EXT_texture_buffer */ - -#ifndef GL_EXT_texture_compression_astc_decode_mode -#define GL_EXT_texture_compression_astc_decode_mode 1 -#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 -#endif /* GL_EXT_texture_compression_astc_decode_mode */ - -#ifndef GL_EXT_texture_compression_bptc -#define GL_EXT_texture_compression_bptc 1 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F -#endif /* GL_EXT_texture_compression_bptc */ - -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#endif /* GL_EXT_texture_compression_dxt1 */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif /* GL_EXT_texture_compression_rgtc */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif /* GL_EXT_texture_compression_s3tc */ - -#ifndef GL_EXT_texture_compression_s3tc_srgb -#define GL_EXT_texture_compression_s3tc_srgb 1 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif /* GL_EXT_texture_compression_s3tc_srgb */ - -#ifndef GL_EXT_texture_cube_map_array -#define GL_EXT_texture_cube_map_array 1 -#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A -#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#endif /* GL_EXT_texture_cube_map_array */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif /* GL_EXT_texture_filter_anisotropic */ - -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 -#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 -#define GL_WEIGHTED_AVERAGE_EXT 0x9367 -#endif /* GL_EXT_texture_filter_minmax */ - -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_EXT_texture_format_BGRA8888 1 -#endif /* GL_EXT_texture_format_BGRA8888 */ - -#ifndef GL_EXT_texture_format_sRGB_override -#define GL_EXT_texture_format_sRGB_override 1 -#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF -#endif /* GL_EXT_texture_format_sRGB_override */ - -#ifndef GL_EXT_texture_mirror_clamp_to_edge -#define GL_EXT_texture_mirror_clamp_to_edge 1 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#endif /* GL_EXT_texture_mirror_clamp_to_edge */ - -#ifndef GL_EXT_texture_norm16 -#define GL_EXT_texture_norm16 1 -#define GL_R16_EXT 0x822A -#define GL_RG16_EXT 0x822C -#define GL_RGBA16_EXT 0x805B -#define GL_RGB16_EXT 0x8054 -#define GL_RGB16_SNORM_EXT 0x8F9A -#endif /* GL_EXT_texture_norm16 */ - -#ifndef GL_EXT_texture_query_lod -#define GL_EXT_texture_query_lod 1 -#endif /* GL_EXT_texture_query_lod */ - -#ifndef GL_EXT_texture_rg -#define GL_EXT_texture_rg 1 -#define GL_RED_EXT 0x1903 -#define GL_RG_EXT 0x8227 -#define GL_R8_EXT 0x8229 -#define GL_RG8_EXT 0x822B -#endif /* GL_EXT_texture_rg */ - -#ifndef GL_EXT_texture_sRGB_R8 -#define GL_EXT_texture_sRGB_R8 1 -#define GL_SR8_EXT 0x8FBD -#endif /* GL_EXT_texture_sRGB_R8 */ - -#ifndef GL_EXT_texture_sRGB_RG8 -#define GL_EXT_texture_sRGB_RG8 1 -#define GL_SRG8_EXT 0x8FBE -#endif /* GL_EXT_texture_sRGB_RG8 */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif /* GL_EXT_texture_sRGB_decode */ - -#ifndef GL_EXT_texture_shadow_lod -#define GL_EXT_texture_shadow_lod 1 -#endif /* GL_EXT_texture_shadow_lod */ - -#ifndef GL_EXT_texture_storage -#define GL_EXT_texture_storage 1 -#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F -#define GL_ALPHA8_EXT 0x803C -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_RGBA32F_EXT 0x8814 -#define GL_RGB32F_EXT 0x8815 -#define GL_ALPHA32F_EXT 0x8816 -#define GL_LUMINANCE32F_EXT 0x8818 -#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 -#define GL_ALPHA16F_EXT 0x881C -#define GL_LUMINANCE16F_EXT 0x881E -#define GL_LUMINANCE_ALPHA16F_EXT 0x881F -#define GL_R32F_EXT 0x822E -#define GL_RG32F_EXT 0x8230 -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif -#endif /* GL_EXT_texture_storage */ - -#ifndef GL_EXT_texture_storage_compression -#define GL_EXT_texture_storage_compression 1 -#define GL_NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E -#define GL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9 -#define GL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA -#define GL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB -#define GL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC -#define GL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD -#define GL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE -#define GL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorageAttribs2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); -GL_APICALL void GL_APIENTRY glTexStorageAttribs3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); -#endif -#endif /* GL_EXT_texture_storage_compression */ - -#ifndef GL_EXT_texture_type_2_10_10_10_REV -#define GL_EXT_texture_type_2_10_10_10_REV 1 -#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 -#endif /* GL_EXT_texture_type_2_10_10_10_REV */ - -#ifndef GL_EXT_texture_view -#define GL_EXT_texture_view 1 -#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE -typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -#endif -#endif /* GL_EXT_texture_view */ - -#ifndef GL_EXT_unpack_subimage -#define GL_EXT_unpack_subimage 1 -#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 -#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 -#endif /* GL_EXT_unpack_subimage */ - -#ifndef GL_EXT_win32_keyed_mutex -#define GL_EXT_win32_keyed_mutex 1 -typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); -typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); -GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); -#endif -#endif /* GL_EXT_win32_keyed_mutex */ - -#ifndef GL_EXT_window_rectangles -#define GL_EXT_window_rectangles 1 -#define GL_INCLUSIVE_EXT 0x8F10 -#define GL_EXCLUSIVE_EXT 0x8F11 -#define GL_WINDOW_RECTANGLE_EXT 0x8F12 -#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 -#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 -#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 -typedef void (GL_APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); -#endif -#endif /* GL_EXT_window_rectangles */ - -#ifndef GL_FJ_shader_binary_GCCSO -#define GL_FJ_shader_binary_GCCSO 1 -#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 -#endif /* GL_FJ_shader_binary_GCCSO */ - -#ifndef GL_IMG_bindless_texture -#define GL_IMG_bindless_texture 1 -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture); -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEIMGPROC) (GLuint texture, GLuint sampler); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64IMGPROC) (GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VIMGPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64IMGPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VIMGPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG (GLuint texture); -GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleIMG (GLuint texture, GLuint sampler); -GL_APICALL void GL_APIENTRY glUniformHandleui64IMG (GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glUniformHandleui64vIMG (GLint location, GLsizei count, const GLuint64 *value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64IMG (GLuint program, GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vIMG (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -#endif -#endif /* GL_IMG_bindless_texture */ - -#ifndef GL_IMG_framebuffer_downsample -#define GL_IMG_framebuffer_downsample 1 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_AND_DOWNSAMPLE_IMG 0x913C -#define GL_NUM_DOWNSAMPLE_SCALES_IMG 0x913D -#define GL_DOWNSAMPLE_SCALES_IMG 0x913E -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SCALE_IMG 0x913F -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTexture2DDownsampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); -GL_APICALL void GL_APIENTRY glFramebufferTextureLayerDownsampleIMG (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); -#endif -#endif /* GL_IMG_framebuffer_downsample */ - -#ifndef GL_IMG_multisampled_render_to_texture -#define GL_IMG_multisampled_render_to_texture 1 -#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 -#define GL_MAX_SAMPLES_IMG 0x9135 -#define GL_TEXTURE_SAMPLES_IMG 0x9136 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -#endif -#endif /* GL_IMG_multisampled_render_to_texture */ - -#ifndef GL_IMG_program_binary -#define GL_IMG_program_binary 1 -#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 -#endif /* GL_IMG_program_binary */ - -#ifndef GL_IMG_read_format -#define GL_IMG_read_format 1 -#define GL_BGRA_IMG 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 -#endif /* GL_IMG_read_format */ - -#ifndef GL_IMG_shader_binary -#define GL_IMG_shader_binary 1 -#define GL_SGX_BINARY_IMG 0x8C0A -#endif /* GL_IMG_shader_binary */ - -#ifndef GL_IMG_texture_compression_pvrtc -#define GL_IMG_texture_compression_pvrtc 1 -#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 -#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 -#endif /* GL_IMG_texture_compression_pvrtc */ - -#ifndef GL_IMG_texture_compression_pvrtc2 -#define GL_IMG_texture_compression_pvrtc2 1 -#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 -#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 -#endif /* GL_IMG_texture_compression_pvrtc2 */ - -#ifndef GL_IMG_texture_filter_cubic -#define GL_IMG_texture_filter_cubic 1 -#define GL_CUBIC_IMG 0x9139 -#define GL_CUBIC_MIPMAP_NEAREST_IMG 0x913A -#define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B -#endif /* GL_IMG_texture_filter_cubic */ - -#ifndef GL_INTEL_blackhole_render -#define GL_INTEL_blackhole_render 1 -#define GL_BLACKHOLE_RENDER_INTEL 0x83FC -#endif /* GL_INTEL_blackhole_render */ - -#ifndef GL_INTEL_conservative_rasterization -#define GL_INTEL_conservative_rasterization 1 -#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE -#endif /* GL_INTEL_conservative_rasterization */ - -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 -typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); -#endif -#endif /* GL_INTEL_framebuffer_CMAA */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - -#ifndef GL_MESA_bgra -#define GL_MESA_bgra 1 -#define GL_BGR_EXT 0x80E0 -#endif /* GL_MESA_bgra */ - -#ifndef GL_MESA_framebuffer_flip_x -#define GL_MESA_framebuffer_flip_x 1 -#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC -#endif /* GL_MESA_framebuffer_flip_x */ - -#ifndef GL_MESA_framebuffer_flip_y -#define GL_MESA_framebuffer_flip_y 1 -#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); -#endif -#endif /* GL_MESA_framebuffer_flip_y */ - -#ifndef GL_MESA_framebuffer_swap_xy -#define GL_MESA_framebuffer_swap_xy 1 -#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD -#endif /* GL_MESA_framebuffer_swap_xy */ - -#ifndef GL_MESA_program_binary_formats -#define GL_MESA_program_binary_formats 1 -#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F -#endif /* GL_MESA_program_binary_formats */ - -#ifndef GL_MESA_shader_integer_functions -#define GL_MESA_shader_integer_functions 1 -#endif /* GL_MESA_shader_integer_functions */ - -#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers -#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 -#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture); -GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif -#endif /* GL_NV_bindless_texture */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glBlendBarrierNV (void); -#endif -#endif /* GL_NV_blend_equation_advanced */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#endif /* GL_NV_blend_equation_advanced_coherent */ - -#ifndef GL_NV_blend_minmax_factor -#define GL_NV_blend_minmax_factor 1 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif /* GL_NV_blend_minmax_factor */ - -#ifndef GL_NV_clip_space_w_scaling -#define GL_NV_clip_space_w_scaling 1 -#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C -#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D -#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E -typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); -#endif -#endif /* GL_NV_clip_space_w_scaling */ - -#ifndef GL_NV_compute_shader_derivatives -#define GL_NV_compute_shader_derivatives 1 -#endif /* GL_NV_compute_shader_derivatives */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void); -#endif -#endif /* GL_NV_conditional_render */ - -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 -typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); -#endif -#endif /* GL_NV_conservative_raster */ - -#ifndef GL_NV_conservative_raster_pre_snap -#define GL_NV_conservative_raster_pre_snap 1 -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 -#endif /* GL_NV_conservative_raster_pre_snap */ - -#ifndef GL_NV_conservative_raster_pre_snap_triangles -#define GL_NV_conservative_raster_pre_snap_triangles 1 -#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D -#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E -#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F -typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); -#endif -#endif /* GL_NV_conservative_raster_pre_snap_triangles */ - -#ifndef GL_NV_copy_buffer -#define GL_NV_copy_buffer 1 -#define GL_COPY_READ_BUFFER_NV 0x8F36 -#define GL_COPY_WRITE_BUFFER_NV 0x8F37 -typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif -#endif /* GL_NV_copy_buffer */ - -#ifndef GL_NV_coverage_sample -#define GL_NV_coverage_sample 1 -#define GL_COVERAGE_COMPONENT_NV 0x8ED0 -#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 -#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 -#define GL_COVERAGE_BUFFERS_NV 0x8ED3 -#define GL_COVERAGE_SAMPLES_NV 0x8ED4 -#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 -#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 -#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 -#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 -typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); -typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); -GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); -#endif -#endif /* GL_NV_coverage_sample */ - -#ifndef GL_NV_depth_nonlinear -#define GL_NV_depth_nonlinear 1 -#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C -#endif /* GL_NV_depth_nonlinear */ - -#ifndef GL_NV_draw_buffers -#define GL_NV_draw_buffers 1 -#define GL_MAX_DRAW_BUFFERS_NV 0x8824 -#define GL_DRAW_BUFFER0_NV 0x8825 -#define GL_DRAW_BUFFER1_NV 0x8826 -#define GL_DRAW_BUFFER2_NV 0x8827 -#define GL_DRAW_BUFFER3_NV 0x8828 -#define GL_DRAW_BUFFER4_NV 0x8829 -#define GL_DRAW_BUFFER5_NV 0x882A -#define GL_DRAW_BUFFER6_NV 0x882B -#define GL_DRAW_BUFFER7_NV 0x882C -#define GL_DRAW_BUFFER8_NV 0x882D -#define GL_DRAW_BUFFER9_NV 0x882E -#define GL_DRAW_BUFFER10_NV 0x882F -#define GL_DRAW_BUFFER11_NV 0x8830 -#define GL_DRAW_BUFFER12_NV 0x8831 -#define GL_DRAW_BUFFER13_NV 0x8832 -#define GL_DRAW_BUFFER14_NV 0x8833 -#define GL_DRAW_BUFFER15_NV 0x8834 -#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 -#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 -#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 -#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 -#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 -#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 -#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 -#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 -#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 -#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 -#define GL_COLOR_ATTACHMENT10_NV 0x8CEA -#define GL_COLOR_ATTACHMENT11_NV 0x8CEB -#define GL_COLOR_ATTACHMENT12_NV 0x8CEC -#define GL_COLOR_ATTACHMENT13_NV 0x8CED -#define GL_COLOR_ATTACHMENT14_NV 0x8CEE -#define GL_COLOR_ATTACHMENT15_NV 0x8CEF -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); -#endif -#endif /* GL_NV_draw_buffers */ - -#ifndef GL_NV_draw_instanced -#define GL_NV_draw_instanced 1 -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -#endif -#endif /* GL_NV_draw_instanced */ - -#ifndef GL_NV_draw_vulkan_image -#define GL_NV_draw_vulkan_image 1 -typedef void (GL_APIENTRY *GLVULKANPROCNV)(void); -typedef void (GL_APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -typedef GLVULKANPROCNV (GL_APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); -typedef void (GL_APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (GL_APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); -typedef void (GL_APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -GL_APICALL GLVULKANPROCNV GL_APIENTRY glGetVkProcAddrNV (const GLchar *name); -GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); -GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); -GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence); -#endif -#endif /* GL_NV_draw_vulkan_image */ - -#ifndef GL_NV_explicit_attrib_location -#define GL_NV_explicit_attrib_location 1 -#endif /* GL_NV_explicit_attrib_location */ - -#ifndef GL_NV_fbo_color_attachments -#define GL_NV_fbo_color_attachments 1 -#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF -#endif /* GL_NV_fbo_color_attachments */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); -GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif -#endif /* GL_NV_fence */ - -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 -#define GL_FILL_RECTANGLE_NV 0x933C -#endif /* GL_NV_fill_rectangle */ - -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE -typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color); -#endif -#endif /* GL_NV_fragment_coverage_to_color */ - -#ifndef GL_NV_fragment_shader_barycentric -#define GL_NV_fragment_shader_barycentric 1 -#endif /* GL_NV_fragment_shader_barycentric */ - -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 -#endif /* GL_NV_fragment_shader_interlock */ - -#ifndef GL_NV_framebuffer_blit -#define GL_NV_framebuffer_blit 1 -#define GL_READ_FRAMEBUFFER_NV 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -#endif /* GL_NV_framebuffer_blit */ - -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 -typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); -typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); -GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); -GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components); -#endif -#endif /* GL_NV_framebuffer_mixed_samples */ - -#ifndef GL_NV_framebuffer_multisample -#define GL_NV_framebuffer_multisample 1 -#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 -#define GL_MAX_SAMPLES_NV 0x8D57 -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif /* GL_NV_framebuffer_multisample */ - -#ifndef GL_NV_generate_mipmap_sRGB -#define GL_NV_generate_mipmap_sRGB 1 -#endif /* GL_NV_generate_mipmap_sRGB */ - -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 -#endif /* GL_NV_geometry_shader_passthrough */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -typedef khronos_int64_t GLint64EXT; -typedef khronos_uint64_t GLuint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -#define GL_PATCHES 0x000E -typedef void (GL_APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (GL_APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GL_APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GL_APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GL_APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GL_APICALL void GL_APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GL_APICALL void GL_APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GL_APICALL void GL_APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GL_APICALL void GL_APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GL_APICALL void GL_APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GL_APICALL void GL_APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GL_APICALL void GL_APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GL_APICALL void GL_APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GL_APICALL void GL_APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GL_APICALL void GL_APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GL_APICALL void GL_APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GL_APICALL void GL_APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GL_APICALL void GL_APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GL_APICALL void GL_APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GL_APICALL void GL_APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GL_APICALL void GL_APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GL_APICALL void GL_APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GL_APICALL void GL_APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_NV_gpu_shader5 */ - -#ifndef GL_NV_image_formats -#define GL_NV_image_formats 1 -#endif /* GL_NV_image_formats */ - -#ifndef GL_NV_instanced_arrays -#define GL_NV_instanced_arrays 1 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); -#endif -#endif /* GL_NV_instanced_arrays */ - -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); -#endif -#endif /* GL_NV_internalformat_sample_query */ - -#ifndef GL_NV_memory_attachment -#define GL_NV_memory_attachment 1 -#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 -#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 -#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 -#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 -#define GL_MEMORY_ATTACHABLE_NV 0x95A8 -#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 -#define GL_DETACHED_TEXTURES_NV 0x95AA -#define GL_DETACHED_BUFFERS_NV 0x95AB -#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC -#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD -typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); -typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); -GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); -GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); -#endif -#endif /* GL_NV_memory_attachment */ - -#ifndef GL_NV_memory_object_sparse -#define GL_NV_memory_object_sparse 1 -typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); -GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); -#endif -#endif /* GL_NV_memory_object_sparse */ - -#ifndef GL_NV_mesh_shader -#define GL_NV_mesh_shader 1 -#define GL_MESH_SHADER_NV 0x9559 -#define GL_TASK_SHADER_NV 0x955A -#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 -#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 -#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 -#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 -#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 -#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 -#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 -#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 -#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 -#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 -#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A -#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B -#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C -#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D -#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E -#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F -#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 -#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 -#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 -#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 -#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 -#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 -#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A -#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D -#define GL_MAX_MESH_VIEWS_NV 0x9557 -#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF -#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 -#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B -#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C -#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E -#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F -#define GL_MESH_VERTICES_OUT_NV 0x9579 -#define GL_MESH_PRIMITIVES_OUT_NV 0x957A -#define GL_MESH_OUTPUT_TYPE_NV 0x957B -#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D -#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 -#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 -#define GL_MESH_SHADER_BIT_NV 0x00000040 -#define GL_TASK_SHADER_BIT_NV 0x00000080 -#define GL_MESH_SUBROUTINE_NV 0x957C -#define GL_TASK_SUBROUTINE_NV 0x957D -#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E -#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F -typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); -typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); -GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); -GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); -GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -#endif -#endif /* GL_NV_mesh_shader */ - -#ifndef GL_NV_non_square_matrices -#define GL_NV_non_square_matrices 1 -#define GL_FLOAT_MAT2x3_NV 0x8B65 -#define GL_FLOAT_MAT2x4_NV 0x8B66 -#define GL_FLOAT_MAT3x2_NV 0x8B67 -#define GL_FLOAT_MAT3x4_NV 0x8B68 -#define GL_FLOAT_MAT4x2_NV 0x8B69 -#define GL_FLOAT_MAT4x3_NV 0x8B6A -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif -#endif /* GL_NV_non_square_matrices */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -typedef double GLdouble; -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D -typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range); -GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path); -GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func); -GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); -GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); -GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode); -GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -#endif -#endif /* GL_NV_path_rendering */ - -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 -#define GL_SHARED_EDGE_NV 0xC0 -#endif /* GL_NV_path_rendering_shared_edge */ - -#ifndef GL_NV_pixel_buffer_object -#define GL_NV_pixel_buffer_object 1 -#define GL_PIXEL_PACK_BUFFER_NV 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF -#endif /* GL_NV_pixel_buffer_object */ - -#ifndef GL_NV_polygon_mode -#define GL_NV_polygon_mode 1 -#define GL_POLYGON_MODE_NV 0x0B40 -#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 -#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 -#define GL_POINT_NV 0x1B00 -#define GL_LINE_NV 0x1B01 -#define GL_FILL_NV 0x1B02 -typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode); -#endif -#endif /* GL_NV_polygon_mode */ - -#ifndef GL_NV_primitive_shading_rate -#define GL_NV_primitive_shading_rate 1 -#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 -#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 -#endif /* GL_NV_primitive_shading_rate */ - -#ifndef GL_NV_read_buffer -#define GL_NV_read_buffer 1 -#define GL_READ_BUFFER_NV 0x0C02 -typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); -#endif -#endif /* GL_NV_read_buffer */ - -#ifndef GL_NV_read_buffer_front -#define GL_NV_read_buffer_front 1 -#endif /* GL_NV_read_buffer_front */ - -#ifndef GL_NV_read_depth -#define GL_NV_read_depth 1 -#endif /* GL_NV_read_depth */ - -#ifndef GL_NV_read_depth_stencil -#define GL_NV_read_depth_stencil 1 -#endif /* GL_NV_read_depth_stencil */ - -#ifndef GL_NV_read_stencil -#define GL_NV_read_stencil 1 -#endif /* GL_NV_read_stencil */ - -#ifndef GL_NV_representative_fragment_test -#define GL_NV_representative_fragment_test 1 -#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F -#endif /* GL_NV_representative_fragment_test */ - -#ifndef GL_NV_sRGB_formats -#define GL_NV_sRGB_formats 1 -#define GL_SLUMINANCE_NV 0x8C46 -#define GL_SLUMINANCE_ALPHA_NV 0x8C44 -#define GL_SRGB8_NV 0x8C41 -#define GL_SLUMINANCE8_NV 0x8C47 -#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 -#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F -#define GL_ETC1_SRGB8_NV 0x88EE -#endif /* GL_NV_sRGB_formats */ - -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void); -#endif -#endif /* GL_NV_sample_locations */ - -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 -#endif /* GL_NV_sample_mask_override_coverage */ - -#ifndef GL_NV_scissor_exclusive -#define GL_NV_scissor_exclusive 1 -#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 -#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 -typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); -#endif -#endif /* GL_NV_scissor_exclusive */ - -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 -#endif /* GL_NV_shader_atomic_fp16_vector */ - -#ifndef GL_NV_shader_noperspective_interpolation -#define GL_NV_shader_noperspective_interpolation 1 -#endif /* GL_NV_shader_noperspective_interpolation */ - -#ifndef GL_NV_shader_subgroup_partitioned -#define GL_NV_shader_subgroup_partitioned 1 -#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 -#endif /* GL_NV_shader_subgroup_partitioned */ - -#ifndef GL_NV_shader_texture_footprint -#define GL_NV_shader_texture_footprint 1 -#endif /* GL_NV_shader_texture_footprint */ - -#ifndef GL_NV_shading_rate_image -#define GL_NV_shading_rate_image 1 -#define GL_SHADING_RATE_IMAGE_NV 0x9563 -#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 -#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 -#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 -#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 -#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A -#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B -#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C -#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D -#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E -#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F -#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B -#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C -#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D -#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E -#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F -#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE -#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF -#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 -typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); -typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); -typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); -typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); -typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); -typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture); -GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); -GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); -GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); -GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); -GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order); -GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); -#endif -#endif /* GL_NV_shading_rate_image */ - -#ifndef GL_NV_shadow_samplers_array -#define GL_NV_shadow_samplers_array 1 -#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 -#endif /* GL_NV_shadow_samplers_array */ - -#ifndef GL_NV_shadow_samplers_cube -#define GL_NV_shadow_samplers_cube 1 -#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 -#endif /* GL_NV_shadow_samplers_cube */ - -#ifndef GL_NV_stereo_view_rendering -#define GL_NV_stereo_view_rendering 1 -#endif /* GL_NV_stereo_view_rendering */ - -#ifndef GL_NV_texture_border_clamp -#define GL_NV_texture_border_clamp 1 -#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 -#define GL_CLAMP_TO_BORDER_NV 0x812D -#endif /* GL_NV_texture_border_clamp */ - -#ifndef GL_NV_texture_compression_s3tc_update -#define GL_NV_texture_compression_s3tc_update 1 -#endif /* GL_NV_texture_compression_s3tc_update */ - -#ifndef GL_NV_texture_npot_2D_mipmap -#define GL_NV_texture_npot_2D_mipmap 1 -#endif /* GL_NV_texture_npot_2D_mipmap */ - -#ifndef GL_NV_timeline_semaphore -#define GL_NV_timeline_semaphore 1 -#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 -#define GL_SEMAPHORE_TYPE_NV 0x95B3 -#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 -#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 -#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 -typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); -GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); -#endif -#endif /* GL_NV_timeline_semaphore */ - -#ifndef GL_NV_viewport_array -#define GL_NV_viewport_array 1 -#define GL_MAX_VIEWPORTS_NV 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F -typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v); -GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v); -GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v); -GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data); -GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index); -#endif -#endif /* GL_NV_viewport_array */ - -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 -#endif /* GL_NV_viewport_array2 */ - -#ifndef GL_NV_viewport_swizzle -#define GL_NV_viewport_swizzle 1 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 -#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 -#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 -#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 -#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 -#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A -#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B -typedef void (GL_APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); -#endif -#endif /* GL_NV_viewport_swizzle */ - -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -#endif -#endif /* GL_OVR_multiview */ - -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 -#endif /* GL_OVR_multiview2 */ - -#ifndef GL_OVR_multiview_multisampled_render_to_texture -#define GL_OVR_multiview_multisampled_render_to_texture 1 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); -#endif -#endif /* GL_OVR_multiview_multisampled_render_to_texture */ - -#ifndef GL_QCOM_YUV_texture_gather -#define GL_QCOM_YUV_texture_gather 1 -#endif /* GL_QCOM_YUV_texture_gather */ - -#ifndef GL_QCOM_alpha_test -#define GL_QCOM_alpha_test 1 -#define GL_ALPHA_TEST_QCOM 0x0BC0 -#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 -#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 -typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); -#endif -#endif /* GL_QCOM_alpha_test */ - -#ifndef GL_QCOM_binning_control -#define GL_QCOM_binning_control 1 -#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 -#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 -#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 -#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 -#endif /* GL_QCOM_binning_control */ - -#ifndef GL_QCOM_driver_control -#define GL_QCOM_driver_control 1 -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); -GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); -GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); -GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); -#endif -#endif /* GL_QCOM_driver_control */ - -#ifndef GL_QCOM_extended_get -#define GL_QCOM_extended_get 1 -#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 -#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 -#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 -#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 -#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 -#define GL_TEXTURE_TYPE_QCOM 0x8BD7 -#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 -#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 -#define GL_TEXTURE_TARGET_QCOM 0x8BDA -#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB -#define GL_STATE_RESTORE 0x8BDC -typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); -typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); -GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); -GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); -GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); -GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); -GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); -#endif -#endif /* GL_QCOM_extended_get */ - -#ifndef GL_QCOM_extended_get2 -#define GL_QCOM_extended_get2 1 -typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); -typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); -GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); -GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); -GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); -#endif -#endif /* GL_QCOM_extended_get2 */ - -#ifndef GL_QCOM_frame_extrapolation -#define GL_QCOM_frame_extrapolation 1 -typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); -#endif -#endif /* GL_QCOM_frame_extrapolation */ - -#ifndef GL_QCOM_framebuffer_foveated -#define GL_QCOM_framebuffer_foveated 1 -#define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001 -#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x00000002 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFoveationConfigQCOM (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); -GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#endif -#endif /* GL_QCOM_framebuffer_foveated */ - -#ifndef GL_QCOM_motion_estimation -#define GL_QCOM_motion_estimation 1 -#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90 -#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91 -typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output); -typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output); -GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask); -#endif -#endif /* GL_QCOM_motion_estimation */ - -#ifndef GL_QCOM_perfmon_global_mode -#define GL_QCOM_perfmon_global_mode 1 -#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 -#endif /* GL_QCOM_perfmon_global_mode */ - -#ifndef GL_QCOM_render_shared_exponent -#define GL_QCOM_render_shared_exponent 1 -#endif /* GL_QCOM_render_shared_exponent */ - -#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent -#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 -#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void); -#endif -#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ - -#ifndef GL_QCOM_shader_framebuffer_fetch_rate -#define GL_QCOM_shader_framebuffer_fetch_rate 1 -#endif /* GL_QCOM_shader_framebuffer_fetch_rate */ - -#ifndef GL_QCOM_shading_rate -#define GL_QCOM_shading_rate 1 -#define GL_SHADING_RATE_QCOM 0x96A4 -#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5 -#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6 -#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7 -#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8 -#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9 -#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC -#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE -typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate); -#endif -#endif /* GL_QCOM_shading_rate */ - -#ifndef GL_QCOM_texture_foveated -#define GL_QCOM_texture_foveated 1 -#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB -#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC -#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD -#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE -#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF -typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); -#endif -#endif /* GL_QCOM_texture_foveated */ - -#ifndef GL_QCOM_texture_foveated2 -#define GL_QCOM_texture_foveated2 1 -#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0 -#endif /* GL_QCOM_texture_foveated2 */ - -#ifndef GL_QCOM_texture_foveated_subsampled_layout -#define GL_QCOM_texture_foveated_subsampled_layout 1 -#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004 -#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1 -#endif /* GL_QCOM_texture_foveated_subsampled_layout */ - -#ifndef GL_QCOM_tiled_rendering -#define GL_QCOM_tiled_rendering 1 -#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 -#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 -#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 -#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 -#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 -#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 -#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 -#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 -#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 -#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 -#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 -#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 -#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 -#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 -#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 -#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 -#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 -#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 -#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 -#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 -#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 -#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 -#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 -#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 -#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 -#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 -#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 -#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 -#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 -#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 -#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 -#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 -typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); -GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); -#endif -#endif /* GL_QCOM_tiled_rendering */ - -#ifndef GL_QCOM_writeonly_rendering -#define GL_QCOM_writeonly_rendering 1 -#define GL_WRITEONLY_RENDERING_QCOM 0x8823 -#endif /* GL_QCOM_writeonly_rendering */ - -#ifndef GL_VIV_shader_binary -#define GL_VIV_shader_binary 1 -#define GL_SHADER_BINARY_VIV 0x8FC4 -#endif /* GL_VIV_shader_binary */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2platform.h b/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2platform.h deleted file mode 100644 index 426796ef..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles2_gl2platform.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __gl2platform_h_ -#define __gl2platform_h_ - -/* -** Copyright 2017-2020 The Khronos Group Inc. -** SPDX-License-Identifier: Apache-2.0 -*/ - -/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h - * - * Adopters may modify khrplatform.h and this file to suit their platform. - * Please contribute modifications back to Khronos as pull requests on the - * public github repository: - * https://github.com/KhronosGroup/OpenGL-Registry - */ - -/*#include */ - -#ifndef GL_APICALL -#define GL_APICALL KHRONOS_APICALL -#endif - -#ifndef GL_APIENTRY -#define GL_APIENTRY KHRONOS_APIENTRY -#endif - -#endif /* __gl2platform_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_opengles2_khrplatform.h b/libs/hwcodec/externals/SDL/include/SDL_opengles2_khrplatform.h deleted file mode 100644 index 01646449..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_opengles2_khrplatform.h +++ /dev/null @@ -1,311 +0,0 @@ -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * The master copy of khrplatform.h is maintained in the Khronos EGL - * Registry repository at https://github.com/KhronosGroup/EGL-Registry - * The last semantic modification to khrplatform.h was at commit ID: - * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by filing pull requests or issues on - * the EGL Registry repository linked above. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_APIENTRY - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) -# define KHRONOS_STATIC 1 -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(KHRONOS_STATIC) - /* If the preprocessor constant KHRONOS_STATIC is defined, make the - * header compatible with static linking. */ -# define KHRONOS_APICALL -#elif defined(_WIN32) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#elif defined(__ANDROID__) -# define KHRONOS_APICALL __attribute__((visibility("default"))) -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIENTRY - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_APIENTRY __stdcall -#else -# define KHRONOS_APIENTRY -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 -/* - * To support platform where unsigned long cannot be used interchangeably with - * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. - * Ideally, we could just use (u)intptr_t everywhere, but this could result in - * ABI breakage if khronos_uintptr_t is changed from unsigned long to - * unsigned long long or similar (this results in different C++ name mangling). - * To avoid changes for existing platforms, we restrict usage of intptr_t to - * platforms where the size of a pointer is larger than the size of long. - */ -#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) -#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ -#define KHRONOS_USE_INTPTR_T -#endif -#endif - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef KHRONOS_USE_INTPTR_T -typedef intptr_t khronos_intptr_t; -typedef uintptr_t khronos_uintptr_t; -#elif defined(_WIN64) -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -#endif - -#if defined(_WIN64) -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_pixels.h b/libs/hwcodec/externals/SDL/include/SDL_pixels.h deleted file mode 100644 index 9abd57b4..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_pixels.h +++ /dev/null @@ -1,644 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_pixels.h - * - * Header for the enumerated pixel format definitions. - */ - -#ifndef SDL_pixels_h_ -#define SDL_pixels_h_ - -#include "SDL_stdinc.h" -#include "SDL_endian.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Transparency definitions - * - * These define alpha as the opacity of a surface. - */ -/* @{ */ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/* @} */ - -/** Pixel type. */ -typedef enum -{ - SDL_PIXELTYPE_UNKNOWN, - SDL_PIXELTYPE_INDEX1, - SDL_PIXELTYPE_INDEX4, - SDL_PIXELTYPE_INDEX8, - SDL_PIXELTYPE_PACKED8, - SDL_PIXELTYPE_PACKED16, - SDL_PIXELTYPE_PACKED32, - SDL_PIXELTYPE_ARRAYU8, - SDL_PIXELTYPE_ARRAYU16, - SDL_PIXELTYPE_ARRAYU32, - SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32 -} SDL_PixelType; - -/** Bitmap pixel order, high bit -> low bit. */ -typedef enum -{ - SDL_BITMAPORDER_NONE, - SDL_BITMAPORDER_4321, - SDL_BITMAPORDER_1234 -} SDL_BitmapOrder; - -/** Packed component order, high bit -> low bit. */ -typedef enum -{ - SDL_PACKEDORDER_NONE, - SDL_PACKEDORDER_XRGB, - SDL_PACKEDORDER_RGBX, - SDL_PACKEDORDER_ARGB, - SDL_PACKEDORDER_RGBA, - SDL_PACKEDORDER_XBGR, - SDL_PACKEDORDER_BGRX, - SDL_PACKEDORDER_ABGR, - SDL_PACKEDORDER_BGRA -} SDL_PackedOrder; - -/** Array component order, low byte -> high byte. */ -/* !!! FIXME: in 2.1, make these not overlap differently with - !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ -typedef enum -{ - SDL_ARRAYORDER_NONE, - SDL_ARRAYORDER_RGB, - SDL_ARRAYORDER_RGBA, - SDL_ARRAYORDER_ARGB, - SDL_ARRAYORDER_BGR, - SDL_ARRAYORDER_BGRA, - SDL_ARRAYORDER_ABGR -} SDL_ArrayOrder; - -/** Packed component layout. */ -typedef enum -{ - SDL_PACKEDLAYOUT_NONE, - SDL_PACKEDLAYOUT_332, - SDL_PACKEDLAYOUT_4444, - SDL_PACKEDLAYOUT_1555, - SDL_PACKEDLAYOUT_5551, - SDL_PACKEDLAYOUT_565, - SDL_PACKEDLAYOUT_8888, - SDL_PACKEDLAYOUT_2101010, - SDL_PACKEDLAYOUT_1010102 -} SDL_PackedLayout; - -#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) - -#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ - ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ - ((bits) << 8) | ((bytes) << 0)) - -#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) -#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) -#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) -#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) -#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) -#define SDL_BYTESPERPIXEL(X) \ - (SDL_ISPIXELFORMAT_FOURCC(X) ? \ - ((((X) == SDL_PIXELFORMAT_YUY2) || \ - ((X) == SDL_PIXELFORMAT_UYVY) || \ - ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) - -#define SDL_ISPIXELFORMAT_INDEXED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) - -#define SDL_ISPIXELFORMAT_PACKED(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) - -#define SDL_ISPIXELFORMAT_ARRAY(format) \ - (!SDL_ISPIXELFORMAT_FOURCC(format) && \ - ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) - -#define SDL_ISPIXELFORMAT_ALPHA(format) \ - ((SDL_ISPIXELFORMAT_PACKED(format) && \ - ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ - (SDL_ISPIXELFORMAT_ARRAY(format) && \ - ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ - (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) - -/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ -#define SDL_ISPIXELFORMAT_FOURCC(format) \ - ((format) && (SDL_PIXELFLAG(format) != 1)) - -/* Note: If you modify this list, update SDL_GetPixelFormatName() */ -typedef enum -{ - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX1MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX4LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX4MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX8 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), - SDL_PIXELFORMAT_RGB332 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_XRGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, - SDL_PIXELFORMAT_XBGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, - SDL_PIXELFORMAT_XRGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, - SDL_PIXELFORMAT_XBGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, - SDL_PIXELFORMAT_ARGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_RGBA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ABGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_BGRA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ARGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_RGBA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_ABGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_BGRA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_RGB565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_BGR565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_RGB24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, - 24, 3), - SDL_PIXELFORMAT_BGR24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, - 24, 3), - SDL_PIXELFORMAT_XRGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_RGBX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_XBGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_BGRX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_ARGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_RGBA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ABGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_BGRA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ARGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - - /* Aliases for RGBA byte arrays of color data, for the current platform */ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, -#else - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, -#endif - - SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ - SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), - SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), - SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), - SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ - SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') -} SDL_PixelFormatEnum; - -/** - * The bits of this structure can be directly reinterpreted as an integer-packed - * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888 - * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems). - */ -typedef struct SDL_Color -{ - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette -{ - int ncolors; - SDL_Color *colors; - Uint32 version; - int refcount; -} SDL_Palette; - -/** - * \note Everything in the pixel format structure is read-only. - */ -typedef struct SDL_PixelFormat -{ - Uint32 format; - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 padding[2]; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - int refcount; - struct SDL_PixelFormat *next; -} SDL_PixelFormat; - -/** - * Get the human readable name of a pixel format. - * - * \param format the pixel format to query - * \returns the human readable name of the specified pixel format or - * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); - -/** - * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. - * - * \param format one of the SDL_PixelFormatEnum values - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask a pointer filled in with the red mask for the format - * \param Gmask a pointer filled in with the green mask for the format - * \param Bmask a pointer filled in with the blue mask for the format - * \param Amask a pointer filled in with the alpha mask for the format - * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't - * possible; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MasksToPixelFormatEnum - */ -extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, - int *bpp, - Uint32 * Rmask, - Uint32 * Gmask, - Uint32 * Bmask, - Uint32 * Amask); - -/** - * Convert a bpp value and RGBA masks to an enumerated pixel format. - * - * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't - * possible. - * - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask the red mask for the format - * \param Gmask the green mask for the format - * \param Bmask the blue mask for the format - * \param Amask the alpha mask for the format - * \returns one of the SDL_PixelFormatEnum values - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_PixelFormatEnumToMasks - */ -extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); - -/** - * Create an SDL_PixelFormat structure corresponding to a pixel format. - * - * Returned structure may come from a shared global cache (i.e. not newly - * allocated), and hence should not be modified, especially the palette. Weird - * errors such as `Blit combination not supported` may occur. - * - * \param pixel_format one of the SDL_PixelFormatEnum values - * \returns the new SDL_PixelFormat structure or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeFormat - */ -extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); - -/** - * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat(). - * - * \param format the SDL_PixelFormat structure to free - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocFormat - */ -extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); - -/** - * Create a palette structure with the specified number of color entries. - * - * The palette entries are initialized to white. - * - * \param ncolors represents the number of color entries in the color palette - * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if - * there wasn't enough memory); call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreePalette - */ -extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); - -/** - * Set the palette for a pixel format structure. - * - * \param format the SDL_PixelFormat structure that will use the palette - * \param palette the SDL_Palette structure that will be used - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocPalette - * \sa SDL_FreePalette - */ -extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, - SDL_Palette *palette); - -/** - * Set a range of colors in a palette. - * - * \param palette the SDL_Palette structure to modify - * \param colors an array of SDL_Color structures to copy into the palette - * \param firstcolor the index of the first palette entry to modify - * \param ncolors the number of entries to modify - * \returns 0 on success or a negative error code if not all of the colors - * could be set; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocPalette - * \sa SDL_CreateRGBSurface - */ -extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, - const SDL_Color * colors, - int firstcolor, int ncolors); - -/** - * Free a palette created with SDL_AllocPalette(). - * - * \param palette the SDL_Palette structure to be freed - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocPalette - */ -extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); - -/** - * Map an RGB triple to an opaque pixel value for a given pixel format. - * - * This function maps the RGB color value to the specified pixel format and - * returns the pixel value best approximating the given RGB color value for - * the given pixel format. - * - * If the format has a palette (8-bit) the index of the closest matching color - * in the palette will be returned. - * - * If the specified pixel format has an alpha component it will be returned as - * all 1 bits (fully opaque). - * - * If the pixel format bpp (color depth) is less than 32-bpp then the unused - * upper bits of the return value can safely be ignored (e.g., with a 16-bpp - * format the return value can be assigned to a Uint16, and similarly a Uint8 - * for an 8-bpp format). - * - * \param format an SDL_PixelFormat structure describing the pixel format - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \returns a pixel value - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRGB - * \sa SDL_GetRGBA - * \sa SDL_MapRGBA - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b); - -/** - * Map an RGBA quadruple to a pixel value for a given pixel format. - * - * This function maps the RGBA color value to the specified pixel format and - * returns the pixel value best approximating the given RGBA color value for - * the given pixel format. - * - * If the specified pixel format has no alpha component the alpha value will - * be ignored (as it will be in formats with a palette). - * - * If the format has a palette (8-bit) the index of the closest matching color - * in the palette will be returned. - * - * If the pixel format bpp (color depth) is less than 32-bpp then the unused - * upper bits of the return value can safely be ignored (e.g., with a 16-bpp - * format the return value can be assigned to a Uint16, and similarly a Uint8 - * for an 8-bpp format). - * - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \param a the alpha component of the pixel in the range 0-255 - * \returns a pixel value - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRGB - * \sa SDL_GetRGBA - * \sa SDL_MapRGB - */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * Get RGB values from a pixel in the specified format. - * - * This function uses the entire 8-bit [0..255] range when converting color - * components from pixel formats with less than 8-bits per RGB component - * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, - * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). - * - * \param pixel a pixel value - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRGBA - * \sa SDL_MapRGB - * \sa SDL_MapRGBA - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b); - -/** - * Get RGBA values from a pixel in the specified format. - * - * This function uses the entire 8-bit [0..255] range when converting color - * components from pixel formats with less than 8-bits per RGB component - * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, - * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). - * - * If the surface has no alpha component, the alpha will be returned as 0xff - * (100% opaque). - * - * \param pixel a pixel value - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component - * \param a a pointer filled in with the alpha component - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRGB - * \sa SDL_MapRGB - * \sa SDL_MapRGBA - */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * Calculate a 256 entry gamma ramp for a gamma value. - * - * \param gamma a gamma value where 0.0 is black and 1.0 is identity - * \param ramp an array of 256 values filled in with the gamma ramp - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowGammaRamp - */ -extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_pixels_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_platform.h b/libs/hwcodec/externals/SDL/include/SDL_platform.h deleted file mode 100644 index d2a7e052..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_platform.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_platform.h - * - * Try to get a standard set of platform defines. - */ - -#ifndef SDL_platform_h_ -#define SDL_platform_h_ - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if (defined(linux) || defined(__linux) || defined(__linux__)) -#undef __LINUX__ -#define __LINUX__ 1 -#endif -#if defined(ANDROID) || defined(__ANDROID__) -#undef __ANDROID__ -#undef __LINUX__ /* do we need to do this? */ -#define __ANDROID__ 1 -#endif -#if defined(__NGAGE__) -#undef __NGAGE__ -#define __NGAGE__ 1 -#endif - -#if defined(__APPLE__) -/* lets us know what version of Mac OS X we're compiling on */ -#include -#include - -/* Fix building with older SDKs that don't define these - See this for more information: - https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets -*/ -#ifndef TARGET_OS_MACCATALYST -#define TARGET_OS_MACCATALYST 0 -#endif -#ifndef TARGET_OS_IOS -#define TARGET_OS_IOS 0 -#endif -#ifndef TARGET_OS_IPHONE -#define TARGET_OS_IPHONE 0 -#endif -#ifndef TARGET_OS_TV -#define TARGET_OS_TV 0 -#endif -#ifndef TARGET_OS_SIMULATOR -#define TARGET_OS_SIMULATOR 0 -#endif - -#if TARGET_OS_TV -#undef __TVOS__ -#define __TVOS__ 1 -#endif -#if TARGET_OS_IPHONE -/* if compiling for iOS */ -#undef __IPHONEOS__ -#define __IPHONEOS__ 1 -#undef __MACOSX__ -#else -/* if not compiling for iOS */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 -# error SDL for Mac OS X only supports deploying on 10.7 and above. -#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */ -#endif /* TARGET_OS_IPHONE */ -#endif /* defined(__APPLE__) */ - -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) || defined(__EMX__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__sun) && defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif - -#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) -/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */ -#if defined(_MSC_VER) && defined(__has_include) -#if __has_include() -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */ -#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */ -#define HAVE_WINAPIFAMILY_H 1 -#else -#define HAVE_WINAPIFAMILY_H 0 -#endif - -#if HAVE_WINAPIFAMILY_H -#include -#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) -#else -#define WINAPI_FAMILY_WINRT 0 -#endif /* HAVE_WINAPIFAMILY_H */ - -#if WINAPI_FAMILY_WINRT -#undef __WINRT__ -#define __WINRT__ 1 -#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */ -#undef __WINGDK__ -#define __WINGDK__ 1 -#elif defined(_GAMING_XBOX_XBOXONE) -#undef __XBOXONE__ -#define __XBOXONE__ 1 -#elif defined(_GAMING_XBOX_SCARLETT) -#undef __XBOXSERIES__ -#define __XBOXSERIES__ 1 -#else -#undef __WINDOWS__ -#define __WINDOWS__ 1 -#endif -#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ - -#if defined(__WINDOWS__) -#undef __WIN32__ -#define __WIN32__ 1 -#endif -/* This is to support generic "any GDK" separate from a platform-specific GDK */ -#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) -#undef __GDK__ -#define __GDK__ 1 -#endif -#if defined(__PSP__) -#undef __PSP__ -#define __PSP__ 1 -#endif -#if defined(PS2) -#define __PS2__ 1 -#endif - -/* The NACL compiler defines __native_client__ and __pnacl__ - * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi - */ -#if defined(__native_client__) -#undef __LINUX__ -#undef __NACL__ -#define __NACL__ 1 -#endif -#if defined(__pnacl__) -#undef __LINUX__ -#undef __PNACL__ -#define __PNACL__ 1 -/* PNACL with newlib supports static linking only */ -#define __SDL_NOGETPROCADDR__ -#endif - -#if defined(__vita__) -#define __VITA__ 1 -#endif - -#if defined(__3DS__) -#undef __3DS__ -#define __3DS__ 1 -#endif - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Get the name of the platform. - * - * Here are the names returned for some (but not all) supported platforms: - * - * - "Windows" - * - "Mac OS X" - * - "Linux" - * - "iOS" - * - "Android" - * - * \returns the name of the platform. If the correct platform name is not - * available, returns a string beginning with the text "Unknown". - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_platform_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_power.h b/libs/hwcodec/externals/SDL/include/SDL_power.h deleted file mode 100644 index be06c8b4..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_power.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_power_h_ -#define SDL_power_h_ - -/** - * \file SDL_power.h - * - * Header for the SDL power management routines. - */ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The basic state for the system's power supply. - */ -typedef enum -{ - SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ - SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ - SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ - SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ - SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ -} SDL_PowerState; - - -/** - * Get the current power supply details. - * - * You should never take a battery status as absolute truth. Batteries - * (especially failing batteries) are delicate hardware, and the values - * reported here are best estimates based on what that hardware reports. It's - * not uncommon for older batteries to lose stored power much faster than it - * reports, or completely drain when reporting it has 20 percent left, etc. - * - * Battery status can change at any time; if you are concerned with power - * state, you should call this function frequently, and perhaps ignore changes - * until they seem to be stable for a few seconds. - * - * It's possible a platform can only report battery percentage or time left - * but not both. - * - * \param secs seconds of battery life left, you can pass a NULL here if you - * don't care, will return -1 if we can't determine a value, or - * we're not running on a battery - * \param pct percentage of battery life left, between 0 and 100, you can pass - * a NULL here if you don't care, will return -1 if we can't - * determine a value, or we're not running on a battery - * \returns an SDL_PowerState enum representing the current battery state. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_power_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_quit.h b/libs/hwcodec/externals/SDL/include/SDL_quit.h deleted file mode 100644 index d8ceb894..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_quit.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_quit.h - * - * Include file for SDL quit event handling. - */ - -#ifndef SDL_quit_h_ -#define SDL_quit_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/** - * \file SDL_quit.h - * - * An ::SDL_QUIT event is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate ::SDL_QUIT events as well. There is no way - * to determine the cause of an ::SDL_QUIT event, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - * - * \sa SDL_Quit() - */ - -/* There are no functions directly affecting the quit event */ - -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) - -#endif /* SDL_quit_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_rect.h b/libs/hwcodec/externals/SDL/include/SDL_rect.h deleted file mode 100644 index 9611a311..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_rect.h +++ /dev/null @@ -1,376 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rect.h - * - * Header file for SDL_rect definition and management functions. - */ - -#ifndef SDL_rect_h_ -#define SDL_rect_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_pixels.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The structure that defines a point (integer) - * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect - */ -typedef struct SDL_Point -{ - int x; - int y; -} SDL_Point; - -/** - * The structure that defines a point (floating point) - * - * \sa SDL_EncloseFPoints - * \sa SDL_PointInFRect - */ -typedef struct SDL_FPoint -{ - float x; - float y; -} SDL_FPoint; - - -/** - * A rectangle, with the origin at the upper left (integer). - * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_IntersectRectAndLine - * \sa SDL_UnionRect - * \sa SDL_EnclosePoints - */ -typedef struct SDL_Rect -{ - int x, y; - int w, h; -} SDL_Rect; - - -/** - * A rectangle, with the origin at the upper left (floating point). - * - * \sa SDL_FRectEmpty - * \sa SDL_FRectEquals - * \sa SDL_FRectEqualsEpsilon - * \sa SDL_HasIntersectionF - * \sa SDL_IntersectFRect - * \sa SDL_IntersectFRectAndLine - * \sa SDL_UnionFRect - * \sa SDL_EncloseFPoints - * \sa SDL_PointInFRect - */ -typedef struct SDL_FRect -{ - float x; - float y; - float w; - float h; -} SDL_FRect; - - -/** - * Returns true if point resides inside a rectangle. - */ -SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) -{ - return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; -} - -/** - * Returns true if the rectangle has no area. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) -{ - return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * Returns true if the two rectangles are equal. - */ -SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) -{ - return (a && b && (a->x == b->x) && (a->y == b->y) && - (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * Determine whether two rectangles intersect. - * - * If either pointer is NULL the function will return SDL_FALSE. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_IntersectRect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, - const SDL_Rect * B); - -/** - * Calculate the intersection of two rectangles. - * - * If `result` is NULL then this function will return SDL_FALSE. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \param result an SDL_Rect structure filled in with the intersection of - * rectangles `A` and `B` - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasIntersection - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * Calculate the union of two rectangles. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \param result an SDL_Rect structure filled in with the union of rectangles - * `A` and `B` - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, - const SDL_Rect * B, - SDL_Rect * result); - -/** - * Calculate a minimal rectangle enclosing a set of points. - * - * If `clip` is not NULL then only points inside of the clipping rectangle are - * considered. - * - * \param points an array of SDL_Point structures representing points to be - * enclosed - * \param count the number of structures in the `points` array - * \param clip an SDL_Rect used for clipping or NULL to enclose all points - * \param result an SDL_Rect structure filled in with the minimal enclosing - * rectangle - * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the - * points were outside of the clipping rectangle. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, - int count, - const SDL_Rect * clip, - SDL_Rect * result); - -/** - * Calculate the intersection of a rectangle and line segment. - * - * This function is used to clip a line segment to a rectangle. A line segment - * contained entirely within the rectangle or that does not intersect will - * remain unchanged. A line segment that crosses the rectangle at either or - * both ends will be clipped to the boundary of the rectangle and the new - * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. - * - * \param rect an SDL_Rect structure representing the rectangle to intersect - * \param X1 a pointer to the starting X-coordinate of the line - * \param Y1 a pointer to the starting Y-coordinate of the line - * \param X2 a pointer to the ending X-coordinate of the line - * \param Y2 a pointer to the ending Y-coordinate of the line - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * - rect, int *X1, - int *Y1, int *X2, - int *Y2); - - -/* SDL_FRect versions... */ - -/** - * Returns true if point resides inside a rectangle. - */ -SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r) -{ - return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && - (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; -} - -/** - * Returns true if the rectangle has no area. - */ -SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r) -{ - return ((!r) || (r->w <= 0.0f) || (r->h <= 0.0f)) ? SDL_TRUE : SDL_FALSE; -} - -/** - * Returns true if the two rectangles are equal, within some given epsilon. - * - * \since This function is available since SDL 2.0.22. - */ -SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon) -{ - return (a && b && ((a == b) || - ((SDL_fabsf(a->x - b->x) <= epsilon) && - (SDL_fabsf(a->y - b->y) <= epsilon) && - (SDL_fabsf(a->w - b->w) <= epsilon) && - (SDL_fabsf(a->h - b->h) <= epsilon)))) - ? SDL_TRUE : SDL_FALSE; -} - -/** - * Returns true if the two rectangles are equal, using a default epsilon. - * - * \since This function is available since SDL 2.0.22. - */ -SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b) -{ - return SDL_FRectEqualsEpsilon(a, b, SDL_FLT_EPSILON); -} - -/** - * Determine whether two rectangles intersect with float precision. - * - * If either pointer is NULL the function will return SDL_FALSE. - * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.22. - * - * \sa SDL_IntersectRect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A, - const SDL_FRect * B); - -/** - * Calculate the intersection of two rectangles with float precision. - * - * If `result` is NULL then this function will return SDL_FALSE. - * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle - * \param result an SDL_FRect structure filled in with the intersection of - * rectangles `A` and `B` - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.22. - * - * \sa SDL_HasIntersectionF - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A, - const SDL_FRect * B, - SDL_FRect * result); - -/** - * Calculate the union of two rectangles with float precision. - * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle - * \param result an SDL_FRect structure filled in with the union of rectangles - * `A` and `B` - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A, - const SDL_FRect * B, - SDL_FRect * result); - -/** - * Calculate a minimal rectangle enclosing a set of points with float - * precision. - * - * If `clip` is not NULL then only points inside of the clipping rectangle are - * considered. - * - * \param points an array of SDL_FPoint structures representing points to be - * enclosed - * \param count the number of structures in the `points` array - * \param clip an SDL_FRect used for clipping or NULL to enclose all points - * \param result an SDL_FRect structure filled in with the minimal enclosing - * rectangle - * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the - * points were outside of the clipping rectangle. - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points, - int count, - const SDL_FRect * clip, - SDL_FRect * result); - -/** - * Calculate the intersection of a rectangle and line segment with float - * precision. - * - * This function is used to clip a line segment to a rectangle. A line segment - * contained entirely within the rectangle or that does not intersect will - * remain unchanged. A line segment that crosses the rectangle at either or - * both ends will be clipped to the boundary of the rectangle and the new - * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. - * - * \param rect an SDL_FRect structure representing the rectangle to intersect - * \param X1 a pointer to the starting X-coordinate of the line - * \param Y1 a pointer to the starting Y-coordinate of the line - * \param X2 a pointer to the ending X-coordinate of the line - * \param Y2 a pointer to the ending Y-coordinate of the line - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRectAndLine(const SDL_FRect * - rect, float *X1, - float *Y1, float *X2, - float *Y2); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rect_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_render.h b/libs/hwcodec/externals/SDL/include/SDL_render.h deleted file mode 100644 index c7295014..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_render.h +++ /dev/null @@ -1,1919 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_render.h - * - * Header file for SDL 2D rendering functions. - * - * This API supports the following features: - * * single pixel points - * * single pixel lines - * * filled rectangles - * * texture images - * - * The primitives may be drawn in opaque, blended, or additive modes. - * - * The texture images may be drawn in opaque, blended, or additive modes. - * They can have an additional color tint or alpha modulation applied to - * them, and may also be stretched with linear interpolation. - * - * This API is designed to accelerate simple 2D operations. You may - * want more functionality such as polygons and particle effects and - * in that case you should use SDL's OpenGL/Direct3D support or one - * of the many good 3D engines. - * - * These functions must be called from the main thread. - * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 - */ - -#ifndef SDL_render_h_ -#define SDL_render_h_ - -#include "SDL_stdinc.h" -#include "SDL_rect.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Flags used when creating a rendering context - */ -typedef enum -{ - SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ - SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware - acceleration */ - SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized - with the refresh rate */ - SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports - rendering to texture */ -} SDL_RendererFlags; - -/** - * Information on the capabilities of a render driver or context. - */ -typedef struct SDL_RendererInfo -{ - const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported ::SDL_RendererFlags */ - Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[16]; /**< The available texture formats */ - int max_texture_width; /**< The maximum texture width */ - int max_texture_height; /**< The maximum texture height */ -} SDL_RendererInfo; - -/** - * Vertex structure - */ -typedef struct SDL_Vertex -{ - SDL_FPoint position; /**< Vertex position, in SDL_Renderer coordinates */ - SDL_Color color; /**< Vertex color */ - SDL_FPoint tex_coord; /**< Normalized texture coordinates, if needed */ -} SDL_Vertex; - -/** - * The scaling mode for a texture. - */ -typedef enum -{ - SDL_ScaleModeNearest, /**< nearest pixel sampling */ - SDL_ScaleModeLinear, /**< linear filtering */ - SDL_ScaleModeBest /**< anisotropic filtering */ -} SDL_ScaleMode; - -/** - * The access pattern allowed for a texture. - */ -typedef enum -{ - SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ - SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ - SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ -} SDL_TextureAccess; - -/** - * The texture channel modulation used in SDL_RenderCopy(). - */ -typedef enum -{ - SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ - SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ - SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ -} SDL_TextureModulate; - -/** - * Flip constants for SDL_RenderCopyEx - */ -typedef enum -{ - SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ - SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ - SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ -} SDL_RendererFlip; - -/** - * A structure representing rendering state - */ -struct SDL_Renderer; -typedef struct SDL_Renderer SDL_Renderer; - -/** - * An efficient driver-specific representation of pixel data - */ -struct SDL_Texture; -typedef struct SDL_Texture SDL_Texture; - -/* Function prototypes */ - -/** - * Get the number of 2D rendering drivers available for the current display. - * - * A render driver is a set of code that handles rendering and texture - * management on a particular display. Normally there is only one, but some - * drivers may have several available with different capabilities. - * - * There may be none if SDL was compiled without render support. - * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - * \sa SDL_GetRenderDriverInfo - */ -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); - -/** - * Get info about a specific 2D rendering driver for the current display. - * - * \param index the index of the driver to query information about - * \param info an SDL_RendererInfo structure to be filled with information on - * the rendering driver - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - * \sa SDL_GetNumRenderDrivers - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, - SDL_RendererInfo * info); - -/** - * Create a window and default renderer. - * - * \param width the width of the window - * \param height the height of the window - * \param window_flags the flags used to create the window (see - * SDL_CreateWindow()) - * \param window a pointer filled with the window, or NULL on error - * \param renderer a pointer filled with the renderer, or NULL on error - * \returns 0 on success, or -1 on error; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - * \sa SDL_CreateWindow - */ -extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( - int width, int height, Uint32 window_flags, - SDL_Window **window, SDL_Renderer **renderer); - - -/** - * Create a 2D rendering context for a window. - * - * \param window the window where rendering is displayed - * \param index the index of the rendering driver to initialize, or -1 to - * initialize the first one supporting the requested flags - * \param flags 0, or one or more SDL_RendererFlags OR'd together - * \returns a valid rendering context or NULL if there was an error; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSoftwareRenderer - * \sa SDL_DestroyRenderer - * \sa SDL_GetNumRenderDrivers - * \sa SDL_GetRendererInfo - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, - int index, Uint32 flags); - -/** - * Create a 2D software rendering context for a surface. - * - * Two other API which can be used to create SDL_Renderer: - * SDL_CreateRenderer() and SDL_CreateWindowAndRenderer(). These can _also_ - * create a software renderer, but they are intended to be used with an - * SDL_Window as the final destination and not an SDL_Surface. - * - * \param surface the SDL_Surface structure representing the surface where - * rendering is done - * \returns a valid rendering context or NULL if there was an error; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - * \sa SDL_CreateWindowRenderer - * \sa SDL_DestroyRenderer - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); - -/** - * Get the renderer associated with a window. - * - * \param window the window to query - * \returns the rendering context on success or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - */ -extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); - -/** - * Get the window associated with a renderer. - * - * \param renderer the renderer to query - * \returns the window on success or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer); - -/** - * Get information about a rendering context. - * - * \param renderer the rendering context - * \param info an SDL_RendererInfo structure filled with information about the - * current renderer - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - */ -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, - SDL_RendererInfo * info); - -/** - * Get the output size in pixels of a rendering context. - * - * Due to high-dpi displays, you might end up with a rendering context that - * has more pixels than the window that contains it, so use this instead of - * SDL_GetWindowSize() to decide how much drawing area you have. - * - * \param renderer the rendering context - * \param w an int filled with the width - * \param h an int filled with the height - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRenderer - */ -extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, - int *w, int *h); - -/** - * Create a texture for a rendering context. - * - * You can set the texture scaling method by setting - * `SDL_HINT_RENDER_SCALE_QUALITY` before creating the texture. - * - * \param renderer the rendering context - * \param format one of the enumerated values in SDL_PixelFormatEnum - * \param access one of the enumerated values in SDL_TextureAccess - * \param w the width of the texture in pixels - * \param h the height of the texture in pixels - * \returns a pointer to the created texture or NULL if no rendering context - * was active, the format was unsupported, or the width or height - * were out of range; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateTextureFromSurface - * \sa SDL_DestroyTexture - * \sa SDL_QueryTexture - * \sa SDL_UpdateTexture - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, - Uint32 format, - int access, int w, - int h); - -/** - * Create a texture from an existing surface. - * - * The surface is not modified or freed by this function. - * - * The SDL_TextureAccess hint for the created texture is - * `SDL_TEXTUREACCESS_STATIC`. - * - * The pixel format of the created texture may be different from the pixel - * format of the surface. Use SDL_QueryTexture() to query the pixel format of - * the texture. - * - * \param renderer the rendering context - * \param surface the SDL_Surface structure containing pixel data used to fill - * the texture - * \returns the created texture or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateTexture - * \sa SDL_DestroyTexture - * \sa SDL_QueryTexture - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); - -/** - * Query the attributes of a texture. - * - * \param texture the texture to query - * \param format a pointer filled in with the raw format of the texture; the - * actual format may differ, but pixel transfers will use this - * format (one of the SDL_PixelFormatEnum values). This argument - * can be NULL if you don't need this information. - * \param access a pointer filled in with the actual access to the texture - * (one of the SDL_TextureAccess values). This argument can be - * NULL if you don't need this information. - * \param w a pointer filled in with the width of the texture in pixels. This - * argument can be NULL if you don't need this information. - * \param h a pointer filled in with the height of the texture in pixels. This - * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateTexture - */ -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, - Uint32 * format, int *access, - int *w, int *h); - -/** - * Set an additional color value multiplied into render copy operations. - * - * When this texture is rendered, during the copy operation each source color - * channel is modulated by the appropriate color value according to the - * following formula: - * - * `srcC = srcC * (color / 255)` - * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. - * - * \param texture the texture to update - * \param r the red color value multiplied into copy operations - * \param g the green color value multiplied into copy operations - * \param b the blue color value multiplied into copy operations - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTextureColorMod - * \sa SDL_SetTextureAlphaMod - */ -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * Get the additional color value multiplied into render copy operations. - * - * \param texture the texture to query - * \param r a pointer filled in with the current red color value - * \param g a pointer filled in with the current green color value - * \param b a pointer filled in with the current blue color value - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTextureAlphaMod - * \sa SDL_SetTextureColorMod - */ -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * Set an additional alpha value multiplied into render copy operations. - * - * When this texture is rendered, during the copy operation the source alpha - * value is modulated by this alpha value according to the following formula: - * - * `srcA = srcA * (alpha / 255)` - * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. - * - * \param texture the texture to update - * \param alpha the source alpha value multiplied into copy operations - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTextureAlphaMod - * \sa SDL_SetTextureColorMod - */ -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, - Uint8 alpha); - -/** - * Get the additional alpha value multiplied into render copy operations. - * - * \param texture the texture to query - * \param alpha a pointer filled in with the current alpha value - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTextureColorMod - * \sa SDL_SetTextureAlphaMod - */ -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, - Uint8 * alpha); - -/** - * Set the blend mode for a texture, used by SDL_RenderCopy(). - * - * If the blend mode is not supported, the closest supported mode is chosen - * and this function returns -1. - * - * \param texture the texture to update - * \param blendMode the SDL_BlendMode to use for texture blending - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTextureBlendMode - * \sa SDL_RenderCopy - */ -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode blendMode); - -/** - * Get the blend mode used for texture copy operations. - * - * \param texture the texture to query - * \param blendMode a pointer filled in with the current SDL_BlendMode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetTextureBlendMode - */ -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, - SDL_BlendMode *blendMode); - -/** - * Set the scale mode used for texture scale operations. - * - * If the scale mode is not supported, the closest supported mode is chosen. - * - * \param texture The texture to update. - * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success, or -1 if the texture is not valid. - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_GetTextureScaleMode - */ -extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode scaleMode); - -/** - * Get the scale mode used for texture scale operations. - * - * \param texture the texture to query. - * \param scaleMode a pointer filled in with the current scale mode. - * \return 0 on success, or -1 if the texture is not valid. - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_SetTextureScaleMode - */ -extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, - SDL_ScaleMode *scaleMode); - -/** - * Associate a user-specified pointer with a texture. - * - * \param texture the texture to update. - * \param userdata the pointer to associate with the texture. - * \returns 0 on success, or -1 if the texture is not valid. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GetTextureUserData - */ -extern DECLSPEC int SDLCALL SDL_SetTextureUserData(SDL_Texture * texture, - void *userdata); - -/** - * Get the user-specified pointer associated with a texture - * - * \param texture the texture to query. - * \return the pointer associated with the texture, or NULL if the texture is - * not valid. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_SetTextureUserData - */ -extern DECLSPEC void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture); - -/** - * Update the given texture rectangle with new pixel data. - * - * The pixel data must be in the pixel format of the texture. Use - * SDL_QueryTexture() to query the pixel format of the texture. - * - * This is a fairly slow function, intended for use with static textures that - * do not change often. - * - * If the texture is intended to be updated often, it is preferred to create - * the texture as streaming and use the locking functions referenced below. - * While this function will work with streaming textures, for optimization - * reasons you may not get the pixels back if you lock the texture afterward. - * - * \param texture the texture to update - * \param rect an SDL_Rect structure representing the area to update, or NULL - * to update the entire texture - * \param pixels the raw pixel data in the format of the texture - * \param pitch the number of bytes in a row of pixel data, including padding - * between lines - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateTexture - * \sa SDL_LockTexture - * \sa SDL_UnlockTexture - */ -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const void *pixels, int pitch); - -/** - * Update a rectangle within a planar YV12 or IYUV texture with new pixel - * data. - * - * You can use SDL_UpdateTexture() as long as your pixel data is a contiguous - * block of Y and U/V planes in the proper order, but this function is - * available if your pixel data is not contiguous. - * - * \param texture the texture to update - * \param rect a pointer to the rectangle of pixels to update, or NULL to - * update the entire texture - * \param Yplane the raw pixel data for the Y plane - * \param Ypitch the number of bytes between rows of pixel data for the Y - * plane - * \param Uplane the raw pixel data for the U plane - * \param Upitch the number of bytes between rows of pixel data for the U - * plane - * \param Vplane the raw pixel data for the V plane - * \param Vpitch the number of bytes between rows of pixel data for the V - * plane - * \returns 0 on success or -1 if the texture is not valid; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.1. - * - * \sa SDL_UpdateTexture - */ -extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch); - -/** - * Update a rectangle within a planar NV12 or NV21 texture with new pixels. - * - * You can use SDL_UpdateTexture() as long as your pixel data is a contiguous - * block of NV12/21 planes in the proper order, but this function is available - * if your pixel data is not contiguous. - * - * \param texture the texture to update - * \param rect a pointer to the rectangle of pixels to update, or NULL to - * update the entire texture. - * \param Yplane the raw pixel data for the Y plane. - * \param Ypitch the number of bytes between rows of pixel data for the Y - * plane. - * \param UVplane the raw pixel data for the UV plane. - * \param UVpitch the number of bytes between rows of pixel data for the UV - * plane. - * \return 0 on success, or -1 if the texture is not valid. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch); - -/** - * Lock a portion of the texture for **write-only** pixel access. - * - * As an optimization, the pixels made available for editing don't necessarily - * contain the old texture data. This is a write-only operation, and if you - * need to keep a copy of the texture data you should do that at the - * application level. - * - * You must use SDL_UnlockTexture() to unlock the pixels and apply any - * changes. - * - * \param texture the texture to lock for access, which was created with - * `SDL_TEXTUREACCESS_STREAMING` - * \param rect an SDL_Rect structure representing the area to lock for access; - * NULL to lock the entire texture - * \param pixels this is filled in with a pointer to the locked pixels, - * appropriately offset by the locked area - * \param pitch this is filled in with the pitch of the locked pixels; the - * pitch is the length of one row in bytes - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_UnlockTexture - */ -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, - const SDL_Rect * rect, - void **pixels, int *pitch); - -/** - * Lock a portion of the texture for **write-only** pixel access, and expose - * it as a SDL surface. - * - * Besides providing an SDL_Surface instead of raw pixel data, this function - * operates like SDL_LockTexture. - * - * As an optimization, the pixels made available for editing don't necessarily - * contain the old texture data. This is a write-only operation, and if you - * need to keep a copy of the texture data you should do that at the - * application level. - * - * You must use SDL_UnlockTexture() to unlock the pixels and apply any - * changes. - * - * The returned surface is freed internally after calling SDL_UnlockTexture() - * or SDL_DestroyTexture(). The caller should not free it. - * - * \param texture the texture to lock for access, which was created with - * `SDL_TEXTUREACCESS_STREAMING` - * \param rect a pointer to the rectangle to lock for access. If the rect is - * NULL, the entire texture will be locked - * \param surface this is filled in with an SDL surface representing the - * locked area - * \returns 0 on success, or -1 if the texture is not valid or was not created - * with `SDL_TEXTUREACCESS_STREAMING` - * - * \since This function is available since SDL 2.0.12. - * - * \sa SDL_LockTexture - * \sa SDL_UnlockTexture - */ -extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); - -/** - * Unlock a texture, uploading the changes to video memory, if needed. - * - * **Warning**: Please note that SDL_LockTexture() is intended to be - * write-only; it will not guarantee the previous contents of the texture will - * be provided. You must fully initialize any area of a texture that you lock - * before unlocking it, as the pixels might otherwise be uninitialized memory. - * - * Which is to say: locking and immediately unlocking a texture can result in - * corrupted textures, depending on the renderer in use. - * - * \param texture a texture locked by SDL_LockTexture() - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockTexture - */ -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); - -/** - * Determine whether a renderer supports the use of render targets. - * - * \param renderer the renderer that will be checked - * \returns SDL_TRUE if supported or SDL_FALSE if not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRenderTarget - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); - -/** - * Set a texture as the current rendering target. - * - * Before using this function, you should check the - * `SDL_RENDERER_TARGETTEXTURE` bit in the flags of SDL_RendererInfo to see if - * render targets are supported. - * - * The default render target is the window for which the renderer was created. - * To stop rendering to a texture and render to the window again, call this - * function with a NULL `texture`. - * - * \param renderer the rendering context - * \param texture the targeted texture, which must be created with the - * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the - * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRenderTarget - */ -extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, - SDL_Texture *texture); - -/** - * Get the current render target. - * - * The default render target is the window for which the renderer was created, - * and is reported a NULL here. - * - * \param renderer the rendering context - * \returns the current render target or NULL for the default render target. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRenderTarget - */ -extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); - -/** - * Set a device independent resolution for rendering. - * - * This function uses the viewport and scaling functionality to allow a fixed - * logical resolution for rendering, regardless of the actual output - * resolution. If the actual output resolution doesn't have the same aspect - * ratio the output rendering will be centered within the output display. - * - * If the output display is a window, mouse and touch events in the window - * will be filtered and scaled so they seem to arrive within the logical - * resolution. The SDL_HINT_MOUSE_RELATIVE_SCALING hint controls whether - * relative motion events are also scaled. - * - * If this function results in scaling or subpixel drawing by the rendering - * backend, it will be handled using the appropriate quality hints. - * - * \param renderer the renderer for which resolution should be set - * \param w the width of the logical resolution - * \param h the height of the logical resolution - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderGetLogicalSize - */ -extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); - -/** - * Get device independent resolution for rendering. - * - * When using the main rendering target (eg no target texture is set): this - * may return 0 for `w` and `h` if the SDL_Renderer has never had its logical - * size set by SDL_RenderSetLogicalSize(). Otherwise it returns the logical - * width and height. - * - * When using a target texture: Never return 0 for `w` and `h` at first. Then - * it returns the logical width and height that are set. - * - * \param renderer a rendering context - * \param w an int to be filled with the width - * \param h an int to be filled with the height - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderSetLogicalSize - */ -extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); - -/** - * Set whether to force integer scales for resolution-independent rendering. - * - * This function restricts the logical viewport to integer values - that is, - * when a resolution is between two multiples of a logical size, the viewport - * size is rounded down to the lower multiple. - * - * \param renderer the renderer for which integer scaling should be set - * \param enable enable or disable the integer scaling for rendering - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_RenderGetIntegerScale - * \sa SDL_RenderSetLogicalSize - */ -extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, - SDL_bool enable); - -/** - * Get whether integer scales are forced for resolution-independent rendering. - * - * \param renderer the renderer from which integer scaling should be queried - * \returns SDL_TRUE if integer scales are forced or SDL_FALSE if not and on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_RenderSetIntegerScale - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer); - -/** - * Set the drawing area for rendering on the current target. - * - * When the window is resized, the viewport is reset to fill the entire new - * window size. - * - * \param renderer the rendering context - * \param rect the SDL_Rect structure representing the drawing area, or NULL - * to set the viewport to the entire target - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderGetViewport - */ -extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * Get the drawing area for the current target. - * - * \param renderer the rendering context - * \param rect an SDL_Rect structure filled in with the current drawing area - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderSetViewport - */ -extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * Set the clip rectangle for rendering on the specified target. - * - * \param renderer the rendering context for which clip rectangle should be - * set - * \param rect an SDL_Rect structure representing the clip area, relative to - * the viewport, or NULL to disable clipping - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderGetClipRect - * \sa SDL_RenderIsClipEnabled - */ -extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * Get the clip rectangle for the current target. - * - * \param renderer the rendering context from which clip rectangle should be - * queried - * \param rect an SDL_Rect structure filled in with the current clipping area - * or an empty rectangle if clipping is disabled - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderIsClipEnabled - * \sa SDL_RenderSetClipRect - */ -extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, - SDL_Rect * rect); - -/** - * Get whether clipping is enabled on the given renderer. - * - * \param renderer the renderer from which clip state should be queried - * \returns SDL_TRUE if clipping is enabled or SDL_FALSE if not; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_RenderGetClipRect - * \sa SDL_RenderSetClipRect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); - - -/** - * Set the drawing scale for rendering on the current target. - * - * The drawing coordinates are scaled by the x/y scaling factors before they - * are used by the renderer. This allows resolution independent drawing with a - * single coordinate system. - * - * If this results in scaling or subpixel drawing by the rendering backend, it - * will be handled using the appropriate quality hints. For best results use - * integer scaling factors. - * - * \param renderer a rendering context - * \param scaleX the horizontal scaling factor - * \param scaleY the vertical scaling factor - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderGetScale - * \sa SDL_RenderSetLogicalSize - */ -extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, - float scaleX, float scaleY); - -/** - * Get the drawing scale for the current target. - * - * \param renderer the renderer from which drawing scale should be queried - * \param scaleX a pointer filled in with the horizontal scaling factor - * \param scaleY a pointer filled in with the vertical scaling factor - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderSetScale - */ -extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, - float *scaleX, float *scaleY); - -/** - * Get logical coordinates of point in renderer when given real coordinates of - * point in window. - * - * Logical coordinates will differ from real coordinates when render is scaled - * and logical renderer size set - * - * \param renderer the renderer from which the logical coordinates should be - * calculated - * \param windowX the real X coordinate in the window - * \param windowY the real Y coordinate in the window - * \param logicalX the pointer filled with the logical x coordinate - * \param logicalY the pointer filled with the logical y coordinate - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_RenderGetScale - * \sa SDL_RenderSetScale - * \sa SDL_RenderGetLogicalSize - * \sa SDL_RenderSetLogicalSize - */ -extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer, - int windowX, int windowY, - float *logicalX, float *logicalY); - - -/** - * Get real coordinates of point in window when given logical coordinates of - * point in renderer. - * - * Logical coordinates will differ from real coordinates when render is scaled - * and logical renderer size set - * - * \param renderer the renderer from which the window coordinates should be - * calculated - * \param logicalX the logical x coordinate - * \param logicalY the logical y coordinate - * \param windowX the pointer filled with the real X coordinate in the window - * \param windowY the pointer filled with the real Y coordinate in the window - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_RenderGetScale - * \sa SDL_RenderSetScale - * \sa SDL_RenderGetLogicalSize - * \sa SDL_RenderSetLogicalSize - */ -extern DECLSPEC void SDLCALL SDL_RenderLogicalToWindow(SDL_Renderer * renderer, - float logicalX, float logicalY, - int *windowX, int *windowY); - -/** - * Set the color used for drawing operations (Rect, Line and Clear). - * - * Set the color for drawing or filling rectangles, lines, and points, and for - * SDL_RenderClear(). - * - * \param renderer the rendering context - * \param r the red value used to draw on the rendering target - * \param g the green value used to draw on the rendering target - * \param b the blue value used to draw on the rendering target - * \param a the alpha value used to draw on the rendering target; usually - * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to - * specify how the alpha channel is used - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRenderDrawColor - * \sa SDL_RenderClear - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * Get the color used for drawing operations (Rect, Line and Clear). - * - * \param renderer the rendering context - * \param r a pointer filled in with the red value used to draw on the - * rendering target - * \param g a pointer filled in with the green value used to draw on the - * rendering target - * \param b a pointer filled in with the blue value used to draw on the - * rendering target - * \param a a pointer filled in with the alpha value used to draw on the - * rendering target; usually `SDL_ALPHA_OPAQUE` (255) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * Set the blend mode used for drawing operations (Fill and Line). - * - * If the blend mode is not supported, the closest supported mode is chosen. - * - * \param renderer the rendering context - * \param blendMode the SDL_BlendMode to use for blending - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRenderDrawBlendMode - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode blendMode); - -/** - * Get the blend mode used for drawing operations. - * - * \param renderer the rendering context - * \param blendMode a pointer filled in with the current SDL_BlendMode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRenderDrawBlendMode - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, - SDL_BlendMode *blendMode); - -/** - * Clear the current rendering target with the drawing color. - * - * This function clears the entire rendering target, ignoring the viewport and - * the clip rectangle. - * - * \param renderer the rendering context - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); - -/** - * Draw a point on the current rendering target. - * - * SDL_RenderDrawPoint() draws a single point. If you want to draw multiple, - * use SDL_RenderDrawPoints() instead. - * - * \param renderer the rendering context - * \param x the x coordinate of the point - * \param y the y coordinate of the point - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, - int x, int y); - -/** - * Draw multiple points on the current rendering target. - * - * \param renderer the rendering context - * \param points an array of SDL_Point structures that represent the points to - * draw - * \param count the number of points to draw - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * Draw a line on the current rendering target. - * - * SDL_RenderDrawLine() draws the line to include both end points. If you want - * to draw multiple, connecting lines use SDL_RenderDrawLines() instead. - * - * \param renderer the rendering context - * \param x1 the x coordinate of the start point - * \param y1 the y coordinate of the start point - * \param x2 the x coordinate of the end point - * \param y2 the y coordinate of the end point - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, - int x1, int y1, int x2, int y2); - -/** - * Draw a series of connected lines on the current rendering target. - * - * \param renderer the rendering context - * \param points an array of SDL_Point structures representing points along - * the lines - * \param count the number of points, drawing count-1 lines - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, - int count); - -/** - * Draw a rectangle on the current rendering target. - * - * \param renderer the rendering context - * \param rect an SDL_Rect structure representing the rectangle to draw, or - * NULL to outline the entire rendering target - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * Draw some number of rectangles on the current rendering target. - * - * \param renderer the rendering context - * \param rects an array of SDL_Rect structures representing the rectangles to - * be drawn - * \param count the number of rectangles - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * Fill a rectangle on the current rendering target with the drawing color. - * - * The current drawing color is set by SDL_SetRenderDrawColor(), and the - * color's alpha value is ignored unless blending is enabled with the - * appropriate call to SDL_SetRenderDrawBlendMode(). - * - * \param renderer the rendering context - * \param rect the SDL_Rect structure representing the rectangle to fill, or - * NULL for the entire rendering target - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRects - * \sa SDL_RenderPresent - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, - const SDL_Rect * rect); - -/** - * Fill some number of rectangles on the current rendering target with the - * drawing color. - * - * \param renderer the rendering context - * \param rects an array of SDL_Rect structures representing the rectangles to - * be filled - * \param count the number of rectangles - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderPresent - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect * rects, - int count); - -/** - * Copy a portion of the texture to the current rendering target. - * - * The texture is blended with the destination based on its blend mode set - * with SDL_SetTextureBlendMode(). - * - * The texture color is affected based on its color modulation set by - * SDL_SetTextureColorMod(). - * - * The texture alpha is affected based on its alpha modulation set by - * SDL_SetTextureAlphaMod(). - * - * \param renderer the rendering context - * \param texture the source texture - * \param srcrect the source SDL_Rect structure or NULL for the entire texture - * \param dstrect the destination SDL_Rect structure or NULL for the entire - * rendering target; the texture will be stretched to fill the - * given rectangle - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderCopyEx - * \sa SDL_SetTextureAlphaMod - * \sa SDL_SetTextureBlendMode - * \sa SDL_SetTextureColorMod - */ -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); - -/** - * Copy a portion of the texture to the current rendering, with optional - * rotation and flipping. - * - * Copy a portion of the texture to the current rendering target, optionally - * rotating it by angle around the given center and also flipping it - * top-bottom and/or left-right. - * - * The texture is blended with the destination based on its blend mode set - * with SDL_SetTextureBlendMode(). - * - * The texture color is affected based on its color modulation set by - * SDL_SetTextureColorMod(). - * - * The texture alpha is affected based on its alpha modulation set by - * SDL_SetTextureAlphaMod(). - * - * \param renderer the rendering context - * \param texture the source texture - * \param srcrect the source SDL_Rect structure or NULL for the entire texture - * \param dstrect the destination SDL_Rect structure or NULL for the entire - * rendering target - * \param angle an angle in degrees that indicates the rotation that will be - * applied to dstrect, rotating it in a clockwise direction - * \param center a pointer to a point indicating the point around which - * dstrect will be rotated (if NULL, rotation will be done - * around `dstrect.w / 2`, `dstrect.h / 2`) - * \param flip a SDL_RendererFlip value stating which flipping actions should - * be performed on the texture - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderCopy - * \sa SDL_SetTextureAlphaMod - * \sa SDL_SetTextureBlendMode - * \sa SDL_SetTextureColorMod - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect, - const double angle, - const SDL_Point *center, - const SDL_RendererFlip flip); - - -/** - * Draw a point on the current rendering target at subpixel precision. - * - * \param renderer The renderer which should draw a point. - * \param x The x coordinate of the point. - * \param y The y coordinate of the point. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, - float x, float y); - -/** - * Draw multiple points on the current rendering target at subpixel precision. - * - * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * Draw a line on the current rendering target at subpixel precision. - * - * \param renderer The renderer which should draw a line. - * \param x1 The x coordinate of the start point. - * \param y1 The y coordinate of the start point. - * \param x2 The x coordinate of the end point. - * \param y2 The y coordinate of the end point. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, - float x1, float y1, float x2, float y2); - -/** - * Draw a series of connected lines on the current rendering target at - * subpixel precision. - * - * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, - const SDL_FPoint * points, - int count); - -/** - * Draw a rectangle on the current rendering target at subpixel precision. - * - * \param renderer The renderer which should draw a rectangle. - * \param rect A pointer to the destination rectangle, or NULL to outline the - * entire rendering target. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * Draw some number of rectangles on the current rendering target at subpixel - * precision. - * - * \param renderer The renderer which should draw multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * Fill a rectangle on the current rendering target with the drawing color at - * subpixel precision. - * - * \param renderer The renderer which should fill a rectangle. - * \param rect A pointer to the destination rectangle, or NULL for the entire - * rendering target. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, - const SDL_FRect * rect); - -/** - * Fill some number of rectangles on the current rendering target with the - * drawing color at subpixel precision. - * - * \param renderer The renderer which should fill multiple rectangles. - * \param rects A pointer to an array of destination rectangles. - * \param count The number of rectangles. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, - int count); - -/** - * Copy a portion of the texture to the current rendering target at subpixel - * precision. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect); - -/** - * Copy a portion of the source texture to the current rendering target, with - * rotation and flipping, at subpixel precision. - * - * \param renderer The renderer which should copy parts of a texture. - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire - * texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the - * entire rendering target. - * \param angle An angle in degrees that indicates the rotation that will be - * applied to dstrect, rotating it in a clockwise direction - * \param center A pointer to a point indicating the point around which - * dstrect will be rotated (if NULL, rotation will be done - * around dstrect.w/2, dstrect.h/2). - * \param flip An SDL_RendererFlip value stating which flipping actions should - * be performed on the texture - * \return 0 on success, or -1 on error - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_FRect * dstrect, - const double angle, - const SDL_FPoint *center, - const SDL_RendererFlip flip); - -/** - * Render a list of triangles, optionally using a texture and indices into the - * vertex array Color and alpha modulation is done per vertex - * (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). - * - * \param renderer The rendering context. - * \param texture (optional) The SDL texture to use. - * \param vertices Vertices. - * \param num_vertices Number of vertices. - * \param indices (optional) An array of integer indices into the 'vertices' - * array, if NULL all vertices will be rendered in sequential - * order. - * \param num_indices Number of indices. - * \return 0 on success, or -1 if the operation is not supported - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_RenderGeometryRaw - * \sa SDL_Vertex - */ -extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, - SDL_Texture *texture, - const SDL_Vertex *vertices, int num_vertices, - const int *indices, int num_indices); - -/** - * Render a list of triangles, optionally using a texture and indices into the - * vertex arrays Color and alpha modulation is done per vertex - * (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). - * - * \param renderer The rendering context. - * \param texture (optional) The SDL texture to use. - * \param xy Vertex positions - * \param xy_stride Byte size to move from one element to the next element - * \param color Vertex colors (as SDL_Color) - * \param color_stride Byte size to move from one element to the next element - * \param uv Vertex normalized texture coordinates - * \param uv_stride Byte size to move from one element to the next element - * \param num_vertices Number of vertices. - * \param indices (optional) An array of indices into the 'vertices' arrays, - * if NULL all vertices will be rendered in sequential order. - * \param num_indices Number of indices. - * \param size_indices Index size: 1 (byte), 2 (short), 4 (int) - * \return 0 on success, or -1 if the operation is not supported - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_RenderGeometry - * \sa SDL_Vertex - */ -extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride, - int num_vertices, - const void *indices, int num_indices, int size_indices); - -/** - * Read pixels from the current rendering target to an array of pixels. - * - * **WARNING**: This is a very slow operation, and should not be used - * frequently. If you're using this on the main rendering target, it should be - * called after rendering and before SDL_RenderPresent(). - * - * `pitch` specifies the number of bytes between rows in the destination - * `pixels` data. This allows you to write to a subrectangle or have padded - * rows in the destination. Generally, `pitch` should equal the number of - * pixels per row in the `pixels` data times the number of bytes per pixel, - * but it might contain additional padding (for example, 24bit RGB Windows - * Bitmap data pads all rows to multiples of 4 bytes). - * - * \param renderer the rendering context - * \param rect an SDL_Rect structure representing the area to read, or NULL - * for the entire render target - * \param format an SDL_PixelFormatEnum value of the desired format of the - * pixel data, or 0 to use the format of the rendering target - * \param pixels a pointer to the pixel data to copy into - * \param pitch the pitch of the `pixels` parameter - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, - const SDL_Rect * rect, - Uint32 format, - void *pixels, int pitch); - -/** - * Update the screen with any rendering performed since the previous call. - * - * SDL's rendering functions operate on a backbuffer; that is, calling a - * rendering function such as SDL_RenderDrawLine() does not directly put a - * line on the screen, but rather updates the backbuffer. As such, you compose - * your entire scene and *present* the composed backbuffer to the screen as a - * complete picture. - * - * Therefore, when using SDL's rendering API, one does all drawing intended - * for the frame, and then calls this function once per frame to present the - * final drawing to the user. - * - * The backbuffer should be considered invalidated after each present; do not - * assume that previous contents will exist between frames. You are strongly - * encouraged to call SDL_RenderClear() to initialize the backbuffer before - * starting each new frame's drawing, even if you plan to overwrite every - * pixel. - * - * \param renderer the rendering context - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RenderClear - * \sa SDL_RenderDrawLine - * \sa SDL_RenderDrawLines - * \sa SDL_RenderDrawPoint - * \sa SDL_RenderDrawPoints - * \sa SDL_RenderDrawRect - * \sa SDL_RenderDrawRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_SetRenderDrawColor - */ -extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); - -/** - * Destroy the specified texture. - * - * Passing NULL or an otherwise invalid texture will set the SDL error message - * to "Invalid texture". - * - * \param texture the texture to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateTexture - * \sa SDL_CreateTextureFromSurface - */ -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); - -/** - * Destroy the rendering context for a window and free associated textures. - * - * If `renderer` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid renderer". See SDL_GetError(). - * - * \param renderer the rendering context - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRenderer - */ -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); - -/** - * Force the rendering context to flush any pending commands to the underlying - * rendering API. - * - * You do not need to (and in fact, shouldn't) call this function unless you - * are planning to call into OpenGL/Direct3D/Metal/whatever directly in - * addition to using an SDL_Renderer. - * - * This is for a very-specific case: if you are using SDL's render API, you - * asked for a specific renderer backend (OpenGL, Direct3D, etc), you set - * SDL_HINT_RENDER_BATCHING to "1", and you plan to make OpenGL/D3D/whatever - * calls in addition to SDL render API calls. If all of this applies, you - * should call SDL_RenderFlush() between calls to SDL's render API and the - * low-level API you're using in cooperation. - * - * In all other cases, you can ignore this function. This is only here to get - * maximum performance out of a specific situation. In all other cases, SDL - * will do the right thing, perhaps at a performance loss. - * - * This function is first available in SDL 2.0.10, and is not needed in 2.0.9 - * and earlier, as earlier versions did not queue rendering commands at all, - * instead flushing them to the OS immediately. - * - * \param renderer the rendering context - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); - - -/** - * Bind an OpenGL/ES/ES2 texture to the current context. - * - * This is for use with OpenGL instructions when rendering OpenGL primitives - * directly. - * - * If not NULL, `texw` and `texh` will be filled with the width and height - * values suitable for the provided texture. In most cases, both will be 1.0, - * however, on systems that support the GL_ARB_texture_rectangle extension, - * these values will actually be the pixel width and height used to create the - * texture, so this factor needs to be taken into account when providing - * texture coordinates to OpenGL. - * - * You need a renderer to create an SDL_Texture, therefore you can only use - * this function with an implicit OpenGL context from SDL_CreateRenderer(), - * not with your own OpenGL context. If you need control over your OpenGL - * context, you need to write your own texture-loading methods. - * - * Also note that SDL may upload RGB textures as BGR (or vice-versa), and - * re-order the color channels in the shaders phase, so the uploaded texture - * may have swapped color channels. - * - * \param texture the texture to bind to the current OpenGL/ES/ES2 context - * \param texw a pointer to a float value which will be filled with the - * texture width or NULL if you don't need that value - * \param texh a pointer to a float value which will be filled with the - * texture height or NULL if you don't need that value - * \returns 0 on success, or -1 if the operation is not supported; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_MakeCurrent - * \sa SDL_GL_UnbindTexture - */ -extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); - -/** - * Unbind an OpenGL/ES/ES2 texture from the current context. - * - * See SDL_GL_BindTexture() for examples on how to use these functions - * - * \param texture the texture to unbind from the current OpenGL/ES/ES2 context - * \returns 0 on success, or -1 if the operation is not supported - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_BindTexture - * \sa SDL_GL_MakeCurrent - */ -extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); - -/** - * Get the CAMetalLayer associated with the given Metal renderer. - * - * This function returns `void *`, so SDL doesn't have to include Metal's - * headers, but it can be safely cast to a `CAMetalLayer *`. - * - * \param renderer The renderer to query - * \returns a `CAMetalLayer *` on success, or NULL if the renderer isn't a - * Metal renderer - * - * \since This function is available since SDL 2.0.8. - * - * \sa SDL_RenderGetMetalCommandEncoder - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); - -/** - * Get the Metal command encoder for the current frame - * - * This function returns `void *`, so SDL doesn't have to include Metal's - * headers, but it can be safely cast to an `id`. - * - * Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give - * SDL a drawable to render to, which might happen if the window is - * hidden/minimized/offscreen. This doesn't apply to command encoders for - * render targets, just the window's backbacker. Check your return values! - * - * \param renderer The renderer to query - * \returns an `id` on success, or NULL if the - * renderer isn't a Metal renderer or there was an error. - * - * \since This function is available since SDL 2.0.8. - * - * \sa SDL_RenderGetMetalLayer - */ -extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer); - -/** - * Toggle VSync of the given renderer. - * - * \param renderer The renderer to toggle - * \param vsync 1 for on, 0 for off. All other values are reserved - * \returns a 0 int on success, or non-zero on failure - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_RenderSetVSync(SDL_Renderer* renderer, int vsync); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_render_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_revision.h b/libs/hwcodec/externals/SDL/include/SDL_revision.h deleted file mode 100644 index ffb5c6b7..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_revision.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Generated by updaterev.sh, do not edit */ -#ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-release-2.26.5-0-gac13ca9ab (" SDL_VENDOR_INFO ")" -#else -#define SDL_REVISION "SDL-release-2.26.5-0-gac13ca9ab" -#endif -#define SDL_REVISION_NUMBER 0 diff --git a/libs/hwcodec/externals/SDL/include/SDL_rwops.h b/libs/hwcodec/externals/SDL/include/SDL_rwops.h deleted file mode 100644 index 8615cb54..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_rwops.h +++ /dev/null @@ -1,841 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_rwops.h - * - * This file provides a general interface for SDL to read and write - * data streams. It can easily be extended to files, memory, etc. - */ - -#ifndef SDL_rwops_h_ -#define SDL_rwops_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* RWops Types */ -#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */ -#define SDL_RWOPS_WINFILE 1U /**< Win32 file */ -#define SDL_RWOPS_STDFILE 2U /**< Stdio file */ -#define SDL_RWOPS_JNIFILE 3U /**< Android asset */ -#define SDL_RWOPS_MEMORY 4U /**< Memory stream */ -#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */ - -/** - * This is the read/write operation structure -- very basic. - */ -typedef struct SDL_RWops -{ - /** - * Return the size of the file in this rwops, or -1 if unknown - */ - Sint64 (SDLCALL * size) (struct SDL_RWops * context); - - /** - * Seek to \c offset relative to \c whence, one of stdio's whence values: - * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - * - * \return the final offset in the data stream, or -1 on error. - */ - Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, - int whence); - - /** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. - * - * \return the number of objects read, or 0 at error or end of file. - */ - size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, - size_t size, size_t maxnum); - - /** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. - * - * \return the number of objects written, or 0 at error or end of file. - */ - size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, - size_t size, size_t num); - - /** - * Close and free an allocated SDL_RWops structure. - * - * \return 0 if successful or -1 on write error when flushing data. - */ - int (SDLCALL * close) (struct SDL_RWops * context); - - Uint32 type; - union - { -#if defined(__ANDROID__) - struct - { - void *asset; - } androidio; -#elif defined(__WIN32__) || defined(__GDK__) - struct - { - SDL_bool append; - void *h; - struct - { - void *data; - size_t size; - size_t left; - } buffer; - } windowsio; -#endif - -#ifdef HAVE_STDIO_H - struct - { - SDL_bool autoclose; - FILE *fp; - } stdio; -#endif - struct - { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct - { - void *data1; - void *data2; - } unknown; - } hidden; - -} SDL_RWops; - - -/** - * \name RWFrom functions - * - * Functions to create SDL_RWops structures from various data streams. - */ -/* @{ */ - -/** - * Use this function to create a new SDL_RWops structure for reading from - * and/or writing to a named file. - * - * The `mode` string is treated roughly the same as in a call to the C - * library's fopen(), even if SDL doesn't happen to use fopen() behind the - * scenes. - * - * Available `mode` strings: - * - * - "r": Open a file for reading. The file must exist. - * - "w": Create an empty file for writing. If a file with the same name - * already exists its content is erased and the file is treated as a new - * empty file. - * - "a": Append to a file. Writing operations append data at the end of the - * file. The file is created if it does not exist. - * - "r+": Open a file for update both reading and writing. The file must - * exist. - * - "w+": Create an empty file for both reading and writing. If a file with - * the same name already exists its content is erased and the file is - * treated as a new empty file. - * - "a+": Open a file for reading and appending. All writing operations are - * performed at the end of the file, protecting the previous content to be - * overwritten. You can reposition (fseek, rewind) the internal pointer to - * anywhere in the file for reading, but writing operations will move it - * back to the end of file. The file is created if it does not exist. - * - * **NOTE**: In order to open a file as a binary file, a "b" character has to - * be included in the `mode` string. This additional "b" character can either - * be appended at the end of the string (thus making the following compound - * modes: "rb", "wb", "ab", "r+b", "w+b", "a+b") or be inserted between the - * letter and the "+" sign for the mixed modes ("rb+", "wb+", "ab+"). - * Additional characters may follow the sequence, although they should have no - * effect. For example, "t" is sometimes appended to make explicit the file is - * a text file. - * - * This function supports Unicode filenames, but they must be encoded in UTF-8 - * format, regardless of the underlying operating system. - * - * As a fallback, SDL_RWFromFile() will transparently open a matching filename - * in an Android app's `assets`. - * - * Closing the SDL_RWops will close the file handle SDL is holding internally. - * - * \param file a UTF-8 string representing the filename to open - * \param mode an ASCII string representing the mode to be used for opening - * the file. - * \returns a pointer to the SDL_RWops structure that is created, or NULL on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWtell - * \sa SDL_RWwrite - */ -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, - const char *mode); - -#ifdef HAVE_STDIO_H - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose); - -#else - -/** - * Use this function to create an SDL_RWops structure from a standard I/O file - * pointer (stdio.h's `FILE*`). - * - * This function is not available on Windows, since files opened in an - * application on that platform cannot be used by a dynamically linked - * library. - * - * On some platforms, the first parameter is a `void*`, on others, it's a - * `FILE*`, depending on what system headers are available to SDL. It is - * always intended to be the `FILE*` type from the C runtime's stdio.h. - * - * \param fp the `FILE*` that feeds the SDL_RWops stream - * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops, - * SDL_FALSE to leave the `FILE*` open when the RWops is - * closed - * \returns a pointer to the SDL_RWops structure that is created, or NULL on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWtell - * \sa SDL_RWwrite - */ -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, - SDL_bool autoclose); -#endif - -/** - * Use this function to prepare a read-write memory buffer for use with - * SDL_RWops. - * - * This function sets up an SDL_RWops struct based on a memory area of a - * certain size, for both read and write access. - * - * This memory buffer is not copied by the RWops; the pointer you provide must - * remain valid until you close the stream. Closing the stream will not free - * the original buffer. - * - * If you need to make sure the RWops never writes to the memory buffer, you - * should use SDL_RWFromConstMem() with a read-only buffer of memory instead. - * - * \param mem a pointer to a buffer to feed an SDL_RWops stream - * \param size the buffer size, in bytes - * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWtell - * \sa SDL_RWwrite - */ -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); - -/** - * Use this function to prepare a read-only memory buffer for use with RWops. - * - * This function sets up an SDL_RWops struct based on a memory area of a - * certain size. It assumes the memory area is not writable. - * - * Attempting to write to this RWops stream will report an error without - * writing to the memory buffer. - * - * This memory buffer is not copied by the RWops; the pointer you provide must - * remain valid until you close the stream. Closing the stream will not free - * the original buffer. - * - * If you need to write to a memory buffer, you should use SDL_RWFromMem() - * with a writable buffer of memory instead. - * - * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream - * \param size the buffer size, in bytes - * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWtell - */ -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, - int size); - -/* @} *//* RWFrom functions */ - - -/** - * Use this function to allocate an empty, unpopulated SDL_RWops structure. - * - * Applications do not need to use this function unless they are providing - * their own SDL_RWops implementation. If you just need a SDL_RWops to - * read/write a common data source, you should use the built-in - * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc. - * - * You must free the returned pointer with SDL_FreeRW(). Depending on your - * operating system and compiler, there may be a difference between the - * malloc() and free() your program uses and the versions SDL calls - * internally. Trying to mix the two can cause crashing such as segmentation - * faults. Since all SDL_RWops must free themselves when their **close** - * method is called, all SDL_RWops must be allocated through this function, so - * they can all be freed correctly with SDL_FreeRW(). - * - * \returns a pointer to the allocated memory on success, or NULL on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeRW - */ -extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); - -/** - * Use this function to free an SDL_RWops structure allocated by - * SDL_AllocRW(). - * - * Applications do not need to use this function unless they are providing - * their own SDL_RWops implementation. If you just need a SDL_RWops to - * read/write a common data source, you should use the built-in - * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and - * call the **close** method on those SDL_RWops pointers when you are done - * with them. - * - * Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is - * invalid as soon as this function returns. Any extra memory allocated during - * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must - * be responsible for managing that memory in their **close** method. - * - * \param area the SDL_RWops structure to be freed - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocRW - */ -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); - -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ - -/** - * Use this function to get the size of the data stream in an SDL_RWops. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context the SDL_RWops to get the size of the data stream from - * \returns the size of the data stream in the SDL_RWops on success, -1 if - * unknown or a negative error code on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); - -/** - * Seek within an SDL_RWops data stream. - * - * This function seeks to byte `offset`, relative to `whence`. - * - * `whence` may be any of the following values: - * - * - `RW_SEEK_SET`: seek from the beginning of data - * - `RW_SEEK_CUR`: seek relative to current read point - * - `RW_SEEK_END`: seek relative to the end of data - * - * If this stream can not seek, it will return -1. - * - * SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's - * `seek` method appropriately, to simplify application development. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context a pointer to an SDL_RWops structure - * \param offset an offset in bytes, relative to **whence** location; can be - * negative - * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END` - * \returns the final offset in the data stream after the seek or -1 on error. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWtell - * \sa SDL_RWwrite - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, - Sint64 offset, int whence); - -/** - * Determine the current read/write offset in an SDL_RWops data stream. - * - * SDL_RWtell is actually a wrapper function that calls the SDL_RWops's `seek` - * method, with an offset of 0 bytes from `RW_SEEK_CUR`, to simplify - * application development. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context a SDL_RWops data stream object from which to get the current - * offset - * \returns the current offset in the stream, or -1 if the information can not - * be determined. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWwrite - */ -extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); - -/** - * Read from a data source. - * - * This function reads up to `maxnum` objects each of size `size` from the - * data source to the area pointed at by `ptr`. This function may read less - * objects than requested. It will return zero when there has been an error or - * the data stream is completely read. - * - * SDL_RWread() is actually a function wrapper that calls the SDL_RWops's - * `read` method appropriately, to simplify application development. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context a pointer to an SDL_RWops structure - * \param ptr a pointer to a buffer to read data into - * \param size the size of each object to read, in bytes - * \param maxnum the maximum number of objects to be read - * \returns the number of objects read, or 0 at error or end of file; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWseek - * \sa SDL_RWwrite - */ -extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, - void *ptr, size_t size, - size_t maxnum); - -/** - * Write to an SDL_RWops data stream. - * - * This function writes exactly `num` objects each of size `size` from the - * area pointed at by `ptr` to the stream. If this fails for any reason, it'll - * return less than `num` to demonstrate how far the write progressed. On - * success, it returns `num`. - * - * SDL_RWwrite is actually a function wrapper that calls the SDL_RWops's - * `write` method appropriately, to simplify application development. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context a pointer to an SDL_RWops structure - * \param ptr a pointer to a buffer containing data to write - * \param size the size of an object to write, in bytes - * \param num the number of objects to write - * \returns the number of objects written, which will be less than **num** on - * error; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_RWclose - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - */ -extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, - const void *ptr, size_t size, - size_t num); - -/** - * Close and free an allocated SDL_RWops structure. - * - * SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any - * resources used by the stream and frees the SDL_RWops itself with - * SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to - * flush to its output (e.g. to disk). - * - * Note that if this fails to flush the stream to disk, this function reports - * an error, but the SDL_RWops is still invalid once this function returns. - * - * Prior to SDL 2.0.10, this function was a macro. - * - * \param context SDL_RWops structure to close - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.10. - * - * \sa SDL_RWFromConstMem - * \sa SDL_RWFromFile - * \sa SDL_RWFromFP - * \sa SDL_RWFromMem - * \sa SDL_RWread - * \sa SDL_RWseek - * \sa SDL_RWwrite - */ -extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); - -/** - * Load all the data from an SDL data stream. - * - * The data is allocated with a zero byte at the end (null terminated) for - * convenience. This extra byte is not included in the value reported via - * `datasize`. - * - * The data should be freed with SDL_free(). - * - * \param src the SDL_RWops to read all available data from - * \param datasize if not NULL, will store the number of bytes read - * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning - * \returns the data, or NULL if there was an error. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, - size_t *datasize, - int freesrc); - -/** - * Load all the data from a file path. - * - * The data is allocated with a zero byte at the end (null terminated) for - * convenience. This extra byte is not included in the value reported via - * `datasize`. - * - * The data should be freed with SDL_free(). - * - * Prior to SDL 2.0.10, this function was a macro wrapping around - * SDL_LoadFile_RW. - * - * \param file the path to read all available data from - * \param datasize if not NULL, will store the number of bytes read - * \returns the data, or NULL if there was an error. - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); - -/** - * \name Read endian functions - * - * Read an item of the specified endianness and return in native format. - */ -/* @{ */ - -/** - * Use this function to read a byte from an SDL_RWops. - * - * \param src the SDL_RWops to read from - * \returns the read byte on success or 0 on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteU8 - */ -extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); - -/** - * Use this function to read 16 bits of little-endian data from an SDL_RWops - * and return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 16 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadBE16 - */ -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); - -/** - * Use this function to read 16 bits of big-endian data from an SDL_RWops and - * return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 16 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadLE16 - */ -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); - -/** - * Use this function to read 32 bits of little-endian data from an SDL_RWops - * and return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 32 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadBE32 - */ -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); - -/** - * Use this function to read 32 bits of big-endian data from an SDL_RWops and - * return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 32 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadLE32 - */ -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); - -/** - * Use this function to read 64 bits of little-endian data from an SDL_RWops - * and return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 64 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadBE64 - */ -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); - -/** - * Use this function to read 64 bits of big-endian data from an SDL_RWops and - * return in native format. - * - * SDL byteswaps the data only if necessary, so the data returned will be in - * the native byte order. - * - * \param src the stream from which to read data - * \returns 64 bits of data in the native byte order of the platform. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadLE64 - */ -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); -/* @} *//* Read endian functions */ - -/** - * \name Write endian functions - * - * Write an item of native format to the specified endianness. - */ -/* @{ */ - -/** - * Use this function to write a byte to an SDL_RWops. - * - * \param dst the SDL_RWops to write to - * \param value the byte value to write - * \returns 1 on success or 0 on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ReadU8 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); - -/** - * Use this function to write 16 bits in native format to a SDL_RWops as - * little-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in little-endian - * format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteBE16 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); - -/** - * Use this function to write 16 bits in native format to a SDL_RWops as - * big-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in big-endian format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteLE16 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); - -/** - * Use this function to write 32 bits in native format to a SDL_RWops as - * little-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in little-endian - * format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteBE32 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); - -/** - * Use this function to write 32 bits in native format to a SDL_RWops as - * big-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in big-endian format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteLE32 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); - -/** - * Use this function to write 64 bits in native format to a SDL_RWops as - * little-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in little-endian - * format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteBE64 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); - -/** - * Use this function to write 64 bits in native format to a SDL_RWops as - * big-endian data. - * - * SDL byteswaps the data only if necessary, so the application always - * specifies native format, and the data written will be in big-endian format. - * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format - * \returns 1 on successful write, 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WriteLE64 - */ -extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); -/* @} *//* Write endian functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_rwops_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_scancode.h b/libs/hwcodec/externals/SDL/include/SDL_scancode.h deleted file mode 100644 index a960a799..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_scancode.h +++ /dev/null @@ -1,438 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_scancode.h - * - * Defines keyboard scancodes. - */ - -#ifndef SDL_scancode_h_ -#define SDL_scancode_h_ - -#include "SDL_stdinc.h" - -/** - * \brief The SDL keyboard scancode representation. - * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. - * - * The values in this enumeration are based on the USB usage page standard: - * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf - */ -typedef enum -{ - SDL_SCANCODE_UNKNOWN = 0, - - /** - * \name Usage page 0x07 - * - * These values are from usage page 0x07 (USB keyboard page). - */ - /* @{ */ - - SDL_SCANCODE_A = 4, - SDL_SCANCODE_B = 5, - SDL_SCANCODE_C = 6, - SDL_SCANCODE_D = 7, - SDL_SCANCODE_E = 8, - SDL_SCANCODE_F = 9, - SDL_SCANCODE_G = 10, - SDL_SCANCODE_H = 11, - SDL_SCANCODE_I = 12, - SDL_SCANCODE_J = 13, - SDL_SCANCODE_K = 14, - SDL_SCANCODE_L = 15, - SDL_SCANCODE_M = 16, - SDL_SCANCODE_N = 17, - SDL_SCANCODE_O = 18, - SDL_SCANCODE_P = 19, - SDL_SCANCODE_Q = 20, - SDL_SCANCODE_R = 21, - SDL_SCANCODE_S = 22, - SDL_SCANCODE_T = 23, - SDL_SCANCODE_U = 24, - SDL_SCANCODE_V = 25, - SDL_SCANCODE_W = 26, - SDL_SCANCODE_X = 27, - SDL_SCANCODE_Y = 28, - SDL_SCANCODE_Z = 29, - - SDL_SCANCODE_1 = 30, - SDL_SCANCODE_2 = 31, - SDL_SCANCODE_3 = 32, - SDL_SCANCODE_4 = 33, - SDL_SCANCODE_5 = 34, - SDL_SCANCODE_6 = 35, - SDL_SCANCODE_7 = 36, - SDL_SCANCODE_8 = 37, - SDL_SCANCODE_9 = 38, - SDL_SCANCODE_0 = 39, - - SDL_SCANCODE_RETURN = 40, - SDL_SCANCODE_ESCAPE = 41, - SDL_SCANCODE_BACKSPACE = 42, - SDL_SCANCODE_TAB = 43, - SDL_SCANCODE_SPACE = 44, - - SDL_SCANCODE_MINUS = 45, - SDL_SCANCODE_EQUALS = 46, - SDL_SCANCODE_LEFTBRACKET = 47, - SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return - * key on ISO keyboards and at the right end - * of the QWERTY row on ANSI keyboards. - * Produces REVERSE SOLIDUS (backslash) and - * VERTICAL LINE in a US layout, REVERSE - * SOLIDUS and VERTICAL LINE in a UK Mac - * layout, NUMBER SIGN and TILDE in a UK - * Windows layout, DOLLAR SIGN and POUND SIGN - * in a Swiss German layout, NUMBER SIGN and - * APOSTROPHE in a German layout, GRAVE - * ACCENT and POUND SIGN in a French Mac - * layout, and ASTERISK and MICRO SIGN in a - * French Windows layout. - */ - SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code - * instead of 49 for the same key, but all - * OSes I've seen treat the two codes - * identically. So, as an implementor, unless - * your keyboard generates both of those - * codes and your OS treats them differently, - * you should generate SDL_SCANCODE_BACKSLASH - * instead of this code. As a user, you - * should not rely on this code because SDL - * will never generate it with most (all?) - * keyboards. - */ - SDL_SCANCODE_SEMICOLON = 51, - SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI - * and ISO keyboards). Produces GRAVE ACCENT and - * TILDE in a US Windows layout and in US and UK - * Mac layouts on ANSI keyboards, GRAVE ACCENT - * and NOT SIGN in a UK Windows layout, SECTION - * SIGN and PLUS-MINUS SIGN in US and UK Mac - * layouts on ISO keyboards, SECTION SIGN and - * DEGREE SIGN in a Swiss German layout (Mac: - * only on ISO keyboards), CIRCUMFLEX ACCENT and - * DEGREE SIGN in a German layout (Mac: only on - * ISO keyboards), SUPERSCRIPT TWO and TILDE in a - * French Windows layout, COMMERCIAL AT and - * NUMBER SIGN in a French Mac layout on ISO - * keyboards, and LESS-THAN SIGN and GREATER-THAN - * SIGN in a Swiss German, German, or French Mac - * layout on ANSI keyboards. - */ - SDL_SCANCODE_COMMA = 54, - SDL_SCANCODE_PERIOD = 55, - SDL_SCANCODE_SLASH = 56, - - SDL_SCANCODE_CAPSLOCK = 57, - - SDL_SCANCODE_F1 = 58, - SDL_SCANCODE_F2 = 59, - SDL_SCANCODE_F3 = 60, - SDL_SCANCODE_F4 = 61, - SDL_SCANCODE_F5 = 62, - SDL_SCANCODE_F6 = 63, - SDL_SCANCODE_F7 = 64, - SDL_SCANCODE_F8 = 65, - SDL_SCANCODE_F9 = 66, - SDL_SCANCODE_F10 = 67, - SDL_SCANCODE_F11 = 68, - SDL_SCANCODE_F12 = 69, - - SDL_SCANCODE_PRINTSCREEN = 70, - SDL_SCANCODE_SCROLLLOCK = 71, - SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but - does send code 73, not 117) */ - SDL_SCANCODE_HOME = 74, - SDL_SCANCODE_PAGEUP = 75, - SDL_SCANCODE_DELETE = 76, - SDL_SCANCODE_END = 77, - SDL_SCANCODE_PAGEDOWN = 78, - SDL_SCANCODE_RIGHT = 79, - SDL_SCANCODE_LEFT = 80, - SDL_SCANCODE_DOWN = 81, - SDL_SCANCODE_UP = 82, - - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards - */ - SDL_SCANCODE_KP_DIVIDE = 84, - SDL_SCANCODE_KP_MULTIPLY = 85, - SDL_SCANCODE_KP_MINUS = 86, - SDL_SCANCODE_KP_PLUS = 87, - SDL_SCANCODE_KP_ENTER = 88, - SDL_SCANCODE_KP_1 = 89, - SDL_SCANCODE_KP_2 = 90, - SDL_SCANCODE_KP_3 = 91, - SDL_SCANCODE_KP_4 = 92, - SDL_SCANCODE_KP_5 = 93, - SDL_SCANCODE_KP_6 = 94, - SDL_SCANCODE_KP_7 = 95, - SDL_SCANCODE_KP_8 = 96, - SDL_SCANCODE_KP_9 = 97, - SDL_SCANCODE_KP_0 = 98, - SDL_SCANCODE_KP_PERIOD = 99, - - SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO - * keyboards have over ANSI ones, - * located between left shift and Y. - * Produces GRAVE ACCENT and TILDE in a - * US or UK Mac layout, REVERSE SOLIDUS - * (backslash) and VERTICAL LINE in a - * US or UK Windows layout, and - * LESS-THAN SIGN and GREATER-THAN SIGN - * in a Swiss German, German, or French - * layout. */ - SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ - SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, - * not a physical key - but some Mac keyboards - * do have a power key. */ - SDL_SCANCODE_KP_EQUALS = 103, - SDL_SCANCODE_F13 = 104, - SDL_SCANCODE_F14 = 105, - SDL_SCANCODE_F15 = 106, - SDL_SCANCODE_F16 = 107, - SDL_SCANCODE_F17 = 108, - SDL_SCANCODE_F18 = 109, - SDL_SCANCODE_F19 = 110, - SDL_SCANCODE_F20 = 111, - SDL_SCANCODE_F21 = 112, - SDL_SCANCODE_F22 = 113, - SDL_SCANCODE_F23 = 114, - SDL_SCANCODE_F24 = 115, - SDL_SCANCODE_EXECUTE = 116, - SDL_SCANCODE_HELP = 117, /**< AL Integrated Help Center */ - SDL_SCANCODE_MENU = 118, /**< Menu (show menu) */ - SDL_SCANCODE_SELECT = 119, - SDL_SCANCODE_STOP = 120, /**< AC Stop */ - SDL_SCANCODE_AGAIN = 121, /**< AC Redo/Repeat */ - SDL_SCANCODE_UNDO = 122, /**< AC Undo */ - SDL_SCANCODE_CUT = 123, /**< AC Cut */ - SDL_SCANCODE_COPY = 124, /**< AC Copy */ - SDL_SCANCODE_PASTE = 125, /**< AC Paste */ - SDL_SCANCODE_FIND = 126, /**< AC Find */ - SDL_SCANCODE_MUTE = 127, - SDL_SCANCODE_VOLUMEUP = 128, - SDL_SCANCODE_VOLUMEDOWN = 129, -/* not sure whether there's a reason to enable these */ -/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ -/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ -/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ - SDL_SCANCODE_KP_COMMA = 133, - SDL_SCANCODE_KP_EQUALSAS400 = 134, - - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see - footnotes in USB doc */ - SDL_SCANCODE_INTERNATIONAL2 = 136, - SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ - SDL_SCANCODE_INTERNATIONAL4 = 138, - SDL_SCANCODE_INTERNATIONAL5 = 139, - SDL_SCANCODE_INTERNATIONAL6 = 140, - SDL_SCANCODE_INTERNATIONAL7 = 141, - SDL_SCANCODE_INTERNATIONAL8 = 142, - SDL_SCANCODE_INTERNATIONAL9 = 143, - SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ - SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ - SDL_SCANCODE_LANG3 = 146, /**< Katakana */ - SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ - SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ - SDL_SCANCODE_LANG6 = 149, /**< reserved */ - SDL_SCANCODE_LANG7 = 150, /**< reserved */ - SDL_SCANCODE_LANG8 = 151, /**< reserved */ - SDL_SCANCODE_LANG9 = 152, /**< reserved */ - - SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ - SDL_SCANCODE_SYSREQ = 154, - SDL_SCANCODE_CANCEL = 155, /**< AC Cancel */ - SDL_SCANCODE_CLEAR = 156, - SDL_SCANCODE_PRIOR = 157, - SDL_SCANCODE_RETURN2 = 158, - SDL_SCANCODE_SEPARATOR = 159, - SDL_SCANCODE_OUT = 160, - SDL_SCANCODE_OPER = 161, - SDL_SCANCODE_CLEARAGAIN = 162, - SDL_SCANCODE_CRSEL = 163, - SDL_SCANCODE_EXSEL = 164, - - SDL_SCANCODE_KP_00 = 176, - SDL_SCANCODE_KP_000 = 177, - SDL_SCANCODE_THOUSANDSSEPARATOR = 178, - SDL_SCANCODE_DECIMALSEPARATOR = 179, - SDL_SCANCODE_CURRENCYUNIT = 180, - SDL_SCANCODE_CURRENCYSUBUNIT = 181, - SDL_SCANCODE_KP_LEFTPAREN = 182, - SDL_SCANCODE_KP_RIGHTPAREN = 183, - SDL_SCANCODE_KP_LEFTBRACE = 184, - SDL_SCANCODE_KP_RIGHTBRACE = 185, - SDL_SCANCODE_KP_TAB = 186, - SDL_SCANCODE_KP_BACKSPACE = 187, - SDL_SCANCODE_KP_A = 188, - SDL_SCANCODE_KP_B = 189, - SDL_SCANCODE_KP_C = 190, - SDL_SCANCODE_KP_D = 191, - SDL_SCANCODE_KP_E = 192, - SDL_SCANCODE_KP_F = 193, - SDL_SCANCODE_KP_XOR = 194, - SDL_SCANCODE_KP_POWER = 195, - SDL_SCANCODE_KP_PERCENT = 196, - SDL_SCANCODE_KP_LESS = 197, - SDL_SCANCODE_KP_GREATER = 198, - SDL_SCANCODE_KP_AMPERSAND = 199, - SDL_SCANCODE_KP_DBLAMPERSAND = 200, - SDL_SCANCODE_KP_VERTICALBAR = 201, - SDL_SCANCODE_KP_DBLVERTICALBAR = 202, - SDL_SCANCODE_KP_COLON = 203, - SDL_SCANCODE_KP_HASH = 204, - SDL_SCANCODE_KP_SPACE = 205, - SDL_SCANCODE_KP_AT = 206, - SDL_SCANCODE_KP_EXCLAM = 207, - SDL_SCANCODE_KP_MEMSTORE = 208, - SDL_SCANCODE_KP_MEMRECALL = 209, - SDL_SCANCODE_KP_MEMCLEAR = 210, - SDL_SCANCODE_KP_MEMADD = 211, - SDL_SCANCODE_KP_MEMSUBTRACT = 212, - SDL_SCANCODE_KP_MEMMULTIPLY = 213, - SDL_SCANCODE_KP_MEMDIVIDE = 214, - SDL_SCANCODE_KP_PLUSMINUS = 215, - SDL_SCANCODE_KP_CLEAR = 216, - SDL_SCANCODE_KP_CLEARENTRY = 217, - SDL_SCANCODE_KP_BINARY = 218, - SDL_SCANCODE_KP_OCTAL = 219, - SDL_SCANCODE_KP_DECIMAL = 220, - SDL_SCANCODE_KP_HEXADECIMAL = 221, - - SDL_SCANCODE_LCTRL = 224, - SDL_SCANCODE_LSHIFT = 225, - SDL_SCANCODE_LALT = 226, /**< alt, option */ - SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ - SDL_SCANCODE_RCTRL = 228, - SDL_SCANCODE_RSHIFT = 229, - SDL_SCANCODE_RALT = 230, /**< alt gr, option */ - SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ - - SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered - * by any of the above, but since there's a - * special KMOD_MODE for it I'm adding it here - */ - - /* @} *//* Usage page 0x07 */ - - /** - * \name Usage page 0x0C - * - * These values are mapped from usage page 0x0C (USB consumer page). - * See https://usb.org/sites/default/files/hut1_2.pdf - * - * There are way more keys in the spec than we can represent in the - * current scancode range, so pick the ones that commonly come up in - * real world usage. - */ - /* @{ */ - - SDL_SCANCODE_AUDIONEXT = 258, - SDL_SCANCODE_AUDIOPREV = 259, - SDL_SCANCODE_AUDIOSTOP = 260, - SDL_SCANCODE_AUDIOPLAY = 261, - SDL_SCANCODE_AUDIOMUTE = 262, - SDL_SCANCODE_MEDIASELECT = 263, - SDL_SCANCODE_WWW = 264, /**< AL Internet Browser */ - SDL_SCANCODE_MAIL = 265, - SDL_SCANCODE_CALCULATOR = 266, /**< AL Calculator */ - SDL_SCANCODE_COMPUTER = 267, - SDL_SCANCODE_AC_SEARCH = 268, /**< AC Search */ - SDL_SCANCODE_AC_HOME = 269, /**< AC Home */ - SDL_SCANCODE_AC_BACK = 270, /**< AC Back */ - SDL_SCANCODE_AC_FORWARD = 271, /**< AC Forward */ - SDL_SCANCODE_AC_STOP = 272, /**< AC Stop */ - SDL_SCANCODE_AC_REFRESH = 273, /**< AC Refresh */ - SDL_SCANCODE_AC_BOOKMARKS = 274, /**< AC Bookmarks */ - - /* @} *//* Usage page 0x0C */ - - /** - * \name Walther keys - * - * These are values that Christian Walther added (for mac keyboard?). - */ - /* @{ */ - - SDL_SCANCODE_BRIGHTNESSDOWN = 275, - SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display - switch, video mode switch */ - SDL_SCANCODE_KBDILLUMTOGGLE = 278, - SDL_SCANCODE_KBDILLUMDOWN = 279, - SDL_SCANCODE_KBDILLUMUP = 280, - SDL_SCANCODE_EJECT = 281, - SDL_SCANCODE_SLEEP = 282, /**< SC System Sleep */ - - SDL_SCANCODE_APP1 = 283, - SDL_SCANCODE_APP2 = 284, - - /* @} *//* Walther keys */ - - /** - * \name Usage page 0x0C (additional media keys) - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIOREWIND = 285, - SDL_SCANCODE_AUDIOFASTFORWARD = 286, - - /* @} *//* Usage page 0x0C (additional media keys) */ - - /** - * \name Mobile keys - * - * These are values that are often used on mobile phones. - */ - /* @{ */ - - SDL_SCANCODE_SOFTLEFT = 287, /**< Usually situated below the display on phones and - used as a multi-function feature key for selecting - a software defined function shown on the bottom left - of the display. */ - SDL_SCANCODE_SOFTRIGHT = 288, /**< Usually situated below the display on phones and - used as a multi-function feature key for selecting - a software defined function shown on the bottom right - of the display. */ - SDL_SCANCODE_CALL = 289, /**< Used for accepting phone calls. */ - SDL_SCANCODE_ENDCALL = 290, /**< Used for rejecting phone calls. */ - - /* @} *//* Mobile keys */ - - /* Add any other keys here. */ - - SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes - for array bounds */ -} SDL_Scancode; - -#endif /* SDL_scancode_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_sensor.h b/libs/hwcodec/externals/SDL/include/SDL_sensor.h deleted file mode 100644 index 3010e497..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_sensor.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_sensor.h - * - * Include file for SDL sensor event handling - * - */ - -#ifndef SDL_sensor_h_ -#define SDL_sensor_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \brief SDL_sensor.h - * - * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system - * for sensors, and load appropriate drivers. - */ - -struct _SDL_Sensor; -typedef struct _SDL_Sensor SDL_Sensor; - -/** - * This is a unique ID for a sensor for the time it is connected to the system, - * and is never reused for the lifetime of the application. - * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. - */ -typedef Sint32 SDL_SensorID; - -/* The different sensors defined by SDL - * - * Additional sensors may be available, using platform dependent semantics. - * - * Hare are the additional Android sensors: - * https://developer.android.com/reference/android/hardware/SensorEvent.html#values - */ -typedef enum -{ - SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ - SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ - SDL_SENSOR_ACCEL, /**< Accelerometer */ - SDL_SENSOR_GYRO, /**< Gyroscope */ - SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */ - SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */ - SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */ - SDL_SENSOR_GYRO_R /**< Gyroscope for right Joy-Con controller */ -} SDL_SensorType; - -/** - * Accelerometer sensor - * - * The accelerometer returns the current acceleration in SI meters per - * second squared. This measurement includes the force of gravity, so - * a device at rest will have an value of SDL_STANDARD_GRAVITY away - * from the center of the earth. - * - * values[0]: Acceleration on the x axis - * values[1]: Acceleration on the y axis - * values[2]: Acceleration on the z axis - * - * For phones held in portrait mode and game controllers held in front of you, - * the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ -#define SDL_STANDARD_GRAVITY 9.80665f - -/** - * Gyroscope sensor - * - * The gyroscope returns the current rate of rotation in radians per second. - * The rotation is positive in the counter-clockwise direction. That is, - * an observer looking from a positive location on one of the axes would - * see positive rotation on that axis when it appeared to be rotating - * counter-clockwise. - * - * values[0]: Angular speed around the x axis (pitch) - * values[1]: Angular speed around the y axis (yaw) - * values[2]: Angular speed around the z axis (roll) - * - * For phones held in portrait mode and game controllers held in front of you, - * the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone or controller is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ - -/* Function prototypes */ - -/** - * Locking for multi-threaded access to the sensor API - * - * If you are using the sensor API or handling events from multiple threads - * you should use these locking functions to protect access to the sensors. - * - * In particular, you are guaranteed that the sensor list won't change, so the - * API functions that take a sensor index will be valid, and sensor events - * will not be delivered. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC void SDLCALL SDL_LockSensors(void); -extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); - -/** - * Count the number of sensors attached to the system right now. - * - * \returns the number of sensors detected. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_NumSensors(void); - -/** - * Get the implementation dependent name of a sensor. - * - * \param device_index The sensor to obtain name from - * \returns the sensor name, or NULL if `device_index` is out of range. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); - -/** - * Get the type of a sensor. - * - * \param device_index The sensor to get the type from - * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is - * out of range. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); - -/** - * Get the platform dependent type of a sensor. - * - * \param device_index The sensor to check - * \returns the sensor platform dependent type, or -1 if `device_index` is out - * of range. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); - -/** - * Get the instance ID of a sensor. - * - * \param device_index The sensor to get instance id from - * \returns the sensor instance ID, or -1 if `device_index` is out of range. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); - -/** - * Open a sensor for use. - * - * \param device_index The sensor to open - * \returns an SDL_Sensor sensor object, or NULL if an error occurred. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); - -/** - * Return the SDL_Sensor associated with an instance id. - * - * \param instance_id The sensor from instance id - * \returns an SDL_Sensor object. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); - -/** - * Get the implementation dependent name of a sensor - * - * \param sensor The SDL_Sensor object - * \returns the sensor name, or NULL if `sensor` is NULL. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); - -/** - * Get the type of a sensor. - * - * \param sensor The SDL_Sensor object to inspect - * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is - * NULL. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); - -/** - * Get the platform dependent type of a sensor. - * - * \param sensor The SDL_Sensor object to inspect - * \returns the sensor platform dependent type, or -1 if `sensor` is NULL. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); - -/** - * Get the instance ID of a sensor. - * - * \param sensor The SDL_Sensor object to inspect - * \returns the sensor instance ID, or -1 if `sensor` is NULL. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); - -/** - * Get the current state of an opened sensor. - * - * The number of values and interpretation of the data is sensor dependent. - * - * \param sensor The SDL_Sensor object to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * \returns 0 or -1 if an error occurred. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values); - -/** - * Get the current state of an opened sensor with the timestamp of the last - * update. - * - * The number of values and interpretation of the data is sensor dependent. - * - * \param sensor The SDL_Sensor object to query - * \param timestamp A pointer filled with the timestamp in microseconds of the - * current sensor reading if available, or 0 if not - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * \returns 0 or -1 if an error occurred. - * - * \since This function is available since SDL 2.26.0. - */ -extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values); - -/** - * Close a sensor previously opened with SDL_SensorOpen(). - * - * \param sensor The SDL_Sensor object to close - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor); - -/** - * Update the current state of the open sensors. - * - * This is called automatically by the event loop if sensor events are - * enabled. - * - * This needs to be called from the thread that initialized the sensor - * subsystem. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* SDL_sensor_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_shape.h b/libs/hwcodec/externals/SDL/include/SDL_shape.h deleted file mode 100644 index f66babc0..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_shape.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_shape_h_ -#define SDL_shape_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** \file SDL_shape.h - * - * Header file for the shaped window API. - */ - -#define SDL_NONSHAPEABLE_WINDOW -1 -#define SDL_INVALID_SHAPE_ARGUMENT -2 -#define SDL_WINDOW_LACKS_SHAPE -3 - -/** - * Create a window that can be shaped with the specified position, dimensions, - * and flags. - * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window. - * \param h The height of the window. - * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with - * any of the following: ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, - * and ::SDL_WINDOW_FULLSCREEN is always unset. - * \return the window created, or NULL if window creation failed. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DestroyWindow - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); - -/** - * Return whether the given window is a shaped window. - * - * \param window The window to query for being shaped. - * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if - * the window is unshaped or NULL. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateShapedWindow - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); - -/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ -typedef enum { - /** \brief The default mode, a binarized alpha cutoff of 1. */ - ShapeModeDefault, - /** \brief A binarized alpha cutoff with a given integer value. */ - ShapeModeBinarizeAlpha, - /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ - ShapeModeReverseBinarizeAlpha, - /** \brief A color key is applied. */ - ShapeModeColorKey -} WindowShapeMode; - -#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) - -/** \brief A union containing parameters for shaped windows. */ -typedef union { - /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ - Uint8 binarizationCutoff; - SDL_Color colorKey; -} SDL_WindowShapeParams; - -/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ -typedef struct SDL_WindowShapeMode { - /** \brief The mode of these window-shape parameters. */ - WindowShapeMode mode; - /** \brief Window-shape parameters. */ - SDL_WindowShapeParams parameters; -} SDL_WindowShapeMode; - -/** - * Set the shape and parameters of a shaped window. - * - * \param window The shaped window whose parameters should be set. - * \param shape A surface encoding the desired shape for the window. - * \param shape_mode The parameters to set for the shaped window. - * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape - * argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does - * not reference a valid shaped window. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WindowShapeMode - * \sa SDL_GetShapedWindowMode - */ -extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); - -/** - * Get the shape parameters of a shaped window. - * - * \param window The shaped window whose parameters should be retrieved. - * \param shape_mode An empty shape-mode structure to fill, or NULL to check - * whether the window has a shape. - * \return 0 if the window has a shape and, provided shape_mode was not NULL, - * shape_mode has been filled with the mode data, - * SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped - * window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a - * shapeable window currently lacking a shape. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_WindowShapeMode - * \sa SDL_SetWindowShape - */ -extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_shape_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_stdinc.h b/libs/hwcodec/externals/SDL/include/SDL_stdinc.h deleted file mode 100644 index bbce3d06..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_stdinc.h +++ /dev/null @@ -1,830 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_stdinc.h - * - * This is a general header that includes C language support. - */ - -#ifndef SDL_stdinc_h_ -#define SDL_stdinc_h_ - -#include "SDL_config.h" - -#ifdef __APPLE__ -#ifndef _DARWIN_C_SOURCE -#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ -#endif -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#if defined(STDC_HEADERS) -# include -# include -# include -#else -# if defined(HAVE_STDLIB_H) -# include -# elif defined(HAVE_MALLOC_H) -# include -# endif -# if defined(HAVE_STDDEF_H) -# include -# endif -# if defined(HAVE_STDARG_H) -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_WCHAR_H -# include -#endif -#if defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_STDINT_H) -# include -#endif -#ifdef HAVE_CTYPE_H -# include -#endif -#ifdef HAVE_MATH_H -# if defined(_MSC_VER) -/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on - Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx - for more information. -*/ -# define _USE_MATH_DEFINES -# endif -# include -#endif -#ifdef HAVE_FLOAT_H -# include -#endif -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include -# define alloca _alloca -# elif defined(__WATCOMC__) -# include -# elif defined(__BORLANDC__) -# include -# elif defined(__DMC__) -# include -# elif defined(__AIX__) -#pragma alloca -# elif defined(__MRC__) -void *alloca(unsigned); -# else -char *alloca(); -# endif -#endif - -#ifdef SIZE_MAX -# define SDL_SIZE_MAX SIZE_MAX -#else -# define SDL_SIZE_MAX ((size_t) -1) -#endif - -/** - * Check if the compiler supports a given builtin. - * Supported by virtually all clang versions and recent gcc. Use this - * instead of checking the clang version if possible. - */ -#ifdef __has_builtin -#define _SDL_HAS_BUILTIN(x) __has_builtin(x) -#else -#define _SDL_HAS_BUILTIN(x) 0 -#endif - -/** - * The number of elements in an array. - */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/** - * Macro useful for building other macros with strings in them - * - * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") - */ -#define SDL_STRINGIFY_ARG(arg) #arg - -/** - * \name Cast operators - * - * Use proper C++ casts when compiled as C++ to be compatible with the option - * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). - */ -/* @{ */ -#ifdef __cplusplus -#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) -#define SDL_static_cast(type, expression) static_cast(expression) -#define SDL_const_cast(type, expression) const_cast(expression) -#else -#define SDL_reinterpret_cast(type, expression) ((type)(expression)) -#define SDL_static_cast(type, expression) ((type)(expression)) -#define SDL_const_cast(type, expression) ((type)(expression)) -#endif -/* @} *//* Cast operators */ - -/* Define a four character code as a Uint32 */ -#define SDL_FOURCC(A, B, C, D) \ - ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ - (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) - -/** - * \name Basic data types - */ -/* @{ */ - -#ifdef __CC_ARM -/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */ -#define SDL_FALSE 0 -#define SDL_TRUE 1 -typedef int SDL_bool; -#else -typedef enum -{ - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; -#endif - -/** - * \brief A signed 8-bit integer type. - */ -#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ -#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ -typedef int8_t Sint8; -/** - * \brief An unsigned 8-bit integer type. - */ -#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ -#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ -typedef uint8_t Uint8; -/** - * \brief A signed 16-bit integer type. - */ -#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ -#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ -typedef int16_t Sint16; -/** - * \brief An unsigned 16-bit integer type. - */ -#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ -#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ -typedef uint16_t Uint16; -/** - * \brief A signed 32-bit integer type. - */ -#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ -#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ -typedef int32_t Sint32; -/** - * \brief An unsigned 32-bit integer type. - */ -#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ -#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ -typedef uint32_t Uint32; - -/** - * \brief A signed 64-bit integer type. - */ -#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ -#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ -typedef int64_t Sint64; -/** - * \brief An unsigned 64-bit integer type. - */ -#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ -#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ -typedef uint64_t Uint64; - -/* @} *//* Basic data types */ - -/** - * \name Floating-point constants - */ -/* @{ */ - -#ifdef FLT_EPSILON -#define SDL_FLT_EPSILON FLT_EPSILON -#else -#define SDL_FLT_EPSILON 1.1920928955078125e-07F /* 0x0.000002p0 */ -#endif - -/* @} *//* Floating-point constants */ - -/* Make sure we have macros for printing width-based integers. - * should define these but this is not true all platforms. - * (for example win32) */ -#ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) || defined(__GDK__) -#define SDL_PRIs64 "I64d" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIs64 "ld" -#else -#define SDL_PRIs64 "lld" -#endif -#endif -#ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) || defined(__GDK__) -#define SDL_PRIu64 "I64u" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIu64 "lu" -#else -#define SDL_PRIu64 "llu" -#endif -#endif -#ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) || defined(__GDK__) -#define SDL_PRIx64 "I64x" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIx64 "lx" -#else -#define SDL_PRIx64 "llx" -#endif -#endif -#ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) || defined(__GDK__) -#define SDL_PRIX64 "I64X" -#elif defined(__LINUX__) && defined(__LP64__) -#define SDL_PRIX64 "lX" -#else -#define SDL_PRIX64 "llX" -#endif -#endif -#ifndef SDL_PRIs32 -#ifdef PRId32 -#define SDL_PRIs32 PRId32 -#else -#define SDL_PRIs32 "d" -#endif -#endif -#ifndef SDL_PRIu32 -#ifdef PRIu32 -#define SDL_PRIu32 PRIu32 -#else -#define SDL_PRIu32 "u" -#endif -#endif -#ifndef SDL_PRIx32 -#ifdef PRIx32 -#define SDL_PRIx32 PRIx32 -#else -#define SDL_PRIx32 "x" -#endif -#endif -#ifndef SDL_PRIX32 -#ifdef PRIX32 -#define SDL_PRIX32 PRIX32 -#else -#define SDL_PRIX32 "X" -#endif -#endif - -/* Annotations to help code analysis tools */ -#ifdef SDL_DISABLE_ANALYZE_MACROS -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#else -#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ -#include - -#define SDL_IN_BYTECAP(x) _In_bytecount_(x) -#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) -#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) -#define SDL_OUT_CAP(x) _Out_cap_(x) -#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) -#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) - -#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ -#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ -#else -#define SDL_IN_BYTECAP(x) -#define SDL_INOUT_Z_CAP(x) -#define SDL_OUT_Z_CAP(x) -#define SDL_OUT_CAP(x) -#define SDL_OUT_BYTECAP(x) -#define SDL_OUT_Z_BYTECAP(x) -#define SDL_PRINTF_FORMAT_STRING -#define SDL_SCANF_FORMAT_STRING -#endif -#if defined(__GNUC__) -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#else -#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#endif -#endif /* SDL_DISABLE_ANALYZE_MACROS */ - -#ifndef SDL_COMPILE_TIME_ASSERT -#if defined(__cplusplus) -#if (__cplusplus >= 201103L) -#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) -#endif -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) -#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x) -#endif -#endif /* !SDL_COMPILE_TIME_ASSERT */ - -#ifndef SDL_COMPILE_TIME_ASSERT -/* universal, but may trigger -Wunused-local-typedefs */ -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] -#endif - -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -/* Check to make sure enums are the size of ints, for structure packing. - For both Watcom C/C++ and Borland C/C++ the compiler option that makes - enums having the size of an int must be enabled. - This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). -*/ - -/** \cond */ -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__) - /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ -typedef enum -{ - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ -/** \endcond */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -extern DECLSPEC void SDLCALL SDL_free(void *mem); - -typedef void *(SDLCALL *SDL_malloc_func)(size_t size); -typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); -typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); -typedef void (SDLCALL *SDL_free_func)(void *mem); - -/** - * Get the original set of SDL memory functions - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func, - SDL_calloc_func *calloc_func, - SDL_realloc_func *realloc_func, - SDL_free_func *free_func); - -/** - * Get the current set of SDL memory functions - * - * \since This function is available since SDL 2.0.7. - */ -extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, - SDL_calloc_func *calloc_func, - SDL_realloc_func *realloc_func, - SDL_free_func *free_func); - -/** - * Replace SDL's memory allocation functions with a custom set - * - * \since This function is available since SDL 2.0.7. - */ -extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, - SDL_calloc_func calloc_func, - SDL_realloc_func realloc_func, - SDL_free_func free_func); - -/** - * Get the number of outstanding (unfreed) allocations - * - * \since This function is available since SDL 2.0.7. - */ -extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); - -extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); - -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); -extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); - -extern DECLSPEC int SDLCALL SDL_abs(int x); - -/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */ -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) -#define SDL_clamp(x, a, b) (((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x))) - -extern DECLSPEC int SDLCALL SDL_isalpha(int x); -extern DECLSPEC int SDLCALL SDL_isalnum(int x); -extern DECLSPEC int SDLCALL SDL_isblank(int x); -extern DECLSPEC int SDLCALL SDL_iscntrl(int x); -extern DECLSPEC int SDLCALL SDL_isdigit(int x); -extern DECLSPEC int SDLCALL SDL_isxdigit(int x); -extern DECLSPEC int SDLCALL SDL_ispunct(int x); -extern DECLSPEC int SDLCALL SDL_isspace(int x); -extern DECLSPEC int SDLCALL SDL_isupper(int x); -extern DECLSPEC int SDLCALL SDL_islower(int x); -extern DECLSPEC int SDLCALL SDL_isprint(int x); -extern DECLSPEC int SDLCALL SDL_isgraph(int x); -extern DECLSPEC int SDLCALL SDL_toupper(int x); -extern DECLSPEC int SDLCALL SDL_tolower(int x); - -extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len); -extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); - -extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); - -#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) -#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) - -#define SDL_copyp(dst, src) \ - { SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \ - SDL_memcpy((dst), (src), sizeof (*(src))) - - -/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ -SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) -{ -#ifdef __APPLE__ - memset_pattern4(dst, &val, dwords * 4); -#elif defined(__GNUC__) && defined(__i386__) - int u0, u1, u2; - __asm__ __volatile__ ( - "cld \n\t" - "rep ; stosl \n\t" - : "=&D" (u0), "=&a" (u1), "=&c" (u2) - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) - : "memory" - ); -#else - size_t _n = (dwords + 3) / 4; - Uint32 *_p = SDL_static_cast(Uint32 *, dst); - Uint32 _val = (val); - if (dwords == 0) { - return; - } - switch (dwords % 4) { - case 0: do { *_p++ = _val; SDL_FALLTHROUGH; - case 3: *_p++ = _val; SDL_FALLTHROUGH; - case 2: *_p++ = _val; SDL_FALLTHROUGH; - case 1: *_p++ = _val; - } while ( --_n ); - } -#endif -} - -extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); - -extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); - -extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); -extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); -extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); - -extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); -extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); -extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); -extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); - -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); -extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); -extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); -extern DECLSPEC char *SDLCALL SDL_strrev(char *str); -extern DECLSPEC char *SDLCALL SDL_strupr(char *str); -extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); -extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); -extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle); -extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); -extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); -extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes); - -extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); -extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); - -extern DECLSPEC int SDLCALL SDL_atoi(const char *str); -extern DECLSPEC double SDLCALL SDL_atof(const char *str); -extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); -extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); - -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); - -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); -extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); -extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); - -#ifndef HAVE_M_PI -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 /**< pi */ -#endif -#endif - -/** - * Use this function to compute arc cosine of `x`. - * - * The definition of `y = acos(x)` is `x = cos(y)`. - * - * Domain: `-1 <= x <= 1` - * - * Range: `0 <= y <= Pi` - * - * \param x floating point value, in radians. - * \returns arc cosine of `x`. - * - * \since This function is available since SDL 2.0.2. - */ -extern DECLSPEC double SDLCALL SDL_acos(double x); -extern DECLSPEC float SDLCALL SDL_acosf(float x); -extern DECLSPEC double SDLCALL SDL_asin(double x); -extern DECLSPEC float SDLCALL SDL_asinf(float x); -extern DECLSPEC double SDLCALL SDL_atan(double x); -extern DECLSPEC float SDLCALL SDL_atanf(float x); -extern DECLSPEC double SDLCALL SDL_atan2(double y, double x); -extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x); -extern DECLSPEC double SDLCALL SDL_ceil(double x); -extern DECLSPEC float SDLCALL SDL_ceilf(float x); -extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y); -extern DECLSPEC double SDLCALL SDL_cos(double x); -extern DECLSPEC float SDLCALL SDL_cosf(float x); -extern DECLSPEC double SDLCALL SDL_exp(double x); -extern DECLSPEC float SDLCALL SDL_expf(float x); -extern DECLSPEC double SDLCALL SDL_fabs(double x); -extern DECLSPEC float SDLCALL SDL_fabsf(float x); -extern DECLSPEC double SDLCALL SDL_floor(double x); -extern DECLSPEC float SDLCALL SDL_floorf(float x); -extern DECLSPEC double SDLCALL SDL_trunc(double x); -extern DECLSPEC float SDLCALL SDL_truncf(float x); -extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); -extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); -extern DECLSPEC double SDLCALL SDL_log(double x); -extern DECLSPEC float SDLCALL SDL_logf(float x); -extern DECLSPEC double SDLCALL SDL_log10(double x); -extern DECLSPEC float SDLCALL SDL_log10f(float x); -extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -extern DECLSPEC float SDLCALL SDL_powf(float x, float y); -extern DECLSPEC double SDLCALL SDL_round(double x); -extern DECLSPEC float SDLCALL SDL_roundf(float x); -extern DECLSPEC long SDLCALL SDL_lround(double x); -extern DECLSPEC long SDLCALL SDL_lroundf(float x); -extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); -extern DECLSPEC double SDLCALL SDL_sin(double x); -extern DECLSPEC float SDLCALL SDL_sinf(float x); -extern DECLSPEC double SDLCALL SDL_sqrt(double x); -extern DECLSPEC float SDLCALL SDL_sqrtf(float x); -extern DECLSPEC double SDLCALL SDL_tan(double x); -extern DECLSPEC float SDLCALL SDL_tanf(float x); - -/* The SDL implementation of iconv() returns these error codes */ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 - -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, - const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); - -/** - * This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, - const char *fromcode, - const char *inbuf, - size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) - -/* force builds using Clang's static analysis tools to use literal C runtime - here, since there are possibly tests that are ineffective otherwise. */ -#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) - -/* The analyzer knows about strlcpy even when the system doesn't provide it */ -#ifndef HAVE_STRLCPY -size_t strlcpy(char* dst, const char* src, size_t size); -#endif - -/* The analyzer knows about strlcat even when the system doesn't provide it */ -#ifndef HAVE_STRLCAT -size_t strlcat(char* dst, const char* src, size_t size); -#endif - -#define SDL_malloc malloc -#define SDL_calloc calloc -#define SDL_realloc realloc -#define SDL_free free -#define SDL_memset memset -#define SDL_memcpy memcpy -#define SDL_memmove memmove -#define SDL_memcmp memcmp -#define SDL_strlcpy strlcpy -#define SDL_strlcat strlcat -#define SDL_strlen strlen -#define SDL_wcslen wcslen -#define SDL_wcslcpy wcslcpy -#define SDL_wcslcat wcslcat -#define SDL_strdup strdup -#define SDL_wcsdup wcsdup -#define SDL_strchr strchr -#define SDL_strrchr strrchr -#define SDL_strstr strstr -#define SDL_wcsstr wcsstr -#define SDL_strtokr strtok_r -#define SDL_strcmp strcmp -#define SDL_wcscmp wcscmp -#define SDL_strncmp strncmp -#define SDL_wcsncmp wcsncmp -#define SDL_strcasecmp strcasecmp -#define SDL_strncasecmp strncasecmp -#define SDL_sscanf sscanf -#define SDL_vsscanf vsscanf -#define SDL_snprintf snprintf -#define SDL_vsnprintf vsnprintf -#endif - -SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) -{ - return SDL_memcpy(dst, src, dwords * 4); -} - -/** - * If a * b would overflow, return -1. Otherwise store a * b via ret - * and return 0. - * - * \since This function is available since SDL 2.24.0. - */ -SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a, - size_t b, - size_t *ret) -{ - if (a != 0 && b > SDL_SIZE_MAX / a) { - return -1; - } - *ret = a * b; - return 0; -} - -#if _SDL_HAS_BUILTIN(__builtin_mul_overflow) -/* This needs to be wrapped in an inline rather than being a direct #define, - * because __builtin_mul_overflow() is type-generic, but we want to be - * consistent about interpreting a and b as size_t. */ -SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a, - size_t b, - size_t *ret) -{ - return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1; -} -#define SDL_size_mul_overflow(a, b, ret) (_SDL_size_mul_overflow_builtin(a, b, ret)) -#endif - -/** - * If a + b would overflow, return -1. Otherwise store a + b via ret - * and return 0. - * - * \since This function is available since SDL 2.24.0. - */ -SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a, - size_t b, - size_t *ret) -{ - if (b > SDL_SIZE_MAX - a) { - return -1; - } - *ret = a + b; - return 0; -} - -#if _SDL_HAS_BUILTIN(__builtin_add_overflow) -/* This needs to be wrapped in an inline rather than being a direct #define, - * the same as the call to __builtin_mul_overflow() above. */ -SDL_FORCE_INLINE int _SDL_size_add_overflow_builtin (size_t a, - size_t b, - size_t *ret) -{ - return __builtin_add_overflow(a, b, ret) == 0 ? 0 : -1; -} -#define SDL_size_add_overflow(a, b, ret) (_SDL_size_add_overflow_builtin(a, b, ret)) -#endif - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_stdinc_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_surface.h b/libs/hwcodec/externals/SDL/include/SDL_surface.h deleted file mode 100644 index d6ee615c..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_surface.h +++ /dev/null @@ -1,997 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_surface.h - * - * Header file for ::SDL_Surface definition and management functions. - */ - -#ifndef SDL_surface_h_ -#define SDL_surface_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_blendmode.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Surface flags - * - * These are the currently supported flags for the ::SDL_Surface. - * - * \internal - * Used internally (read-only). - */ -/* @{ */ -#define SDL_SWSURFACE 0 /**< Just here for compatibility */ -#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ -#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ -#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ -/* @} *//* Surface flags */ - -/** - * Evaluates to true if the surface needs to be locked before access. - */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) - -typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */ - -/** - * \brief A collection of pixels used in software blitting. - * - * \note This structure should be treated as read-only, except for \c pixels, - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface -{ - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - int pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - - /** Application data associated with the surface */ - void *userdata; /**< Read-write */ - - /** information needed for surfaces requiring locks */ - int locked; /**< Read-only */ - - /** list of BlitMap that hold a reference to this surface */ - void *list_blitmap; /**< Private */ - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - - /** info for fast blit mapping to other surfaces */ - SDL_BlitMap *map; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** - * \brief The type of function used for surface blitting functions. - */ -typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, - struct SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * \brief The formula used for converting between YUV and RGB - */ -typedef enum -{ - SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ - SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ - SDL_YUV_CONVERSION_BT709, /**< BT.709 */ - SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ -} SDL_YUV_CONVERSION_MODE; - -/** - * Allocate a new RGB surface. - * - * If `depth` is 4 or 8 bits, an empty palette is allocated for the surface. - * If `depth` is greater than 8 bits, the pixel format is set using the - * [RGBA]mask parameters. - * - * The [RGBA]mask parameters are the bitmasks used to extract that color from - * a pixel. For instance, `Rmask` being 0xFF000000 means the red data is - * stored in the most significant byte. Using zeros for the RGB masks sets a - * default value, based on the depth. For example: - * - * ```c++ - * SDL_CreateRGBSurface(0,w,h,32,0,0,0,0); - * ``` - * - * However, using zero for the Amask results in an Amask of 0. - * - * By default surfaces with an alpha mask are set up for blending as with: - * - * ```c++ - * SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND) - * ``` - * - * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a - * different `blendMode`. - * - * \param flags the flags are unused and should be set to 0 - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param Rmask the red mask for the pixels - * \param Gmask the green mask for the pixels - * \param Bmask the blue mask for the pixels - * \param Amask the alpha mask for the pixels - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRGBSurfaceFrom - * \sa SDL_CreateRGBSurfaceWithFormat - * \sa SDL_FreeSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); - - -/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ - -/** - * Allocate a new RGB surface with a specific pixel format. - * - * This function operates mostly like SDL_CreateRGBSurface(), except instead - * of providing pixel color masks, you provide it with a predefined format - * from SDL_PixelFormatEnum. - * - * \param flags the flags are unused and should be set to 0 - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param format the SDL_PixelFormatEnum for the new surface's pixel format. - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_CreateRGBSurface - * \sa SDL_CreateRGBSurfaceFrom - * \sa SDL_FreeSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat - (Uint32 flags, int width, int height, int depth, Uint32 format); - -/** - * Allocate a new RGB surface with existing pixel data. - * - * This function operates mostly like SDL_CreateRGBSurface(), except it does - * not allocate memory for the pixel data, instead the caller provides an - * existing buffer of data for the surface to use. - * - * No copy is made of the pixel data. Pixel data is not managed automatically; - * you must free the surface before you free the pixel data. - * - * \param pixels a pointer to existing pixel data - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param pitch the pitch of the surface in bytes - * \param Rmask the red mask for the pixels - * \param Gmask the green mask for the pixels - * \param Bmask the blue mask for the pixels - * \param Amask the alpha mask for the pixels - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRGBSurface - * \sa SDL_CreateRGBSurfaceWithFormat - * \sa SDL_FreeSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, - int height, - int depth, - int pitch, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); - -/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ - -/** - * Allocate a new RGB surface with with a specific pixel format and existing - * pixel data. - * - * This function operates mostly like SDL_CreateRGBSurfaceFrom(), except - * instead of providing pixel color masks, you provide it with a predefined - * format from SDL_PixelFormatEnum. - * - * No copy is made of the pixel data. Pixel data is not managed automatically; - * you must free the surface before you free the pixel data. - * - * \param pixels a pointer to existing pixel data - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param pitch the pitch of the surface in bytes - * \param format the SDL_PixelFormatEnum for the new surface's pixel format. - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_CreateRGBSurfaceFrom - * \sa SDL_CreateRGBSurfaceWithFormat - * \sa SDL_FreeSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom - (void *pixels, int width, int height, int depth, int pitch, Uint32 format); - -/** - * Free an RGB surface. - * - * It is safe to pass NULL to this function. - * - * \param surface the SDL_Surface to free. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateRGBSurface - * \sa SDL_CreateRGBSurfaceFrom - * \sa SDL_LoadBMP - * \sa SDL_LoadBMP_RW - */ -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); - -/** - * Set the palette used by a surface. - * - * A single palette can be shared with many surfaces. - * - * \param surface the SDL_Surface structure to update - * \param palette the SDL_Palette structure to use - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, - SDL_Palette * palette); - -/** - * Set up a surface for directly accessing the pixels. - * - * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to - * and read from `surface->pixels`, using the pixel format stored in - * `surface->format`. Once you are done accessing the surface, you should use - * SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to - * 0, then you can read and write to the surface at any time, and the pixel - * format of the surface will not change. - * - * \param surface the SDL_Surface structure to be locked - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MUSTLOCK - * \sa SDL_UnlockSurface - */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); - -/** - * Release a surface after directly accessing the pixels. - * - * \param surface the SDL_Surface structure to be unlocked - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LockSurface - */ -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); - -/** - * Load a BMP image from a seekable SDL data stream. - * - * The new surface should be freed with SDL_FreeSurface(). Not doing so will - * result in a memory leak. - * - * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile. - * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap - * from a file, convert it to an SDL_Surface and then close the file. - * - * \param src the data stream for the surface - * \param freesrc non-zero to close the stream after being read - * \returns a pointer to a new SDL_Surface structure or NULL if there was an - * error; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeSurface - * \sa SDL_RWFromFile - * \sa SDL_LoadBMP - * \sa SDL_SaveBMP_RW - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, - int freesrc); - -/** - * Load a surface from a file. - * - * Convenience macro. - */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) - -/** - * Save a surface to a seekable SDL data stream in BMP format. - * - * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the - * BMP directly. Other RGB formats with 8-bit or higher get converted to a - * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit - * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are - * not supported. - * - * \param surface the SDL_Surface structure containing the image to be saved - * \param dst a data stream to save to - * \param freedst non-zero to close the stream after being written - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadBMP_RW - * \sa SDL_SaveBMP - */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface * surface, SDL_RWops * dst, int freedst); - -/** - * Save a surface to a file. - * - * Convenience macro. - */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * Set the RLE acceleration hint for a surface. - * - * If RLE is enabled, color key and alpha blending blits are much faster, but - * the surface must be locked before directly accessing the pixels. - * - * \param surface the SDL_Surface structure to optimize - * \param flag 0 to disable, non-zero to enable RLE acceleration - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - * \sa SDL_LockSurface - * \sa SDL_UnlockSurface - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, - int flag); - -/** - * Returns whether the surface is RLE enabled - * - * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. - * - * \param surface the SDL_Surface structure to query - * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - * - * \sa SDL_SetSurfaceRLE - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); - -/** - * Set the color key (transparent pixel) in a surface. - * - * The color key defines a pixel value that will be treated as transparent in - * a blit. For example, one can use this to specify that cyan pixels should be - * considered transparent, and therefore not rendered. - * - * It is a pixel of the format used by the surface, as generated by - * SDL_MapRGB(). - * - * RLE acceleration can substantially speed up blitting of images with large - * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details. - * - * \param surface the SDL_Surface structure to update - * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key - * \param key the transparent pixel - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - * \sa SDL_GetColorKey - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, - int flag, Uint32 key); - -/** - * Returns whether the surface has a color key - * - * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. - * - * \param surface the SDL_Surface structure to query - * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_SetColorKey - * \sa SDL_GetColorKey - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); - -/** - * Get the color key (transparent pixel) for a surface. - * - * The color key is a pixel of the format used by the surface, as generated by - * SDL_MapRGB(). - * - * If the surface doesn't have color key enabled this function returns -1. - * - * \param surface the SDL_Surface structure to query - * \param key a pointer filled in with the transparent pixel - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - * \sa SDL_SetColorKey - */ -extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, - Uint32 * key); - -/** - * Set an additional color value multiplied into blit operations. - * - * When this surface is blitted, during the blit operation each source color - * channel is modulated by the appropriate color value according to the - * following formula: - * - * `srcC = srcC * (color / 255)` - * - * \param surface the SDL_Surface structure to update - * \param r the red color value multiplied into blit operations - * \param g the green color value multiplied into blit operations - * \param b the blue color value multiplied into blit operations - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetSurfaceColorMod - * \sa SDL_SetSurfaceAlphaMod - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * Get the additional color value multiplied into blit operations. - * - * \param surface the SDL_Surface structure to query - * \param r a pointer filled in with the current red color value - * \param g a pointer filled in with the current green color value - * \param b a pointer filled in with the current blue color value - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetSurfaceAlphaMod - * \sa SDL_SetSurfaceColorMod - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * Set an additional alpha value used in blit operations. - * - * When this surface is blitted, during the blit operation the source alpha - * value is modulated by this alpha value according to the following formula: - * - * `srcA = srcA * (alpha / 255)` - * - * \param surface the SDL_Surface structure to update - * \param alpha the alpha value multiplied into blit operations - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetSurfaceAlphaMod - * \sa SDL_SetSurfaceColorMod - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 alpha); - -/** - * Get the additional alpha value used in blit operations. - * - * \param surface the SDL_Surface structure to query - * \param alpha a pointer filled in with the current alpha value - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetSurfaceColorMod - * \sa SDL_SetSurfaceAlphaMod - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, - Uint8 * alpha); - -/** - * Set the blend mode used for blit operations. - * - * To copy a surface to another surface (or texture) without blending with the - * existing data, the blendmode of the SOURCE surface should be set to - * `SDL_BLENDMODE_NONE`. - * - * \param surface the SDL_Surface structure to update - * \param blendMode the SDL_BlendMode to use for blit blending - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetSurfaceBlendMode - */ -extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode blendMode); - -/** - * Get the blend mode used for blit operations. - * - * \param surface the SDL_Surface structure to query - * \param blendMode a pointer filled in with the current SDL_BlendMode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetSurfaceBlendMode - */ -extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, - SDL_BlendMode *blendMode); - -/** - * Set the clipping rectangle for a surface. - * - * When `surface` is the destination of a blit, only the area within the clip - * rectangle is drawn into. - * - * Note that blits are automatically clipped to the edges of the source and - * destination surfaces. - * - * \param surface the SDL_Surface structure to be clipped - * \param rect the SDL_Rect structure representing the clipping rectangle, or - * NULL to disable clipping - * \returns SDL_TRUE if the rectangle intersects the surface, otherwise - * SDL_FALSE and blits will be completely clipped. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - * \sa SDL_GetClipRect - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, - const SDL_Rect * rect); - -/** - * Get the clipping rectangle for a surface. - * - * When `surface` is the destination of a blit, only the area within the clip - * rectangle is drawn into. - * - * \param surface the SDL_Surface structure representing the surface to be - * clipped - * \param rect an SDL_Rect structure filled in with the clipping rectangle for - * the surface - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - * \sa SDL_SetClipRect - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, - SDL_Rect * rect); - -/* - * Creates a new surface identical to the existing surface. - * - * The returned surface should be freed with SDL_FreeSurface(). - * - * \param surface the surface to duplicate. - * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for - * more information. - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface); - -/** - * Copy an existing surface to a new surface of the specified format. - * - * This function is used to optimize images for faster *repeat* blitting. This - * is accomplished by converting the original and storing the result as a new - * surface. The new, optimized surface can then be used as the source for - * future blits, making them faster. - * - * \param src the existing SDL_Surface structure to convert - * \param fmt the SDL_PixelFormat structure that the new surface is optimized - * for - * \param flags the flags are unused and should be set to 0; this is a - * leftover from SDL 1.2's API - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocFormat - * \sa SDL_ConvertSurfaceFormat - * \sa SDL_CreateRGBSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface - (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); - -/** - * Copy an existing surface to a new surface of the specified format enum. - * - * This function operates just like SDL_ConvertSurface(), but accepts an - * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such, - * it might be easier to call but it doesn't have access to palette - * information for the destination surface, in case that would be important. - * - * \param src the existing SDL_Surface structure to convert - * \param pixel_format the SDL_PixelFormatEnum that the new surface is - * optimized for - * \param flags the flags are unused and should be set to 0; this is a - * leftover from SDL 1.2's API - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AllocFormat - * \sa SDL_ConvertSurface - * \sa SDL_CreateRGBSurface - */ -extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat - (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); - -/** - * Copy a block of pixels of one format to another format. - * - * \param width the width of the block to copy, in pixels - * \param height the height of the block to copy, in pixels - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format - * \param src a pointer to the source pixels - * \param src_pitch the pitch of the source pixels, in bytes - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format - * \param dst a pointer to be filled in with new pixel data - * \param dst_pitch the pitch of the destination pixels, in bytes - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, - Uint32 src_format, - const void * src, int src_pitch, - Uint32 dst_format, - void * dst, int dst_pitch); - -/** - * Premultiply the alpha on a block of pixels. - * - * This is safe to use with src == dst, but not for other overlapping areas. - * - * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888. - * - * \param width the width of the block to convert, in pixels - * \param height the height of the block to convert, in pixels - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format - * \param src a pointer to the source pixels - * \param src_pitch the pitch of the source pixels, in bytes - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format - * \param dst a pointer to be filled in with premultiplied pixel data - * \param dst_pitch the pitch of the destination pixels, in bytes - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, - Uint32 src_format, - const void * src, int src_pitch, - Uint32 dst_format, - void * dst, int dst_pitch); - -/** - * Perform a fast fill of a rectangle with a specific color. - * - * `color` should be a pixel of the format used by the surface, and can be - * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an - * alpha component then the destination is simply filled with that alpha - * information, no blending takes place. - * - * If there is a clip rectangle set on the destination (set via - * SDL_SetClipRect()), then this function will fill based on the intersection - * of the clip rectangle and `rect`. - * - * \param dst the SDL_Surface structure that is the drawing target - * \param rect the SDL_Rect structure representing the rectangle to fill, or - * NULL to fill the entire surface - * \param color the color to fill with - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FillRects - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); - -/** - * Perform a fast fill of a set of rectangles with a specific color. - * - * `color` should be a pixel of the format used by the surface, and can be - * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an - * alpha component then the destination is simply filled with that alpha - * information, no blending takes place. - * - * If there is a clip rectangle set on the destination (set via - * SDL_SetClipRect()), then this function will fill based on the intersection - * of the clip rectangle and `rect`. - * - * \param dst the SDL_Surface structure that is the drawing target - * \param rects an array of SDL_Rects representing the rectangles to fill. - * \param count the number of rectangles in the array - * \param color the color to fill with - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FillRect - */ -extern DECLSPEC int SDLCALL SDL_FillRects - (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); - -/* !!! FIXME: merge this documentation with the wiki */ -/** - * Performs a fast blit from the source surface to the destination surface. - * - * This assumes that the source and destination rectangles are - * the same size. If either \c srcrect or \c dstrect are NULL, the entire - * surface (\c src or \c dst) is copied. The final blit rectangles are saved - * in \c srcrect and \c dstrect after all clipping is performed. - * - * \returns 0 if the blit is successful, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without blending and colorkey - * are defined as follows: - * \verbatim - RGBA->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB, set destination alpha to source per-surface alpha value. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - - RGBA->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - \endverbatim - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. - */ -#define SDL_BlitSurface SDL_UpperBlit - -/** - * Perform a fast blit from the source surface to the destination surface. - * - * SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a - * macro for this function with a less confusing name. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * Perform low-level surface blitting only. - * - * This is a semi-private blit function and it performs low-level surface - * blitting, assuming the input rectangles have already been clipped. - * - * Unless you know what you're doing, you should be using SDL_BlitSurface() - * instead. - * - * \param src the SDL_Surface structure to be copied from - * \param srcrect the SDL_Rect structure representing the rectangle to be - * copied, or NULL to copy the entire surface - * \param dst the SDL_Surface structure that is the blit target - * \param dstrect the SDL_Rect structure representing the rectangle that is - * copied into - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitSurface - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - - -/** - * Perform a fast, low quality, stretch blit between two surfaces of the same - * format. - * - * Please use SDL_BlitScaled() instead. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - const SDL_Rect * dstrect); - -/** - * Perform bilinear scaling between two surfaces of the same format, 32BPP. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - const SDL_Rect * dstrect); - - -#define SDL_BlitScaled SDL_UpperBlitScaled - -/** - * Perform a scaled surface copy to a destination surface. - * - * SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is - * merely a macro for this function with a less confusing name. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitScaled - */ -extern DECLSPEC int SDLCALL SDL_UpperBlitScaled - (SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * Perform low-level surface scaled blitting only. - * - * This is a semi-private function and it performs low-level surface blitting, - * assuming the input rectangles have already been clipped. - * - * \param src the SDL_Surface structure to be copied from - * \param srcrect the SDL_Rect structure representing the rectangle to be - * copied - * \param dst the SDL_Surface structure that is the blit target - * \param dstrect the SDL_Rect structure representing the rectangle that is - * copied into - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_BlitScaled - */ -extern DECLSPEC int SDLCALL SDL_LowerBlitScaled - (SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect); - -/** - * Set the YUV conversion mode - * - * \since This function is available since SDL 2.0.8. - */ -extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); - -/** - * Get the YUV conversion mode - * - * \since This function is available since SDL 2.0.8. - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); - -/** - * Get the YUV conversion mode, returning the correct mode for the resolution - * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC - * - * \since This function is available since SDL 2.0.8. - */ -extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_surface_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_system.h b/libs/hwcodec/externals/SDL/include/SDL_system.h deleted file mode 100644 index 4b7eaddc..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_system.h +++ /dev/null @@ -1,623 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_system.h - * - * Include file for platform specific SDL API functions - */ - -#ifndef SDL_system_h_ -#define SDL_system_h_ - -#include "SDL_stdinc.h" -#include "SDL_keyboard.h" -#include "SDL_render.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* Platform specific functions for Windows */ -#if defined(__WIN32__) || defined(__GDK__) - -typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); - -/** - * Set a callback for every Windows message, run before TranslateMessage(). - * - * \param callback The SDL_WindowsMessageHook function to call. - * \param userdata a pointer to pass to every iteration of `callback` - * - * \since This function is available since SDL 2.0.4. - */ -extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); - -#endif /* defined(__WIN32__) || defined(__GDK__) */ - -#if defined(__WIN32__) || defined(__WINGDK__) - -/** - * Get the D3D9 adapter index that matches the specified display index. - * - * The returned adapter index can be passed to `IDirect3D9::CreateDevice` and - * controls on which monitor a full screen application will appear. - * - * \param displayIndex the display index for which to get the D3D9 adapter - * index - * \returns the D3D9 adapter index on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.1. - */ -extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); - -typedef struct IDirect3DDevice9 IDirect3DDevice9; - -/** - * Get the D3D9 device associated with a renderer. - * - * Once you are done using the device, you should release it to avoid a - * resource leak. - * - * \param renderer the renderer from which to get the associated D3D device - * \returns the D3D9 device associated with given renderer or NULL if it is - * not a D3D9 renderer; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.1. - */ -extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); - -typedef struct ID3D11Device ID3D11Device; - -/** - * Get the D3D11 device associated with a renderer. - * - * Once you are done using the device, you should release it to avoid a - * resource leak. - * - * \param renderer the renderer from which to get the associated D3D11 device - * \returns the D3D11 device associated with given renderer or NULL if it is - * not a D3D11 renderer; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer); - -#endif /* defined(__WIN32__) || defined(__WINGDK__) */ - -#if defined(__WIN32__) || defined(__GDK__) - -typedef struct ID3D12Device ID3D12Device; - -/** - * Get the D3D12 device associated with a renderer. - * - * Once you are done using the device, you should release it to avoid a - * resource leak. - * - * \param renderer the renderer from which to get the associated D3D12 device - * \returns the D3D12 device associated with given renderer or NULL if it is - * not a D3D12 renderer; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer); - -#endif /* defined(__WIN32__) || defined(__GDK__) */ - -#if defined(__WIN32__) || defined(__WINGDK__) - -/** - * Get the DXGI Adapter and Output indices for the specified display index. - * - * The DXGI Adapter and Output indices can be passed to `EnumAdapters` and - * `EnumOutputs` respectively to get the objects required to create a DX10 or - * DX11 device and swap chain. - * - * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it - * returns an SDL_bool. - * - * \param displayIndex the display index for which to get both indices - * \param adapterIndex a pointer to be filled in with the adapter index - * \param outputIndex a pointer to be filled in with the output index - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.2. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); - -#endif /* defined(__WIN32__) || defined(__WINGDK__) */ - -/* Platform specific functions for Linux */ -#ifdef __LINUX__ - -/** - * Sets the UNIX nice value for a thread. - * - * This uses setpriority() if possible, and RealtimeKit if available. - * - * \param threadID the Unix thread ID to change priority of. - * \param priority The new, Unix-specific, priority value. - * \returns 0 on success, or -1 on error. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); - -/** - * Sets the priority (not nice level) and scheduling policy for a thread. - * - * This uses setpriority() if possible, and RealtimeKit if available. - * - * \param threadID The Unix thread ID to change priority of. - * \param sdlPriority The new SDL_ThreadPriority value. - * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR, - * SCHED_OTHER, etc...) - * \returns 0 on success, or -1 on error. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); - -#endif /* __LINUX__ */ - -/* Platform specific functions for iOS */ -#ifdef __IPHONEOS__ - -#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) - -/** - * Use this function to set the animation callback on Apple iOS. - * - * The function prototype for `callback` is: - * - * ```c - * void callback(void* callbackParam); - * ``` - * - * Where its parameter, `callbackParam`, is what was passed as `callbackParam` - * to SDL_iPhoneSetAnimationCallback(). - * - * This function is only available on Apple iOS. - * - * For more information see: - * https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md - * - * This functions is also accessible using the macro - * SDL_iOSSetAnimationCallback() since SDL 2.0.4. - * - * \param window the window for which the animation callback should be set - * \param interval the number of frames after which **callback** will be - * called - * \param callback the function to call for every frame. - * \param callbackParam a pointer that is passed to `callback`. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_iPhoneSetEventPump - */ -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam); - -#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) - -/** - * Use this function to enable or disable the SDL event pump on Apple iOS. - * - * This function is only available on Apple iOS. - * - * This functions is also accessible using the macro SDL_iOSSetEventPump() - * since SDL 2.0.4. - * - * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_iPhoneSetAnimationCallback - */ -extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); - -#endif /* __IPHONEOS__ */ - - -/* Platform specific functions for Android */ -#ifdef __ANDROID__ - -/** - * Get the Android Java Native Interface Environment of the current thread. - * - * This is the JNIEnv one needs to access the Java virtual machine from native - * code, and is needed for many Android APIs to be usable from C. - * - * The prototype of the function in SDL's code actually declare a void* return - * type, even if the implementation returns a pointer to a JNIEnv. The - * rationale being that the SDL headers can avoid including jni.h. - * - * \returns a pointer to Java native interface object (JNIEnv) to which the - * current thread is attached, or 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AndroidGetActivity - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); - -/** - * Retrieve the Java instance of the Android activity class. - * - * The prototype of the function in SDL's code actually declares a void* - * return type, even if the implementation returns a jobject. The rationale - * being that the SDL headers can avoid including jni.h. - * - * The jobject returned by the function is a local reference and must be - * released by the caller. See the PushLocalFrame() and PopLocalFrame() or - * DeleteLocalRef() functions of the Java native interface: - * - * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html - * - * \returns the jobject representing the instance of the Activity class of the - * Android application, or NULL on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AndroidGetJNIEnv - */ -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); - -/** - * Query Android API level of the current device. - * - * - API level 31: Android 12 - * - API level 30: Android 11 - * - API level 29: Android 10 - * - API level 28: Android 9 - * - API level 27: Android 8.1 - * - API level 26: Android 8.0 - * - API level 25: Android 7.1 - * - API level 24: Android 7.0 - * - API level 23: Android 6.0 - * - API level 22: Android 5.1 - * - API level 21: Android 5.0 - * - API level 20: Android 4.4W - * - API level 19: Android 4.4 - * - API level 18: Android 4.3 - * - API level 17: Android 4.2 - * - API level 16: Android 4.1 - * - API level 15: Android 4.0.3 - * - API level 14: Android 4.0 - * - API level 13: Android 3.2 - * - API level 12: Android 3.1 - * - API level 11: Android 3.0 - * - API level 10: Android 2.3.3 - * - * \returns the Android API level. - * - * \since This function is available since SDL 2.0.12. - */ -extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); - -/** - * Query if the application is running on Android TV. - * - * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.8. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); - -/** - * Query if the application is running on a Chromebook. - * - * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); - -/** - * Query if the application is running on a Samsung DeX docking station. - * - * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); - -/** - * Trigger the Android system back button behavior. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); - -/** - See the official Android developer guide for more information: - http://developer.android.com/guide/topics/data/data-storage.html -*/ -#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 -#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 - -/** - * Get the path used for internal storage for this application. - * - * This path is unique to your application and cannot be written to by other - * applications. - * - * Your internal storage path is typically: - * `/data/data/your.app.package/files`. - * - * \returns the path used for internal storage or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AndroidGetExternalStorageState - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); - -/** - * Get the current state of external storage. - * - * The current state of external storage, a bitmask of these values: - * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`. - * - * If external storage is currently unavailable, this will return 0. - * - * \returns the current state of external storage on success or 0 on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AndroidGetExternalStoragePath - */ -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); - -/** - * Get the path used for external storage for this application. - * - * This path is unique to your application, but is public and can be written - * to by other applications. - * - * Your external storage path is typically: - * `/storage/sdcard0/Android/data/your.app.package/files`. - * - * \returns the path used for external storage for this application on success - * or NULL on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AndroidGetExternalStorageState - */ -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); - -/** - * Request permissions at runtime. - * - * This blocks the calling thread until the permission is granted or denied. - * - * \param permission The permission to request. - * \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.14. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); - -/** - * Shows an Android toast notification. - * - * Toasts are a sort of lightweight notification that are unique to Android. - * - * https://developer.android.com/guide/topics/ui/notifiers/toasts - * - * Shows toast in UI thread. - * - * For the `gravity` parameter, choose a value from here, or -1 if you don't - * have a preference: - * - * https://developer.android.com/reference/android/view/Gravity - * - * \param message text message to be shown - * \param duration 0=short, 1=long - * \param gravity where the notification should appear on the screen. - * \param xoffset set this parameter only when gravity >=0 - * \param yoffset set this parameter only when gravity >=0 - * \returns 0 if success, -1 if any error occurs. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset); - -/** - * Send a user command to SDLActivity. - * - * Override "boolean onUnhandledMessage(Message msg)" to handle the message. - * - * \param command user command that must be greater or equal to 0x8000 - * \param param user parameter - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param); - -#endif /* __ANDROID__ */ - -/* Platform specific functions for WinRT */ -#ifdef __WINRT__ - -/** - * \brief WinRT / Windows Phone path types - */ -typedef enum -{ - /** \brief The installed app's root directory. - Files here are likely to be read-only. */ - SDL_WINRT_PATH_INSTALLED_LOCATION, - - /** \brief The app's local data store. Files may be written here */ - SDL_WINRT_PATH_LOCAL_FOLDER, - - /** \brief The app's roaming data store. Unsupported on Windows Phone. - Files written here may be copied to other machines via a network - connection. - */ - SDL_WINRT_PATH_ROAMING_FOLDER, - - /** \brief The app's temporary data store. Unsupported on Windows Phone. - Files written here may be deleted at any time. */ - SDL_WINRT_PATH_TEMP_FOLDER -} SDL_WinRT_Path; - - -/** - * \brief WinRT Device Family - */ -typedef enum -{ - /** \brief Unknown family */ - SDL_WINRT_DEVICEFAMILY_UNKNOWN, - - /** \brief Desktop family*/ - SDL_WINRT_DEVICEFAMILY_DESKTOP, - - /** \brief Mobile family (for example smartphone) */ - SDL_WINRT_DEVICEFAMILY_MOBILE, - - /** \brief XBox family */ - SDL_WINRT_DEVICEFAMILY_XBOX, -} SDL_WinRT_DeviceFamily; - - -/** - * Retrieve a WinRT defined path on the local file system. - * - * Not all paths are available on all versions of Windows. This is especially - * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path - * for more information on which path types are supported where. - * - * Documentation on most app-specific path types on WinRT can be found on - * MSDN, at the URL: - * - * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType the type of path to retrieve, one of SDL_WinRT_Path - * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if - * the path is not available for any reason; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.3. - * - * \sa SDL_WinRTGetFSPathUTF8 - */ -extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); - -/** - * Retrieve a WinRT defined path on the local file system. - * - * Not all paths are available on all versions of Windows. This is especially - * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path - * for more information on which path types are supported where. - * - * Documentation on most app-specific path types on WinRT can be found on - * MSDN, at the URL: - * - * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType the type of path to retrieve, one of SDL_WinRT_Path - * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if - * the path is not available for any reason; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.3. - * - * \sa SDL_WinRTGetFSPathUNICODE - */ -extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); - -/** - * Detects the device family of WinRT platform at runtime. - * - * \returns a value from the SDL_WinRT_DeviceFamily enum. - * - * \since This function is available since SDL 2.0.8. - */ -extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); - -#endif /* __WINRT__ */ - -/** - * Query if the current device is a tablet. - * - * If SDL can't determine this, it will return SDL_FALSE. - * - * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.9. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); - -/* Functions used by iOS application delegates to notify SDL about state changes */ -extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void); -extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); -extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); -extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void); -extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); -extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); -#ifdef __IPHONEOS__ -extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); -#endif - -/* Functions used only by GDK */ -#if defined(__GDK__) -typedef struct XTaskQueueObject * XTaskQueueHandle; - -/** - * Gets a reference to the global async task queue handle for GDK, - * initializing if needed. - * - * Once you are done with the task queue, you should call - * XTaskQueueCloseHandle to reduce the reference count to avoid a resource - * leak. - * - * \param outTaskQueue a pointer to be filled in with task queue handle. - * \returns 0 if success, -1 if any error occurs. - * - * \since This function is available since SDL 2.24.0. - */ -extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); - -#endif - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_system_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_syswm.h b/libs/hwcodec/externals/SDL/include/SDL_syswm.h deleted file mode 100644 index b35734de..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_syswm.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_syswm.h - * - * Include file for SDL custom system window manager hooks. - */ - -#ifndef SDL_syswm_h_ -#define SDL_syswm_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_version.h" - -/** - * \brief SDL_syswm.h - * - * Your application has access to a special type of event ::SDL_SYSWMEVENT, - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState(). - */ -struct SDL_SysWMinfo; - -#if !defined(SDL_PROTOTYPES_ONLY) - -#if defined(SDL_VIDEO_DRIVER_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef NOMINMAX /* don't define min() and max(). */ -#define NOMINMAX -#endif -#include -#endif - -#if defined(SDL_VIDEO_DRIVER_WINRT) -#include -#endif - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) -#if defined(__APPLE__) && defined(__MACH__) -/* conflicts with Quickdraw.h */ -#define Cursor X11Cursor -#endif - -#include -#include - -#if defined(__APPLE__) && defined(__MACH__) -/* matches the re-define above */ -#undef Cursor -#endif - -#endif /* defined(SDL_VIDEO_DRIVER_X11) */ - -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) -#include -#endif - -#if defined(SDL_VIDEO_DRIVER_COCOA) -#ifdef __OBJC__ -@class NSWindow; -#else -typedef struct _NSWindow NSWindow; -#endif -#endif - -#if defined(SDL_VIDEO_DRIVER_UIKIT) -#ifdef __OBJC__ -#include -#else -typedef struct _UIWindow UIWindow; -typedef struct _UIViewController UIViewController; -#endif -typedef Uint32 GLuint; -#endif - -#if defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL) -#define SDL_METALVIEW_TAG 255 -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) -typedef struct ANativeWindow ANativeWindow; -typedef void *EGLSurface; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) -#include "SDL_egl.h" -#endif - -#if defined(SDL_VIDEO_DRIVER_OS2) -#define INCL_WIN -#include -#endif -#endif /* SDL_PROTOTYPES_ONLY */ - -#if defined(SDL_VIDEO_DRIVER_KMSDRM) -struct gbm_device; -#endif - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(SDL_PROTOTYPES_ONLY) -/** - * These are the various supported windowing subsystems - */ -typedef enum -{ - SDL_SYSWM_UNKNOWN, - SDL_SYSWM_WINDOWS, - SDL_SYSWM_X11, - SDL_SYSWM_DIRECTFB, - SDL_SYSWM_COCOA, - SDL_SYSWM_UIKIT, - SDL_SYSWM_WAYLAND, - SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - SDL_SYSWM_WINRT, - SDL_SYSWM_ANDROID, - SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2, - SDL_SYSWM_HAIKU, - SDL_SYSWM_KMSDRM, - SDL_SYSWM_RISCOS -} SDL_SYSWM_TYPE; - -/** - * The custom event structure. - */ -struct SDL_SysWMmsg -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct { - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct { - XEvent event; - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct { - DFBEvent event; - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { - /* Latest version of Xcode clang complains about empty structs in C v. C++: - error: empty struct has size 0 in C, size 1 in C++ - */ - int dummy; - /* No Cocoa window events yet */ - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { - int dummy; - /* No UIKit window events yet */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - int dummy; - /* No Vivante window events yet */ - } vivante; -#endif -#if defined(SDL_VIDEO_DRIVER_OS2) - struct - { - BOOL fFrame; /**< TRUE if hwnd is a frame window */ - HWND hwnd; /**< The window receiving the message */ - ULONG msg; /**< The message identifier */ - MPARAM mp1; /**< The first first message parameter */ - MPARAM mp2; /**< The second first message parameter */ - } os2; -#endif - /* Can't have an empty union */ - int dummy; - } msg; -}; - -/** - * The custom window manager information structure. - * - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { -#if defined(SDL_VIDEO_DRIVER_WINDOWS) - struct - { - HWND window; /**< The window handle */ - HDC hdc; /**< The window device context */ - HINSTANCE hinstance; /**< The instance handle */ - } win; -#endif -#if defined(SDL_VIDEO_DRIVER_WINRT) - struct - { - IInspectable * window; /**< The WinRT CoreWindow */ - } winrt; -#endif -#if defined(SDL_VIDEO_DRIVER_X11) - struct - { - Display *display; /**< The X11 display */ - Window window; /**< The X11 window */ - } x11; -#endif -#if defined(SDL_VIDEO_DRIVER_DIRECTFB) - struct - { - IDirectFB *dfb; /**< The directfb main interface */ - IDirectFBWindow *window; /**< The directfb window handle */ - IDirectFBSurface *surface; /**< The directfb client surface */ - } dfb; -#endif -#if defined(SDL_VIDEO_DRIVER_COCOA) - struct - { -#if defined(__OBJC__) && defined(__has_feature) - #if __has_feature(objc_arc) - NSWindow __unsafe_unretained *window; /**< The Cocoa window */ - #else - NSWindow *window; /**< The Cocoa window */ - #endif -#else - NSWindow *window; /**< The Cocoa window */ -#endif - } cocoa; -#endif -#if defined(SDL_VIDEO_DRIVER_UIKIT) - struct - { -#if defined(__OBJC__) && defined(__has_feature) - #if __has_feature(objc_arc) - UIWindow __unsafe_unretained *window; /**< The UIKit window */ - #else - UIWindow *window; /**< The UIKit window */ - #endif -#else - UIWindow *window; /**< The UIKit window */ -#endif - GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ - GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ - GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ - } uikit; -#endif -#if defined(SDL_VIDEO_DRIVER_WAYLAND) - struct - { - struct wl_display *display; /**< Wayland display */ - struct wl_surface *surface; /**< Wayland surface */ - void *shell_surface; /**< DEPRECATED Wayland shell_surface (window manager handle) */ - struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */ - struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */ - struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */ - struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */ - struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */ - } wl; -#endif -#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ - struct - { - void *connection; /**< Mir display server connection */ - void *surface; /**< Mir surface */ - } mir; -#endif - -#if defined(SDL_VIDEO_DRIVER_ANDROID) - struct - { - ANativeWindow *window; - EGLSurface surface; - } android; -#endif - -#if defined(SDL_VIDEO_DRIVER_OS2) - struct - { - HWND hwnd; /**< The window handle */ - HWND hwndFrame; /**< The frame window handle */ - } os2; -#endif - -#if defined(SDL_VIDEO_DRIVER_VIVANTE) - struct - { - EGLNativeDisplayType display; - EGLNativeWindowType window; - } vivante; -#endif - -#if defined(SDL_VIDEO_DRIVER_KMSDRM) - struct - { - int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */ - int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */ - struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */ - } kmsdrm; -#endif - - /* Make sure this union is always 64 bytes (8 64-bit pointers). */ - /* Be careful not to overflow this if you add a new target! */ - Uint8 dummy[64]; - } info; -}; - -#endif /* SDL_PROTOTYPES_ONLY */ - -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - - -/** - * Get driver-specific information about a window. - * - * You must include SDL_syswm.h for the declaration of SDL_SysWMinfo. - * - * The caller must initialize the `info` structure's version by using - * `SDL_VERSION(&info.version)`, and then this function will fill in the rest - * of the structure with information about the given window. - * - * \param window the window about which information is being requested - * \param info an SDL_SysWMinfo structure filled in with window information - * \returns SDL_TRUE if the function is implemented and the `version` member - * of the `info` struct is valid, or SDL_FALSE if the information - * could not be retrieved; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, - SDL_SysWMinfo * info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_syswm_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test.h b/libs/hwcodec/externals/SDL/include/SDL_test.h deleted file mode 100644 index 80daaafb..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -#ifndef SDL_test_h_ -#define SDL_test_h_ - -#include "SDL.h" -#include "SDL_test_assert.h" -#include "SDL_test_common.h" -#include "SDL_test_compare.h" -#include "SDL_test_crc32.h" -#include "SDL_test_font.h" -#include "SDL_test_fuzzer.h" -#include "SDL_test_harness.h" -#include "SDL_test_images.h" -#include "SDL_test_log.h" -#include "SDL_test_md5.h" -#include "SDL_test_memory.h" -#include "SDL_test_random.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Global definitions */ - -/* - * Note: Maximum size of SDLTest log message is less than SDL's limit - * to ensure we can fit additional information such as the timestamp. - */ -#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_assert.h b/libs/hwcodec/externals/SDL/include/SDL_test_assert.h deleted file mode 100644 index 341e490f..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_assert.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_assert.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - * - * Assert API for test code and test cases - * - */ - -#ifndef SDL_test_assert_h_ -#define SDL_test_assert_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Fails the assert. - */ -#define ASSERT_FAIL 0 - -/** - * \brief Passes the assert. - */ -#define ASSERT_PASS 1 - -/** - * \brief Assert that logs and break execution flow on failures. - * - * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). - * \param assertDescription Message to log with the assert describing it. - */ -void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. - * - * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). - * \param assertDescription Message to log with the assert describing it. - * - * \returns the assertCondition so it can be used to externally to break execution flow if desired. - */ -int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. - * - * \param assertDescription Message to log with the assert describing it. - */ -void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Resets the assert summary counters to zero. - */ -void SDLTest_ResetAssertSummary(void); - -/** - * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. - */ -void SDLTest_LogAssertSummary(void); - - -/** - * \brief Converts the current assert summary state to a test result. - * - * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT - */ -int SDLTest_AssertSummaryToTestResult(void); - -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_assert_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_common.h b/libs/hwcodec/externals/SDL/include/SDL_test_common.h deleted file mode 100644 index 6de63cad..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_common.h +++ /dev/null @@ -1,236 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_common.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* Ported from original test\common.h file. */ - -#ifndef SDL_test_common_h_ -#define SDL_test_common_h_ - -#include "SDL.h" - -#if defined(__PSP__) -#define DEFAULT_WINDOW_WIDTH 480 -#define DEFAULT_WINDOW_HEIGHT 272 -#elif defined(__VITA__) -#define DEFAULT_WINDOW_WIDTH 960 -#define DEFAULT_WINDOW_HEIGHT 544 -#else -#define DEFAULT_WINDOW_WIDTH 640 -#define DEFAULT_WINDOW_HEIGHT 480 -#endif - -#define VERBOSE_VIDEO 0x00000001 -#define VERBOSE_MODES 0x00000002 -#define VERBOSE_RENDER 0x00000004 -#define VERBOSE_EVENT 0x00000008 -#define VERBOSE_AUDIO 0x00000010 -#define VERBOSE_MOTION 0x00000020 - -typedef struct -{ - /* SDL init flags */ - char **argv; - Uint32 flags; - Uint32 verbose; - - /* Video info */ - const char *videodriver; - int display; - const char *window_title; - const char *window_icon; - Uint32 window_flags; - SDL_bool flash_on_focus_loss; - int window_x; - int window_y; - int window_w; - int window_h; - int window_minW; - int window_minH; - int window_maxW; - int window_maxH; - int logical_w; - int logical_h; - float scale; - int depth; - int refresh_rate; - int num_windows; - SDL_Window **windows; - - /* Renderer info */ - const char *renderdriver; - Uint32 render_flags; - SDL_bool skip_renderer; - SDL_Renderer **renderers; - SDL_Texture **targets; - - /* Audio info */ - const char *audiodriver; - SDL_AudioSpec audiospec; - - /* GL settings */ - int gl_red_size; - int gl_green_size; - int gl_blue_size; - int gl_alpha_size; - int gl_buffer_size; - int gl_depth_size; - int gl_stencil_size; - int gl_double_buffer; - int gl_accum_red_size; - int gl_accum_green_size; - int gl_accum_blue_size; - int gl_accum_alpha_size; - int gl_stereo; - int gl_multisamplebuffers; - int gl_multisamplesamples; - int gl_retained_backing; - int gl_accelerated; - int gl_major_version; - int gl_minor_version; - int gl_debug; - int gl_profile_mask; - - /* Additional fields added in 2.0.18 */ - SDL_Rect confine; - -} SDLTest_CommonState; - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -/** - * \brief Parse command line parameters and create common state. - * - * \param argv Array of command line parameters - * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) - * - * \returns a newly allocated common state object. - */ -SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); - -/** - * \brief Process one common argument. - * - * \param state The common state describing the test window to create. - * \param index The index of the argument to process in argv[]. - * - * \returns the number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. - */ -int SDLTest_CommonArg(SDLTest_CommonState * state, int index); - - -/** - * \brief Logs command line usage info. - * - * This logs the appropriate command line options for the subsystems in use - * plus other common options, and then any application-specific options. - * This uses the SDL_Log() function and splits up output to be friendly to - * 80-character-wide terminals. - * - * \param state The common state describing the test window for the app. - * \param argv0 argv[0], as passed to main/SDL_main. - * \param options an array of strings for application specific options. The last element of the array should be NULL. - */ -void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options); - -/** - * \brief Returns common usage information - * - * You should (probably) be using SDLTest_CommonLogUsage() instead, but this - * function remains for binary compatibility. Strings returned from this - * function are valid until SDLTest_CommonQuit() is called, in which case - * those strings' memory is freed and can no longer be used. - * - * \param state The common state describing the test window to create. - * \returns a string with usage information - */ -const char *SDLTest_CommonUsage(SDLTest_CommonState * state); - -/** - * \brief Open test window. - * - * \param state The common state describing the test window to create. - * - * \returns SDL_TRUE if initialization succeeded, false otherwise - */ -SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); - -/** - * \brief Easy argument handling when test app doesn't need any custom args. - * - * \param state The common state describing the test window to create. - * \param argc argc, as supplied to SDL_main - * \param argv argv, as supplied to SDL_main - * - * \returns SDL_FALSE if app should quit, true otherwise. - */ -SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv); - -/** - * \brief Common event handler for test windows. - * - * \param state The common state used to create test window. - * \param event The event to handle. - * \param done Flag indicating we are done. - * - */ -void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); - -/** - * \brief Close test window. - * - * \param state The common state used to create test window. - * - */ -void SDLTest_CommonQuit(SDLTest_CommonState * state); - -/** - * \brief Draws various window information (position, size, etc.) to the renderer. - * - * \param renderer The renderer to draw to. - * \param window The window whose information should be displayed. - * \param usedHeight Returns the height used, so the caller can draw more below. - * - */ -void SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * usedHeight); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_common_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_compare.h b/libs/hwcodec/externals/SDL/include/SDL_test_compare.h deleted file mode 100644 index 5fce25ca..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_compare.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_compare.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Defines comparison functions (i.e. for surfaces). - -*/ - -#ifndef SDL_test_compare_h_ -#define SDL_test_compare_h_ - -#include "SDL.h" - -#include "SDL_test_images.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Compares a surface and with reference image data for equality - * - * \param surface Surface used in comparison - * \param referenceSurface Test Surface used in comparison - * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. - * - * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. - */ -int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_compare_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_crc32.h b/libs/hwcodec/externals/SDL/include/SDL_test_crc32.h deleted file mode 100644 index bf347821..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_crc32.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_crc32.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Implements CRC32 calculations (default output is Perl String::CRC32 compatible). - -*/ - -#ifndef SDL_test_crc32_h_ -#define SDL_test_crc32_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* ------------ Definitions --------- */ - -/* Definition shared by all CRC routines */ - -#ifndef CrcUint32 - #define CrcUint32 unsigned int -#endif -#ifndef CrcUint8 - #define CrcUint8 unsigned char -#endif - -#ifdef ORIGINAL_METHOD - #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ -#else - #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ -#endif - -/** - * Data structure for CRC32 (checksum) computation - */ - typedef struct { - CrcUint32 crc32_table[256]; /* CRC table */ - } SDLTest_Crc32Context; - -/* ---------- Function Prototypes ------------- */ - -/** - * \brief Initialize the CRC context - * - * Note: The function initializes the crc table required for all crc calculations. - * - * \param crcContext pointer to context variable - * - * \returns 0 for OK, -1 on error - * - */ - int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); - - -/** - * \brief calculate a crc32 from a data block - * - * \param crcContext pointer to context variable - * \param inBuf input buffer to checksum - * \param inLen length of input buffer - * \param crc32 pointer to Uint32 to store the final CRC into - * - * \returns 0 for OK, -1 on error - * - */ -int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - -/* Same routine broken down into three steps */ -int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); -int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); -int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); - - -/** - * \brief clean up CRC context - * - * \param crcContext pointer to context variable - * - * \returns 0 for OK, -1 on error - * -*/ - -int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_crc32_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_font.h b/libs/hwcodec/externals/SDL/include/SDL_test_font.h deleted file mode 100644 index 18a82ffc..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_font.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_font.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -#ifndef SDL_test_font_h_ -#define SDL_test_font_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Function prototypes */ - -#define FONT_CHARACTER_SIZE 8 -#define FONT_LINE_HEIGHT (FONT_CHARACTER_SIZE + 2) - -/** - * \brief Draw a string in the currently set font. - * - * \param renderer The renderer to draw on. - * \param x The X coordinate of the upper left corner of the character. - * \param y The Y coordinate of the upper left corner of the character. - * \param c The character to draw. - * - * \returns 0 on success, -1 on failure. - */ -int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c); - -/** - * \brief Draw a UTF-8 string in the currently set font. - * - * The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets. - * - * \param renderer The renderer to draw on. - * \param x The X coordinate of the upper left corner of the string. - * \param y The Y coordinate of the upper left corner of the string. - * \param s The string to draw. - * - * \returns 0 on success, -1 on failure. - */ -int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); - -/** - * \brief Data used for multi-line text output - */ -typedef struct SDLTest_TextWindow -{ - SDL_Rect rect; - int current; - int numlines; - char **lines; -} SDLTest_TextWindow; - -/** - * \brief Create a multi-line text output window - * - * \param x The X coordinate of the upper left corner of the window. - * \param y The Y coordinate of the upper left corner of the window. - * \param w The width of the window (currently ignored) - * \param h The height of the window (currently ignored) - * - * \returns the new window, or NULL on failure. - * - * \since This function is available since SDL 2.24.0 - */ -SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h); - -/** - * \brief Display a multi-line text output window - * - * This function should be called every frame to display the text - * - * \param textwin The text output window - * \param renderer The renderer to use for display - * - * \since This function is available since SDL 2.24.0 - */ -void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer); - -/** - * \brief Add text to a multi-line text output window - * - * Adds UTF-8 text to the end of the current text. The newline character starts a - * new line of text. The backspace character deletes the last character or, if the - * line is empty, deletes the line and goes to the end of the previous line. - * - * \param textwin The text output window - * \param fmt A printf() style format string - * \param ... additional parameters matching % tokens in the `fmt` string, if any - * - * \since This function is available since SDL 2.24.0 - */ -void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); - -/** - * \brief Add text to a multi-line text output window - * - * Adds UTF-8 text to the end of the current text. The newline character starts a - * new line of text. The backspace character deletes the last character or, if the - * line is empty, deletes the line and goes to the end of the previous line. - * - * \param textwin The text output window - * \param text The text to add to the window - * \param len The length, in bytes, of the text to add to the window - * - * \since This function is available since SDL 2.24.0 - */ -void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len); - -/** - * \brief Clear the text in a multi-line text output window - * - * \param textwin The text output window - * - * \since This function is available since SDL 2.24.0 - */ -void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin); - -/** - * \brief Free the storage associated with a multi-line text output window - * - * \param textwin The text output window - * - * \since This function is available since SDL 2.24.0 - */ -void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin); - -/** - * \brief Cleanup textures used by font drawing functions. - */ -void SDLTest_CleanupTextDrawing(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_font_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_fuzzer.h b/libs/hwcodec/externals/SDL/include/SDL_test_fuzzer.h deleted file mode 100644 index cfe6a14f..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_fuzzer.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_fuzzer.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Data generators for fuzzing test data in a reproducible way. - -*/ - -#ifndef SDL_test_fuzzer_h_ -#define SDL_test_fuzzer_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* - Based on GSOC code by Markus Kauppila -*/ - - -/** - * \file - * Note: The fuzzer implementation uses a static instance of random context - * internally which makes it thread-UNsafe. - */ - -/** - * Initializes the fuzzer for a test - * - * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. - * - */ -void SDLTest_FuzzerInit(Uint64 execKey); - - -/** - * Returns a random Uint8 - * - * \returns a generated integer - */ -Uint8 SDLTest_RandomUint8(void); - -/** - * Returns a random Sint8 - * - * \returns a generated signed integer - */ -Sint8 SDLTest_RandomSint8(void); - - -/** - * Returns a random Uint16 - * - * \returns a generated integer - */ -Uint16 SDLTest_RandomUint16(void); - -/** - * Returns a random Sint16 - * - * \returns a generated signed integer - */ -Sint16 SDLTest_RandomSint16(void); - - -/** - * Returns a random integer - * - * \returns a generated integer - */ -Sint32 SDLTest_RandomSint32(void); - - -/** - * Returns a random positive integer - * - * \returns a generated integer - */ -Uint32 SDLTest_RandomUint32(void); - -/** - * Returns random Uint64. - * - * \returns a generated integer - */ -Uint64 SDLTest_RandomUint64(void); - - -/** - * Returns random Sint64. - * - * \returns a generated signed integer - */ -Sint64 SDLTest_RandomSint64(void); - -/** - * \returns a random float in range [0.0 - 1.0] - */ -float SDLTest_RandomUnitFloat(void); - -/** - * \returns a random double in range [0.0 - 1.0] - */ -double SDLTest_RandomUnitDouble(void); - -/** - * \returns a random float. - * - */ -float SDLTest_RandomFloat(void); - -/** - * \returns a random double. - * - */ -double SDLTest_RandomDouble(void); - -/** - * Returns a random boundary value for Uint8 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or 0 with error set - */ -Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint16 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or 0 with error set - */ -Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint32 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or 0 with error set - */ -Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Uint64 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 - * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 - * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 - * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or 0 with error set - */ -Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint8 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 - * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or SINT8_MIN with error set - */ -Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); - - -/** - * Returns a random boundary value for Sint16 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 - * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or SINT16_MIN with error set - */ -Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint32 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 - * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or SINT32_MIN with error set - */ -Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); - -/** - * Returns a random boundary value for Sint64 within the given boundaries. - * Boundaries are inclusive, see the usage examples below. If validDomain - * is true, the function will only return valid boundaries, otherwise non-valid - * boundaries are also possible. - * If boundary1 > boundary2, the values are swapped - * - * Usage examples: - * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 - * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 - * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 - * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set - * - * \param boundary1 Lower boundary limit - * \param boundary2 Upper boundary limit - * \param validDomain Should the generated boundary be valid (=within the bounds) or not? - * - * \returns a random boundary value for the given range and domain or SINT64_MIN with error set - */ -Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); - - -/** - * Returns integer in range [min, max] (inclusive). - * Min and max values can be negative values. - * If Max in smaller than min, then the values are swapped. - * Min and max are the same value, that value will be returned. - * - * \param min Minimum inclusive value of returned random number - * \param max Maximum inclusive value of returned random number - * - * \returns a generated random integer in range - */ -Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); - - -/** - * Generates random null-terminated string. The minimum length for - * the string is 1 character, maximum length for the string is 255 - * characters and it can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \returns a newly allocated random string; or NULL if length was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiString(void); - - -/** - * Generates random null-terminated string. The maximum length for - * the string is defined by the maxLength parameter. - * String can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \param maxLength The maximum length of the generated string. - * - * \returns a newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); - - -/** - * Generates random null-terminated string. The length for - * the string is defined by the size parameter. - * String can contain ASCII characters from 32 to 126. - * - * Note: Returned string needs to be deallocated. - * - * \param size The length of the generated string - * - * \returns a newly allocated random string; or NULL if size was invalid or string could not be allocated. - */ -char * SDLTest_RandomAsciiStringOfSize(int size); - -/** - * Get the invocation count for the fuzzer since last ...FuzzerInit. - * - * \returns the invocation count. - */ -int SDLTest_GetFuzzerInvocationCount(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_fuzzer_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_harness.h b/libs/hwcodec/externals/SDL/include/SDL_test_harness.h deleted file mode 100644 index 26231dcd..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_harness.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_harness.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - Defines types for test case definitions and the test execution harness API. - - Based on original GSOC code by Markus Kauppila -*/ - -#ifndef SDL_test_h_arness_h -#define SDL_test_h_arness_h - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/* ! Definitions for test case structures */ -#define TEST_ENABLED 1 -#define TEST_DISABLED 0 - -/* ! Definition of all the possible test return values of the test case method */ -#define TEST_ABORTED -1 -#define TEST_STARTED 0 -#define TEST_COMPLETED 1 -#define TEST_SKIPPED 2 - -/* ! Definition of all the possible test results for the harness */ -#define TEST_RESULT_PASSED 0 -#define TEST_RESULT_FAILED 1 -#define TEST_RESULT_NO_ASSERT 2 -#define TEST_RESULT_SKIPPED 3 -#define TEST_RESULT_SETUP_FAILURE 4 - -/* !< Function pointer to a test case setup function (run before every test) */ -typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); - -/* !< Function pointer to a test case function */ -typedef int (*SDLTest_TestCaseFp)(void *arg); - -/* !< Function pointer to a test case teardown function (run after every test) */ -typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); - -/** - * Holds information about a single test case. - */ -typedef struct SDLTest_TestCaseReference { - /* !< Func2Stress */ - SDLTest_TestCaseFp testCase; - /* !< Short name (or function name) "Func2Stress" */ - const char *name; - /* !< Long name or full description "This test pushes func2() to the limit." */ - const char *description; - /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ - int enabled; -} SDLTest_TestCaseReference; - -/** - * Holds information about a test suite (multiple test cases). - */ -typedef struct SDLTest_TestSuiteReference { - /* !< "PlatformSuite" */ - const char *name; - /* !< The function that is run before each test. NULL skips. */ - SDLTest_TestCaseSetUpFp testSetUp; - /* !< The test cases that are run as part of the suite. Last item should be NULL. */ - const SDLTest_TestCaseReference **testCases; - /* !< The function that is run after each test. NULL skips. */ - SDLTest_TestCaseTearDownFp testTearDown; -} SDLTest_TestSuiteReference; - - -/** - * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). - * - * Note: The returned string needs to be deallocated by the caller. - * - * \param length The length of the seed string to generate - * - * \returns the generated seed string - */ -char *SDLTest_GenerateRunSeed(const int length); - -/** - * \brief Execute a test suite using the given run seed and execution key. - * - * \param testSuites Suites containing the test case. - * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. - * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. - * \param filter Filter specification. NULL disables. Case sensitive. - * \param testIterations Number of iterations to run each test case. - * - * \returns the test run result: 0 when all tests passed, 1 if any tests failed. - */ -int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_h_arness_h */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_images.h b/libs/hwcodec/externals/SDL/include/SDL_test_images.h deleted file mode 100644 index 12113717..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_images.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_images.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - Defines some images for tests. - -*/ - -#ifndef SDL_test_images_h_ -#define SDL_test_images_h_ - -#include "SDL.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - *Type for test images. - */ -typedef struct SDLTest_SurfaceImage_s { - int width; - int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - const char *pixel_data; -} SDLTest_SurfaceImage_t; - -/* Test images */ -SDL_Surface *SDLTest_ImageBlit(void); -SDL_Surface *SDLTest_ImageBlitColor(void); -SDL_Surface *SDLTest_ImageBlitAlpha(void); -SDL_Surface *SDLTest_ImageBlitBlendAdd(void); -SDL_Surface *SDLTest_ImageBlitBlend(void); -SDL_Surface *SDLTest_ImageBlitBlendMod(void); -SDL_Surface *SDLTest_ImageBlitBlendNone(void); -SDL_Surface *SDLTest_ImageBlitBlendAll(void); -SDL_Surface *SDLTest_ImageFace(void); -SDL_Surface *SDLTest_ImagePrimitives(void); -SDL_Surface *SDLTest_ImagePrimitivesBlend(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_images_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_log.h b/libs/hwcodec/externals/SDL/include/SDL_test_log.h deleted file mode 100644 index a27ffc20..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_log.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_log.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - * - * Wrapper to log in the TEST category - * - */ - -#ifndef SDL_test_log_h_ -#define SDL_test_log_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Prints given message with a timestamp in the TEST category and INFO priority. - * - * \param fmt Message to be logged - */ -void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/** - * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. - * - * \param fmt Message to be logged - */ -void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_log_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_md5.h b/libs/hwcodec/externals/SDL/include/SDL_test_md5.h deleted file mode 100644 index 538c7ae3..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_md5.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_md5.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - *********************************************************************** - ** Header file for implementation of MD5 ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** - ** Revised (for MD5): RLR 4/27/91 ** - ** -- G modified to have y&~z instead of y&z ** - ** -- FF, GG, HH modified to add in last register done ** - ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** - ** -- distinct additive constant for each step ** - ** -- round 4 added, working mod 7 ** - *********************************************************************** -*/ - -/* - *********************************************************************** - ** Message-digest routines: ** - ** To form the message digest for a message M ** - ** (1) Initialize a context buffer mdContext using MD5Init ** - ** (2) Call MD5Update on mdContext and M ** - ** (3) Call MD5Final on mdContext ** - ** The message digest is now in mdContext->digest[0...15] ** - *********************************************************************** -*/ - -#ifndef SDL_test_md5_h_ -#define SDL_test_md5_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------ Definitions --------- */ - -/* typedef a 32-bit type */ - typedef unsigned long int MD5UINT4; - -/* Data structure for MD5 (Message-Digest) computation */ - typedef struct { - MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ - MD5UINT4 buf[4]; /* scratch buffer */ - unsigned char in[64]; /* input buffer */ - unsigned char digest[16]; /* actual digest after Md5Final call */ - } SDLTest_Md5Context; - -/* ---------- Function Prototypes ------------- */ - -/** - * \brief initialize the context - * - * \param mdContext pointer to context variable - * - * Note: The function initializes the message-digest context - * mdContext. Call before each new use of the context - - * all fields are set to zero. - */ - void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); - - -/** - * \brief update digest from variable length data - * - * \param mdContext pointer to context variable - * \param inBuf pointer to data array/string - * \param inLen length of data array/string - * - * Note: The function updates the message-digest context to account - * for the presence of each of the characters inBuf[0..inLen-1] - * in the message whose digest is being computed. -*/ - - void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, - unsigned int inLen); - - -/** - * \brief complete digest computation - * - * \param mdContext pointer to context variable - * - * Note: The function terminates the message-digest computation and - * ends with the desired message digest in mdContext.digest[0..15]. - * Always call before using the digest[] variable. -*/ - - void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_md5_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_memory.h b/libs/hwcodec/externals/SDL/include/SDL_test_memory.h deleted file mode 100644 index f959177d..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_memory.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_memory.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -#ifndef SDL_test_memory_h_ -#define SDL_test_memory_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief Start tracking SDL memory allocations - * - * \note This should be called before any other SDL functions for complete tracking coverage - */ -int SDLTest_TrackAllocations(void); - -/** - * \brief Print a log of any outstanding allocations - * - * \note This can be called after SDL_Quit() - */ -void SDLTest_LogAllocations(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_memory_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_test_random.h b/libs/hwcodec/externals/SDL/include/SDL_test_random.h deleted file mode 100644 index 0035a803..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_test_random.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_random.h - * - * Include file for SDL test framework. - * - * This code is a part of the SDL2_test library, not the main SDL library. - */ - -/* - - A "32-bit Multiply with carry random number generator. Very fast. - Includes a list of recommended multipliers. - - multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. - period: (a*2^31)-1 - -*/ - -#ifndef SDL_test_random_h_ -#define SDL_test_random_h_ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* --- Definitions */ - -/* - * Macros that return a random number in a specific format. - */ -#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) - -/* - * Context structure for the random number generator state. - */ - typedef struct { - unsigned int a; - unsigned int x; - unsigned int c; - unsigned int ah; - unsigned int al; - } SDLTest_RandomContext; - - -/* --- Function prototypes */ - -/** - * \brief Initialize random number generator with two integers. - * - * Note: The random sequence of numbers returned by ...Random() is the - * same for the same two integers and has a period of 2^31. - * - * \param rndContext pointer to context structure - * \param xi integer that defines the random sequence - * \param ci integer that defines the random sequence - * - */ - void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, - unsigned int ci); - -/** - * \brief Initialize random number generator based on current system time. - * - * \param rndContext pointer to context structure - * - */ - void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); - - -/** - * \brief Initialize random number generator based on current system time. - * - * Note: ...RandomInit() or ...RandomInitTime() must have been called - * before using this function. - * - * \param rndContext pointer to context structure - * - * \returns a random number (32bit unsigned integer) - * - */ - unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_test_random_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_thread.h b/libs/hwcodec/externals/SDL/include/SDL_thread.h deleted file mode 100644 index 849f70bd..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_thread.h +++ /dev/null @@ -1,464 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_thread_h_ -#define SDL_thread_h_ - -/** - * \file SDL_thread.h - * - * Header for the SDL thread management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_atomic.h" -#include "SDL_mutex.h" - -#if defined(__WIN32__) || defined(__GDK__) -#include /* _beginthreadex() and _endthreadex() */ -#endif -#if defined(__OS2__) /* for _beginthread() and _endthread() */ -#ifndef __EMX__ -#include -#else -#include -#endif -#endif - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/* The SDL thread ID */ -typedef unsigned long SDL_threadID; - -/* Thread local storage ID, 0 is the invalid ID */ -typedef unsigned int SDL_TLSID; - -/** - * The SDL thread priority. - * - * SDL will make system changes as necessary in order to apply the thread priority. - * Code which attempts to control thread state related to priority should be aware - * that calling SDL_SetThreadPriority may alter such state. - * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. - * - * \note On many systems you require special privileges to set high or time critical priority. - */ -typedef enum { - SDL_THREAD_PRIORITY_LOW, - SDL_THREAD_PRIORITY_NORMAL, - SDL_THREAD_PRIORITY_HIGH, - SDL_THREAD_PRIORITY_TIME_CRITICAL -} SDL_ThreadPriority; - -/** - * The function passed to SDL_CreateThread(). - * - * \param data what was passed as `data` to SDL_CreateThread() - * \returns a value that can be reported through SDL_WaitThread(). - */ -typedef int (SDLCALL * SDL_ThreadFunction) (void *data); - - -#if defined(__WIN32__) || defined(__GDK__) -/** - * \file SDL_thread.h - * - * We compile SDL into a DLL. This means, that it's the DLL which - * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL2.DLL will - * be initialized for those threads, and not the RTL of the calling - * application! - * - * To solve this, we make a little hack here. - * - * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL2.DLL which uses this API, - * then the RTL of SDL2.DLL will be used to create the new thread, and if it's - * the application, then the RTL of the application will be used. - * - * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime - * library! - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD - -typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) - (void *, unsigned, unsigned (__stdcall *func)(void *), - void * /*arg*/, unsigned, unsigned * /* threadID */); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); - -#ifndef SDL_beginthread -#define SDL_beginthread _beginthreadex -#endif -#ifndef SDL_endthread -#define SDL_endthread _endthreadex -#endif - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, - const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - - -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#endif - -#elif defined(__OS2__) -/* - * just like the windows case above: We compile SDL2 - * into a dll with Watcom's runtime statically linked. - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD - -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); -typedef void (*pfnSDL_CurrentEndThread)(void); - -#ifndef SDL_beginthread -#define SDL_beginthread _beginthread -#endif -#ifndef SDL_endthread -#define SDL_endthread _endthread -#endif - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#endif - -#else - -/** - * Create a new thread with a default stack size. - * - * This is equivalent to calling: - * - * ```c - * SDL_CreateThreadWithStackSize(fn, name, 0, data); - * ``` - * - * \param fn the SDL_ThreadFunction function to call in the new thread - * \param name the name of the thread - * \param data a pointer that is passed to `fn` - * \returns an opaque pointer to the new thread object on success, NULL if the - * new thread could not be created; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateThreadWithStackSize - * \sa SDL_WaitThread - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); - -/** - * Create a new thread with a specific stack size. - * - * SDL makes an attempt to report `name` to the system, so that debuggers can - * display it. Not all platforms support this. - * - * Thread naming is a little complicated: Most systems have very small limits - * for the string length (Haiku has 32 bytes, Linux currently has 16, Visual - * C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to - * see what happens with your system's debugger. The name should be UTF-8 (but - * using the naming limits of C identifiers is a better bet). There are no - * requirements for thread naming conventions, so long as the string is - * null-terminated UTF-8, but these guidelines are helpful in choosing a name: - * - * https://stackoverflow.com/questions/149932/naming-conventions-for-threads - * - * If a system imposes requirements, SDL will try to munge the string for it - * (truncate, etc), but the original string contents will be available from - * SDL_GetThreadName(). - * - * The size (in bytes) of the new stack can be specified. Zero means "use the - * system default" which might be wildly different between platforms. x86 - * Linux generally defaults to eight megabytes, an embedded device might be a - * few kilobytes instead. You generally need to specify a stack that is a - * multiple of the system's page size (in many cases, this is 4 kilobytes, but - * check your system documentation). - * - * In SDL 2.1, stack size will be folded into the original SDL_CreateThread - * function, but for backwards compatibility, this is currently a separate - * function. - * - * \param fn the SDL_ThreadFunction function to call in the new thread - * \param name the name of the thread - * \param stacksize the size, in bytes, to allocate for the new thread stack. - * \param data a pointer that is passed to `fn` - * \returns an opaque pointer to the new thread object on success, NULL if the - * new thread could not be created; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_WaitThread - */ -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); - -#endif - -/** - * Get the thread name as it was specified in SDL_CreateThread(). - * - * This is internal memory, not to be freed by the caller, and remains valid - * until the specified thread is cleaned up by SDL_WaitThread(). - * - * \param thread the thread to query - * \returns a pointer to a UTF-8 string that names the specified thread, or - * NULL if it doesn't have a name. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateThread - */ -extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); - -/** - * Get the thread identifier for the current thread. - * - * This thread identifier is as reported by the underlying operating system. - * If SDL is running on a platform that does not support threads the return - * value will always be zero. - * - * This function also returns a valid thread ID when called from the main - * thread. - * - * \returns the ID of the current thread. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetThreadID - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); - -/** - * Get the thread identifier for the specified thread. - * - * This thread identifier is as reported by the underlying operating system. - * If SDL is running on a platform that does not support threads the return - * value will always be zero. - * - * \param thread the thread to query - * \returns the ID of the specified thread, or the ID of the current thread if - * `thread` is NULL. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ThreadID - */ -extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); - -/** - * Set the priority for the current thread. - * - * Note that some platforms will not let you alter the priority (or at least, - * promote the thread to a higher priority) at all, and some require you to be - * an administrator account. Be prepared for this to fail. - * - * \param priority the SDL_ThreadPriority to set - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); - -/** - * Wait for a thread to finish. - * - * Threads that haven't been detached will remain (as a "zombie") until this - * function cleans them up. Not doing so is a resource leak. - * - * Once a thread has been cleaned up through this function, the SDL_Thread - * that references it becomes invalid and should not be referenced again. As - * such, only one thread may call SDL_WaitThread() on another. - * - * The return code for the thread function is placed in the area pointed to by - * `status`, if `status` is not NULL. - * - * You may not wait on a thread that has been used in a call to - * SDL_DetachThread(). Use either that function or this one, but not both, or - * behavior is undefined. - * - * It is safe to pass a NULL thread to this function; it is a no-op. - * - * Note that the thread pointer is freed by this function and is not valid - * afterward. - * - * \param thread the SDL_Thread pointer that was returned from the - * SDL_CreateThread() call that started this thread - * \param status pointer to an integer that will receive the value returned - * from the thread function by its 'return', or NULL to not - * receive such value back. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateThread - * \sa SDL_DetachThread - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); - -/** - * Let a thread clean up on exit without intervention. - * - * A thread may be "detached" to signify that it should not remain until - * another thread has called SDL_WaitThread() on it. Detaching a thread is - * useful for long-running threads that nothing needs to synchronize with or - * further manage. When a detached thread is done, it simply goes away. - * - * There is no way to recover the return code of a detached thread. If you - * need this, don't detach the thread and instead use SDL_WaitThread(). - * - * Once a thread is detached, you should usually assume the SDL_Thread isn't - * safe to reference again, as it will become invalid immediately upon the - * detached thread's exit, instead of remaining until someone has called - * SDL_WaitThread() to finally clean it up. As such, don't detach the same - * thread more than once. - * - * If a thread has already exited when passed to SDL_DetachThread(), it will - * stop waiting for a call to SDL_WaitThread() and clean up immediately. It is - * not safe to detach a thread that might be used with SDL_WaitThread(). - * - * You may not call SDL_WaitThread() on a thread that has been detached. Use - * either that function or this one, but not both, or behavior is undefined. - * - * It is safe to pass NULL to this function; it is a no-op. - * - * \param thread the SDL_Thread pointer that was returned from the - * SDL_CreateThread() call that started this thread - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_CreateThread - * \sa SDL_WaitThread - */ -extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); - -/** - * Create a piece of thread-local storage. - * - * This creates an identifier that is globally visible to all threads but - * refers to data that is thread-specific. - * - * \returns the newly created thread local storage identifier or 0 on error. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_TLSGet - * \sa SDL_TLSSet - */ -extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); - -/** - * Get the current thread's value associated with a thread local storage ID. - * - * \param id the thread local storage ID - * \returns the value associated with the ID for the current thread or NULL if - * no value has been set; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_TLSCreate - * \sa SDL_TLSSet - */ -extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); - -/** - * Set the current thread's value associated with a thread local storage ID. - * - * The function prototype for `destructor` is: - * - * ```c - * void destructor(void *value) - * ``` - * - * where its parameter `value` is what was passed as `value` to SDL_TLSSet(). - * - * \param id the thread local storage ID - * \param value the value to associate with the ID for the current thread - * \param destructor a function called when the thread exits, to free the - * value - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_TLSCreate - * \sa SDL_TLSGet - */ -extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); - -/** - * Cleanup all TLS data for this thread. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC void SDLCALL SDL_TLSCleanup(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_thread_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_timer.h b/libs/hwcodec/externals/SDL/include/SDL_timer.h deleted file mode 100644 index 98f9ad16..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_timer.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_timer_h_ -#define SDL_timer_h_ - -/** - * \file SDL_timer.h - * - * Header for the SDL time management routines. - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Get the number of milliseconds since SDL library initialization. - * - * This value wraps if the program runs for more than ~49 days. - * - * This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64() - * instead, where the value doesn't wrap every ~49 days. There are places in - * SDL where we provide a 32-bit timestamp that can not change without - * breaking binary compatibility, though, so this function isn't officially - * deprecated. - * - * \returns an unsigned 32-bit value representing the number of milliseconds - * since the SDL library initialized. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_TICKS_PASSED - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/** - * Get the number of milliseconds since SDL library initialization. - * - * Note that you should not use the SDL_TICKS_PASSED macro with values - * returned by this function, as that macro does clever math to compensate for - * the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit - * values from this function can be safely compared directly. - * - * For example, if you want to wait 100 ms, you could do this: - * - * ```c - * const Uint64 timeout = SDL_GetTicks64() + 100; - * while (SDL_GetTicks64() < timeout) { - * // ... do work until timeout has elapsed - * } - * ``` - * - * \returns an unsigned 64-bit value representing the number of milliseconds - * since the SDL library initialized. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void); - -/** - * Compare 32-bit SDL ticks values, and return true if `A` has passed `B`. - * - * This should be used with results from SDL_GetTicks(), as this macro - * attempts to deal with the 32-bit counter wrapping back to zero every ~49 - * days, but should _not_ be used with SDL_GetTicks64(), which does not have - * that problem. - * - * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could - * do this: - * - * ```c - * const Uint32 timeout = SDL_GetTicks() + 100; - * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { - * // ... do work until timeout has elapsed - * } - * ``` - * - * Note that this does not handle tick differences greater - * than 2^31 so take care when using the above kind of code - * with large timeout delays (tens of days). - */ -#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) - -/** - * Get the current value of the high resolution counter. - * - * This function is typically used for profiling. - * - * The counter values are only meaningful relative to each other. Differences - * between values can be converted to times by using - * SDL_GetPerformanceFrequency(). - * - * \returns the current counter value. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetPerformanceFrequency - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); - -/** - * Get the count per second of the high resolution counter. - * - * \returns a platform-specific count per second. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetPerformanceCounter - */ -extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); - -/** - * Wait a specified number of milliseconds before returning. - * - * This function waits a specified number of milliseconds before returning. It - * waits at least the specified time, but possibly longer due to OS - * scheduling. - * - * \param ms the number of milliseconds to delay - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** - * Function prototype for the timer callback function. - * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); - -/** - * Definition of the timer ID type. - */ -typedef int SDL_TimerID; - -/** - * Call a callback function at a future time. - * - * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init(). - * - * The callback function is passed the current timer interval and the user - * supplied parameter from the SDL_AddTimer() call and should return the next - * timer interval. If the value returned from the callback is 0, the timer is - * canceled. - * - * The callback is run on a separate thread. - * - * Timers take into account the amount of time it took to execute the - * callback. For example, if the callback took 250 ms to execute and returned - * 1000 (ms), the timer would only wait another 750 ms before its next - * iteration. - * - * Timing may be inexact due to OS scheduling. Be sure to note the current - * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your - * callback needs to adjust for variances. - * - * \param interval the timer delay, in milliseconds, passed to `callback` - * \param callback the SDL_TimerCallback function to call when the specified - * `interval` elapses - * \param param a pointer that is passed to `callback` - * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RemoveTimer - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, - SDL_TimerCallback callback, - void *param); - -/** - * Remove a timer created with SDL_AddTimer(). - * - * \param id the ID of the timer to remove - * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't - * found. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AddTimer - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_timer_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_touch.h b/libs/hwcodec/externals/SDL/include/SDL_touch.h deleted file mode 100644 index c12d4a1c..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_touch.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_touch.h - * - * Include file for SDL touch event handling. - */ - -#ifndef SDL_touch_h_ -#define SDL_touch_h_ - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -typedef Sint64 SDL_TouchID; -typedef Sint64 SDL_FingerID; - -typedef enum -{ - SDL_TOUCH_DEVICE_INVALID = -1, - SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ - SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ -} SDL_TouchDeviceType; - -typedef struct SDL_Finger -{ - SDL_FingerID id; - float x; - float y; - float pressure; -} SDL_Finger; - -/* Used as the device ID for mouse events simulated with touch input */ -#define SDL_TOUCH_MOUSEID ((Uint32)-1) - -/* Used as the SDL_TouchID for touch events simulated with mouse input */ -#define SDL_MOUSE_TOUCHID ((Sint64)-1) - - -/** - * Get the number of registered touch devices. - * - * On some platforms SDL first sees the touch device if it was actually used. - * Therefore SDL_GetNumTouchDevices() may return 0 although devices are - * available. After using all devices at least once the number will be - * correct. - * - * This was fixed for Android in SDL 2.0.1. - * - * \returns the number of registered touch devices. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchDevice - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); - -/** - * Get the touch ID with the given index. - * - * \param index the touch device index - * \returns the touch ID with the given index on success or 0 if the index is - * invalid; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumTouchDevices - */ -extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); - -/** - * Get the touch device name as reported from the driver or NULL if the index - * is invalid. - * - * \since This function is available since SDL 2.0.22. - */ -extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index); - -/** - * Get the type of the given touch device. - * - * \since This function is available since SDL 2.0.10. - */ -extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); - -/** - * Get the number of active fingers for a given touch device. - * - * \param touchID the ID of a touch device - * \returns the number of active fingers for a given touch device on success - * or 0 on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchFinger - */ -extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); - -/** - * Get the finger object for specified touch device ID and finger index. - * - * The returned resource is owned by SDL and should not be deallocated. - * - * \param touchID the ID of the requested touch device - * \param index the index of the requested finger - * \returns a pointer to the SDL_Finger object or NULL if no object at the - * given ID and index could be found. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_RecordGesture - */ -extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_touch_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_types.h b/libs/hwcodec/externals/SDL/include/SDL_types.h deleted file mode 100644 index b5d7192f..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_types.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_types.h - * - * \deprecated - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/libs/hwcodec/externals/SDL/include/SDL_version.h b/libs/hwcodec/externals/SDL/include/SDL_version.h deleted file mode 100644 index 5c357a7a..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_version.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_version.h - * - * This header defines the current SDL version. - */ - -#ifndef SDL_version_h_ -#define SDL_version_h_ - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Information about the version of SDL in use. - * - * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). - * - * \sa SDL_VERSION - * \sa SDL_GetVersion - */ -typedef struct SDL_version -{ - Uint8 major; /**< major version */ - Uint8 minor; /**< minor version */ - Uint8 patch; /**< update version */ -} SDL_version; - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 26 -#define SDL_PATCHLEVEL 5 - -/** - * Macro to determine SDL version program was compiled against. - * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), - * is not a macro. - * - * \param x A pointer to a SDL_version struct to initialize. - * - * \sa SDL_version - * \sa SDL_GetVersion - */ -#define SDL_VERSION(x) \ -{ \ - (x)->major = SDL_MAJOR_VERSION; \ - (x)->minor = SDL_MINOR_VERSION; \ - (x)->patch = SDL_PATCHLEVEL; \ -} - -/* TODO: Remove this whole block in SDL 3 */ -#if SDL_MAJOR_VERSION < 3 -/** - * This macro turns the version numbers into a numeric value: - * \verbatim - (1,2,3) -> (1203) - \endverbatim - * - * This assumes that there will never be more than 100 patchlevels. - * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300, - * and 2.255.99 would be encoded as 25799. - * This macro will not be available in SDL 3.x. - */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/** - * This is the version number macro for the current SDL version. - * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300. - * This macro will not be available in SDL 3.x. - * - * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. - */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) -#endif /* SDL_MAJOR_VERSION < 3 */ - -/** - * This macro will evaluate to true if compiled with SDL at least X.Y.Z. - */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - ((SDL_MAJOR_VERSION >= X) && \ - (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \ - (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z)) - -/** - * Get the version of SDL that is linked against your program. - * - * If you are linking to SDL dynamically, then it is possible that the current - * version will be different than the version you compiled against. This - * function returns the current version, while SDL_VERSION() is a macro that - * tells you what version you compiled with. - * - * This function may be called safely at any time, even before SDL_Init(). - * - * \param ver the SDL_version structure that contains the version information - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRevision - */ -extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); - -/** - * Get the code revision of SDL that is linked against your program. - * - * This value is the revision of the code you are linked with and may be - * different from the code you are compiling with, which is found in the - * constant SDL_REVISION. - * - * The revision is arbitrary string (a hash value) uniquely identifying the - * exact revision of the SDL library in use, and is only useful in comparing - * against other revisions. It is NOT an incrementing number. - * - * If SDL wasn't built from a git repository with the appropriate tools, this - * will return an empty string. - * - * Prior to SDL 2.0.16, before development moved to GitHub, this returned a - * hash for a Mercurial repository. - * - * You shouldn't use this function for anything but logging it for debugging - * purposes. The string is not intended to be reliable in any way. - * - * \returns an arbitrary string, uniquely identifying the exact revision of - * the SDL library in use. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetVersion - */ -extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); - -/** - * Obsolete function, do not use. - * - * When SDL was hosted in a Mercurial repository, and was built carefully, - * this would return the revision number that the build was created from. This - * number was not reliable for several reasons, but more importantly, SDL is - * now hosted in a git repository, which does not offer numbers at all, only - * hashes. This function only ever returns zero now. Don't use it. - * - * Before SDL 2.0.16, this might have returned an unreliable, but non-zero - * number. - * - * \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it - * will return a git hash. - * - * \returns zero, always, in modern SDL releases. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetRevision - */ -extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_version_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_video.h b/libs/hwcodec/externals/SDL/include/SDL_video.h deleted file mode 100644 index c70facb5..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_video.h +++ /dev/null @@ -1,2150 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_video.h - * - * Header file for SDL video functions. - */ - -#ifndef SDL_video_h_ -#define SDL_video_h_ - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The structure that defines a display mode - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() - */ -typedef struct -{ - Uint32 format; /**< pixel format */ - int w; /**< width, in screen coordinates */ - int h; /**< height, in screen coordinates */ - int refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ -} SDL_DisplayMode; - -/** - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_FlashWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowKeyboardGrab() - * \sa SDL_GetWindowMouseGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowKeyboardGrab() - * \sa SDL_SetWindowMouseGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowBordered() - * \sa SDL_SetWindowResizable() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() - */ -typedef struct SDL_Window SDL_Window; - -/** - * \brief The flags on a window - * - * \sa SDL_GetWindowFlags() - */ -typedef enum -{ - SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ - SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ - SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ - SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ - SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ - SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ - SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ - SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ - SDL_WINDOW_MOUSE_GRABBED = 0x00000100, /**< window has grabbed mouse input */ - SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ - SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ - SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), - SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ - SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported. - On macOS NSHighResolutionCapable must be set true in the - application's Info.plist for this to have any effect. */ - SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ - SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */ - SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */ - SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ - SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ - SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ - SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, /**< window has grabbed keyboard input */ - SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ - SDL_WINDOW_METAL = 0x20000000, /**< window usable for Metal view */ - - SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED /**< equivalent to SDL_WINDOW_MOUSE_GRABBED for compatibility */ -} SDL_WindowFlags; - -/** - * \brief Used to indicate that you don't care what the window position is. - */ -#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u -#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) -#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) -#define SDL_WINDOWPOS_ISUNDEFINED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) - -/** - * \brief Used to indicate that the window position should be centered. - */ -#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u -#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) -#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) -#define SDL_WINDOWPOS_ISCENTERED(X) \ - (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) - -/** - * \brief Event subtype for window events - */ -typedef enum -{ - SDL_WINDOWEVENT_NONE, /**< Never used */ - SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ - SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ - SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be - redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 - */ - SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ - SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as - a result of an API call or through the - system or user changing the window size. */ - SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ - SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ - SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size - and position */ - SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ - SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ - SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ - SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ - SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */ - SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ - SDL_WINDOWEVENT_HIT_TEST, /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */ - SDL_WINDOWEVENT_ICCPROF_CHANGED,/**< The ICC profile of the window's display has changed. */ - SDL_WINDOWEVENT_DISPLAY_CHANGED /**< Window has been moved to display data1. */ -} SDL_WindowEventID; - -/** - * \brief Event subtype for display events - */ -typedef enum -{ - SDL_DISPLAYEVENT_NONE, /**< Never used */ - SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ - SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ - SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */ -} SDL_DisplayEventID; - -/** - * \brief Display orientation - */ -typedef enum -{ - SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ - SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ - SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */ - SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */ - SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */ -} SDL_DisplayOrientation; - -/** - * \brief Window flash operation - */ -typedef enum -{ - SDL_FLASH_CANCEL, /**< Cancel any window flash state */ - SDL_FLASH_BRIEFLY, /**< Flash the window briefly to get attention */ - SDL_FLASH_UNTIL_FOCUSED /**< Flash the window until it gets focus */ -} SDL_FlashOperation; - -/** - * \brief An opaque handle to an OpenGL context. - */ -typedef void *SDL_GLContext; - -/** - * \brief OpenGL configuration attributes - */ -typedef enum -{ - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, - SDL_GL_CONTEXT_NO_ERROR, - SDL_GL_FLOATBUFFERS -} SDL_GLattr; - -typedef enum -{ - SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, - SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, - SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ -} SDL_GLprofile; - -typedef enum -{ - SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, - SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, - SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, - SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 -} SDL_GLcontextFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 -} SDL_GLcontextReleaseFlag; - -typedef enum -{ - SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, - SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 -} SDL_GLContextResetNotification; - -/* Function prototypes */ - -/** - * Get the number of video drivers compiled into SDL. - * - * \returns a number >= 1 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetVideoDriver - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); - -/** - * Get the name of a built in video driver. - * - * The video drivers are presented in the order in which they are normally - * checked during initialization. - * - * \param index the index of a video driver - * \returns the name of the video driver with the given **index**. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumVideoDrivers - */ -extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); - -/** - * Initialize the video subsystem, optionally specifying a video driver. - * - * This function initializes the video subsystem, setting up a connection to - * the window manager, etc, and determines the available display modes and - * pixel formats, but does not initialize a window or graphics mode. - * - * If you use this function and you haven't used the SDL_INIT_VIDEO flag with - * either SDL_Init() or SDL_InitSubSystem(), you should call SDL_VideoQuit() - * before calling SDL_Quit(). - * - * It is safe to call this function multiple times. SDL_VideoInit() will call - * SDL_VideoQuit() itself if the video subsystem has already been initialized. - * - * You can use SDL_GetNumVideoDrivers() and SDL_GetVideoDriver() to find a - * specific `driver_name`. - * - * \param driver_name the name of a video driver to initialize, or NULL for - * the default driver - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumVideoDrivers - * \sa SDL_GetVideoDriver - * \sa SDL_InitSubSystem - * \sa SDL_VideoQuit - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); - -/** - * Shut down the video subsystem, if initialized with SDL_VideoInit(). - * - * This function closes all windows, and restores the original video mode. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_VideoInit - */ -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); - -/** - * Get the name of the currently initialized video driver. - * - * \returns the name of the current video driver or NULL if no driver has been - * initialized. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumVideoDrivers - * \sa SDL_GetVideoDriver - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); - -/** - * Get the number of available video displays. - * - * \returns a number >= 1 or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetDisplayBounds - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); - -/** - * Get the name of a display in UTF-8 encoding. - * - * \param displayIndex the index of display from which the name should be - * queried - * \returns the name of a display or NULL for an invalid display index or - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); - -/** - * Get the desktop area represented by a display. - * - * The primary display (`displayIndex` zero) is always located at 0,0. - * - * \param displayIndex the index of the display to query - * \param rect the SDL_Rect structure filled in with the display bounds - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); - -/** - * Get the usable desktop area represented by a display. - * - * The primary display (`displayIndex` zero) is always located at 0,0. - * - * This is the same area as SDL_GetDisplayBounds() reports, but with portions - * reserved by the system removed. For example, on Apple's macOS, this - * subtracts the area occupied by the menu bar and dock. - * - * Setting a window to be fullscreen generally bypasses these unusable areas, - * so these are good guidelines for the maximum space available to a - * non-fullscreen window. - * - * The parameter `rect` is ignored if it is NULL. - * - * This function also returns -1 if the parameter `displayIndex` is out of - * range. - * - * \param displayIndex the index of the display to query the usable bounds - * from - * \param rect the SDL_Rect structure filled in with the display bounds - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_GetDisplayBounds - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect); - -/** - * Get the dots/pixels-per-inch for a display. - * - * Diagonal, horizontal and vertical DPI can all be optionally returned if the - * appropriate parameter is non-NULL. - * - * A failure of this function usually means that either no DPI information is - * available or the `displayIndex` is out of range. - * - * **WARNING**: This reports the DPI that the hardware reports, and it is not - * always reliable! It is almost always better to use SDL_GetWindowSize() to - * find the window size, which might be in logical points instead of pixels, - * and then SDL_GL_GetDrawableSize(), SDL_Vulkan_GetDrawableSize(), - * SDL_Metal_GetDrawableSize(), or SDL_GetRendererOutputSize(), and compare - * the two values to get an actual scaling value between the two. We will be - * rethinking how high-dpi details should be managed in SDL3 to make things - * more consistent, reliable, and clear. - * - * \param displayIndex the index of the display from which DPI information - * should be queried - * \param ddpi a pointer filled in with the diagonal DPI of the display; may - * be NULL - * \param hdpi a pointer filled in with the horizontal DPI of the display; may - * be NULL - * \param vdpi a pointer filled in with the vertical DPI of the display; may - * be NULL - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); - -/** - * Get the orientation of a display. - * - * \param displayIndex the index of the display to query - * \returns The SDL_DisplayOrientation enum value of the display, or - * `SDL_ORIENTATION_UNKNOWN` if it isn't available. - * - * \since This function is available since SDL 2.0.9. - * - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex); - -/** - * Get the number of available display modes. - * - * The `displayIndex` needs to be in the range from 0 to - * SDL_GetNumVideoDisplays() - 1. - * - * \param displayIndex the index of the display to query - * \returns a number >= 1 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetDisplayMode - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); - -/** - * Get information about a specific display mode. - * - * The display modes are sorted in this priority: - * - * - width -> largest to smallest - * - height -> largest to smallest - * - bits per pixel -> more colors to fewer colors - * - packed pixel layout -> largest to smallest - * - refresh rate -> highest to lowest - * - * \param displayIndex the index of the display to query - * \param modeIndex the index of the display mode to query - * \param mode an SDL_DisplayMode structure filled in with the mode at - * `modeIndex` - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumDisplayModes - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, - SDL_DisplayMode * mode); - -/** - * Get information about the desktop's display mode. - * - * There's a difference between this function and SDL_GetCurrentDisplayMode() - * when SDL runs fullscreen and has changed the resolution. In that case this - * function will return the previous native display mode, and not the current - * display mode. - * - * \param displayIndex the index of the display to query - * \param mode an SDL_DisplayMode structure filled in with the current display - * mode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetCurrentDisplayMode - * \sa SDL_GetDisplayMode - * \sa SDL_SetWindowDisplayMode - */ -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); - -/** - * Get information about the current display mode. - * - * There's a difference between this function and SDL_GetDesktopDisplayMode() - * when SDL runs fullscreen and has changed the resolution. In that case this - * function will return the current display mode, and not the previous native - * display mode. - * - * \param displayIndex the index of the display to query - * \param mode an SDL_DisplayMode structure filled in with the current display - * mode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetDesktopDisplayMode - * \sa SDL_GetDisplayMode - * \sa SDL_GetNumVideoDisplays - * \sa SDL_SetWindowDisplayMode - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); - - -/** - * Get the closest match to the requested display mode. - * - * The available display modes are scanned and `closest` is filled in with the - * closest mode matching the requested mode and returned. The mode format and - * refresh rate default to the desktop mode if they are set to 0. The modes - * are scanned with size being first priority, format being second priority, - * and finally checking the refresh rate. If all the available modes are too - * small, then NULL is returned. - * - * \param displayIndex the index of the display to query - * \param mode an SDL_DisplayMode structure containing the desired display - * mode - * \param closest an SDL_DisplayMode structure filled in with the closest - * match of the available display modes - * \returns the passed in value `closest` or NULL if no matching video mode - * was available; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetDisplayMode - * \sa SDL_GetNumDisplayModes - */ -extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); - -/** - * Get the index of the display containing a point - * - * \param point the point to query - * \returns the index of the display containing the point or a negative error - * code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GetDisplayBounds - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetPointDisplayIndex(const SDL_Point * point); - -/** - * Get the index of the display primarily containing a rect - * - * \param rect the rect to query - * \returns the index of the display entirely containing the rect or closest - * to the center of the rect on success or a negative error code on - * failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.24.0. - * - * \sa SDL_GetDisplayBounds - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect); - -/** - * Get the index of the display associated with a window. - * - * \param window the window to query - * \returns the index of the display containing the center of the window on - * success or a negative error code on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetDisplayBounds - * \sa SDL_GetNumVideoDisplays - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); - -/** - * Set the display mode to use when a window is visible at fullscreen. - * - * This only affects the display mode used when the window is fullscreen. To - * change the window size when the window is not fullscreen, use - * SDL_SetWindowSize(). - * - * \param window the window to affect - * \param mode the SDL_DisplayMode structure representing the mode to use, or - * NULL to use the window's dimensions and the desktop's format - * and refresh rate - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowDisplayMode - * \sa SDL_SetWindowFullscreen - */ -extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, - const SDL_DisplayMode * mode); - -/** - * Query the display mode to use when a window is visible at fullscreen. - * - * \param window the window to query - * \param mode an SDL_DisplayMode structure filled in with the fullscreen - * display mode - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowDisplayMode - * \sa SDL_SetWindowFullscreen - */ -extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, - SDL_DisplayMode * mode); - -/** - * Get the raw ICC profile data for the screen the window is currently on. - * - * Data returned should be freed with SDL_free. - * - * \param window the window to query - * \param size the size of the ICC profile - * \returns the raw ICC profile data on success or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.18. - */ -extern DECLSPEC void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size); - -/** - * Get the pixel format associated with the window. - * - * \param window the window to query - * \returns the pixel format of the window on success or - * SDL_PIXELFORMAT_UNKNOWN on failure; call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); - -/** - * Create a window with the specified position, dimensions, and flags. - * - * `flags` may be any of the following OR'd together: - * - * - `SDL_WINDOW_FULLSCREEN`: fullscreen window - * - `SDL_WINDOW_FULLSCREEN_DESKTOP`: fullscreen window at desktop resolution - * - `SDL_WINDOW_OPENGL`: window usable with an OpenGL context - * - `SDL_WINDOW_VULKAN`: window usable with a Vulkan instance - * - `SDL_WINDOW_METAL`: window usable with a Metal instance - * - `SDL_WINDOW_HIDDEN`: window is not visible - * - `SDL_WINDOW_BORDERLESS`: no window decoration - * - `SDL_WINDOW_RESIZABLE`: window can be resized - * - `SDL_WINDOW_MINIMIZED`: window is minimized - * - `SDL_WINDOW_MAXIMIZED`: window is maximized - * - `SDL_WINDOW_INPUT_GRABBED`: window has grabbed input focus - * - `SDL_WINDOW_ALLOW_HIGHDPI`: window should be created in high-DPI mode if - * supported (>= SDL 2.0.1) - * - * `SDL_WINDOW_SHOWN` is ignored by SDL_CreateWindow(). The SDL_Window is - * implicitly shown if SDL_WINDOW_HIDDEN is not set. `SDL_WINDOW_SHOWN` may be - * queried later using SDL_GetWindowFlags(). - * - * On Apple's macOS, you **must** set the NSHighResolutionCapable Info.plist - * property to YES, otherwise you will not receive a High-DPI OpenGL canvas. - * - * If the window is created with the `SDL_WINDOW_ALLOW_HIGHDPI` flag, its size - * in pixels may differ from its size in screen coordinates on platforms with - * high-DPI support (e.g. iOS and macOS). Use SDL_GetWindowSize() to query the - * client area's size in screen coordinates, and SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to query the drawable size in pixels. Note that - * when this flag is set, the drawable size can vary after the window is - * created and should be queried after major window events such as when the - * window is resized or moved between displays. - * - * If the window is set fullscreen, the width and height parameters `w` and - * `h` will not be used. However, invalid size parameters (e.g. too large) may - * still fail. Window size is actually limited to 16384 x 16384 for all - * platforms at window creation. - * - * If the window is created with any of the SDL_WINDOW_OPENGL or - * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function - * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the - * corresponding UnloadLibrary function is called by SDL_DestroyWindow(). - * - * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, - * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. - * - * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, - * SDL_CreateWindow() will fail. - * - * On non-Apple devices, SDL requires you to either not link to the Vulkan - * loader or link to a dynamic library version. This limitation may be removed - * in a future version of SDL. - * - * \param title the title of the window, in UTF-8 encoding - * \param x the x position of the window, `SDL_WINDOWPOS_CENTERED`, or - * `SDL_WINDOWPOS_UNDEFINED` - * \param y the y position of the window, `SDL_WINDOWPOS_CENTERED`, or - * `SDL_WINDOWPOS_UNDEFINED` - * \param w the width of the window, in screen coordinates - * \param h the height of the window, in screen coordinates - * \param flags 0, or one or more SDL_WindowFlags OR'd together - * \returns the window that was created or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateWindowFrom - * \sa SDL_DestroyWindow - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, - int x, int y, int w, - int h, Uint32 flags); - -/** - * Create an SDL window from an existing native window. - * - * In some cases (e.g. OpenGL) and on some platforms (e.g. Microsoft Windows) - * the hint `SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT` needs to be configured - * before using SDL_CreateWindowFrom(). - * - * \param data a pointer to driver-dependent window creation data, typically - * your native window cast to a void* - * \returns the window that was created or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateWindow - * \sa SDL_DestroyWindow - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); - -/** - * Get the numeric ID of a window. - * - * The numeric ID is what SDL_WindowEvent references, and is necessary to map - * these events to specific SDL_Window objects. - * - * \param window the window to query - * \returns the ID of the window on success or 0 on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowFromID - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); - -/** - * Get a window from a stored ID. - * - * The numeric ID is what SDL_WindowEvent references, and is necessary to map - * these events to specific SDL_Window objects. - * - * \param id the ID of the window - * \returns the window associated with `id` or NULL if it doesn't exist; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowID - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); - -/** - * Get the window flags. - * - * \param window the window to query - * \returns a mask of the SDL_WindowFlags associated with `window` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateWindow - * \sa SDL_HideWindow - * \sa SDL_MaximizeWindow - * \sa SDL_MinimizeWindow - * \sa SDL_SetWindowFullscreen - * \sa SDL_SetWindowGrab - * \sa SDL_ShowWindow - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); - -/** - * Set the title of a window. - * - * This string is expected to be in UTF-8 encoding. - * - * \param window the window to change - * \param title the desired window title in UTF-8 format - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowTitle - */ -extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, - const char *title); - -/** - * Get the title of a window. - * - * \param window the window to query - * \returns the title of the window in UTF-8 format or "" if there is no - * title. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowTitle - */ -extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); - -/** - * Set the icon for a window. - * - * \param window the window to change - * \param icon an SDL_Surface structure containing the icon for the window - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, - SDL_Surface * icon); - -/** - * Associate an arbitrary named pointer with a window. - * - * `name` is case-sensitive. - * - * \param window the window to associate with the pointer - * \param name the name of the pointer - * \param userdata the associated pointer - * \returns the previous value associated with `name`. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowData - */ -extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, - const char *name, - void *userdata); - -/** - * Retrieve the data pointer associated with a window. - * - * \param window the window to query - * \param name the name of the pointer - * \returns the value associated with `name`. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowData - */ -extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, - const char *name); - -/** - * Set the position of a window. - * - * The window coordinate origin is the upper left of the display. - * - * \param window the window to reposition - * \param x the x coordinate of the window in screen coordinates, or - * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` - * \param y the y coordinate of the window in screen coordinates, or - * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowPosition - */ -extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, - int x, int y); - -/** - * Get the position of a window. - * - * If you do not need the value for one of the positions a NULL may be passed - * in the `x` or `y` parameter. - * - * \param window the window to query - * \param x a pointer filled in with the x position of the window, in screen - * coordinates, may be NULL - * \param y a pointer filled in with the y position of the window, in screen - * coordinates, may be NULL - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowPosition - */ -extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, - int *x, int *y); - -/** - * Set the size of a window's client area. - * - * The window size in screen coordinates may differ from the size in pixels, - * if the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a platform - * with high-dpi support (e.g. iOS or macOS). Use SDL_GL_GetDrawableSize() or - * SDL_GetRendererOutputSize() to get the real client area size in pixels. - * - * Fullscreen windows automatically match the size of the display mode, and - * you should use SDL_SetWindowDisplayMode() to change their size. - * - * \param window the window to change - * \param w the width of the window in pixels, in screen coordinates, must be - * > 0 - * \param h the height of the window in pixels, in screen coordinates, must be - * > 0 - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowSize - * \sa SDL_SetWindowDisplayMode - */ -extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, - int h); - -/** - * Get the size of a window's client area. - * - * NULL can safely be passed as the `w` or `h` parameter if the width or - * height value is not desired. - * - * The window size in screen coordinates may differ from the size in pixels, - * if the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a platform - * with high-dpi support (e.g. iOS or macOS). Use SDL_GL_GetDrawableSize(), - * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to get the - * real client area size in pixels. - * - * \param window the window to query the width and height from - * \param w a pointer filled in with the width of the window, in screen - * coordinates, may be NULL - * \param h a pointer filled in with the height of the window, in screen - * coordinates, may be NULL - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_GetDrawableSize - * \sa SDL_Vulkan_GetDrawableSize - * \sa SDL_SetWindowSize - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, - int *h); - -/** - * Get the size of a window's borders (decorations) around the client area. - * - * Note: If this function fails (returns -1), the size values will be - * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as if the - * window in question was borderless. - * - * Note: This function may fail on systems where the window has not yet been - * decorated by the display server (for example, immediately after calling - * SDL_CreateWindow). It is recommended that you wait at least until the - * window has been presented and composited, so that the window system has a - * chance to decorate the window and provide the border dimensions to SDL. - * - * This function also returns -1 if getting the information is not supported. - * - * \param window the window to query the size values of the border - * (decorations) from - * \param top pointer to variable for storing the size of the top border; NULL - * is permitted - * \param left pointer to variable for storing the size of the left border; - * NULL is permitted - * \param bottom pointer to variable for storing the size of the bottom - * border; NULL is permitted - * \param right pointer to variable for storing the size of the right border; - * NULL is permitted - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_GetWindowSize - */ -extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, - int *top, int *left, - int *bottom, int *right); - -/** - * Get the size of a window in pixels. - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a - * platform with high-DPI support (Apple calls this "Retina"), and not - * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. - * - * \param window the window from which the drawable size should be queried - * \param w a pointer to variable for storing the width in pixels, may be NULL - * \param h a pointer to variable for storing the height in pixels, may be - * NULL - * - * \since This function is available since SDL 2.26.0. - * - * \sa SDL_CreateWindow - * \sa SDL_GetWindowSize - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window, - int *w, int *h); - -/** - * Set the minimum size of a window's client area. - * - * \param window the window to change - * \param min_w the minimum width of the window in pixels - * \param min_h the minimum height of the window in pixels - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowMinimumSize - * \sa SDL_SetWindowMaximumSize - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, - int min_w, int min_h); - -/** - * Get the minimum size of a window's client area. - * - * \param window the window to query - * \param w a pointer filled in with the minimum width of the window, may be - * NULL - * \param h a pointer filled in with the minimum height of the window, may be - * NULL - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowMaximumSize - * \sa SDL_SetWindowMinimumSize - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, - int *w, int *h); - -/** - * Set the maximum size of a window's client area. - * - * \param window the window to change - * \param max_w the maximum width of the window in pixels - * \param max_h the maximum height of the window in pixels - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowMaximumSize - * \sa SDL_SetWindowMinimumSize - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, - int max_w, int max_h); - -/** - * Get the maximum size of a window's client area. - * - * \param window the window to query - * \param w a pointer filled in with the maximum width of the window, may be - * NULL - * \param h a pointer filled in with the maximum height of the window, may be - * NULL - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowMinimumSize - * \sa SDL_SetWindowMaximumSize - */ -extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, - int *w, int *h); - -/** - * Set the border state of a window. - * - * This will add or remove the window's `SDL_WINDOW_BORDERLESS` flag and add - * or remove the border from the actual window. This is a no-op if the - * window's border already matches the requested state. - * - * You can't change the border state of a fullscreen window. - * - * \param window the window of which to change the border state - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowFlags - */ -extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, - SDL_bool bordered); - -/** - * Set the user-resizable state of a window. - * - * This will add or remove the window's `SDL_WINDOW_RESIZABLE` flag and - * allow/disallow user resizing of the window. This is a no-op if the window's - * resizable state already matches the requested state. - * - * You can't change the resizable state of a fullscreen window. - * - * \param window the window of which to change the resizable state - * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_GetWindowFlags - */ -extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, - SDL_bool resizable); - -/** - * Set the window to always be above the others. - * - * This will add or remove the window's `SDL_WINDOW_ALWAYS_ON_TOP` flag. This - * will bring the window to the front and keep the window above the rest. - * - * \param window The window of which to change the always on top state - * \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to - * disable - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_GetWindowFlags - */ -extern DECLSPEC void SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window * window, - SDL_bool on_top); - -/** - * Show a window. - * - * \param window the window to show - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HideWindow - * \sa SDL_RaiseWindow - */ -extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); - -/** - * Hide a window. - * - * \param window the window to hide - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ShowWindow - */ -extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); - -/** - * Raise a window above other windows and set the input focus. - * - * \param window the window to raise - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); - -/** - * Make a window as large as possible. - * - * \param window the window to maximize - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MinimizeWindow - * \sa SDL_RestoreWindow - */ -extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); - -/** - * Minimize a window to an iconic representation. - * - * \param window the window to minimize - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MaximizeWindow - * \sa SDL_RestoreWindow - */ -extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); - -/** - * Restore the size and position of a minimized or maximized window. - * - * \param window the window to restore - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_MaximizeWindow - * \sa SDL_MinimizeWindow - */ -extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); - -/** - * Set a window's fullscreen state. - * - * `flags` may be `SDL_WINDOW_FULLSCREEN`, for "real" fullscreen with a - * videomode change; `SDL_WINDOW_FULLSCREEN_DESKTOP` for "fake" fullscreen - * that takes the size of the desktop; and 0 for windowed mode. - * - * \param window the window to change - * \param flags `SDL_WINDOW_FULLSCREEN`, `SDL_WINDOW_FULLSCREEN_DESKTOP` or 0 - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowDisplayMode - * \sa SDL_SetWindowDisplayMode - */ -extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, - Uint32 flags); - -/** - * Get the SDL surface associated with the window. - * - * A new surface will be created with the optimal format for the window, if - * necessary. This surface will be freed when the window is destroyed. Do not - * free this surface. - * - * This surface will be invalidated if the window is resized. After resizing a - * window this function must be called again to return a valid surface. - * - * You may not combine this with 3D or the rendering API on this window. - * - * This function is affected by `SDL_HINT_FRAMEBUFFER_ACCELERATION`. - * - * \param window the window to query - * \returns the surface associated with the window, or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_UpdateWindowSurface - * \sa SDL_UpdateWindowSurfaceRects - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); - -/** - * Copy the window surface to the screen. - * - * This is the function you use to reflect any changes to the surface on the - * screen. - * - * This function is equivalent to the SDL 1.2 API SDL_Flip(). - * - * \param window the window to update - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowSurface - * \sa SDL_UpdateWindowSurfaceRects - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); - -/** - * Copy areas of the window surface to the screen. - * - * This is the function you use to reflect changes to portions of the surface - * on the screen. - * - * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). - * - * \param window the window to update - * \param rects an array of SDL_Rect structures representing areas of the - * surface to copy - * \param numrects the number of rectangles - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowSurface - * \sa SDL_UpdateWindowSurface - */ -extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, - const SDL_Rect * rects, - int numrects); - -/** - * Set a window's input grab mode. - * - * When input is grabbed, the mouse is confined to the window. This function - * will also grab the keyboard if `SDL_HINT_GRAB_KEYBOARD` is set. To grab the - * keyboard without also grabbing the mouse, use SDL_SetWindowKeyboardGrab(). - * - * If the caller enables a grab while another window is currently grabbed, the - * other window loses its grab in favor of the caller's window. - * - * \param window the window for which the input grab mode should be set - * \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetGrabbedWindow - * \sa SDL_GetWindowGrab - */ -extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * Set a window's keyboard grab mode. - * - * Keyboard grab enables capture of system keyboard shortcuts like Alt+Tab or - * the Meta/Super key. Note that not all system keyboard shortcuts can be - * captured by applications (one example is Ctrl+Alt+Del on Windows). - * - * This is primarily intended for specialized applications such as VNC clients - * or VM frontends. Normal games should not use keyboard grab. - * - * When keyboard grab is enabled, SDL will continue to handle Alt+Tab when the - * window is full-screen to ensure the user is not trapped in your - * application. If you have a custom keyboard shortcut to exit fullscreen - * mode, you may suppress this behavior with - * `SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED`. - * - * If the caller enables a grab while another window is currently grabbed, the - * other window loses its grab in favor of the caller's window. - * - * \param window The window for which the keyboard grab mode should be set. - * \param grabbed This is SDL_TRUE to grab keyboard, and SDL_FALSE to release. - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_GetWindowKeyboardGrab - * \sa SDL_SetWindowMouseGrab - * \sa SDL_SetWindowGrab - */ -extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * Set a window's mouse grab mode. - * - * Mouse grab confines the mouse cursor to the window. - * - * \param window The window for which the mouse grab mode should be set. - * \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release. - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_GetWindowMouseGrab - * \sa SDL_SetWindowKeyboardGrab - * \sa SDL_SetWindowGrab - */ -extern DECLSPEC void SDLCALL SDL_SetWindowMouseGrab(SDL_Window * window, - SDL_bool grabbed); - -/** - * Get a window's input grab mode. - * - * \param window the window to query - * \returns SDL_TRUE if input is grabbed, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowGrab - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); - -/** - * Get a window's keyboard grab mode. - * - * \param window the window to query - * \returns SDL_TRUE if keyboard is grabbed, and SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_SetWindowKeyboardGrab - * \sa SDL_GetWindowGrab - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window * window); - -/** - * Get a window's mouse grab mode. - * - * \param window the window to query - * \returns SDL_TRUE if mouse is grabbed, and SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.16. - * - * \sa SDL_SetWindowKeyboardGrab - * \sa SDL_GetWindowGrab - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window * window); - -/** - * Get the window that currently has an input grab enabled. - * - * \returns the window if input is grabbed or NULL otherwise. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_GetWindowGrab - * \sa SDL_SetWindowGrab - */ -extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); - -/** - * Confines the cursor to the specified area of a window. - * - * Note that this does NOT grab the cursor, it only defines the area a cursor - * is restricted to when the window has mouse focus. - * - * \param window The window that will be associated with the barrier. - * \param rect A rectangle area in window-relative coordinates. If NULL the - * barrier for the specified window will be destroyed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_GetWindowMouseRect - * \sa SDL_SetWindowMouseGrab - */ -extern DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect); - -/** - * Get the mouse confinement rectangle of a window. - * - * \param window The window to query - * \returns A pointer to the mouse confinement rectangle of a window, or NULL - * if there isn't one. - * - * \since This function is available since SDL 2.0.18. - * - * \sa SDL_SetWindowMouseRect - */ -extern DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * window); - -/** - * Set the brightness (gamma multiplier) for a given window's display. - * - * Despite the name and signature, this method sets the brightness of the - * entire display, not an individual window. A window is considered to be - * owned by the display that contains the window's center pixel. (The index of - * this display can be retrieved using SDL_GetWindowDisplayIndex().) The - * brightness set will not follow the window if it is moved to another - * display. - * - * Many platforms will refuse to set the display brightness in modern times. - * You are better off using a shader to adjust gamma during rendering, or - * something similar. - * - * \param window the window used to select the display whose brightness will - * be changed - * \param brightness the brightness (gamma multiplier) value to set where 0.0 - * is completely dark and 1.0 is normal brightness - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowBrightness - * \sa SDL_SetWindowGammaRamp - */ -extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); - -/** - * Get the brightness (gamma multiplier) for a given window's display. - * - * Despite the name and signature, this method retrieves the brightness of the - * entire display, not an individual window. A window is considered to be - * owned by the display that contains the window's center pixel. (The index of - * this display can be retrieved using SDL_GetWindowDisplayIndex().) - * - * \param window the window used to select the display whose brightness will - * be queried - * \returns the brightness for the display where 0.0 is completely dark and - * 1.0 is normal brightness. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowBrightness - */ -extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); - -/** - * Set the opacity for a window. - * - * The parameter `opacity` will be clamped internally between 0.0f - * (transparent) and 1.0f (opaque). - * - * This function also returns -1 if setting the opacity isn't supported. - * - * \param window the window which will be made transparent or opaque - * \param opacity the opacity value (0.0f - transparent, 1.0f - opaque) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_GetWindowOpacity - */ -extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity); - -/** - * Get the opacity of a window. - * - * If transparency isn't supported on this platform, opacity will be reported - * as 1.0f without error. - * - * The parameter `opacity` is ignored if it is NULL. - * - * This function also returns -1 if an invalid window was provided. - * - * \param window the window to get the current opacity value from - * \param out_opacity the float filled in (0.0f - transparent, 1.0f - opaque) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_SetWindowOpacity - */ -extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity); - -/** - * Set the window as a modal for another window. - * - * \param modal_window the window that should be set modal - * \param parent_window the parent window for the modal window - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window); - -/** - * Explicitly set input focus to the window. - * - * You almost certainly want SDL_RaiseWindow() instead of this function. Use - * this with caution, as you might give focus to a window that is completely - * obscured by other windows. - * - * \param window the window that should get the input focus - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.5. - * - * \sa SDL_RaiseWindow - */ -extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); - -/** - * Set the gamma ramp for the display that owns a given window. - * - * Set the gamma translation table for the red, green, and blue channels of - * the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. The - * input is the index into the array, and the output is the 16-bit gamma value - * at that index, scaled to the output color precision. - * - * Despite the name and signature, this method sets the gamma ramp of the - * entire display, not an individual window. A window is considered to be - * owned by the display that contains the window's center pixel. (The index of - * this display can be retrieved using SDL_GetWindowDisplayIndex().) The gamma - * ramp set will not follow the window if it is moved to another display. - * - * \param window the window used to select the display whose gamma ramp will - * be changed - * \param red a 256 element array of 16-bit quantities representing the - * translation table for the red channel, or NULL - * \param green a 256 element array of 16-bit quantities representing the - * translation table for the green channel, or NULL - * \param blue a 256 element array of 16-bit quantities representing the - * translation table for the blue channel, or NULL - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetWindowGammaRamp - */ -extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, - const Uint16 * red, - const Uint16 * green, - const Uint16 * blue); - -/** - * Get the gamma ramp for a given window's display. - * - * Despite the name and signature, this method retrieves the gamma ramp of the - * entire display, not an individual window. A window is considered to be - * owned by the display that contains the window's center pixel. (The index of - * this display can be retrieved using SDL_GetWindowDisplayIndex().) - * - * \param window the window used to select the display whose gamma ramp will - * be queried - * \param red a 256 element array of 16-bit quantities filled in with the - * translation table for the red channel, or NULL - * \param green a 256 element array of 16-bit quantities filled in with the - * translation table for the green channel, or NULL - * \param blue a 256 element array of 16-bit quantities filled in with the - * translation table for the blue channel, or NULL - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SetWindowGammaRamp - */ -extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, - Uint16 * red, - Uint16 * green, - Uint16 * blue); - -/** - * Possible return values from the SDL_HitTest callback. - * - * \sa SDL_HitTest - */ -typedef enum -{ - SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ - SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ - SDL_HITTEST_RESIZE_TOPLEFT, - SDL_HITTEST_RESIZE_TOP, - SDL_HITTEST_RESIZE_TOPRIGHT, - SDL_HITTEST_RESIZE_RIGHT, - SDL_HITTEST_RESIZE_BOTTOMRIGHT, - SDL_HITTEST_RESIZE_BOTTOM, - SDL_HITTEST_RESIZE_BOTTOMLEFT, - SDL_HITTEST_RESIZE_LEFT -} SDL_HitTestResult; - -/** - * Callback used for hit-testing. - * - * \param win the SDL_Window where hit-testing was set on - * \param area an SDL_Point which should be hit-tested - * \param data what was passed as `callback_data` to SDL_SetWindowHitTest() - * \return an SDL_HitTestResult value. - * - * \sa SDL_SetWindowHitTest - */ -typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, - const SDL_Point *area, - void *data); - -/** - * Provide a callback that decides if a window region has special properties. - * - * Normally windows are dragged and resized by decorations provided by the - * system window manager (a title bar, borders, etc), but for some apps, it - * makes sense to drag them from somewhere else inside the window itself; for - * example, one might have a borderless window that wants to be draggable from - * any part, or simulate its own title bar, etc. - * - * This function lets the app provide a callback that designates pieces of a - * given window as special. This callback is run during event processing if we - * need to tell the OS to treat a region of the window specially; the use of - * this callback is known as "hit testing." - * - * Mouse input may not be delivered to your application if it is within a - * special area; the OS will often apply that input to moving the window or - * resizing the window and not deliver it to the application. - * - * Specifying NULL for a callback disables hit-testing. Hit-testing is - * disabled by default. - * - * Platforms that don't support this functionality will return -1 - * unconditionally, even if you're attempting to disable hit-testing. - * - * Your callback may fire at any time, and its firing does not indicate any - * specific behavior (for example, on Windows, this certainly might fire when - * the OS is deciding whether to drag your window, but it fires for lots of - * other reasons, too, some unrelated to anything you probably care about _and - * when the mouse isn't actually at the location it is testing_). Since this - * can fire at any time, you should try to keep your callback efficient, - * devoid of allocations, etc. - * - * \param window the window to set hit-testing on - * \param callback the function to call when doing a hit-test - * \param callback_data an app-defined void pointer passed to **callback** - * \returns 0 on success or -1 on error (including unsupported); call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - */ -extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, - SDL_HitTest callback, - void *callback_data); - -/** - * Request a window to demand attention from the user. - * - * \param window the window to be flashed - * \param operation the flash operation - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.16. - */ -extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation); - -/** - * Destroy a window. - * - * If `window` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid window". See SDL_GetError(). - * - * \param window the window to destroy - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateWindow - * \sa SDL_CreateWindowFrom - */ -extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); - - -/** - * Check whether the screensaver is currently enabled. - * - * The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2 - * the screensaver was enabled by default. - * - * The default can also be changed using `SDL_HINT_VIDEO_ALLOW_SCREENSAVER`. - * - * \returns SDL_TRUE if the screensaver is enabled, SDL_FALSE if it is - * disabled. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DisableScreenSaver - * \sa SDL_EnableScreenSaver - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); - -/** - * Allow the screen to be blanked by a screen saver. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_DisableScreenSaver - * \sa SDL_IsScreenSaverEnabled - */ -extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); - -/** - * Prevent the screen from being blanked by a screen saver. - * - * If you disable the screensaver, it is automatically re-enabled when SDL - * quits. - * - * The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2 - * the screensaver was enabled by default. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_EnableScreenSaver - * \sa SDL_IsScreenSaverEnabled - */ -extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); - - -/** - * \name OpenGL support functions - */ -/* @{ */ - -/** - * Dynamically load an OpenGL library. - * - * This should be done after initializing the video driver, but before - * creating any OpenGL windows. If no OpenGL library is loaded, the default - * library will be loaded upon creation of the first OpenGL window. - * - * If you do this, you need to retrieve all of the GL functions used in your - * program from the dynamic library using SDL_GL_GetProcAddress(). - * - * \param path the platform dependent OpenGL library name, or NULL to open the - * default OpenGL library - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_GetProcAddress - * \sa SDL_GL_UnloadLibrary - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * Get an OpenGL function by name. - * - * If the GL library is loaded at runtime with SDL_GL_LoadLibrary(), then all - * GL functions must be retrieved this way. Usually this is used to retrieve - * function pointers to OpenGL extensions. - * - * There are some quirks to looking up OpenGL functions that require some - * extra care from the application. If you code carefully, you can handle - * these quirks without any platform-specific code, though: - * - * - On Windows, function pointers are specific to the current GL context; - * this means you need to have created a GL context and made it current - * before calling SDL_GL_GetProcAddress(). If you recreate your context or - * create a second context, you should assume that any existing function - * pointers aren't valid to use with it. This is (currently) a - * Windows-specific limitation, and in practice lots of drivers don't suffer - * this limitation, but it is still the way the wgl API is documented to - * work and you should expect crashes if you don't respect it. Store a copy - * of the function pointers that comes and goes with context lifespan. - * - On X11, function pointers returned by this function are valid for any - * context, and can even be looked up before a context is created at all. - * This means that, for at least some common OpenGL implementations, if you - * look up a function that doesn't exist, you'll get a non-NULL result that - * is _NOT_ safe to call. You must always make sure the function is actually - * available for a given GL context before calling it, by checking for the - * existence of the appropriate extension with SDL_GL_ExtensionSupported(), - * or verifying that the version of OpenGL you're using offers the function - * as core functionality. - * - Some OpenGL drivers, on all platforms, *will* return NULL if a function - * isn't supported, but you can't count on this behavior. Check for - * extensions you use, and if you get a NULL anyway, act as if that - * extension wasn't available. This is probably a bug in the driver, but you - * can code defensively for this scenario anyhow. - * - Just because you're on Linux/Unix, don't assume you'll be using X11. - * Next-gen display servers are waiting to replace it, and may or may not - * make the same promises about function pointers. - * - OpenGL function pointers must be declared `APIENTRY` as in the example - * code. This will ensure the proper calling convention is followed on - * platforms where this matters (Win32) thereby avoiding stack corruption. - * - * \param proc the name of an OpenGL function - * \returns a pointer to the named OpenGL function. The returned pointer - * should be cast to the appropriate function signature. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_ExtensionSupported - * \sa SDL_GL_LoadLibrary - * \sa SDL_GL_UnloadLibrary - */ -extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); - -/** - * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_LoadLibrary - */ -extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); - -/** - * Check if an OpenGL extension is supported for the current context. - * - * This function operates on the current GL context; you must have created a - * context and it must be current before calling this function. Do not assume - * that all contexts you create will have the same set of extensions - * available, or that recreating an existing context will offer the same - * extensions again. - * - * While it's probably not a massive overhead, this function is not an O(1) - * operation. Check the extensions you care about after creating the GL - * context and save that information somewhere instead of calling the function - * every time you need to know. - * - * \param extension the name of the extension to check - * \returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char - *extension); - -/** - * Reset all previously set OpenGL context attributes to their default values. - * - * \since This function is available since SDL 2.0.2. - * - * \sa SDL_GL_GetAttribute - * \sa SDL_GL_SetAttribute - */ -extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); - -/** - * Set an OpenGL window attribute before window creation. - * - * This function sets the OpenGL attribute `attr` to `value`. The requested - * attributes should be set before creating an OpenGL window. You should use - * SDL_GL_GetAttribute() to check the values after creating the OpenGL - * context, since the values obtained can differ from the requested ones. - * - * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to set - * \param value the desired value for the attribute - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_GetAttribute - * \sa SDL_GL_ResetAttributes - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * Get the actual value for an attribute from the current context. - * - * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to get - * \param value a pointer filled in with the current value of `attr` - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_ResetAttributes - * \sa SDL_GL_SetAttribute - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); - -/** - * Create an OpenGL context for an OpenGL window, and make it current. - * - * Windows users new to OpenGL should note that, for historical reasons, GL - * functions added after OpenGL version 1.1 are not available by default. - * Those functions must be loaded at run-time, either with an OpenGL - * extension-handling library or with SDL_GL_GetProcAddress() and its related - * functions. - * - * SDL_GLContext is an alias for `void *`. It's opaque to the application. - * - * \param window the window to associate with the context - * \returns the OpenGL context associated with `window` or NULL on error; call - * SDL_GetError() for more details. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_DeleteContext - * \sa SDL_GL_MakeCurrent - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * - window); - -/** - * Set up an OpenGL context for rendering into an OpenGL window. - * - * The context must have been created with a compatible window. - * - * \param window the window to associate with the context - * \param context the OpenGL context to associate with the window - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_CreateContext - */ -extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, - SDL_GLContext context); - -/** - * Get the currently active OpenGL window. - * - * \returns the currently active OpenGL window on success or NULL on failure; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); - -/** - * Get the currently active OpenGL context. - * - * \returns the currently active OpenGL context or NULL on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_MakeCurrent - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); - -/** - * Get the size of a window's underlying drawable in pixels. - * - * This returns info useful for calling glViewport(). - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a - * platform with high-DPI support (Apple calls this "Retina"), and not - * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. - * - * \param window the window from which the drawable size should be queried - * \param w a pointer to variable for storing the width in pixels, may be NULL - * \param h a pointer to variable for storing the height in pixels, may be - * NULL - * - * \since This function is available since SDL 2.0.1. - * - * \sa SDL_CreateWindow - * \sa SDL_GetWindowSize - */ -extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, - int *h); - -/** - * Set the swap interval for the current OpenGL context. - * - * Some systems allow specifying -1 for the interval, to enable adaptive - * vsync. Adaptive vsync works the same as vsync, but if you've already missed - * the vertical retrace for a given frame, it swaps buffers immediately, which - * might be less jarring for the user during occasional framerate drops. If an - * application requests adaptive vsync and the system does not support it, - * this function will fail and return -1. In such a case, you should probably - * retry the call with 1 for the interval. - * - * Adaptive vsync is implemented for some glX drivers with - * GLX_EXT_swap_control_tear, and for some Windows drivers with - * WGL_EXT_swap_control_tear. - * - * Read more on the Khronos wiki: - * https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync - * - * \param interval 0 for immediate updates, 1 for updates synchronized with - * the vertical retrace, -1 for adaptive vsync - * \returns 0 on success or -1 if setting the swap interval is not supported; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_GetSwapInterval - */ -extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); - -/** - * Get the swap interval for the current OpenGL context. - * - * If the system can't determine the swap interval, or there isn't a valid - * current context, this function will return 0 as a safe default. - * - * \returns 0 if there is no vertical retrace synchronization, 1 if the buffer - * swap is synchronized with the vertical retrace, and -1 if late - * swaps happen immediately instead of waiting for the next retrace; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_SetSwapInterval - */ -extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); - -/** - * Update a window with OpenGL rendering. - * - * This is used with double-buffered OpenGL contexts, which are the default. - * - * On macOS, make sure you bind 0 to the draw framebuffer before swapping the - * window, otherwise nothing will happen. If you aren't using - * glBindFramebuffer(), this is the default and you won't have to do anything - * extra. - * - * \param window the window to change - * - * \since This function is available since SDL 2.0.0. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); - -/** - * Delete an OpenGL context. - * - * \param context the OpenGL context to be deleted - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GL_CreateContext - */ -extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); - -/* @} *//* OpenGL support functions */ - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_video_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/hwcodec/externals/SDL/include/SDL_vulkan.h b/libs/hwcodec/externals/SDL/include/SDL_vulkan.h deleted file mode 100644 index ab86a0b8..00000000 --- a/libs/hwcodec/externals/SDL/include/SDL_vulkan.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 2017, Mark Callow - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_vulkan.h - * - * Header file for functions to creating Vulkan surfaces on SDL windows. - */ - -#ifndef SDL_vulkan_h_ -#define SDL_vulkan_h_ - -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Avoid including vulkan.h, don't define VkInstance if it's already included */ -#ifdef VULKAN_H_ -#define NO_SDL_VULKAN_TYPEDEFS -#endif -#ifndef NO_SDL_VULKAN_TYPEDEFS -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; - -#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; -#else -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; -#endif - -VK_DEFINE_HANDLE(VkInstance) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - -#endif /* !NO_SDL_VULKAN_TYPEDEFS */ - -typedef VkInstance SDL_vulkanInstance; -typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */ - -/** - * \name Vulkan support functions - * - * \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API - * is compatable with Tizen's implementation of Vulkan in SDL. - */ -/* @{ */ - -/** - * Dynamically load the Vulkan loader library. - * - * This should be called after initializing the video driver, but before - * creating any Vulkan windows. If no Vulkan loader library is loaded, the - * default library will be loaded upon creation of the first Vulkan window. - * - * It is fairly common for Vulkan applications to link with libvulkan instead - * of explicitly loading it at run time. This will work with SDL provided the - * application links to a dynamic library and both it and SDL use the same - * search path. - * - * If you specify a non-NULL `path`, an application should retrieve all of the - * Vulkan functions it uses from the dynamic library using - * SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points - * to the same vulkan loader library the application linked to. - * - * On Apple devices, if `path` is NULL, SDL will attempt to find the - * `vkGetInstanceProcAddr` address within all the Mach-O images of the current - * process. This is because it is fairly common for Vulkan applications to - * link with libvulkan (and historically MoltenVK was provided as a static - * library). If it is not found, on macOS, SDL will attempt to load - * `vulkan.framework/vulkan`, `libvulkan.1.dylib`, - * `MoltenVK.framework/MoltenVK`, and `libMoltenVK.dylib`, in that order. On - * iOS, SDL will attempt to load `libMoltenVK.dylib`. Applications using a - * dynamic framework or .dylib must ensure it is included in its application - * bundle. - * - * On non-Apple devices, application linking with a static libvulkan is not - * supported. Either do not link to the Vulkan loader or link to a dynamic - * library version. - * - * \param path The platform dependent Vulkan loader library name or NULL - * \returns 0 on success or -1 if the library couldn't be loaded; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_Vulkan_GetVkInstanceProcAddr - * \sa SDL_Vulkan_UnloadLibrary - */ -extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); - -/** - * Get the address of the `vkGetInstanceProcAddr` function. - * - * This should be called after either calling SDL_Vulkan_LoadLibrary() or - * creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag. - * - * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error. - * - * \since This function is available since SDL 2.0.6. - */ -extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void); - -/** - * Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary() - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_Vulkan_LoadLibrary - */ -extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); - -/** - * Get the names of the Vulkan instance extensions needed to create a surface - * with SDL_Vulkan_CreateSurface. - * - * If `pNames` is NULL, then the number of required Vulkan instance extensions - * is returned in `pCount`. Otherwise, `pCount` must point to a variable set - * to the number of elements in the `pNames` array, and on return the variable - * is overwritten with the number of names actually written to `pNames`. If - * `pCount` is less than the number of required extensions, at most `pCount` - * structures will be written. If `pCount` is smaller than the number of - * required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to - * indicate that not all the required extensions were returned. - * - * The `window` parameter is currently needed to be valid as of SDL 2.0.8, - * however, this parameter will likely be removed in future releases - * - * \param window A window for which the required Vulkan instance extensions - * should be retrieved (will be deprecated in a future release) - * \param pCount A pointer to an unsigned int corresponding to the number of - * extensions to be returned - * \param pNames NULL or a pointer to an array to be filled with required - * Vulkan instance extensions - * \returns SDL_TRUE on success, SDL_FALSE on error. - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_Vulkan_CreateSurface - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, - unsigned int *pCount, - const char **pNames); - -/** - * Create a Vulkan rendering surface for a window. - * - * The `window` must have been created with the `SDL_WINDOW_VULKAN` flag and - * `instance` must have been created with extensions returned by - * SDL_Vulkan_GetInstanceExtensions() enabled. - * - * \param window The window to which to attach the Vulkan surface - * \param instance The Vulkan instance handle - * \param surface A pointer to a VkSurfaceKHR handle to output the newly - * created surface - * \returns SDL_TRUE on success, SDL_FALSE on error. - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_Vulkan_GetInstanceExtensions - * \sa SDL_Vulkan_GetDrawableSize - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, - VkInstance instance, - VkSurfaceKHR* surface); - -/** - * Get the size of the window's underlying drawable dimensions in pixels. - * - * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a - * platform with high-DPI support (Apple calls this "Retina"), and not - * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. - * - * \param window an SDL_Window for which the size is to be queried - * \param w Pointer to the variable to write the width to or NULL - * \param h Pointer to the variable to write the height to or NULL - * - * \since This function is available since SDL 2.0.6. - * - * \sa SDL_GetWindowSize - * \sa SDL_CreateWindow - * \sa SDL_Vulkan_CreateSurface - */ -extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window, - int *w, int *h); - -/* @} *//* Vulkan support functions */ - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* SDL_vulkan_h_ */ diff --git a/libs/hwcodec/externals/SDL/include/begin_code.h b/libs/hwcodec/externals/SDL/include/begin_code.h deleted file mode 100644 index 1f01e0bc..00000000 --- a/libs/hwcodec/externals/SDL/include/begin_code.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file begin_code.h - * - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) - */ - -/* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -#ifndef SDL_DEPRECATED -# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ -# define SDL_DEPRECATED __attribute__((deprecated)) -# else -# define SDL_DEPRECATED -# endif -#endif - -#ifndef SDL_UNUSED -# ifdef __GNUC__ -# define SDL_UNUSED __attribute__((unused)) -# else -# define SDL_UNUSED -# endif -#endif - -/* Some compilers use a special export keyword */ -#ifndef DECLSPEC -# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__) -# ifdef DLL_EXPORT -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/* By default SDL uses the C calling convention */ -#ifndef SDLCALL -#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__) -#define SDLCALL __cdecl -#elif defined(__OS2__) || defined(__EMX__) -#define SDLCALL _System -# if defined (__GNUC__) && !defined(_System) -# define _System /* for old EMX/GCC compat. */ -# endif -#else -#define SDLCALL -#endif -#endif /* SDLCALL */ - -/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ -#ifdef __SYMBIAN32__ -#undef DECLSPEC -#define DECLSPEC -#endif /* __SYMBIAN32__ */ - -/* Force structure packing at 4 byte alignment. - This is necessary if the header is included in code which has structure - packing set to an alternate value, say for loading structures from disk. - The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wpragma-pack" -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#ifdef _WIN64 -/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ -#pragma pack(push,8) -#else -#pragma pack(push,4) -#endif -#endif /* Compiler needs structure packing set */ - -#ifndef SDL_INLINE -#if defined(__GNUC__) -#define SDL_INLINE __inline__ -#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) || defined(__CC_ARM) -#define SDL_INLINE __inline -#ifndef __inline__ -#define __inline__ __inline -#endif -#else -#define SDL_INLINE inline -#ifndef __inline__ -#define __inline__ inline -#endif -#endif -#endif /* SDL_INLINE not defined */ - -#ifndef SDL_FORCE_INLINE -#if defined(_MSC_VER) -#define SDL_FORCE_INLINE __forceinline -#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) -#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ -#else -#define SDL_FORCE_INLINE static SDL_INLINE -#endif -#endif /* SDL_FORCE_INLINE not defined */ - -#ifndef SDL_NORETURN -#if defined(__GNUC__) -#define SDL_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define SDL_NORETURN __declspec(noreturn) -#else -#define SDL_NORETURN -#endif -#endif /* SDL_NORETURN not defined */ - -/* Apparently this is needed by several Windows compilers */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ - -#ifndef SDL_FALLTHROUGH -#if (defined(__cplusplus) && __cplusplus >= 201703L) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) -#define SDL_FALLTHROUGH [[fallthrough]] -#else -#if defined(__has_attribute) -#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__) -#else -#define _HAS_FALLTHROUGH 0 -#endif /* __has_attribute */ -#if _HAS_FALLTHROUGH && \ - ((defined(__GNUC__) && __GNUC__ >= 7) || \ - (defined(__clang_major__) && __clang_major__ >= 10)) -#define SDL_FALLTHROUGH __attribute__((__fallthrough__)) -#else -#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */ -#endif /* _HAS_FALLTHROUGH */ -#undef _HAS_FALLTHROUGH -#endif /* C++17 or C2x */ -#endif /* SDL_FALLTHROUGH not defined */ diff --git a/libs/hwcodec/externals/SDL/include/close_code.h b/libs/hwcodec/externals/SDL/include/close_code.h deleted file mode 100644 index 874a926b..00000000 --- a/libs/hwcodec/externals/SDL/include/close_code.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2023 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file close_code.h - * - * This file reverses the effects of begin_code.h and should be included - * after you finish any function and structure declarations in your headers - */ - -#ifndef _begin_code_h -#error close_code.h included without matching begin_code.h -#endif -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(pop) -#endif /* Compiler needs structure packing set */ diff --git a/libs/hwcodec/externals/SDL/lib/x64/SDL2.dll b/libs/hwcodec/externals/SDL/lib/x64/SDL2.dll deleted file mode 100644 index d0050c95..00000000 Binary files a/libs/hwcodec/externals/SDL/lib/x64/SDL2.dll and /dev/null differ diff --git a/libs/hwcodec/externals/SDL/lib/x64/SDL2.lib b/libs/hwcodec/externals/SDL/lib/x64/SDL2.lib deleted file mode 100644 index f966c7ce..00000000 Binary files a/libs/hwcodec/externals/SDL/lib/x64/SDL2.lib and /dev/null differ diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.cpp b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.cpp deleted file mode 100644 index 0086698b..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.cpp +++ /dev/null @@ -1,860 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include - -#include "NvDecoder/NvDecoder.h" - -#define START_TIMER auto start = std::chrono::high_resolution_clock::now(); - -#define STOP_TIMER(print_message) int64_t elapsedTime = std::chrono::duration_cast( \ - std::chrono::high_resolution_clock::now() - start).count(); \ - std::cout << print_message << \ - elapsedTime \ - << " ms " << std::endl; - -#define CUDA_DRVAPI_CALL( call ) \ - do \ - { \ - CUresult err__ = m_cudl->call; \ - if (err__ != CUDA_SUCCESS) \ - { \ - const char *szErrName = NULL; \ - m_cudl->cuGetErrorName(err__, &szErrName); \ - std::ostringstream errorLog; \ - errorLog << "CUDA driver API error " << szErrName ; \ - throw NVDECException::makeNVDECException(errorLog.str(), err__, __FUNCTION__, __FILE__, __LINE__); \ - } \ - } \ - while (0) - -static const char * GetVideoCodecString(cudaVideoCodec eCodec) { - static struct { - cudaVideoCodec eCodec; - const char *name; - } aCodecName [] = { - { cudaVideoCodec_MPEG1, "MPEG-1" }, - { cudaVideoCodec_MPEG2, "MPEG-2" }, - { cudaVideoCodec_MPEG4, "MPEG-4 (ASP)" }, - { cudaVideoCodec_VC1, "VC-1/WMV" }, - { cudaVideoCodec_H264, "AVC/H.264" }, - { cudaVideoCodec_JPEG, "M-JPEG" }, - { cudaVideoCodec_H264_SVC, "H.264/SVC" }, - { cudaVideoCodec_H264_MVC, "H.264/MVC" }, - { cudaVideoCodec_HEVC, "H.265/HEVC" }, - { cudaVideoCodec_VP8, "VP8" }, - { cudaVideoCodec_VP9, "VP9" }, - { cudaVideoCodec_AV1, "AV1" }, - { cudaVideoCodec_NumCodecs, "Invalid" }, - { cudaVideoCodec_YUV420, "YUV 4:2:0" }, - { cudaVideoCodec_YV12, "YV12 4:2:0" }, - { cudaVideoCodec_NV12, "NV12 4:2:0" }, - { cudaVideoCodec_YUYV, "YUYV 4:2:2" }, - { cudaVideoCodec_UYVY, "UYVY 4:2:2" }, - }; - - if (eCodec >= 0 && eCodec <= cudaVideoCodec_NumCodecs) { - return aCodecName[eCodec].name; - } - for (int i = cudaVideoCodec_NumCodecs + 1; i < sizeof(aCodecName) / sizeof(aCodecName[0]); i++) { - if (eCodec == aCodecName[i].eCodec) { - return aCodecName[eCodec].name; - } - } - return "Unknown"; -} - -static const char * GetVideoChromaFormatString(cudaVideoChromaFormat eChromaFormat) { - static struct { - cudaVideoChromaFormat eChromaFormat; - const char *name; - } aChromaFormatName[] = { - { cudaVideoChromaFormat_Monochrome, "YUV 400 (Monochrome)" }, - { cudaVideoChromaFormat_420, "YUV 420" }, - { cudaVideoChromaFormat_422, "YUV 422" }, - { cudaVideoChromaFormat_444, "YUV 444" }, - }; - - if (eChromaFormat >= 0 && eChromaFormat < sizeof(aChromaFormatName) / sizeof(aChromaFormatName[0])) { - return aChromaFormatName[eChromaFormat].name; - } - return "Unknown"; -} - -static float GetChromaHeightFactor(cudaVideoSurfaceFormat eSurfaceFormat) -{ - float factor = 0.5; - switch (eSurfaceFormat) - { - case cudaVideoSurfaceFormat_NV12: - case cudaVideoSurfaceFormat_P016: - factor = 0.5; - break; - case cudaVideoSurfaceFormat_YUV444: - case cudaVideoSurfaceFormat_YUV444_16Bit: - factor = 1.0; - break; - } - - return factor; -} - -static int GetChromaPlaneCount(cudaVideoSurfaceFormat eSurfaceFormat) -{ - int numPlane = 1; - switch (eSurfaceFormat) - { - case cudaVideoSurfaceFormat_NV12: - case cudaVideoSurfaceFormat_P016: - numPlane = 1; - break; - case cudaVideoSurfaceFormat_YUV444: - case cudaVideoSurfaceFormat_YUV444_16Bit: - numPlane = 2; - break; - } - - return numPlane; -} - -std::map NvDecoder::sessionOverHead = { {0,0}, {1,0} }; - -/** -* @brief This function is used to get codec string from codec id -*/ -const char *NvDecoder::GetCodecString(cudaVideoCodec eCodec) -{ - return GetVideoCodecString(eCodec); -} - -/* Called when the parser encounters sequence header for AV1 SVC content -* return value interpretation: -* < 0 : fail, >=0: succeeded (bit 0-9: currOperatingPoint, bit 10-10: bDispAllLayer, bit 11-30: reserved, must be set 0) -*/ -int NvDecoder::GetOperatingPoint(CUVIDOPERATINGPOINTINFO *pOPInfo) -{ - if (pOPInfo->codec == cudaVideoCodec_AV1) - { - if (pOPInfo->av1.operating_points_cnt > 1) - { - // clip has SVC enabled - if (m_nOperatingPoint >= pOPInfo->av1.operating_points_cnt) - m_nOperatingPoint = 0; - - printf("AV1 SVC clip: operating point count %d ", pOPInfo->av1.operating_points_cnt); - printf("Selected operating point: %d, IDC 0x%x bOutputAllLayers %d\n", m_nOperatingPoint, pOPInfo->av1.operating_points_idc[m_nOperatingPoint], m_bDispAllLayers); - return (m_nOperatingPoint | (m_bDispAllLayers << 10)); - } - } - return -1; -} - -/* Return value from HandleVideoSequence() are interpreted as : -* 0: fail, 1: succeeded, > 1: override dpb size of parser (set by CUVIDPARSERPARAMS::ulMaxNumDecodeSurfaces while creating parser) -*/ -int NvDecoder::HandleVideoSequence(CUVIDEOFORMAT *pVideoFormat) -{ - START_TIMER - m_videoInfo.str(""); - m_videoInfo.clear(); - m_videoInfo << "Video Input Information" << std::endl - << "\tCodec : " << GetVideoCodecString(pVideoFormat->codec) << std::endl - << "\tFrame rate : " << pVideoFormat->frame_rate.numerator << "/" << pVideoFormat->frame_rate.denominator - << " = " << 1.0 * pVideoFormat->frame_rate.numerator / pVideoFormat->frame_rate.denominator << " fps" << std::endl - << "\tSequence : " << (pVideoFormat->progressive_sequence ? "Progressive" : "Interlaced") << std::endl - << "\tCoded size : [" << pVideoFormat->coded_width << ", " << pVideoFormat->coded_height << "]" << std::endl - << "\tDisplay area : [" << pVideoFormat->display_area.left << ", " << pVideoFormat->display_area.top << ", " - << pVideoFormat->display_area.right << ", " << pVideoFormat->display_area.bottom << "]" << std::endl - << "\tChroma : " << GetVideoChromaFormatString(pVideoFormat->chroma_format) << std::endl - << "\tBit depth : " << pVideoFormat->bit_depth_luma_minus8 + 8 - ; - m_videoInfo << std::endl; - m_latestVideoFormat = *pVideoFormat; - - int nDecodeSurface = pVideoFormat->min_num_decode_surfaces; - - CUVIDDECODECAPS decodecaps; - memset(&decodecaps, 0, sizeof(decodecaps)); - - decodecaps.eCodecType = pVideoFormat->codec; - decodecaps.eChromaFormat = pVideoFormat->chroma_format; - decodecaps.nBitDepthMinus8 = pVideoFormat->bit_depth_luma_minus8; - - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - NVDEC_API_CALL(cuvidGetDecoderCaps(&decodecaps)); - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - - if(!decodecaps.bIsSupported){ - NVDEC_THROW_ERROR("Codec not supported on this GPU", CUDA_ERROR_NOT_SUPPORTED); - return nDecodeSurface; - } - - if ((pVideoFormat->coded_width > decodecaps.nMaxWidth) || - (pVideoFormat->coded_height > decodecaps.nMaxHeight)){ - - std::ostringstream errorString; - errorString << std::endl - << "Resolution : " << pVideoFormat->coded_width << "x" << pVideoFormat->coded_height << std::endl - << "Max Supported (wxh) : " << decodecaps.nMaxWidth << "x" << decodecaps.nMaxHeight << std::endl - << "Resolution not supported on this GPU"; - - const std::string cErr = errorString.str(); - NVDEC_THROW_ERROR(cErr, CUDA_ERROR_NOT_SUPPORTED); - return nDecodeSurface; - } - - if ((pVideoFormat->coded_width>>4)*(pVideoFormat->coded_height>>4) > decodecaps.nMaxMBCount){ - - std::ostringstream errorString; - errorString << std::endl - << "MBCount : " << (pVideoFormat->coded_width >> 4)*(pVideoFormat->coded_height >> 4) << std::endl - << "Max Supported mbcnt : " << decodecaps.nMaxMBCount << std::endl - << "MBCount not supported on this GPU"; - - const std::string cErr = errorString.str(); - NVDEC_THROW_ERROR(cErr, CUDA_ERROR_NOT_SUPPORTED); - return nDecodeSurface; - } - - if (m_nWidth && m_nLumaHeight && m_nChromaHeight) { - - // cuvidCreateDecoder() has been called before, and now there's possible config change - return ReconfigureDecoder(pVideoFormat); - } - - // eCodec has been set in the constructor (for parser). Here it's set again for potential correction - m_eCodec = pVideoFormat->codec; - m_eChromaFormat = pVideoFormat->chroma_format; - m_nBitDepthMinus8 = pVideoFormat->bit_depth_luma_minus8; - m_nBPP = m_nBitDepthMinus8 > 0 ? 2 : 1; - - // Set the output surface format same as chroma format - if (m_eChromaFormat == cudaVideoChromaFormat_420 || cudaVideoChromaFormat_Monochrome) - m_eOutputFormat = pVideoFormat->bit_depth_luma_minus8 ? cudaVideoSurfaceFormat_P016 : cudaVideoSurfaceFormat_NV12; - else if (m_eChromaFormat == cudaVideoChromaFormat_444) - m_eOutputFormat = pVideoFormat->bit_depth_luma_minus8 ? cudaVideoSurfaceFormat_YUV444_16Bit : cudaVideoSurfaceFormat_YUV444; - else if (m_eChromaFormat == cudaVideoChromaFormat_422) - m_eOutputFormat = cudaVideoSurfaceFormat_NV12; // no 4:2:2 output format supported yet so make 420 default - - // Check if output format supported. If not, check falback options - if (!(decodecaps.nOutputFormatMask & (1 << m_eOutputFormat))) - { - if (decodecaps.nOutputFormatMask & (1 << cudaVideoSurfaceFormat_NV12)) - m_eOutputFormat = cudaVideoSurfaceFormat_NV12; - else if (decodecaps.nOutputFormatMask & (1 << cudaVideoSurfaceFormat_P016)) - m_eOutputFormat = cudaVideoSurfaceFormat_P016; - else if (decodecaps.nOutputFormatMask & (1 << cudaVideoSurfaceFormat_YUV444)) - m_eOutputFormat = cudaVideoSurfaceFormat_YUV444; - else if (decodecaps.nOutputFormatMask & (1 << cudaVideoSurfaceFormat_YUV444_16Bit)) - m_eOutputFormat = cudaVideoSurfaceFormat_YUV444_16Bit; - else - NVDEC_THROW_ERROR("No supported output format found", CUDA_ERROR_NOT_SUPPORTED); - } - m_videoFormat = *pVideoFormat; - - CUVIDDECODECREATEINFO videoDecodeCreateInfo = { 0 }; - videoDecodeCreateInfo.CodecType = pVideoFormat->codec; - videoDecodeCreateInfo.ChromaFormat = pVideoFormat->chroma_format; - videoDecodeCreateInfo.OutputFormat = m_eOutputFormat; - videoDecodeCreateInfo.bitDepthMinus8 = pVideoFormat->bit_depth_luma_minus8; - if (pVideoFormat->progressive_sequence) - videoDecodeCreateInfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Weave; - else - videoDecodeCreateInfo.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive; - videoDecodeCreateInfo.ulNumOutputSurfaces = 2; - // With PreferCUVID, JPEG is still decoded by CUDA while video is decoded by NVDEC hardware - videoDecodeCreateInfo.ulCreationFlags = cudaVideoCreate_PreferCUVID; - videoDecodeCreateInfo.ulNumDecodeSurfaces = nDecodeSurface; - videoDecodeCreateInfo.vidLock = m_ctxLock; - videoDecodeCreateInfo.ulWidth = pVideoFormat->coded_width; - videoDecodeCreateInfo.ulHeight = pVideoFormat->coded_height; - // AV1 has max width/height of sequence in sequence header - if (pVideoFormat->codec == cudaVideoCodec_AV1 && pVideoFormat->seqhdr_data_length > 0) - { - // dont overwrite if it is already set from cmdline or reconfig.txt - if (!(m_nMaxWidth > pVideoFormat->coded_width || m_nMaxHeight > pVideoFormat->coded_height)) - { - CUVIDEOFORMATEX *vidFormatEx = (CUVIDEOFORMATEX *)pVideoFormat; - m_nMaxWidth = vidFormatEx->av1.max_width; - m_nMaxHeight = vidFormatEx->av1.max_height; - } - } - if (m_nMaxWidth < (int)pVideoFormat->coded_width) - m_nMaxWidth = pVideoFormat->coded_width; - if (m_nMaxHeight < (int)pVideoFormat->coded_height) - m_nMaxHeight = pVideoFormat->coded_height; - videoDecodeCreateInfo.ulMaxWidth = m_nMaxWidth; - videoDecodeCreateInfo.ulMaxHeight = m_nMaxHeight; - - if (!(m_cropRect.r && m_cropRect.b) && !(m_resizeDim.w && m_resizeDim.h)) { - m_nWidth = pVideoFormat->display_area.right - pVideoFormat->display_area.left; - m_nLumaHeight = pVideoFormat->display_area.bottom - pVideoFormat->display_area.top; - videoDecodeCreateInfo.ulTargetWidth = pVideoFormat->coded_width; - videoDecodeCreateInfo.ulTargetHeight = pVideoFormat->coded_height; - } else { - if (m_resizeDim.w && m_resizeDim.h) { - videoDecodeCreateInfo.display_area.left = pVideoFormat->display_area.left; - videoDecodeCreateInfo.display_area.top = pVideoFormat->display_area.top; - videoDecodeCreateInfo.display_area.right = pVideoFormat->display_area.right; - videoDecodeCreateInfo.display_area.bottom = pVideoFormat->display_area.bottom; - m_nWidth = m_resizeDim.w; - m_nLumaHeight = m_resizeDim.h; - } - - if (m_cropRect.r && m_cropRect.b) { - videoDecodeCreateInfo.display_area.left = m_cropRect.l; - videoDecodeCreateInfo.display_area.top = m_cropRect.t; - videoDecodeCreateInfo.display_area.right = m_cropRect.r; - videoDecodeCreateInfo.display_area.bottom = m_cropRect.b; - m_nWidth = m_cropRect.r - m_cropRect.l; - m_nLumaHeight = m_cropRect.b - m_cropRect.t; - } - videoDecodeCreateInfo.ulTargetWidth = m_nWidth; - videoDecodeCreateInfo.ulTargetHeight = m_nLumaHeight; - } - - m_nChromaHeight = (int)(ceil(m_nLumaHeight * GetChromaHeightFactor(m_eOutputFormat))); - m_nNumChromaPlanes = GetChromaPlaneCount(m_eOutputFormat); - m_nSurfaceHeight = videoDecodeCreateInfo.ulTargetHeight; - m_nSurfaceWidth = videoDecodeCreateInfo.ulTargetWidth; - m_displayRect.b = videoDecodeCreateInfo.display_area.bottom; - m_displayRect.t = videoDecodeCreateInfo.display_area.top; - m_displayRect.l = videoDecodeCreateInfo.display_area.left; - m_displayRect.r = videoDecodeCreateInfo.display_area.right; - - m_videoInfo << "Video Decoding Params:" << std::endl - << "\tNum Surfaces : " << videoDecodeCreateInfo.ulNumDecodeSurfaces << std::endl - << "\tCrop : [" << videoDecodeCreateInfo.display_area.left << ", " << videoDecodeCreateInfo.display_area.top << ", " - << videoDecodeCreateInfo.display_area.right << ", " << videoDecodeCreateInfo.display_area.bottom << "]" << std::endl - << "\tResize : " << videoDecodeCreateInfo.ulTargetWidth << "x" << videoDecodeCreateInfo.ulTargetHeight << std::endl - << "\tDeinterlace : " << std::vector{"Weave", "Bob", "Adaptive"}[videoDecodeCreateInfo.DeinterlaceMode] - ; - m_videoInfo << std::endl; - - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - NVDEC_API_CALL(cuvidCreateDecoder(&m_hDecoder, &videoDecodeCreateInfo)); - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - STOP_TIMER("Session Initialization Time: "); - NvDecoder::addDecoderSessionOverHead(getDecoderSessionID(), elapsedTime); - return nDecodeSurface; -} - -int NvDecoder::ReconfigureDecoder(CUVIDEOFORMAT *pVideoFormat) -{ - if (pVideoFormat->bit_depth_luma_minus8 != m_videoFormat.bit_depth_luma_minus8 || pVideoFormat->bit_depth_chroma_minus8 != m_videoFormat.bit_depth_chroma_minus8){ - - NVDEC_THROW_ERROR("Reconfigure Not supported for bit depth change", CUDA_ERROR_NOT_SUPPORTED); - } - - if (pVideoFormat->chroma_format != m_videoFormat.chroma_format) { - - NVDEC_THROW_ERROR("Reconfigure Not supported for chroma format change", CUDA_ERROR_NOT_SUPPORTED); - } - - bool bDecodeResChange = !(pVideoFormat->coded_width == m_videoFormat.coded_width && pVideoFormat->coded_height == m_videoFormat.coded_height); - bool bDisplayRectChange = !(pVideoFormat->display_area.bottom == m_videoFormat.display_area.bottom && pVideoFormat->display_area.top == m_videoFormat.display_area.top \ - && pVideoFormat->display_area.left == m_videoFormat.display_area.left && pVideoFormat->display_area.right == m_videoFormat.display_area.right); - - int nDecodeSurface = pVideoFormat->min_num_decode_surfaces; - - if ((pVideoFormat->coded_width > m_nMaxWidth) || (pVideoFormat->coded_height > m_nMaxHeight)) { - // For VP9, let driver handle the change if new width/height > maxwidth/maxheight - if ((m_eCodec != cudaVideoCodec_VP9) || m_bReconfigExternal) - { - NVDEC_THROW_ERROR("Reconfigure Not supported when width/height > maxwidth/maxheight", CUDA_ERROR_NOT_SUPPORTED); - } - return 1; - } - - if (!bDecodeResChange && !m_bReconfigExtPPChange) { - // if the coded_width/coded_height hasn't changed but display resolution has changed, then need to update width/height for - // correct output without cropping. Example : 1920x1080 vs 1920x1088 - if (bDisplayRectChange) - { - m_nWidth = pVideoFormat->display_area.right - pVideoFormat->display_area.left; - m_nLumaHeight = pVideoFormat->display_area.bottom - pVideoFormat->display_area.top; - m_nChromaHeight = (int)ceil(m_nLumaHeight * GetChromaHeightFactor(m_eOutputFormat)); - m_nNumChromaPlanes = GetChromaPlaneCount(m_eOutputFormat); - } - - // no need for reconfigureDecoder(). Just return - return 1; - } - - CUVIDRECONFIGUREDECODERINFO reconfigParams = { 0 }; - - reconfigParams.ulWidth = m_videoFormat.coded_width = pVideoFormat->coded_width; - reconfigParams.ulHeight = m_videoFormat.coded_height = pVideoFormat->coded_height; - - // Dont change display rect and get scaled output from decoder. This will help display app to present apps smoothly - reconfigParams.display_area.bottom = m_displayRect.b; - reconfigParams.display_area.top = m_displayRect.t; - reconfigParams.display_area.left = m_displayRect.l; - reconfigParams.display_area.right = m_displayRect.r; - reconfigParams.ulTargetWidth = m_nSurfaceWidth; - reconfigParams.ulTargetHeight = m_nSurfaceHeight; - - // If external reconfigure is called along with resolution change even if post processing params is not changed, - // do full reconfigure params update - if ((m_bReconfigExternal && bDecodeResChange) || m_bReconfigExtPPChange) { - // update display rect and target resolution if requested explicitely - m_bReconfigExternal = false; - m_bReconfigExtPPChange = false; - m_videoFormat = *pVideoFormat; - if (!(m_cropRect.r && m_cropRect.b) && !(m_resizeDim.w && m_resizeDim.h)) { - m_nWidth = pVideoFormat->display_area.right - pVideoFormat->display_area.left; - m_nLumaHeight = pVideoFormat->display_area.bottom - pVideoFormat->display_area.top; - reconfigParams.ulTargetWidth = pVideoFormat->coded_width; - reconfigParams.ulTargetHeight = pVideoFormat->coded_height; - } - else { - if (m_resizeDim.w && m_resizeDim.h) { - reconfigParams.display_area.left = pVideoFormat->display_area.left; - reconfigParams.display_area.top = pVideoFormat->display_area.top; - reconfigParams.display_area.right = pVideoFormat->display_area.right; - reconfigParams.display_area.bottom = pVideoFormat->display_area.bottom; - m_nWidth = m_resizeDim.w; - m_nLumaHeight = m_resizeDim.h; - } - - if (m_cropRect.r && m_cropRect.b) { - reconfigParams.display_area.left = m_cropRect.l; - reconfigParams.display_area.top = m_cropRect.t; - reconfigParams.display_area.right = m_cropRect.r; - reconfigParams.display_area.bottom = m_cropRect.b; - m_nWidth = m_cropRect.r - m_cropRect.l; - m_nLumaHeight = m_cropRect.b - m_cropRect.t; - } - reconfigParams.ulTargetWidth = m_nWidth; - reconfigParams.ulTargetHeight = m_nLumaHeight; - } - - m_nChromaHeight = (int)ceil(m_nLumaHeight * GetChromaHeightFactor(m_eOutputFormat)); - m_nNumChromaPlanes = GetChromaPlaneCount(m_eOutputFormat); - m_nSurfaceHeight = reconfigParams.ulTargetHeight; - m_nSurfaceWidth = reconfigParams.ulTargetWidth; - m_displayRect.b = reconfigParams.display_area.bottom; - m_displayRect.t = reconfigParams.display_area.top; - m_displayRect.l = reconfigParams.display_area.left; - m_displayRect.r = reconfigParams.display_area.right; - } - - reconfigParams.ulNumDecodeSurfaces = nDecodeSurface; - - START_TIMER - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - NVDEC_API_CALL(cuvidReconfigureDecoder(m_hDecoder, &reconfigParams)); - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - STOP_TIMER("Session Reconfigure Time: "); - - return nDecodeSurface; -} - -int NvDecoder::setReconfigParams(const Rect *pCropRect, const Dim *pResizeDim) -{ - m_bReconfigExternal = true; - m_bReconfigExtPPChange = false; - if (pCropRect) - { - if (!((pCropRect->t == m_cropRect.t) && (pCropRect->l == m_cropRect.l) && - (pCropRect->b == m_cropRect.b) && (pCropRect->r == m_cropRect.r))) - { - m_bReconfigExtPPChange = true; - m_cropRect = *pCropRect; - } - } - if (pResizeDim) - { - if (!((pResizeDim->w == m_resizeDim.w) && (pResizeDim->h == m_resizeDim.h))) - { - m_bReconfigExtPPChange = true; - m_resizeDim = *pResizeDim; - } - } - - // Clear existing output buffers of different size - uint8_t *pFrame = NULL; - while (!m_vpFrame.empty()) - { - pFrame = m_vpFrame.back(); - m_vpFrame.pop_back(); - if (m_bUseDeviceFrame) - { - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - CUDA_DRVAPI_CALL(cuMemFree((CUdeviceptr)pFrame)); - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - } - else - { - delete pFrame; - } - } - - return 1; -} - -/* Return value from HandlePictureDecode() are interpreted as: -* 0: fail, >=1: succeeded -*/ -int NvDecoder::HandlePictureDecode(CUVIDPICPARAMS *pPicParams) { - if (!m_hDecoder) - { - NVDEC_THROW_ERROR("Decoder not initialized.", CUDA_ERROR_NOT_INITIALIZED); - return false; - } - m_nPicNumInDecodeOrder[pPicParams->CurrPicIdx] = m_nDecodePicCnt++; - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - NVDEC_API_CALL(cuvidDecodePicture(m_hDecoder, pPicParams)); - if (m_bForce_zero_latency && ((!pPicParams->field_pic_flag) || (pPicParams->second_field))) - { - CUVIDPARSERDISPINFO dispInfo; - memset(&dispInfo, 0, sizeof(dispInfo)); - dispInfo.picture_index = pPicParams->CurrPicIdx; - dispInfo.progressive_frame = !pPicParams->field_pic_flag; - dispInfo.top_field_first = pPicParams->bottom_field_flag ^ 1; - HandlePictureDisplay(&dispInfo); - } - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - return 1; -} - -/* Return value from HandlePictureDisplay() are interpreted as: -* 0: fail, >=1: succeeded -*/ -int NvDecoder::HandlePictureDisplay(CUVIDPARSERDISPINFO *pDispInfo) { - CUVIDPROCPARAMS videoProcessingParameters = {}; - videoProcessingParameters.progressive_frame = pDispInfo->progressive_frame; - videoProcessingParameters.second_field = pDispInfo->repeat_first_field + 1; - videoProcessingParameters.top_field_first = pDispInfo->top_field_first; - videoProcessingParameters.unpaired_field = pDispInfo->repeat_first_field < 0; - videoProcessingParameters.output_stream = m_cuvidStream; - - if (m_bExtractSEIMessage) - { - if (m_SEIMessagesDisplayOrder[pDispInfo->picture_index].pSEIData) - { - // Write SEI Message - uint8_t *seiBuffer = (uint8_t *)(m_SEIMessagesDisplayOrder[pDispInfo->picture_index].pSEIData); - uint32_t seiNumMessages = m_SEIMessagesDisplayOrder[pDispInfo->picture_index].sei_message_count; - CUSEIMESSAGE *seiMessagesInfo = m_SEIMessagesDisplayOrder[pDispInfo->picture_index].pSEIMessage; - if (m_fpSEI) - { - for (uint32_t i = 0; i < seiNumMessages; i++) - { - if (m_eCodec == cudaVideoCodec_H264 || cudaVideoCodec_H264_SVC || cudaVideoCodec_H264_MVC || cudaVideoCodec_HEVC) - { - switch (seiMessagesInfo[i].sei_message_type) - { - case SEI_TYPE_TIME_CODE: - { - HEVCSEITIMECODE *timecode = (HEVCSEITIMECODE *)seiBuffer; - fwrite(timecode, sizeof(HEVCSEITIMECODE), 1, m_fpSEI); - } - break; - case SEI_TYPE_USER_DATA_UNREGISTERED: - { - fwrite(seiBuffer, seiMessagesInfo[i].sei_message_size, 1, m_fpSEI); - } - break; - } - } - if (m_eCodec == cudaVideoCodec_AV1) - { - fwrite(seiBuffer, seiMessagesInfo[i].sei_message_size, 1, m_fpSEI); - } - seiBuffer += seiMessagesInfo[i].sei_message_size; - } - } - free(m_SEIMessagesDisplayOrder[pDispInfo->picture_index].pSEIData); - free(m_SEIMessagesDisplayOrder[pDispInfo->picture_index].pSEIMessage); - } - } - - CUdeviceptr dpSrcFrame = 0; - unsigned int nSrcPitch = 0; - CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext)); - NVDEC_API_CALL(cuvidMapVideoFrame(m_hDecoder, pDispInfo->picture_index, &dpSrcFrame, - &nSrcPitch, &videoProcessingParameters)); - - CUVIDGETDECODESTATUS DecodeStatus; - memset(&DecodeStatus, 0, sizeof(DecodeStatus)); - CUresult result = m_cvdl->cuvidGetDecodeStatus(m_hDecoder, pDispInfo->picture_index, &DecodeStatus); - if (result == CUDA_SUCCESS && (DecodeStatus.decodeStatus == cuvidDecodeStatus_Error || DecodeStatus.decodeStatus == cuvidDecodeStatus_Error_Concealed)) - { - printf("Decode Error occurred for picture %d\n", m_nPicNumInDecodeOrder[pDispInfo->picture_index]); - } - - uint8_t *pDecodedFrame = nullptr; - { - std::lock_guard lock(m_mtxVPFrame); - if ((unsigned)++m_nDecodedFrame > m_vpFrame.size()) - { - // Not enough frames in stock - m_nFrameAlloc++; - uint8_t *pFrame = NULL; - if (m_bUseDeviceFrame) - { - if (m_bDeviceFramePitched) - { - CUDA_DRVAPI_CALL(cuMemAllocPitch((CUdeviceptr *)&pFrame, &m_nDeviceFramePitch, GetWidth() * m_nBPP, m_nLumaHeight + (m_nChromaHeight * m_nNumChromaPlanes), 16)); - } - else - { - CUDA_DRVAPI_CALL(cuMemAlloc((CUdeviceptr *)&pFrame, GetFrameSize())); - } - } - else - { - pFrame = new uint8_t[GetFrameSize()]; - } - m_vpFrame.push_back(pFrame); - } - pDecodedFrame = m_vpFrame[m_nDecodedFrame - 1]; - } - - // Copy luma plane - CUDA_MEMCPY2D m = { 0 }; - m.srcMemoryType = CU_MEMORYTYPE_DEVICE; - m.srcDevice = dpSrcFrame; - m.srcPitch = nSrcPitch; - m.dstMemoryType = m_bUseDeviceFrame ? CU_MEMORYTYPE_DEVICE : CU_MEMORYTYPE_HOST; - m.dstDevice = (CUdeviceptr)(m.dstHost = pDecodedFrame); - m.dstPitch = m_nDeviceFramePitch ? m_nDeviceFramePitch : GetWidth() * m_nBPP; - m.WidthInBytes = GetWidth() * m_nBPP; - m.Height = m_nLumaHeight; - CUDA_DRVAPI_CALL(cuMemcpy2DAsync(&m, m_cuvidStream)); - - // Copy chroma plane - // NVDEC output has luma height aligned by 2. Adjust chroma offset by aligning height - m.srcDevice = (CUdeviceptr)((uint8_t *)dpSrcFrame + m.srcPitch * ((m_nSurfaceHeight + 1) & ~1)); - m.dstDevice = (CUdeviceptr)(m.dstHost = pDecodedFrame + m.dstPitch * m_nLumaHeight); - m.Height = m_nChromaHeight; - CUDA_DRVAPI_CALL(cuMemcpy2DAsync(&m, m_cuvidStream)); - - if (m_nNumChromaPlanes == 2) - { - m.srcDevice = (CUdeviceptr)((uint8_t *)dpSrcFrame + m.srcPitch * ((m_nSurfaceHeight + 1) & ~1) * 2); - m.dstDevice = (CUdeviceptr)(m.dstHost = pDecodedFrame + m.dstPitch * m_nLumaHeight * 2); - m.Height = m_nChromaHeight; - CUDA_DRVAPI_CALL(cuMemcpy2DAsync(&m, m_cuvidStream)); - } - CUDA_DRVAPI_CALL(cuStreamSynchronize(m_cuvidStream)); - CUDA_DRVAPI_CALL(cuCtxPopCurrent(NULL)); - - if ((int)m_vTimestamp.size() < m_nDecodedFrame) { - m_vTimestamp.resize(m_vpFrame.size()); - } - m_vTimestamp[m_nDecodedFrame - 1] = pDispInfo->timestamp; - - NVDEC_API_CALL(cuvidUnmapVideoFrame(m_hDecoder, dpSrcFrame)); - return 1; -} - -int NvDecoder::GetSEIMessage(CUVIDSEIMESSAGEINFO *pSEIMessageInfo) -{ - uint32_t seiNumMessages = pSEIMessageInfo->sei_message_count; - CUSEIMESSAGE *seiMessagesInfo = pSEIMessageInfo->pSEIMessage; - size_t totalSEIBufferSize = 0; - if ((pSEIMessageInfo->picIdx < 0) || (pSEIMessageInfo->picIdx >= MAX_FRM_CNT)) - { - printf("Invalid picture index (%d)\n", pSEIMessageInfo->picIdx); - return 0; - } - for (uint32_t i = 0; i < seiNumMessages; i++) - { - totalSEIBufferSize += seiMessagesInfo[i].sei_message_size; - } - if (!m_pCurrSEIMessage) - { - printf("Out of Memory, Allocation failed for m_pCurrSEIMessage\n"); - return 0; - } - m_pCurrSEIMessage->pSEIData = malloc(totalSEIBufferSize); - if (!m_pCurrSEIMessage->pSEIData) - { - printf("Out of Memory, Allocation failed for SEI Buffer\n"); - return 0; - } - memcpy(m_pCurrSEIMessage->pSEIData, pSEIMessageInfo->pSEIData, totalSEIBufferSize); - m_pCurrSEIMessage->pSEIMessage = (CUSEIMESSAGE *)malloc(sizeof(CUSEIMESSAGE) * seiNumMessages); - if (!m_pCurrSEIMessage->pSEIMessage) - { - free(m_pCurrSEIMessage->pSEIData); - m_pCurrSEIMessage->pSEIData = NULL; - return 0; - } - memcpy(m_pCurrSEIMessage->pSEIMessage, pSEIMessageInfo->pSEIMessage, sizeof(CUSEIMESSAGE) * seiNumMessages); - m_pCurrSEIMessage->sei_message_count = pSEIMessageInfo->sei_message_count; - m_SEIMessagesDisplayOrder[pSEIMessageInfo->picIdx] = *m_pCurrSEIMessage; - return 1; -} - -NvDecoder::NvDecoder(CudaFunctions *cudl, CuvidFunctions *cvdl, CUcontext cuContext, bool bUseDeviceFrame, cudaVideoCodec eCodec, bool bLowLatency, - bool bDeviceFramePitched, const Rect *pCropRect, const Dim *pResizeDim, bool extract_user_SEI_Message, - int maxWidth, int maxHeight, unsigned int clkRate, bool force_zero_latency) : - m_cuContext(cuContext), m_bUseDeviceFrame(bUseDeviceFrame), m_eCodec(eCodec), m_bDeviceFramePitched(bDeviceFramePitched), - m_bExtractSEIMessage(extract_user_SEI_Message), m_nMaxWidth (maxWidth), m_nMaxHeight(maxHeight), - m_bForce_zero_latency(force_zero_latency) -{ - if (pCropRect) m_cropRect = *pCropRect; - if (pResizeDim) m_resizeDim = *pResizeDim; - - NVDEC_API_CALL(cuvidCtxLockCreate(&m_ctxLock, cuContext)); - - CUDA_DRVAPI_CALL(cuStreamCreate(&m_cuvidStream, CU_STREAM_DEFAULT)); - - decoderSessionID = 0; - - if (m_bExtractSEIMessage) - { - m_fpSEI = fopen("sei_message.txt", "wb"); - m_pCurrSEIMessage = new CUVIDSEIMESSAGEINFO; - memset(&m_SEIMessagesDisplayOrder, 0, sizeof(m_SEIMessagesDisplayOrder)); - } - CUVIDPARSERPARAMS videoParserParameters = {}; - videoParserParameters.CodecType = eCodec; - videoParserParameters.ulMaxNumDecodeSurfaces = 1; - videoParserParameters.ulClockRate = clkRate; - videoParserParameters.ulMaxDisplayDelay = bLowLatency ? 0 : 1; - videoParserParameters.pUserData = this; - videoParserParameters.pfnSequenceCallback = HandleVideoSequenceProc; - videoParserParameters.pfnDecodePicture = HandlePictureDecodeProc; - videoParserParameters.pfnDisplayPicture = m_bForce_zero_latency ? NULL : HandlePictureDisplayProc; - videoParserParameters.pfnGetOperatingPoint = HandleOperatingPointProc; - videoParserParameters.pfnGetSEIMsg = m_bExtractSEIMessage ? HandleSEIMessagesProc : NULL; - NVDEC_API_CALL(cuvidCreateVideoParser(&m_hParser, &videoParserParameters)); -} - -NvDecoder::~NvDecoder() { - - START_TIMER - - if (m_pCurrSEIMessage) { - delete m_pCurrSEIMessage; - m_pCurrSEIMessage = NULL; - } - - if (m_fpSEI) { - fclose(m_fpSEI); - m_fpSEI = NULL; - } - - if (m_hParser) { - m_cvdl->cuvidDestroyVideoParser(m_hParser); - } - m_cudl->cuCtxPushCurrent(m_cuContext); - if (m_hDecoder) { - m_cvdl->cuvidDestroyDecoder(m_hDecoder); - } - - std::lock_guard lock(m_mtxVPFrame); - - for (uint8_t *pFrame : m_vpFrame) - { - if (m_bUseDeviceFrame) - { - m_cudl->cuMemFree((CUdeviceptr)pFrame); - } - else - { - delete[] pFrame; - } - } - m_cudl->cuCtxPopCurrent(NULL); - - m_cvdl->cuvidCtxLockDestroy(m_ctxLock); - - STOP_TIMER("Session Deinitialization Time: "); - - NvDecoder::addDecoderSessionOverHead(getDecoderSessionID(), elapsedTime); -} - -int NvDecoder::Decode(const uint8_t *pData, int nSize, int nFlags, int64_t nTimestamp) -{ - m_nDecodedFrame = 0; - m_nDecodedFrameReturned = 0; - CUVIDSOURCEDATAPACKET packet = { 0 }; - packet.payload = pData; - packet.payload_size = nSize; - packet.flags = nFlags | CUVID_PKT_TIMESTAMP; - packet.timestamp = nTimestamp; - if (!pData || nSize == 0) { - packet.flags |= CUVID_PKT_ENDOFSTREAM; - } - NVDEC_API_CALL(cuvidParseVideoData(m_hParser, &packet)); - - return m_nDecodedFrame; -} - -uint8_t* NvDecoder::GetFrame(int64_t* pTimestamp) -{ - if (m_nDecodedFrame > 0) - { - std::lock_guard lock(m_mtxVPFrame); - m_nDecodedFrame--; - if (pTimestamp) - *pTimestamp = m_vTimestamp[m_nDecodedFrameReturned]; - return m_vpFrame[m_nDecodedFrameReturned++]; - } - - return NULL; -} - -uint8_t* NvDecoder::GetLockedFrame(int64_t* pTimestamp) -{ - uint8_t *pFrame; - uint64_t timestamp; - if (m_nDecodedFrame > 0) { - std::lock_guard lock(m_mtxVPFrame); - m_nDecodedFrame--; - pFrame = m_vpFrame[0]; - m_vpFrame.erase(m_vpFrame.begin(), m_vpFrame.begin() + 1); - - timestamp = m_vTimestamp[0]; - m_vTimestamp.erase(m_vTimestamp.begin(), m_vTimestamp.begin() + 1); - - if (pTimestamp) - *pTimestamp = timestamp; - - return pFrame; - } - - return NULL; -} - -void NvDecoder::UnlockFrame(uint8_t **pFrame) -{ - std::lock_guard lock(m_mtxVPFrame); - m_vpFrame.insert(m_vpFrame.end(), &pFrame[0], &pFrame[1]); - - // add a dummy entry for timestamp - uint64_t timestamp[2] = {0}; - m_vTimestamp.insert(m_vTimestamp.end(), ×tamp[0], ×tamp[1]); -} diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.h deleted file mode 100644 index b5e975dc..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvDecoder/NvDecoder.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../Utils/NvCodecUtils.h" -#include - -#define MAX_FRM_CNT 32 - -typedef enum{ - SEI_TYPE_TIME_CODE = 136, - SEI_TYPE_USER_DATA_UNREGISTERED = 5 -}SEI_H264_HEVC_PAYLOAD_TYPE; - -/** -* @brief Exception class for error reporting from the decode API. -*/ -class NVDECException : public std::exception -{ -public: - NVDECException(const std::string& errorStr, const CUresult errorCode) - : m_errorString(errorStr), m_errorCode(errorCode) {} - - virtual ~NVDECException() throw() {} - virtual const char* what() const throw() { return m_errorString.c_str(); } - CUresult getErrorCode() const { return m_errorCode; } - const std::string& getErrorString() const { return m_errorString; } - static NVDECException makeNVDECException(const std::string& errorStr, const CUresult errorCode, - const std::string& functionName, const std::string& fileName, int lineNo); -private: - std::string m_errorString; - CUresult m_errorCode; -}; - -inline NVDECException NVDECException::makeNVDECException(const std::string& errorStr, const CUresult errorCode, const std::string& functionName, - const std::string& fileName, int lineNo) -{ - std::ostringstream errorLog; - errorLog << functionName << " : " << errorStr << " at " << fileName << ":" << lineNo << std::endl; - NVDECException exception(errorLog.str(), errorCode); - return exception; -} - -#define NVDEC_THROW_ERROR( errorStr, errorCode ) \ - do \ - { \ - throw NVDECException::makeNVDECException(errorStr, errorCode, __FUNCTION__, __FILE__, __LINE__); \ - } while (0) - - -#define NVDEC_API_CALL( cuvidAPI ) \ - do \ - { \ - CUresult errorCode = m_cvdl->cuvidAPI; \ - if( errorCode != CUDA_SUCCESS) \ - { \ - std::ostringstream errorLog; \ - errorLog << #cuvidAPI << " returned error " << errorCode; \ - throw NVDECException::makeNVDECException(errorLog.str(), errorCode, __FUNCTION__, __FILE__, __LINE__); \ - } \ - } while (0) - -struct Rect { - int l, t, r, b; -}; - -struct Dim { - int w, h; -}; - -/** -* @brief Base class for decoder interface. -*/ -class NvDecoder { - -public: - /** - * @brief This function is used to initialize the decoder session. - * Application must call this function to initialize the decoder, before - * starting to decode any frames. - */ - NvDecoder(CudaFunctions *cudl, CuvidFunctions *cvdl, CUcontext cuContext, bool bUseDeviceFrame, cudaVideoCodec eCodec, bool bLowLatency = false, - bool bDeviceFramePitched = false, const Rect *pCropRect = NULL, const Dim *pResizeDim = NULL, - bool extract_user_SEI_Message = false, int maxWidth = 0, int maxHeight = 0, unsigned int clkRate = 1000, - bool force_zero_latency = false); - ~NvDecoder(); - - /** - * @brief This function is used to get the current CUDA context. - */ - CUcontext GetContext() { return m_cuContext; } - - /** - * @brief This function is used to get the output frame width. - * NV12/P016 output format width is 2 byte aligned because of U and V interleave - */ - int GetWidth() { assert(m_nWidth); return (m_eOutputFormat == cudaVideoSurfaceFormat_NV12 || m_eOutputFormat == cudaVideoSurfaceFormat_P016) - ? (m_nWidth + 1) & ~1 : m_nWidth; } - - /** - * @brief This function is used to get the actual decode width - */ - int GetDecodeWidth() { assert(m_nWidth); return m_nWidth; } - - /** - * @brief This function is used to get the output frame height (Luma height). - */ - int GetHeight() { assert(m_nLumaHeight); return m_nLumaHeight; } - - /** - * @brief This function is used to get the current chroma height. - */ - int GetChromaHeight() { assert(m_nChromaHeight); return m_nChromaHeight; } - - /** - * @brief This function is used to get the number of chroma planes. - */ - int GetNumChromaPlanes() { assert(m_nNumChromaPlanes); return m_nNumChromaPlanes; } - - /** - * @brief This function is used to get the current frame size based on pixel format. - */ - int GetFrameSize() { assert(m_nWidth); return GetWidth() * (m_nLumaHeight + (m_nChromaHeight * m_nNumChromaPlanes)) * m_nBPP; } - - /** - * @brief This function is used to get the current frame Luma plane size. - */ - int GetLumaPlaneSize() { assert(m_nWidth); return GetWidth() * m_nLumaHeight * m_nBPP; } - - /** - * @brief This function is used to get the current frame chroma plane size. - */ - int GetChromaPlaneSize() { assert(m_nWidth); return GetWidth() * (m_nChromaHeight * m_nNumChromaPlanes) * m_nBPP; } - - /** - * @brief This function is used to get the pitch of the device buffer holding the decoded frame. - */ - int GetDeviceFramePitch() { assert(m_nWidth); return m_nDeviceFramePitch ? (int)m_nDeviceFramePitch : GetWidth() * m_nBPP; } - - /** - * @brief This function is used to get the bit depth associated with the pixel format. - */ - int GetBitDepth() { assert(m_nWidth); return m_nBitDepthMinus8 + 8; } - - /** - * @brief This function is used to get the bytes used per pixel. - */ - int GetBPP() { assert(m_nWidth); return m_nBPP; } - - /** - * @brief This function is used to get the YUV chroma format - */ - cudaVideoSurfaceFormat GetOutputFormat() { return m_eOutputFormat; } - - /** - * @brief This function is used to get information about the video stream (codec, display parameters etc) - */ - CUVIDEOFORMAT GetVideoFormatInfo() { assert(m_nWidth); return m_videoFormat; } - - /** - * @brief This function is used to get codec string from codec id - */ - const char *GetCodecString(cudaVideoCodec eCodec); - - /** - * @brief This function is used to print information about the video stream - */ - std::string GetVideoInfo() const { return m_videoInfo.str(); } - - /** - * @brief This function decodes a frame and returns the number of frames that are available for - * display. All frames that are available for display should be read before making a subsequent decode call. - * @param pData - pointer to the data buffer that is to be decoded - * @param nSize - size of the data buffer in bytes - * @param nFlags - CUvideopacketflags for setting decode options - * @param nTimestamp - presentation timestamp - */ - int Decode(const uint8_t *pData, int nSize, int nFlags = 0, int64_t nTimestamp = 0); - - /** - * @brief This function returns a decoded frame and timestamp. This function should be called in a loop for - * fetching all the frames that are available for display. - */ - uint8_t* GetFrame(int64_t* pTimestamp = nullptr); - - - /** - * @brief This function decodes a frame and returns the locked frame buffers - * This makes the buffers available for use by the application without the buffers - * getting overwritten, even if subsequent decode calls are made. The frame buffers - * remain locked, until UnlockFrame() is called - */ - uint8_t* GetLockedFrame(int64_t* pTimestamp = nullptr); - - /** - * @brief This function unlocks the frame buffer and makes the frame buffers available for write again - * @param ppFrame - pointer to array of frames that are to be unlocked - * @param nFrame - number of frames to be unlocked - */ - void UnlockFrame(uint8_t **pFrame); - - /** - * @brief This function allows app to set decoder reconfig params - * @param pCropRect - cropping rectangle coordinates - * @param pResizeDim - width and height of resized output - */ - int setReconfigParams(const Rect * pCropRect, const Dim * pResizeDim); - - /** - * @brief This function allows app to set operating point for AV1 SVC clips - * @param opPoint - operating point of an AV1 scalable bitstream - * @param bDispAllLayers - Output all decoded frames of an AV1 scalable bitstream - */ - void SetOperatingPoint(const uint32_t opPoint, const bool bDispAllLayers) { m_nOperatingPoint = opPoint; m_bDispAllLayers = bDispAllLayers; } - - // start a timer - void startTimer() { m_stDecode_time.Start(); } - - // stop the timer - double stopTimer() { return m_stDecode_time.Stop(); } - - void setDecoderSessionID(int sessionID) { decoderSessionID = sessionID; } - int getDecoderSessionID() { return decoderSessionID; } - - // Session overhead refers to decoder initialization and deinitialization time - static void addDecoderSessionOverHead(int sessionID, int64_t duration) { sessionOverHead[sessionID] += duration; } - static int64_t getDecoderSessionOverHead(int sessionID) { return sessionOverHead[sessionID]; } - - unsigned int GetMaxWidth() { return m_nMaxWidth; } - unsigned int GetMaxHeight() { return m_nMaxHeight; } - CUVIDEOFORMAT GetLatestVideoFormat() { return m_latestVideoFormat; } -private: - int decoderSessionID; // Decoder session identifier. Used to gather session level stats. - static std::map sessionOverHead; // Records session overhead of initialization+deinitialization time. Format is (thread id, duration) - - /** - * @brief Callback function to be registered for getting a callback when decoding of sequence starts - */ - static int CUDAAPI HandleVideoSequenceProc(void *pUserData, CUVIDEOFORMAT *pVideoFormat) { return ((NvDecoder *)pUserData)->HandleVideoSequence(pVideoFormat); } - - /** - * @brief Callback function to be registered for getting a callback when a decoded frame is ready to be decoded - */ - static int CUDAAPI HandlePictureDecodeProc(void *pUserData, CUVIDPICPARAMS *pPicParams) { return ((NvDecoder *)pUserData)->HandlePictureDecode(pPicParams); } - - /** - * @brief Callback function to be registered for getting a callback when a decoded frame is available for display - */ - static int CUDAAPI HandlePictureDisplayProc(void *pUserData, CUVIDPARSERDISPINFO *pDispInfo) { return ((NvDecoder *)pUserData)->HandlePictureDisplay(pDispInfo); } - - /** - * @brief Callback function to be registered for getting a callback to get operating point when AV1 SVC sequence header start. - */ - static int CUDAAPI HandleOperatingPointProc(void *pUserData, CUVIDOPERATINGPOINTINFO *pOPInfo) { return ((NvDecoder *)pUserData)->GetOperatingPoint(pOPInfo); } - - /** - * @brief Callback function to be registered for getting a callback when all the unregistered user SEI Messages are parsed for a frame. - */ - static int CUDAAPI HandleSEIMessagesProc(void *pUserData, CUVIDSEIMESSAGEINFO *pSEIMessageInfo) { return ((NvDecoder *)pUserData)->GetSEIMessage(pSEIMessageInfo); } - - /** - * @brief This function gets called when a sequence is ready to be decoded. The function also gets called - when there is format change - */ - int HandleVideoSequence(CUVIDEOFORMAT *pVideoFormat); - - /** - * @brief This function gets called when a picture is ready to be decoded. cuvidDecodePicture is called from this function - * to decode the picture - */ - int HandlePictureDecode(CUVIDPICPARAMS *pPicParams); - - /** - * @brief This function gets called after a picture is decoded and available for display. Frames are fetched and stored in - internal buffer - */ - int HandlePictureDisplay(CUVIDPARSERDISPINFO *pDispInfo); - - /** - * @brief This function gets called when AV1 sequence encounter more than one operating points - */ - int GetOperatingPoint(CUVIDOPERATINGPOINTINFO *pOPInfo); - - /** - * @brief This function gets called when all unregistered user SEI messages are parsed for a frame - */ - int GetSEIMessage(CUVIDSEIMESSAGEINFO *pSEIMessageInfo); - - /** - * @brief This function reconfigure decoder if there is a change in sequence params. - */ - int ReconfigureDecoder(CUVIDEOFORMAT *pVideoFormat); - -private: - CudaFunctions *m_cudl = NULL; - CuvidFunctions *m_cvdl = NULL; - CUcontext m_cuContext = NULL; - CUvideoctxlock m_ctxLock; - CUvideoparser m_hParser = NULL; - CUvideodecoder m_hDecoder = NULL; - bool m_bUseDeviceFrame; - // dimension of the output - unsigned int m_nWidth = 0, m_nLumaHeight = 0, m_nChromaHeight = 0; - unsigned int m_nNumChromaPlanes = 0; - // height of the mapped surface - int m_nSurfaceHeight = 0; - int m_nSurfaceWidth = 0; - cudaVideoCodec m_eCodec = cudaVideoCodec_NumCodecs; - cudaVideoChromaFormat m_eChromaFormat = cudaVideoChromaFormat_420; - cudaVideoSurfaceFormat m_eOutputFormat = cudaVideoSurfaceFormat_NV12; - int m_nBitDepthMinus8 = 0; - int m_nBPP = 1; - CUVIDEOFORMAT m_videoFormat = {}; - Rect m_displayRect = {}; - // stock of frames - std::vector m_vpFrame; - // timestamps of decoded frames - std::vector m_vTimestamp; - int m_nDecodedFrame = 0, m_nDecodedFrameReturned = 0; - int m_nDecodePicCnt = 0, m_nPicNumInDecodeOrder[MAX_FRM_CNT]; - CUVIDSEIMESSAGEINFO *m_pCurrSEIMessage = NULL; - CUVIDSEIMESSAGEINFO m_SEIMessagesDisplayOrder[MAX_FRM_CNT]; - FILE *m_fpSEI = NULL; - bool m_bEndDecodeDone = false; - std::mutex m_mtxVPFrame; - int m_nFrameAlloc = 0; - CUstream m_cuvidStream = 0; - bool m_bDeviceFramePitched = false; - size_t m_nDeviceFramePitch = 0; - Rect m_cropRect = {}; - Dim m_resizeDim = {}; - - std::ostringstream m_videoInfo; - unsigned int m_nMaxWidth = 0, m_nMaxHeight = 0; - bool m_bReconfigExternal = false; - bool m_bReconfigExtPPChange = false; - StopWatch m_stDecode_time; - - unsigned int m_nOperatingPoint = 0; - bool m_bDispAllLayers = false; - // In H.264, there is an inherent display latency for video contents - // which do not have num_reorder_frames=0 in the VUI. This applies to - // All-Intra and IPPP sequences as well. If the user wants zero display - // latency for All-Intra and IPPP sequences, the below flag will enable - // the display callback immediately after the decode callback. - bool m_bForce_zero_latency = false; - bool m_bExtractSEIMessage = false; - // my variables - CUVIDEOFORMAT m_latestVideoFormat = {}; -}; diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.cpp b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.cpp deleted file mode 100644 index 31c281e5..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.cpp +++ /dev/null @@ -1,1037 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "NvEncoder/NvEncoder.h" - -#ifndef _WIN32 -#include -static inline bool operator==(const GUID &guid1, const GUID &guid2) { - return !memcmp(&guid1, &guid2, sizeof(GUID)); -} - -static inline bool operator!=(const GUID &guid1, const GUID &guid2) { - return !(guid1 == guid2); -} -#endif - -NvEncoder::NvEncoder(NvencFunctions *nvenc_dl, NV_ENC_DEVICE_TYPE eDeviceType, void *pDevice, uint32_t nWidth, uint32_t nHeight, NV_ENC_BUFFER_FORMAT eBufferFormat, - uint32_t nExtraOutputDelay, bool bMotionEstimationOnly, bool bOutputInVideoMemory, bool bDX12Encode, bool bUseIVFContainer) : - m_nvenc_dl(nvenc_dl), - m_pDevice(pDevice), - m_eDeviceType(eDeviceType), - m_nWidth(nWidth), - m_nHeight(nHeight), - m_nMaxEncodeWidth(nWidth), - m_nMaxEncodeHeight(nHeight), - m_eBufferFormat(eBufferFormat), - m_bMotionEstimationOnly(bMotionEstimationOnly), - m_bOutputInVideoMemory(bOutputInVideoMemory), - m_bIsDX12Encode(bDX12Encode), - m_bUseIVFContainer(bUseIVFContainer), - m_nExtraOutputDelay(nExtraOutputDelay), - m_hEncoder(nullptr) -{ - LoadNvEncApi(); - - if (!m_nvenc.nvEncOpenEncodeSession) - { - m_nEncoderBuffer = 0; - NVENC_THROW_ERROR("EncodeAPI not found", NV_ENC_ERR_NO_ENCODE_DEVICE); - } - - NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS encodeSessionExParams = { NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER }; - encodeSessionExParams.device = m_pDevice; - encodeSessionExParams.deviceType = m_eDeviceType; - encodeSessionExParams.apiVersion = NVENCAPI_VERSION; - void *hEncoder = NULL; - NVENC_API_CALL(m_nvenc.nvEncOpenEncodeSessionEx(&encodeSessionExParams, &hEncoder)); - m_hEncoder = hEncoder; -} - -void NvEncoder::LoadNvEncApi() -{ - - uint32_t version = 0; - uint32_t currentVersion = (NVENCAPI_MAJOR_VERSION << 4) | NVENCAPI_MINOR_VERSION; - NVENC_API_CALL(m_nvenc_dl->NvEncodeAPIGetMaxSupportedVersion(&version)); - if (currentVersion > version) - { - NVENC_THROW_ERROR("Current Driver Version does not support this NvEncodeAPI version, please upgrade driver", NV_ENC_ERR_INVALID_VERSION); - } - - - m_nvenc = { NV_ENCODE_API_FUNCTION_LIST_VER }; - NVENC_API_CALL(m_nvenc_dl->NvEncodeAPICreateInstance(&m_nvenc)); -} - -NvEncoder::~NvEncoder() -{ - DestroyHWEncoder(); -} - -void NvEncoder::CreateDefaultEncoderParams(NV_ENC_INITIALIZE_PARAMS* pIntializeParams, GUID codecGuid, GUID presetGuid, NV_ENC_TUNING_INFO tuningInfo) -{ - if (!m_hEncoder) - { - NVENC_THROW_ERROR("Encoder Initialization failed", NV_ENC_ERR_NO_ENCODE_DEVICE); - return; - } - - if (pIntializeParams == nullptr || pIntializeParams->encodeConfig == nullptr) - { - NVENC_THROW_ERROR("pInitializeParams and pInitializeParams->encodeConfig can't be NULL", NV_ENC_ERR_INVALID_PTR); - } - - memset(pIntializeParams->encodeConfig, 0, sizeof(NV_ENC_CONFIG)); - auto pEncodeConfig = pIntializeParams->encodeConfig; - memset(pIntializeParams, 0, sizeof(NV_ENC_INITIALIZE_PARAMS)); - pIntializeParams->encodeConfig = pEncodeConfig; - - - pIntializeParams->encodeConfig->version = NV_ENC_CONFIG_VER; - pIntializeParams->version = NV_ENC_INITIALIZE_PARAMS_VER; - - pIntializeParams->encodeGUID = codecGuid; - pIntializeParams->presetGUID = presetGuid; - pIntializeParams->encodeWidth = m_nWidth; - pIntializeParams->encodeHeight = m_nHeight; - pIntializeParams->darWidth = m_nWidth; - pIntializeParams->darHeight = m_nHeight; - pIntializeParams->frameRateNum = 30; - pIntializeParams->frameRateDen = 1; - pIntializeParams->enablePTD = 1; - pIntializeParams->reportSliceOffsets = 0; - pIntializeParams->enableSubFrameWrite = 0; - pIntializeParams->maxEncodeWidth = m_nWidth; - pIntializeParams->maxEncodeHeight = m_nHeight; - pIntializeParams->enableMEOnlyMode = m_bMotionEstimationOnly; - pIntializeParams->enableOutputInVidmem = m_bOutputInVideoMemory; -#if defined(_WIN32) - if (!m_bOutputInVideoMemory) - { - pIntializeParams->enableEncodeAsync = GetCapabilityValue(codecGuid, NV_ENC_CAPS_ASYNC_ENCODE_SUPPORT); - } -#endif - - NV_ENC_PRESET_CONFIG presetConfig = { NV_ENC_PRESET_CONFIG_VER, { NV_ENC_CONFIG_VER } }; - m_nvenc.nvEncGetEncodePresetConfig(m_hEncoder, codecGuid, presetGuid, &presetConfig); - memcpy(pIntializeParams->encodeConfig, &presetConfig.presetCfg, sizeof(NV_ENC_CONFIG)); - pIntializeParams->encodeConfig->frameIntervalP = 1; - pIntializeParams->encodeConfig->gopLength = NVENC_INFINITE_GOPLENGTH; - - pIntializeParams->encodeConfig->rcParams.rateControlMode = NV_ENC_PARAMS_RC_CONSTQP; - - if (!m_bMotionEstimationOnly) - { - pIntializeParams->tuningInfo = tuningInfo; - NV_ENC_PRESET_CONFIG presetConfig = { NV_ENC_PRESET_CONFIG_VER, { NV_ENC_CONFIG_VER } }; - m_nvenc.nvEncGetEncodePresetConfigEx(m_hEncoder, codecGuid, presetGuid, tuningInfo, &presetConfig); - memcpy(pIntializeParams->encodeConfig, &presetConfig.presetCfg, sizeof(NV_ENC_CONFIG)); - } - else - { - m_encodeConfig.version = NV_ENC_CONFIG_VER; - m_encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CONSTQP; - m_encodeConfig.rcParams.constQP = { 28, 31, 25 }; - } - - if (pIntializeParams->encodeGUID == NV_ENC_CODEC_H264_GUID) - { - if (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444 || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) - { - pIntializeParams->encodeConfig->encodeCodecConfig.h264Config.chromaFormatIDC = 3; - } - pIntializeParams->encodeConfig->encodeCodecConfig.h264Config.idrPeriod = pIntializeParams->encodeConfig->gopLength; - } - else if (pIntializeParams->encodeGUID == NV_ENC_CODEC_HEVC_GUID) - { - pIntializeParams->encodeConfig->encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 = - (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT ) ? 2 : 0; - if (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444 || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) - { - pIntializeParams->encodeConfig->encodeCodecConfig.hevcConfig.chromaFormatIDC = 3; - } - pIntializeParams->encodeConfig->encodeCodecConfig.hevcConfig.idrPeriod = pIntializeParams->encodeConfig->gopLength; - } - else if (pIntializeParams->encodeGUID == NV_ENC_CODEC_AV1_GUID) - { - pIntializeParams->encodeConfig->encodeCodecConfig.av1Config.pixelBitDepthMinus8 = (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT) ? 2 : 0; - pIntializeParams->encodeConfig->encodeCodecConfig.av1Config.inputPixelBitDepthMinus8 = (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT) ? 2 : 0; - pIntializeParams->encodeConfig->encodeCodecConfig.av1Config.chromaFormatIDC = 1; - pIntializeParams->encodeConfig->encodeCodecConfig.av1Config.idrPeriod = pIntializeParams->encodeConfig->gopLength; - if (m_bOutputInVideoMemory) - { - pIntializeParams->encodeConfig->frameIntervalP = 1; - } - } - - if (m_bIsDX12Encode) - { - pIntializeParams->bufferFormat = m_eBufferFormat; - } - - return; -} - -void NvEncoder::CreateEncoder(const NV_ENC_INITIALIZE_PARAMS* pEncoderParams) -{ - if (!m_hEncoder) - { - NVENC_THROW_ERROR("Encoder Initialization failed", NV_ENC_ERR_NO_ENCODE_DEVICE); - } - - if (!pEncoderParams) - { - NVENC_THROW_ERROR("Invalid NV_ENC_INITIALIZE_PARAMS ptr", NV_ENC_ERR_INVALID_PTR); - } - - if (pEncoderParams->encodeWidth == 0 || pEncoderParams->encodeHeight == 0) - { - NVENC_THROW_ERROR("Invalid encoder width and height", NV_ENC_ERR_INVALID_PARAM); - } - - if (pEncoderParams->encodeGUID != NV_ENC_CODEC_H264_GUID && pEncoderParams->encodeGUID != NV_ENC_CODEC_HEVC_GUID && pEncoderParams->encodeGUID != NV_ENC_CODEC_AV1_GUID) - { - NVENC_THROW_ERROR("Invalid codec guid", NV_ENC_ERR_INVALID_PARAM); - } - - if (pEncoderParams->encodeGUID == NV_ENC_CODEC_H264_GUID) - { - if (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) - { - NVENC_THROW_ERROR("10-bit format isn't supported by H264 encoder", NV_ENC_ERR_INVALID_PARAM); - } - } - - if (pEncoderParams->encodeGUID == NV_ENC_CODEC_AV1_GUID) - { - if (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444 || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) - { - NVENC_THROW_ERROR("YUV444 format isn't supported by AV1 encoder", NV_ENC_ERR_INVALID_PARAM); - } - } - - // set other necessary params if not set yet - if (pEncoderParams->encodeGUID == NV_ENC_CODEC_H264_GUID) - { - if ((m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444) && - (pEncoderParams->encodeConfig->encodeCodecConfig.h264Config.chromaFormatIDC != 3)) - { - NVENC_THROW_ERROR("Invalid ChromaFormatIDC", NV_ENC_ERR_INVALID_PARAM); - } - } - - if (pEncoderParams->encodeGUID == NV_ENC_CODEC_HEVC_GUID) - { - bool yuv10BitFormat = (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) ? true : false; - if (yuv10BitFormat && pEncoderParams->encodeConfig->encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 != 2) - { - NVENC_THROW_ERROR("Invalid PixelBitdepth", NV_ENC_ERR_INVALID_PARAM); - } - - if ((m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444 || m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) && - (pEncoderParams->encodeConfig->encodeCodecConfig.hevcConfig.chromaFormatIDC != 3)) - { - NVENC_THROW_ERROR("Invalid ChromaFormatIDC", NV_ENC_ERR_INVALID_PARAM); - } - } - - if (pEncoderParams->encodeGUID == NV_ENC_CODEC_AV1_GUID) - { - bool yuv10BitFormat = (m_eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT) ? true : false; - if (yuv10BitFormat && pEncoderParams->encodeConfig->encodeCodecConfig.av1Config.pixelBitDepthMinus8 != 2) - { - NVENC_THROW_ERROR("Invalid PixelBitdepth", NV_ENC_ERR_INVALID_PARAM); - } - - if (pEncoderParams->encodeConfig->encodeCodecConfig.av1Config.chromaFormatIDC != 1) - { - NVENC_THROW_ERROR("Invalid ChromaFormatIDC", NV_ENC_ERR_INVALID_PARAM); - } - - if (m_bOutputInVideoMemory && pEncoderParams->encodeConfig->frameIntervalP > 1) - { - NVENC_THROW_ERROR("Alt Ref frames not supported for AV1 in case of OutputInVideoMemory", NV_ENC_ERR_INVALID_PARAM); - } - } - - memcpy(&m_initializeParams, pEncoderParams, sizeof(m_initializeParams)); - m_initializeParams.version = NV_ENC_INITIALIZE_PARAMS_VER; - - if (pEncoderParams->encodeConfig) - { - memcpy(&m_encodeConfig, pEncoderParams->encodeConfig, sizeof(m_encodeConfig)); - m_encodeConfig.version = NV_ENC_CONFIG_VER; - } - else - { - NV_ENC_PRESET_CONFIG presetConfig = { NV_ENC_PRESET_CONFIG_VER, { NV_ENC_CONFIG_VER } }; - if (!m_bMotionEstimationOnly) - { - m_nvenc.nvEncGetEncodePresetConfigEx(m_hEncoder, pEncoderParams->encodeGUID, pEncoderParams->presetGUID, pEncoderParams->tuningInfo, &presetConfig); - memcpy(&m_encodeConfig, &presetConfig.presetCfg, sizeof(NV_ENC_CONFIG)); - if (m_bOutputInVideoMemory && pEncoderParams->encodeGUID == NV_ENC_CODEC_AV1_GUID) - { - m_encodeConfig.frameIntervalP = 1; - } - } - else - { - m_encodeConfig.version = NV_ENC_CONFIG_VER; - m_encodeConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CONSTQP; - m_encodeConfig.rcParams.constQP = { 28, 31, 25 }; - } - } - - if (((uint32_t)m_encodeConfig.frameIntervalP) > m_encodeConfig.gopLength) - { - m_encodeConfig.frameIntervalP = m_encodeConfig.gopLength; - } - - m_initializeParams.encodeConfig = &m_encodeConfig; - - NVENC_API_CALL(m_nvenc.nvEncInitializeEncoder(m_hEncoder, &m_initializeParams)); - - m_bEncoderInitialized = true; - m_nWidth = m_initializeParams.encodeWidth; - m_nHeight = m_initializeParams.encodeHeight; - m_nMaxEncodeWidth = m_initializeParams.maxEncodeWidth; - m_nMaxEncodeHeight = m_initializeParams.maxEncodeHeight; - - m_nEncoderBuffer = m_encodeConfig.frameIntervalP + m_encodeConfig.rcParams.lookaheadDepth + m_nExtraOutputDelay; - m_nOutputDelay = m_nEncoderBuffer - 1; - - if (!m_bOutputInVideoMemory) - { - m_vpCompletionEvent.resize(m_nEncoderBuffer, nullptr); - } - -#if defined(_WIN32) - for (uint32_t i = 0; i < m_vpCompletionEvent.size(); i++) - { - m_vpCompletionEvent[i] = CreateEvent(NULL, FALSE, FALSE, NULL); - if (!m_bIsDX12Encode) - { - NV_ENC_EVENT_PARAMS eventParams = { NV_ENC_EVENT_PARAMS_VER }; - eventParams.completionEvent = m_vpCompletionEvent[i]; - m_nvenc.nvEncRegisterAsyncEvent(m_hEncoder, &eventParams); - } - } -#endif - - m_vMappedInputBuffers.resize(m_nEncoderBuffer, nullptr); - - if (m_bMotionEstimationOnly) - { - m_vMappedRefBuffers.resize(m_nEncoderBuffer, nullptr); - - if (!m_bOutputInVideoMemory) - { - InitializeMVOutputBuffer(); - } - } - else - { - if (!m_bOutputInVideoMemory && !m_bIsDX12Encode) - { - m_vBitstreamOutputBuffer.resize(m_nEncoderBuffer, nullptr); - InitializeBitstreamBuffer(); - } - } - - AllocateInputBuffers(m_nEncoderBuffer); -} - -void NvEncoder::DestroyEncoder() -{ - if (!m_hEncoder) - { - return; - } - - ReleaseInputBuffers(); - - DestroyHWEncoder(); -} - -void NvEncoder::DestroyHWEncoder() -{ - if (!m_hEncoder) - { - return; - } - -#if defined(_WIN32) - for (uint32_t i = 0; i < m_vpCompletionEvent.size(); i++) - { - if (m_vpCompletionEvent[i]) - { - if (!m_bIsDX12Encode) - { - NV_ENC_EVENT_PARAMS eventParams = { NV_ENC_EVENT_PARAMS_VER }; - eventParams.completionEvent = m_vpCompletionEvent[i]; - m_nvenc.nvEncUnregisterAsyncEvent(m_hEncoder, &eventParams); - } - CloseHandle(m_vpCompletionEvent[i]); - } - } - m_vpCompletionEvent.clear(); -#endif - - if (m_bMotionEstimationOnly) - { - DestroyMVOutputBuffer(); - } - else - { - if (!m_bIsDX12Encode) - DestroyBitstreamBuffer(); - } - - m_nvenc.nvEncDestroyEncoder(m_hEncoder); - - m_hEncoder = nullptr; - - m_bEncoderInitialized = false; -} - -const NvEncInputFrame* NvEncoder::GetNextInputFrame() -{ - int i = m_iToSend % m_nEncoderBuffer; - return &m_vInputFrames[i]; -} - -const NvEncInputFrame* NvEncoder::GetNextReferenceFrame() -{ - int i = m_iToSend % m_nEncoderBuffer; - return &m_vReferenceFrames[i]; -} - -void NvEncoder::MapResources(uint32_t bfrIdx) -{ - NV_ENC_MAP_INPUT_RESOURCE mapInputResource = { NV_ENC_MAP_INPUT_RESOURCE_VER }; - - mapInputResource.registeredResource = m_vRegisteredResources[bfrIdx]; - NVENC_API_CALL(m_nvenc.nvEncMapInputResource(m_hEncoder, &mapInputResource)); - m_vMappedInputBuffers[bfrIdx] = mapInputResource.mappedResource; - - if (m_bMotionEstimationOnly) - { - mapInputResource.registeredResource = m_vRegisteredResourcesForReference[bfrIdx]; - NVENC_API_CALL(m_nvenc.nvEncMapInputResource(m_hEncoder, &mapInputResource)); - m_vMappedRefBuffers[bfrIdx] = mapInputResource.mappedResource; - } -} - -void NvEncoder::EncodeFrame(std::vector &vPacket, NV_ENC_PIC_PARAMS *pPicParams) -{ - vPacket.clear(); - if (!IsHWEncoderInitialized()) - { - NVENC_THROW_ERROR("Encoder device not found", NV_ENC_ERR_NO_ENCODE_DEVICE); - } - - int bfrIdx = m_iToSend % m_nEncoderBuffer; - - MapResources(bfrIdx); - - NVENCSTATUS nvStatus = DoEncode(m_vMappedInputBuffers[bfrIdx], m_vBitstreamOutputBuffer[bfrIdx], pPicParams); - - if (nvStatus == NV_ENC_SUCCESS || nvStatus == NV_ENC_ERR_NEED_MORE_INPUT) - { - m_iToSend++; - GetEncodedPacket(m_vBitstreamOutputBuffer, vPacket, true); - } - else - { - NVENC_THROW_ERROR("nvEncEncodePicture API failed", nvStatus); - } -} - -void NvEncoder::RunMotionEstimation(std::vector &mvData) -{ - if (!m_hEncoder) - { - NVENC_THROW_ERROR("Encoder Initialization failed", NV_ENC_ERR_NO_ENCODE_DEVICE); - return; - } - - const uint32_t bfrIdx = m_iToSend % m_nEncoderBuffer; - - MapResources(bfrIdx); - - NVENCSTATUS nvStatus = DoMotionEstimation(m_vMappedInputBuffers[bfrIdx], m_vMappedRefBuffers[bfrIdx], m_vMVDataOutputBuffer[bfrIdx]); - - if (nvStatus == NV_ENC_SUCCESS) - { - m_iToSend++; - std::vector vPacket; - GetEncodedPacket(m_vMVDataOutputBuffer, vPacket, true); - if (vPacket.size() != 1) - { - NVENC_THROW_ERROR("GetEncodedPacket() doesn't return one (and only one) MVData", NV_ENC_ERR_GENERIC); - } - mvData = vPacket[0].data; - } - else - { - NVENC_THROW_ERROR("nvEncEncodePicture API failed", nvStatus); - } -} - - -void NvEncoder::GetSequenceParams(std::vector &seqParams) -{ - uint8_t spsppsData[1024]; // Assume maximum spspps data is 1KB or less - memset(spsppsData, 0, sizeof(spsppsData)); - NV_ENC_SEQUENCE_PARAM_PAYLOAD payload = { NV_ENC_SEQUENCE_PARAM_PAYLOAD_VER }; - uint32_t spsppsSize = 0; - - payload.spsppsBuffer = spsppsData; - payload.inBufferSize = sizeof(spsppsData); - payload.outSPSPPSPayloadSize = &spsppsSize; - NVENC_API_CALL(m_nvenc.nvEncGetSequenceParams(m_hEncoder, &payload)); - seqParams.clear(); - seqParams.insert(seqParams.end(), &spsppsData[0], &spsppsData[spsppsSize]); -} - -NVENCSTATUS NvEncoder::DoEncode(NV_ENC_INPUT_PTR inputBuffer, NV_ENC_OUTPUT_PTR outputBuffer, NV_ENC_PIC_PARAMS *pPicParams) -{ - NV_ENC_PIC_PARAMS picParams = {}; - if (pPicParams) - { - picParams = *pPicParams; - } - picParams.version = NV_ENC_PIC_PARAMS_VER; - picParams.pictureStruct = NV_ENC_PIC_STRUCT_FRAME; - picParams.inputBuffer = inputBuffer; - picParams.bufferFmt = GetPixelFormat(); - picParams.inputWidth = GetEncodeWidth(); - picParams.inputHeight = GetEncodeHeight(); - picParams.outputBitstream = outputBuffer; - picParams.completionEvent = GetCompletionEvent(m_iToSend % m_nEncoderBuffer); - NVENCSTATUS nvStatus = m_nvenc.nvEncEncodePicture(m_hEncoder, &picParams); - - return nvStatus; -} - -void NvEncoder::SendEOS() -{ - NV_ENC_PIC_PARAMS picParams = { NV_ENC_PIC_PARAMS_VER }; - picParams.encodePicFlags = NV_ENC_PIC_FLAG_EOS; - picParams.completionEvent = GetCompletionEvent(m_iToSend % m_nEncoderBuffer); - NVENC_API_CALL(m_nvenc.nvEncEncodePicture(m_hEncoder, &picParams)); -} - -void NvEncoder::EndEncode(std::vector &vPacket) -{ - vPacket.clear(); - if (!IsHWEncoderInitialized()) - { - NVENC_THROW_ERROR("Encoder device not initialized", NV_ENC_ERR_ENCODER_NOT_INITIALIZED); - } - - SendEOS(); - - GetEncodedPacket(m_vBitstreamOutputBuffer, vPacket, false); -} - -void NvEncoder::GetEncodedPacket(std::vector &vOutputBuffer, std::vector &vPacket, bool bOutputDelay) -{ - unsigned i = 0; - int iEnd = bOutputDelay ? m_iToSend - m_nOutputDelay : m_iToSend; - for (; m_iGot < iEnd; m_iGot++) - { - WaitForCompletionEvent(m_iGot % m_nEncoderBuffer); - NV_ENC_LOCK_BITSTREAM lockBitstreamData = { NV_ENC_LOCK_BITSTREAM_VER }; - lockBitstreamData.outputBitstream = vOutputBuffer[m_iGot % m_nEncoderBuffer]; - lockBitstreamData.doNotWait = false; - NVENC_API_CALL(m_nvenc.nvEncLockBitstream(m_hEncoder, &lockBitstreamData)); - - uint8_t *pData = (uint8_t *)lockBitstreamData.bitstreamBufferPtr; - if (vPacket.size() < i + 1) - { - vPacket.push_back(NvPacket()); - } - vPacket[i].data.clear(); - - if ((m_initializeParams.encodeGUID == NV_ENC_CODEC_AV1_GUID) && (m_bUseIVFContainer)) - { - if (m_bWriteIVFFileHeader) - { - m_IVFUtils.WriteFileHeader(vPacket[i].data, MAKE_FOURCC('A', 'V', '0', '1'), m_initializeParams.encodeWidth, m_initializeParams.encodeHeight, m_initializeParams.frameRateNum, m_initializeParams.frameRateDen, 0xFFFF); - m_bWriteIVFFileHeader = false; - } - - m_IVFUtils.WriteFrameHeader(vPacket[i].data, lockBitstreamData.bitstreamSizeInBytes, lockBitstreamData.outputTimeStamp); - } - vPacket[i].data.insert(vPacket[i].data.end(), &pData[0], &pData[lockBitstreamData.bitstreamSizeInBytes]); - vPacket[i].pictureType = lockBitstreamData.pictureType; - i++; - - NVENC_API_CALL(m_nvenc.nvEncUnlockBitstream(m_hEncoder, lockBitstreamData.outputBitstream)); - - if (m_vMappedInputBuffers[m_iGot % m_nEncoderBuffer]) - { - NVENC_API_CALL(m_nvenc.nvEncUnmapInputResource(m_hEncoder, m_vMappedInputBuffers[m_iGot % m_nEncoderBuffer])); - m_vMappedInputBuffers[m_iGot % m_nEncoderBuffer] = nullptr; - } - - if (m_bMotionEstimationOnly && m_vMappedRefBuffers[m_iGot % m_nEncoderBuffer]) - { - NVENC_API_CALL(m_nvenc.nvEncUnmapInputResource(m_hEncoder, m_vMappedRefBuffers[m_iGot % m_nEncoderBuffer])); - m_vMappedRefBuffers[m_iGot % m_nEncoderBuffer] = nullptr; - } - } -} - -bool NvEncoder::Reconfigure(const NV_ENC_RECONFIGURE_PARAMS *pReconfigureParams) -{ - NVENC_API_CALL(m_nvenc.nvEncReconfigureEncoder(m_hEncoder, const_cast(pReconfigureParams))); - - memcpy(&m_initializeParams, &(pReconfigureParams->reInitEncodeParams), sizeof(m_initializeParams)); - if (pReconfigureParams->reInitEncodeParams.encodeConfig) - { - memcpy(&m_encodeConfig, pReconfigureParams->reInitEncodeParams.encodeConfig, sizeof(m_encodeConfig)); - } - - m_nWidth = m_initializeParams.encodeWidth; - m_nHeight = m_initializeParams.encodeHeight; - m_nMaxEncodeWidth = m_initializeParams.maxEncodeWidth; - m_nMaxEncodeHeight = m_initializeParams.maxEncodeHeight; - - return true; -} - -NV_ENC_REGISTERED_PTR NvEncoder::RegisterResource(void *pBuffer, NV_ENC_INPUT_RESOURCE_TYPE eResourceType, - int width, int height, int pitch, NV_ENC_BUFFER_FORMAT bufferFormat, NV_ENC_BUFFER_USAGE bufferUsage, - NV_ENC_FENCE_POINT_D3D12* pInputFencePoint) -{ - NV_ENC_REGISTER_RESOURCE registerResource = { NV_ENC_REGISTER_RESOURCE_VER }; - registerResource.resourceType = eResourceType; - registerResource.resourceToRegister = pBuffer; - registerResource.width = width; - registerResource.height = height; - registerResource.pitch = pitch; - registerResource.bufferFormat = bufferFormat; - registerResource.bufferUsage = bufferUsage; - registerResource.pInputFencePoint = pInputFencePoint; - NVENC_API_CALL(m_nvenc.nvEncRegisterResource(m_hEncoder, ®isterResource)); - - return registerResource.registeredResource; -} - -void NvEncoder::RegisterInputResources(std::vector inputframes, NV_ENC_INPUT_RESOURCE_TYPE eResourceType, - int width, int height, int pitch, NV_ENC_BUFFER_FORMAT bufferFormat, bool bReferenceFrame) -{ - for (uint32_t i = 0; i < inputframes.size(); ++i) - { - NV_ENC_REGISTERED_PTR registeredPtr = RegisterResource(inputframes[i], eResourceType, width, height, pitch, bufferFormat, NV_ENC_INPUT_IMAGE); - - std::vector _chromaOffsets; - NvEncoder::GetChromaSubPlaneOffsets(bufferFormat, pitch, height, _chromaOffsets); - NvEncInputFrame inputframe = {}; - inputframe.inputPtr = (void *)inputframes[i]; - inputframe.chromaOffsets[0] = 0; - inputframe.chromaOffsets[1] = 0; - for (uint32_t ch = 0; ch < _chromaOffsets.size(); ch++) - { - inputframe.chromaOffsets[ch] = _chromaOffsets[ch]; - } - inputframe.numChromaPlanes = NvEncoder::GetNumChromaPlanes(bufferFormat); - inputframe.pitch = pitch; - inputframe.chromaPitch = NvEncoder::GetChromaPitch(bufferFormat, pitch); - inputframe.bufferFormat = bufferFormat; - inputframe.resourceType = eResourceType; - - if (bReferenceFrame) - { - m_vRegisteredResourcesForReference.push_back(registeredPtr); - m_vReferenceFrames.push_back(inputframe); - } - else - { - m_vRegisteredResources.push_back(registeredPtr); - m_vInputFrames.push_back(inputframe); - } - } -} - -void NvEncoder::FlushEncoder() -{ - if (!m_bMotionEstimationOnly && !m_bOutputInVideoMemory) - { - // Incase of error it is possible for buffers still mapped to encoder. - // flush the encoder queue and then unmapped it if any surface is still mapped - try - { - std::vector vPacket; - EndEncode(vPacket); - } - catch (...) - { - - } - } -} - -void NvEncoder::UnregisterInputResources() -{ - FlushEncoder(); - - if (m_bMotionEstimationOnly) - { - for (uint32_t i = 0; i < m_vMappedRefBuffers.size(); ++i) - { - if (m_vMappedRefBuffers[i]) - { - m_nvenc.nvEncUnmapInputResource(m_hEncoder, m_vMappedRefBuffers[i]); - } - } - } - m_vMappedRefBuffers.clear(); - - for (uint32_t i = 0; i < m_vMappedInputBuffers.size(); ++i) - { - if (m_vMappedInputBuffers[i]) - { - m_nvenc.nvEncUnmapInputResource(m_hEncoder, m_vMappedInputBuffers[i]); - } - } - m_vMappedInputBuffers.clear(); - - for (uint32_t i = 0; i < m_vRegisteredResources.size(); ++i) - { - if (m_vRegisteredResources[i]) - { - m_nvenc.nvEncUnregisterResource(m_hEncoder, m_vRegisteredResources[i]); - } - } - m_vRegisteredResources.clear(); - - - for (uint32_t i = 0; i < m_vRegisteredResourcesForReference.size(); ++i) - { - if (m_vRegisteredResourcesForReference[i]) - { - m_nvenc.nvEncUnregisterResource(m_hEncoder, m_vRegisteredResourcesForReference[i]); - } - } - m_vRegisteredResourcesForReference.clear(); - -} - - -void NvEncoder::WaitForCompletionEvent(int iEvent) -{ -#if defined(_WIN32) - // Check if we are in async mode. If not, don't wait for event; - NV_ENC_CONFIG sEncodeConfig = { 0 }; - NV_ENC_INITIALIZE_PARAMS sInitializeParams = { 0 }; - sInitializeParams.encodeConfig = &sEncodeConfig; - GetInitializeParams(&sInitializeParams); - - if (0U == sInitializeParams.enableEncodeAsync) - { - return; - } -#ifdef DEBUG - WaitForSingleObject(m_vpCompletionEvent[iEvent], INFINITE); -#else - // wait for 20s which is infinite on terms of gpu time - if (WaitForSingleObject(m_vpCompletionEvent[iEvent], 20000) == WAIT_FAILED) - { - NVENC_THROW_ERROR("Failed to encode frame", NV_ENC_ERR_GENERIC); - } -#endif -#endif -} - -uint32_t NvEncoder::GetWidthInBytes(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t width) -{ - switch (bufferFormat) { - case NV_ENC_BUFFER_FORMAT_NV12: - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - case NV_ENC_BUFFER_FORMAT_YUV444: - return width; - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return width * 2; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return width * 4; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return 0; - } -} - -uint32_t NvEncoder::GetNumChromaPlanes(const NV_ENC_BUFFER_FORMAT bufferFormat) -{ - switch (bufferFormat) - { - case NV_ENC_BUFFER_FORMAT_NV12: - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - return 1; - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - case NV_ENC_BUFFER_FORMAT_YUV444: - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return 2; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return 0; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return -1; - } -} - -uint32_t NvEncoder::GetChromaPitch(const NV_ENC_BUFFER_FORMAT bufferFormat,const uint32_t lumaPitch) -{ - switch (bufferFormat) - { - case NV_ENC_BUFFER_FORMAT_NV12: - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - case NV_ENC_BUFFER_FORMAT_YUV444: - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return lumaPitch; - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - return (lumaPitch + 1)/2; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return 0; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return -1; - } -} - -void NvEncoder::GetChromaSubPlaneOffsets(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t pitch, const uint32_t height, std::vector& chromaOffsets) -{ - chromaOffsets.clear(); - switch (bufferFormat) - { - case NV_ENC_BUFFER_FORMAT_NV12: - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - chromaOffsets.push_back(pitch * height); - return; - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - chromaOffsets.push_back(pitch * height); - chromaOffsets.push_back(chromaOffsets[0] + (NvEncoder::GetChromaPitch(bufferFormat, pitch) * GetChromaHeight(bufferFormat, height))); - return; - case NV_ENC_BUFFER_FORMAT_YUV444: - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - chromaOffsets.push_back(pitch * height); - chromaOffsets.push_back(chromaOffsets[0] + (pitch * height)); - return; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return; - } -} - -uint32_t NvEncoder::GetChromaHeight(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t lumaHeight) -{ - switch (bufferFormat) - { - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - case NV_ENC_BUFFER_FORMAT_NV12: - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - return (lumaHeight + 1)/2; - case NV_ENC_BUFFER_FORMAT_YUV444: - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return lumaHeight; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return 0; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return 0; - } -} - -uint32_t NvEncoder::GetChromaWidthInBytes(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t lumaWidth) -{ - switch (bufferFormat) - { - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - return (lumaWidth + 1) / 2; - case NV_ENC_BUFFER_FORMAT_NV12: - return lumaWidth; - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - return 2 * lumaWidth; - case NV_ENC_BUFFER_FORMAT_YUV444: - return lumaWidth; - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return 2 * lumaWidth; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return 0; - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return 0; - } -} - - -int NvEncoder::GetCapabilityValue(GUID guidCodec, NV_ENC_CAPS capsToQuery) -{ - if (!m_hEncoder) - { - return 0; - } - NV_ENC_CAPS_PARAM capsParam = { NV_ENC_CAPS_PARAM_VER }; - capsParam.capsToQuery = capsToQuery; - int v; - m_nvenc.nvEncGetEncodeCaps(m_hEncoder, guidCodec, &capsParam, &v); - return v; -} - -int NvEncoder::GetFrameSize() const -{ - switch (GetPixelFormat()) - { - case NV_ENC_BUFFER_FORMAT_YV12: - case NV_ENC_BUFFER_FORMAT_IYUV: - case NV_ENC_BUFFER_FORMAT_NV12: - return GetEncodeWidth() * (GetEncodeHeight() + (GetEncodeHeight() + 1) / 2); - case NV_ENC_BUFFER_FORMAT_YUV420_10BIT: - return 2 * GetEncodeWidth() * (GetEncodeHeight() + (GetEncodeHeight() + 1) / 2); - case NV_ENC_BUFFER_FORMAT_YUV444: - return GetEncodeWidth() * GetEncodeHeight() * 3; - case NV_ENC_BUFFER_FORMAT_YUV444_10BIT: - return 2 * GetEncodeWidth() * GetEncodeHeight() * 3; - case NV_ENC_BUFFER_FORMAT_ARGB: - case NV_ENC_BUFFER_FORMAT_ARGB10: - case NV_ENC_BUFFER_FORMAT_AYUV: - case NV_ENC_BUFFER_FORMAT_ABGR: - case NV_ENC_BUFFER_FORMAT_ABGR10: - return 4 * GetEncodeWidth() * GetEncodeHeight(); - default: - NVENC_THROW_ERROR("Invalid Buffer format", NV_ENC_ERR_INVALID_PARAM); - return 0; - } -} - -void NvEncoder::GetInitializeParams(NV_ENC_INITIALIZE_PARAMS *pInitializeParams) -{ - if (!pInitializeParams || !pInitializeParams->encodeConfig) - { - NVENC_THROW_ERROR("Both pInitializeParams and pInitializeParams->encodeConfig can't be NULL", NV_ENC_ERR_INVALID_PTR); - } - NV_ENC_CONFIG *pEncodeConfig = pInitializeParams->encodeConfig; - *pEncodeConfig = m_encodeConfig; - *pInitializeParams = m_initializeParams; - pInitializeParams->encodeConfig = pEncodeConfig; -} - -void NvEncoder::InitializeBitstreamBuffer() -{ - for (int i = 0; i < m_nEncoderBuffer; i++) - { - NV_ENC_CREATE_BITSTREAM_BUFFER createBitstreamBuffer = { NV_ENC_CREATE_BITSTREAM_BUFFER_VER }; - NVENC_API_CALL(m_nvenc.nvEncCreateBitstreamBuffer(m_hEncoder, &createBitstreamBuffer)); - m_vBitstreamOutputBuffer[i] = createBitstreamBuffer.bitstreamBuffer; - } -} - -void NvEncoder::DestroyBitstreamBuffer() -{ - for (uint32_t i = 0; i < m_vBitstreamOutputBuffer.size(); i++) - { - if (m_vBitstreamOutputBuffer[i]) - { - m_nvenc.nvEncDestroyBitstreamBuffer(m_hEncoder, m_vBitstreamOutputBuffer[i]); - } - } - - m_vBitstreamOutputBuffer.clear(); -} - -void NvEncoder::InitializeMVOutputBuffer() -{ - for (int i = 0; i < m_nEncoderBuffer; i++) - { - NV_ENC_CREATE_MV_BUFFER createMVBuffer = { NV_ENC_CREATE_MV_BUFFER_VER }; - NVENC_API_CALL(m_nvenc.nvEncCreateMVBuffer(m_hEncoder, &createMVBuffer)); - m_vMVDataOutputBuffer.push_back(createMVBuffer.mvBuffer); - } -} - -void NvEncoder::DestroyMVOutputBuffer() -{ - for (uint32_t i = 0; i < m_vMVDataOutputBuffer.size(); i++) - { - if (m_vMVDataOutputBuffer[i]) - { - m_nvenc.nvEncDestroyMVBuffer(m_hEncoder, m_vMVDataOutputBuffer[i]); - } - } - - m_vMVDataOutputBuffer.clear(); -} - -NVENCSTATUS NvEncoder::DoMotionEstimation(NV_ENC_INPUT_PTR inputBuffer, NV_ENC_INPUT_PTR inputBufferForReference, NV_ENC_OUTPUT_PTR outputBuffer) -{ - NV_ENC_MEONLY_PARAMS meParams = { NV_ENC_MEONLY_PARAMS_VER }; - meParams.inputBuffer = inputBuffer; - meParams.referenceFrame = inputBufferForReference; - meParams.inputWidth = GetEncodeWidth(); - meParams.inputHeight = GetEncodeHeight(); - meParams.mvBuffer = outputBuffer; - meParams.completionEvent = GetCompletionEvent(m_iToSend % m_nEncoderBuffer); - NVENCSTATUS nvStatus = m_nvenc.nvEncRunMotionEstimationOnly(m_hEncoder, &meParams); - - return nvStatus; -} diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.h deleted file mode 100644 index 5fe49b7d..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoder.h +++ /dev/null @@ -1,483 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include -#include "nvEncodeAPI.h" -#include -#include -#include -#include -#include -#include -#include "dynlink_loader.h" -#include "../Utils/NvCodecUtils.h" - -struct NvPacket -{ - std::vector data; - NV_ENC_PIC_TYPE pictureType; - - NvPacket(std::vector data, NV_ENC_PIC_TYPE pictureType): - data(data), pictureType(pictureType) - {} - - NvPacket(): data(std::vector()), pictureType(NV_ENC_PIC_TYPE_UNKNOWN) - {} -}; - -/** -* @brief Exception class for error reporting from NvEncodeAPI calls. -*/ -class NVENCException : public std::exception -{ -public: - NVENCException(const std::string& errorStr, const NVENCSTATUS errorCode) - : m_errorString(errorStr), m_errorCode(errorCode) {} - - virtual ~NVENCException() throw() {} - virtual const char* what() const throw() { return m_errorString.c_str(); } - NVENCSTATUS getErrorCode() const { return m_errorCode; } - const std::string& getErrorString() const { return m_errorString; } - static NVENCException makeNVENCException(const std::string& errorStr, const NVENCSTATUS errorCode, - const std::string& functionName, const std::string& fileName, int lineNo); -private: - std::string m_errorString; - NVENCSTATUS m_errorCode; -}; - -inline NVENCException NVENCException::makeNVENCException(const std::string& errorStr, const NVENCSTATUS errorCode, const std::string& functionName, - const std::string& fileName, int lineNo) -{ - std::ostringstream errorLog; - errorLog << functionName << " : " << errorStr << " at " << fileName << ":" << lineNo << std::endl; - NVENCException exception(errorLog.str(), errorCode); - return exception; -} - -#define NVENC_THROW_ERROR( errorStr, errorCode ) \ - do \ - { \ - throw NVENCException::makeNVENCException(errorStr, errorCode, __FUNCTION__, __FILE__, __LINE__); \ - } while (0) - - -#define NVENC_API_CALL( nvencAPI ) \ - do \ - { \ - NVENCSTATUS errorCode = nvencAPI; \ - if( errorCode != NV_ENC_SUCCESS) \ - { \ - std::ostringstream errorLog; \ - errorLog << #nvencAPI << " returned error " << errorCode; \ - throw NVENCException::makeNVENCException(errorLog.str(), errorCode, __FUNCTION__, __FILE__, __LINE__); \ - } \ - } while (0) - -struct NvEncInputFrame -{ - void* inputPtr = nullptr; - uint32_t chromaOffsets[2]; - uint32_t numChromaPlanes; - uint32_t pitch; - uint32_t chromaPitch; - NV_ENC_BUFFER_FORMAT bufferFormat; - NV_ENC_INPUT_RESOURCE_TYPE resourceType; -}; - -/** -* @brief Shared base class for different encoder interfaces. -*/ -class NvEncoder -{ -public: - /** - * @brief This function is used to initialize the encoder session. - * Application must call this function to initialize the encoder, before - * starting to encode any frames. - */ - virtual void CreateEncoder(const NV_ENC_INITIALIZE_PARAMS* pEncodeParams); - - /** - * @brief This function is used to destroy the encoder session. - * Application must call this function to destroy the encoder session and - * clean up any allocated resources. The application must call EndEncode() - * function to get any queued encoded frames before calling DestroyEncoder(). - */ - virtual void DestroyEncoder(); - - /** - * @brief This function is used to reconfigure an existing encoder session. - * Application can use this function to dynamically change the bitrate, - * resolution and other QOS parameters. If the application changes the - * resolution, it must set NV_ENC_RECONFIGURE_PARAMS::forceIDR. - */ - bool Reconfigure(const NV_ENC_RECONFIGURE_PARAMS *pReconfigureParams); - - /** - * @brief This function is used to get the next available input buffer. - * Applications must call this function to obtain a pointer to the next - * input buffer. The application must copy the uncompressed data to the - * input buffer and then call EncodeFrame() function to encode it. - */ - const NvEncInputFrame* GetNextInputFrame(); - - - /** - * @brief This function is used to encode a frame. - * Applications must call EncodeFrame() function to encode the uncompressed - * data, which has been copied to an input buffer obtained from the - * GetNextInputFrame() function. - */ - virtual void EncodeFrame(std::vector &vPacket, NV_ENC_PIC_PARAMS *pPicParams = nullptr); - - /** - * @brief This function to flush the encoder queue. - * The encoder might be queuing frames for B picture encoding or lookahead; - * the application must call EndEncode() to get all the queued encoded frames - * from the encoder. The application must call this function before destroying - * an encoder session. - */ - virtual void EndEncode(std::vector &vPacket); - - /** - * @brief This function is used to query hardware encoder capabilities. - * Applications can call this function to query capabilities like maximum encode - * dimensions, support for lookahead or the ME-only mode etc. - */ - int GetCapabilityValue(GUID guidCodec, NV_ENC_CAPS capsToQuery); - - /** - * @brief This function is used to get the current device on which encoder is running. - */ - void *GetDevice() const { return m_pDevice; } - - /** - * @brief This function is used to get the current device type which encoder is running. - */ - NV_ENC_DEVICE_TYPE GetDeviceType() const { return m_eDeviceType; } - - /** - * @brief This function is used to get the current encode width. - * The encode width can be modified by Reconfigure() function. - */ - int GetEncodeWidth() const { return m_nWidth; } - - /** - * @brief This function is used to get the current encode height. - * The encode height can be modified by Reconfigure() function. - */ - int GetEncodeHeight() const { return m_nHeight; } - - /** - * @brief This function is used to get the current frame size based on pixel format. - */ - int GetFrameSize() const; - - /** - * @brief This function is used to initialize config parameters based on - * given codec and preset guids. - * The application can call this function to get the default configuration - * for a certain preset. The application can either use these parameters - * directly or override them with application-specific settings before - * using them in CreateEncoder() function. - */ - void CreateDefaultEncoderParams(NV_ENC_INITIALIZE_PARAMS* pIntializeParams, GUID codecGuid, GUID presetGuid, NV_ENC_TUNING_INFO tuningInfo = NV_ENC_TUNING_INFO_UNDEFINED); - - /** - * @brief This function is used to get the current initialization parameters, - * which had been used to configure the encoder session. - * The initialization parameters are modified if the application calls - * Reconfigure() function. - */ - void GetInitializeParams(NV_ENC_INITIALIZE_PARAMS *pInitializeParams); - - /** - * @brief This function is used to run motion estimation - * This is used to run motion estimation on a a pair of frames. The - * application must copy the reference frame data to the buffer obtained - * by calling GetNextReferenceFrame(), and copy the input frame data to - * the buffer obtained by calling GetNextInputFrame() before calling the - * RunMotionEstimation() function. - */ - void RunMotionEstimation(std::vector &mvData); - - /** - * @brief This function is used to get an available reference frame. - * Application must call this function to get a pointer to reference buffer, - * to be used in the subsequent RunMotionEstimation() function. - */ - const NvEncInputFrame* GetNextReferenceFrame(); - - /** - * @brief This function is used to get sequence and picture parameter headers. - * Application can call this function after encoder is initialized to get SPS and PPS - * nalus for the current encoder instance. The sequence header data might change when - * application calls Reconfigure() function. - */ - void GetSequenceParams(std::vector &seqParams); - - /** - * @brief NvEncoder class virtual destructor. - */ - virtual ~NvEncoder(); - -public: - /** - * @brief This a static function to get chroma offsets for YUV planar formats. - */ - static void GetChromaSubPlaneOffsets(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t pitch, - const uint32_t height, std::vector& chromaOffsets); - /** - * @brief This a static function to get the chroma plane pitch for YUV planar formats. - */ - static uint32_t GetChromaPitch(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t lumaPitch); - - /** - * @brief This a static function to get the number of chroma planes for YUV planar formats. - */ - static uint32_t GetNumChromaPlanes(const NV_ENC_BUFFER_FORMAT bufferFormat); - - /** - * @brief This a static function to get the chroma plane width in bytes for YUV planar formats. - */ - static uint32_t GetChromaWidthInBytes(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t lumaWidth); - - /** - * @brief This a static function to get the chroma planes height in bytes for YUV planar formats. - */ - static uint32_t GetChromaHeight(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t lumaHeight); - - - /** - * @brief This a static function to get the width in bytes for the frame. - * For YUV planar format this is the width in bytes of the luma plane. - */ - static uint32_t GetWidthInBytes(const NV_ENC_BUFFER_FORMAT bufferFormat, const uint32_t width); - - /** - * @brief This function returns the number of allocated buffers. - */ - uint32_t GetEncoderBufferCount() const { return m_nEncoderBuffer; } - - /* - * @brief This function returns initializeParams(width, height, fps etc). - */ - NV_ENC_INITIALIZE_PARAMS GetinitializeParams() const { return m_initializeParams; } -protected: - - /** - * @brief NvEncoder class constructor. - * NvEncoder class constructor cannot be called directly by the application. - */ - NvEncoder(NvencFunctions *nvenc_dl, NV_ENC_DEVICE_TYPE eDeviceType, void *pDevice, uint32_t nWidth, uint32_t nHeight, - NV_ENC_BUFFER_FORMAT eBufferFormat, uint32_t nOutputDelay, bool bMotionEstimationOnly, bool bOutputInVideoMemory = false, bool bDX12Encode = false, - bool bUseIVFContainer = true); - - /** - * @brief This function is used to check if hardware encoder is properly initialized. - */ - bool IsHWEncoderInitialized() const { return m_hEncoder != NULL && m_bEncoderInitialized; } - - /** - * @brief This function is used to register CUDA, D3D or OpenGL input buffers with NvEncodeAPI. - * This is non public function and is called by derived class for allocating - * and registering input buffers. - */ - void RegisterInputResources(std::vector inputframes, NV_ENC_INPUT_RESOURCE_TYPE eResourceType, - int width, int height, int pitch, NV_ENC_BUFFER_FORMAT bufferFormat, bool bReferenceFrame = false); - - /** - * @brief This function is used to unregister resources which had been previously registered for encoding - * using RegisterInputResources() function. - */ - void UnregisterInputResources(); - - /** - * @brief This function is used to register CUDA, D3D or OpenGL input or output buffers with NvEncodeAPI. - */ - NV_ENC_REGISTERED_PTR RegisterResource(void *pBuffer, NV_ENC_INPUT_RESOURCE_TYPE eResourceType, - int width, int height, int pitch, NV_ENC_BUFFER_FORMAT bufferFormat, NV_ENC_BUFFER_USAGE bufferUsage = NV_ENC_INPUT_IMAGE, - NV_ENC_FENCE_POINT_D3D12* pInputFencePoint = NULL); - - /** - * @brief This function returns maximum width used to open the encoder session. - * All encode input buffers are allocated using maximum dimensions. - */ - uint32_t GetMaxEncodeWidth() const { return m_nMaxEncodeWidth; } - - /** - * @brief This function returns maximum height used to open the encoder session. - * All encode input buffers are allocated using maximum dimensions. - */ - uint32_t GetMaxEncodeHeight() const { return m_nMaxEncodeHeight; } - - /** - * @brief This function returns the completion event. - */ - void* GetCompletionEvent(uint32_t eventIdx) { return (m_vpCompletionEvent.size() == m_nEncoderBuffer) ? m_vpCompletionEvent[eventIdx] : nullptr; } - - /** - * @brief This function returns the current pixel format. - */ - NV_ENC_BUFFER_FORMAT GetPixelFormat() const { return m_eBufferFormat; } - - /** - * @brief This function is used to submit the encode commands to the - * NVENC hardware. - */ - NVENCSTATUS DoEncode(NV_ENC_INPUT_PTR inputBuffer, NV_ENC_OUTPUT_PTR outputBuffer, NV_ENC_PIC_PARAMS *pPicParams); - - /** - * @brief This function is used to submit the encode commands to the - * NVENC hardware for ME only mode. - */ - NVENCSTATUS DoMotionEstimation(NV_ENC_INPUT_PTR inputBuffer, NV_ENC_INPUT_PTR inputBufferForReference, NV_ENC_OUTPUT_PTR outputBuffer); - - /** - * @brief This function is used to map the input buffers to NvEncodeAPI. - */ - void MapResources(uint32_t bfrIdx); - - /** - * @brief This function is used to wait for completion of encode command. - */ - void WaitForCompletionEvent(int iEvent); - - /** - * @brief This function is used to send EOS to HW encoder. - */ - void SendEOS(); - -private: - /** - * @brief This is a private function which is used to check if there is any - buffering done by encoder. - * The encoder generally buffers data to encode B frames or for lookahead - * or pipelining. - */ - bool IsZeroDelay() { return m_nOutputDelay == 0; } - - /** - * @brief This is a private function which is used to load the encode api shared library. - */ - void LoadNvEncApi(); - - /** - * @brief This is a private function which is used to get the output packets - * from the encoder HW. - * This is called by DoEncode() function. If there is buffering enabled, - * this may return without any output data. - */ - void GetEncodedPacket(std::vector &vOutputBuffer, std::vector &vPacket, bool bOutputDelay); - - /** - * @brief This is a private function which is used to initialize the bitstream buffers. - * This is only used in the encoding mode. - */ - void InitializeBitstreamBuffer(); - - /** - * @brief This is a private function which is used to destroy the bitstream buffers. - * This is only used in the encoding mode. - */ - void DestroyBitstreamBuffer(); - - /** - * @brief This is a private function which is used to initialize MV output buffers. - * This is only used in ME-only Mode. - */ - void InitializeMVOutputBuffer(); - - /** - * @brief This is a private function which is used to destroy MV output buffers. - * This is only used in ME-only Mode. - */ - void DestroyMVOutputBuffer(); - - /** - * @brief This is a private function which is used to destroy HW encoder. - */ - void DestroyHWEncoder(); - - /** - * @brief This function is used to flush the encoder queue. - */ - void FlushEncoder(); - -private: - /** - * @brief This is a pure virtual function which is used to allocate input buffers. - * The derived classes must implement this function. - */ - virtual void AllocateInputBuffers(int32_t numInputBuffers) = 0; - - /** - * @brief This is a pure virtual function which is used to destroy input buffers. - * The derived classes must implement this function. - */ - virtual void ReleaseInputBuffers() = 0; - -protected: - bool m_bMotionEstimationOnly = false; - bool m_bOutputInVideoMemory = false; - bool m_bIsDX12Encode = false; - void *m_hEncoder = nullptr; - NV_ENCODE_API_FUNCTION_LIST m_nvenc; - NV_ENC_INITIALIZE_PARAMS m_initializeParams = {}; - std::vector m_vInputFrames; - std::vector m_vRegisteredResources; - std::vector m_vReferenceFrames; - std::vector m_vRegisteredResourcesForReference; - std::vector m_vMappedInputBuffers; - std::vector m_vMappedRefBuffers; - std::vector m_vpCompletionEvent; - - int32_t m_iToSend = 0; - int32_t m_iGot = 0; - int32_t m_nEncoderBuffer = 0; - int32_t m_nOutputDelay = 0; - IVFUtils m_IVFUtils; - bool m_bWriteIVFFileHeader = true; - bool m_bUseIVFContainer = true; - -private: - NvencFunctions *m_nvenc_dl = NULL; - uint32_t m_nWidth; - uint32_t m_nHeight; - NV_ENC_BUFFER_FORMAT m_eBufferFormat; - void *m_pDevice; - NV_ENC_DEVICE_TYPE m_eDeviceType; - NV_ENC_CONFIG m_encodeConfig = {}; - bool m_bEncoderInitialized = false; - uint32_t m_nExtraOutputDelay = 3; // To ensure encode and graphics can work in parallel, m_nExtraOutputDelay should be set to at least 1 - std::vector m_vBitstreamOutputBuffer; - std::vector m_vMVDataOutputBuffer; - uint32_t m_nMaxEncodeWidth = 0; - uint32_t m_nMaxEncodeHeight = 0; -}; diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.cpp b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.cpp deleted file mode 100644 index 3402b5af..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - -// #ifndef WIN32 -// #include -// #endif -#include "NvEncoder/NvEncoderD3D11.h" -#include - -#ifndef MAKEFOURCC -#define MAKEFOURCC(a,b,c,d) (((unsigned int)a) | (((unsigned int)b)<< 8) | (((unsigned int)c)<<16) | (((unsigned int)d)<<24) ) -#endif - -DXGI_FORMAT GetD3D11Format(NV_ENC_BUFFER_FORMAT eBufferFormat) -{ - switch (eBufferFormat) - { - case NV_ENC_BUFFER_FORMAT_NV12: - return DXGI_FORMAT_NV12; - case NV_ENC_BUFFER_FORMAT_ARGB: - return DXGI_FORMAT_B8G8R8A8_UNORM; - default: - return DXGI_FORMAT_UNKNOWN; - } -} - -NvEncoderD3D11::NvEncoderD3D11(CudaFunctions *cuda_dl, NvencFunctions *nvenc_dl, ID3D11Device* pD3D11Device, uint32_t nWidth, uint32_t nHeight, - NV_ENC_BUFFER_FORMAT eBufferFormat, uint32_t nExtraOutputDelay, bool bMotionEstimationOnly, bool bOutputInVideoMemory) : - NvEncoder(nvenc_dl, NV_ENC_DEVICE_TYPE_DIRECTX, pD3D11Device, nWidth, nHeight, eBufferFormat, nExtraOutputDelay, bMotionEstimationOnly, bOutputInVideoMemory) -{ - if (!pD3D11Device) - { - NVENC_THROW_ERROR("Bad d3d11device ptr", NV_ENC_ERR_INVALID_PTR); - return; - } - - if (GetD3D11Format(GetPixelFormat()) == DXGI_FORMAT_UNKNOWN) - { - NVENC_THROW_ERROR("Unsupported Buffer format", NV_ENC_ERR_INVALID_PARAM); - } - - if (!m_hEncoder) - { - NVENC_THROW_ERROR("Encoder Initialization failed", NV_ENC_ERR_INVALID_DEVICE); - } - - m_pD3D11Device = pD3D11Device; - m_pD3D11Device->AddRef(); - m_pD3D11Device->GetImmediateContext(&m_pD3D11DeviceContext); -} - -NvEncoderD3D11::~NvEncoderD3D11() -{ - ReleaseD3D11Resources(); -} - -void NvEncoderD3D11::AllocateInputBuffers(int32_t numInputBuffers) -{ - if (!IsHWEncoderInitialized()) - { - NVENC_THROW_ERROR("Encoder intialization failed", NV_ENC_ERR_ENCODER_NOT_INITIALIZED); - } - - // for MEOnly mode we need to allocate seperate set of buffers for reference frame - int numCount = m_bMotionEstimationOnly ? 2 : 1; - for (int count = 0; count < numCount; count++) - { - std::vector inputFrames; - for (int i = 0; i < numInputBuffers; i++) - { - ID3D11Texture2D *pInputTextures = NULL; - D3D11_TEXTURE2D_DESC desc; - ZeroMemory(&desc, sizeof(D3D11_TEXTURE2D_DESC)); - desc.Width = GetMaxEncodeWidth(); - desc.Height = GetMaxEncodeHeight(); - desc.MipLevels = 1; - desc.ArraySize = 1; - desc.Format = GetD3D11Format(GetPixelFormat()); - desc.SampleDesc.Count = 1; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.BindFlags = D3D11_BIND_RENDER_TARGET; - desc.CPUAccessFlags = 0; - if (m_pD3D11Device->CreateTexture2D(&desc, NULL, &pInputTextures) != S_OK) - { - NVENC_THROW_ERROR("Failed to create d3d11textures", NV_ENC_ERR_OUT_OF_MEMORY); - } - inputFrames.push_back(pInputTextures); - } - RegisterInputResources(inputFrames, NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX, - GetMaxEncodeWidth(), GetMaxEncodeHeight(), 0, GetPixelFormat(), count == 1 ? true : false); - } -} - -void NvEncoderD3D11::ReleaseInputBuffers() -{ - ReleaseD3D11Resources(); -} - -void NvEncoderD3D11::ReleaseD3D11Resources() -{ - if (!m_hEncoder) - { - return; - } - - UnregisterInputResources(); - - for (uint32_t i = 0; i < m_vInputFrames.size(); ++i) - { - if (m_vInputFrames[i].inputPtr) - { - reinterpret_cast(m_vInputFrames[i].inputPtr)->Release(); - } - } - m_vInputFrames.clear(); - - for (uint32_t i = 0; i < m_vReferenceFrames.size(); ++i) - { - if (m_vReferenceFrames[i].inputPtr) - { - reinterpret_cast(m_vReferenceFrames[i].inputPtr)->Release(); - } - } - m_vReferenceFrames.clear(); - - if (m_pD3D11DeviceContext) - { - m_pD3D11DeviceContext->Release(); - m_pD3D11DeviceContext = nullptr; - } - - if (m_pD3D11Device) - { - m_pD3D11Device->Release(); - m_pD3D11Device = nullptr; - } -} - diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.h deleted file mode 100644 index 198c4495..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/NvCodec/NvEncoder/NvEncoderD3D11.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include "NvEncoder.h" - -class NvEncoderD3D11 : public NvEncoder -{ -public: - NvEncoderD3D11(CudaFunctions *cuda_dl, NvencFunctions *nvenc_dl, ID3D11Device* pD3D11Device, uint32_t nWidth, uint32_t nHeight, NV_ENC_BUFFER_FORMAT eBufferFormat, - uint32_t nExtraOutputDelay = 3, bool bMotionEstimationOnly = false, bool bOPInVideoMemory = false); - virtual ~NvEncoderD3D11(); - -protected: - /** - * @brief This function is used to release the input buffers allocated for encoding. - * This function is an override of virtual function NvEncoder::ReleaseInputBuffers(). - */ - virtual void ReleaseInputBuffers() override; - -private: - /** - * @brief This function is used to allocate input buffers for encoding. - * This function is an override of virtual function NvEncoder::AllocateInputBuffers(). - * This function creates ID3D11Texture2D textures which is used to accept input data. - * To obtain handle to input buffers application must call NvEncoder::GetNextInputFrame() - */ - virtual void AllocateInputBuffers(int32_t numInputBuffers) override; - -private: - /** - * @brief This is a private function to release ID3D11Texture2D textures used for encoding. - */ - void ReleaseD3D11Resources(); - -protected: - ID3D11Device *m_pD3D11Device = nullptr; - -private: - ID3D11DeviceContext* m_pD3D11DeviceContext = nullptr; -}; diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/Logger.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/Logger.h deleted file mode 100644 index 4a7d159c..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/Logger.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#include -#include - -#pragma comment(lib, "ws2_32.lib") -#undef ERROR -#else -#include -#include -#include -#include -#define SOCKET int -#define INVALID_SOCKET -1 -#endif - -enum LogLevel { - TRACE, - INFO, - WARNING, - ERROR, - FATAL -}; - -namespace simplelogger{ -class Logger { -public: - Logger(LogLevel level, bool bPrintTimeStamp) : level(level), bPrintTimeStamp(bPrintTimeStamp) {} - virtual ~Logger() {} - virtual std::ostream& GetStream() = 0; - virtual void FlushStream() {} - bool ShouldLogFor(LogLevel l) { - return l >= level; - } - char* GetLead(LogLevel l, const char *szFile, int nLine, const char *szFunc) { - if (l < TRACE || l > FATAL) { - sprintf(szLead, "[?????] "); - return szLead; - } - const char *szLevels[] = {"TRACE", "INFO", "WARN", "ERROR", "FATAL"}; - if (bPrintTimeStamp) { - time_t t = time(NULL); - struct tm *ptm = localtime(&t); - sprintf(szLead, "[%-5s][%02d:%02d:%02d] ", - szLevels[l], ptm->tm_hour, ptm->tm_min, ptm->tm_sec); - } else { - sprintf(szLead, "[%-5s] ", szLevels[l]); - } - return szLead; - } - void EnterCriticalSection() { - mtx.lock(); - } - void LeaveCriticalSection() { - mtx.unlock(); - } -private: - LogLevel level; - char szLead[80]; - bool bPrintTimeStamp; - std::mutex mtx; -}; - -class LoggerFactory { -public: - static Logger* CreateFileLogger(std::string strFilePath, - LogLevel level = INFO, bool bPrintTimeStamp = true) { - return new FileLogger(strFilePath, level, bPrintTimeStamp); - } - static Logger* CreateConsoleLogger(LogLevel level = INFO, - bool bPrintTimeStamp = true) { - return new ConsoleLogger(level, bPrintTimeStamp); - } - static Logger* CreateUdpLogger(char *szHost, unsigned uPort, LogLevel level = INFO, - bool bPrintTimeStamp = true) { - return new UdpLogger(szHost, uPort, level, bPrintTimeStamp); - } -private: - LoggerFactory() {} - - class FileLogger : public Logger { - public: - FileLogger(std::string strFilePath, LogLevel level, bool bPrintTimeStamp) - : Logger(level, bPrintTimeStamp) { - pFileOut = new std::ofstream(); - pFileOut->open(strFilePath.c_str()); - } - ~FileLogger() { - pFileOut->close(); - } - std::ostream& GetStream() { - return *pFileOut; - } - private: - std::ofstream *pFileOut; - }; - - class ConsoleLogger : public Logger { - public: - ConsoleLogger(LogLevel level, bool bPrintTimeStamp) - : Logger(level, bPrintTimeStamp) {} - std::ostream& GetStream() { - return std::cout; - } - }; - - class UdpLogger : public Logger { - private: - class UdpOstream : public std::ostream { - public: - UdpOstream(char *szHost, unsigned short uPort) : std::ostream(&sb), socket(INVALID_SOCKET){ -#ifdef _WIN32 - WSADATA w; - if (WSAStartup(0x0101, &w) != 0) { - fprintf(stderr, "WSAStartup() failed.\n"); - return; - } -#endif - socket = ::socket(AF_INET, SOCK_DGRAM, 0); - if (socket == INVALID_SOCKET) { -#ifdef _WIN32 - WSACleanup(); -#endif - fprintf(stderr, "socket() failed.\n"); - return; - } -#ifdef _WIN32 - unsigned int b1, b2, b3, b4; - sscanf(szHost, "%u.%u.%u.%u", &b1, &b2, &b3, &b4); - struct in_addr addr = {(unsigned char)b1, (unsigned char)b2, (unsigned char)b3, (unsigned char)b4}; -#else - struct in_addr addr = {inet_addr(szHost)}; -#endif - struct sockaddr_in s = {AF_INET, htons(uPort), addr}; - server = s; - } - ~UdpOstream() throw() { - if (socket == INVALID_SOCKET) { - return; - } -#ifdef _WIN32 - closesocket(socket); - WSACleanup(); -#else - close(socket); -#endif - } - void Flush() { - if (sendto(socket, sb.str().c_str(), (int)sb.str().length() + 1, - 0, (struct sockaddr *)&server, (int)sizeof(sockaddr_in)) == -1) { - fprintf(stderr, "sendto() failed.\n"); - } - sb.str(""); - } - - private: - std::stringbuf sb; - SOCKET socket; - struct sockaddr_in server; - }; - public: - UdpLogger(char *szHost, unsigned uPort, LogLevel level, bool bPrintTimeStamp) - : Logger(level, bPrintTimeStamp), udpOut(szHost, (unsigned short)uPort) {} - UdpOstream& GetStream() { - return udpOut; - } - virtual void FlushStream() { - udpOut.Flush(); - } - private: - UdpOstream udpOut; - }; -}; - -class LogTransaction { -public: - LogTransaction(Logger *pLogger, LogLevel level, const char *szFile, const int nLine, const char *szFunc) : pLogger(pLogger), level(level) { - if (!pLogger) { - std::cout << "[-----] "; - return; - } - if (!pLogger->ShouldLogFor(level)) { - return; - } - pLogger->EnterCriticalSection(); - pLogger->GetStream() << pLogger->GetLead(level, szFile, nLine, szFunc); - } - ~LogTransaction() { - if (!pLogger) { - std::cout << std::endl; - return; - } - if (!pLogger->ShouldLogFor(level)) { - return; - } - pLogger->GetStream() << std::endl; - pLogger->FlushStream(); - pLogger->LeaveCriticalSection(); - if (level == FATAL) { - exit(1); - } - } - std::ostream& GetStream() { - if (!pLogger) { - return std::cout; - } - if (!pLogger->ShouldLogFor(level)) { - return ossNull; - } - return pLogger->GetStream(); - } -private: - Logger *pLogger; - LogLevel level; - std::ostringstream ossNull; -}; - -} - -extern simplelogger::Logger *logger; -#define LOG(level) simplelogger::LogTransaction(logger, level, __FILE__, __LINE__, __FUNCTION__).GetStream() diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvCodecUtils.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvCodecUtils.h deleted file mode 100644 index 825f0d9e..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvCodecUtils.h +++ /dev/null @@ -1,552 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -//--------------------------------------------------------------------------- -//! \file NvCodecUtils.h -//! \brief Miscellaneous classes and error checking functions. -//! -//! Used by Transcode/Encode samples apps for reading input files, mutithreading, performance measurement or colorspace conversion while decoding. -//--------------------------------------------------------------------------- - -#pragma once -#include -#include -#include -#include -#include -#include -#include "Logger.h" -#include -#include -#include -#include -#include -#include - -extern simplelogger::Logger *logger; - -#ifdef __cuda_cuda_h__ -inline bool check(CUresult e, int iLine, const char *szFile) { - if (e != CUDA_SUCCESS) { - const char *szErrName = NULL; - cuGetErrorName(e, &szErrName); - LOG(FATAL) << "CUDA driver API error " << szErrName << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} -#endif - -#ifdef __CUDA_RUNTIME_H__ -inline bool check(cudaError_t e, int iLine, const char *szFile) { - if (e != cudaSuccess) { - LOG(FATAL) << "CUDA runtime API error " << cudaGetErrorName(e) << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} -#endif - -#ifdef _NV_ENCODEAPI_H_ -inline bool check(NVENCSTATUS e, int iLine, const char *szFile) { - const char *aszErrName[] = { - "NV_ENC_SUCCESS", - "NV_ENC_ERR_NO_ENCODE_DEVICE", - "NV_ENC_ERR_UNSUPPORTED_DEVICE", - "NV_ENC_ERR_INVALID_ENCODERDEVICE", - "NV_ENC_ERR_INVALID_DEVICE", - "NV_ENC_ERR_DEVICE_NOT_EXIST", - "NV_ENC_ERR_INVALID_PTR", - "NV_ENC_ERR_INVALID_EVENT", - "NV_ENC_ERR_INVALID_PARAM", - "NV_ENC_ERR_INVALID_CALL", - "NV_ENC_ERR_OUT_OF_MEMORY", - "NV_ENC_ERR_ENCODER_NOT_INITIALIZED", - "NV_ENC_ERR_UNSUPPORTED_PARAM", - "NV_ENC_ERR_LOCK_BUSY", - "NV_ENC_ERR_NOT_ENOUGH_BUFFER", - "NV_ENC_ERR_INVALID_VERSION", - "NV_ENC_ERR_MAP_FAILED", - "NV_ENC_ERR_NEED_MORE_INPUT", - "NV_ENC_ERR_ENCODER_BUSY", - "NV_ENC_ERR_EVENT_NOT_REGISTERD", - "NV_ENC_ERR_GENERIC", - "NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY", - "NV_ENC_ERR_UNIMPLEMENTED", - "NV_ENC_ERR_RESOURCE_REGISTER_FAILED", - "NV_ENC_ERR_RESOURCE_NOT_REGISTERED", - "NV_ENC_ERR_RESOURCE_NOT_MAPPED", - }; - if (e != NV_ENC_SUCCESS) { - LOG(FATAL) << "NVENC error " << aszErrName[e] << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} -#endif - -#ifdef _WINERROR_ -inline bool check(HRESULT e, int iLine, const char *szFile) { - if (e != S_OK) { - std::stringstream stream; - stream << std::hex << std::uppercase << e; - LOG(FATAL) << "HRESULT error 0x" << stream.str() << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} -#endif - -#if defined(__gl_h_) || defined(__GL_H__) -inline bool check(GLenum e, int iLine, const char *szFile) { - if (e != 0) { - LOG(ERROR) << "GLenum error " << e << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} -#endif - -inline bool check(int e, int iLine, const char *szFile) { - if (e < 0) { - LOG(ERROR) << "General error " << e << " at line " << iLine << " in file " << szFile; - return false; - } - return true; -} - -#define ck(call) check(call, __LINE__, __FILE__) -#define MAKE_FOURCC( ch0, ch1, ch2, ch3 ) \ - ( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \ - ( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) ) - -/** -* @brief Wrapper class around std::thread -*/ -class NvThread -{ -public: - NvThread() = default; - NvThread(const NvThread&) = delete; - NvThread& operator=(const NvThread& other) = delete; - - NvThread(std::thread&& thread) : t(std::move(thread)) - { - - } - - NvThread(NvThread&& thread) : t(std::move(thread.t)) - { - - } - - NvThread& operator=(NvThread&& other) - { - t = std::move(other.t); - return *this; - } - - ~NvThread() - { - join(); - } - - void join() - { - if (t.joinable()) - { - t.join(); - } - } -private: - std::thread t; -}; - -#ifndef _WIN32 -#define _stricmp strcasecmp -#define _stat64 stat64 -#endif - -/** -* @brief Utility class to allocate buffer memory. Helps avoid I/O during the encode/decode loop in case of performance tests. -*/ -class BufferedFileReader { -public: - /** - * @brief Constructor function to allocate appropriate memory and copy file contents into it - */ - BufferedFileReader(const char *szFileName, bool bPartial = false) { - struct _stat64 st; - - if (_stat64(szFileName, &st) != 0) { - return; - } - - nSize = st.st_size; - while (nSize) { - try { - pBuf = new uint8_t[(size_t)nSize]; - if (nSize != st.st_size) { - LOG(WARNING) << "File is too large - only " << std::setprecision(4) << 100.0 * nSize / st.st_size << "% is loaded"; - } - break; - } catch(std::bad_alloc) { - if (!bPartial) { - LOG(ERROR) << "Failed to allocate memory in BufferedReader"; - return; - } - nSize = (uint32_t)(nSize * 0.9); - } - } - - std::ifstream fpIn(szFileName, std::ifstream::in | std::ifstream::binary); - if (!fpIn) - { - LOG(ERROR) << "Unable to open input file: " << szFileName; - return; - } - - std::streamsize nRead = fpIn.read(reinterpret_cast(pBuf), nSize).gcount(); - fpIn.close(); - - assert(nRead == nSize); - } - ~BufferedFileReader() { - if (pBuf) { - delete[] pBuf; - } - } - bool GetBuffer(uint8_t **ppBuf, uint64_t *pnSize) { - if (!pBuf) { - return false; - } - - *ppBuf = pBuf; - *pnSize = nSize; - return true; - } - -private: - uint8_t *pBuf = NULL; - uint64_t nSize = 0; -}; - -/** -* @brief Template class to facilitate color space conversion -*/ -template -class YuvConverter { -public: - YuvConverter(int nWidth, int nHeight) : nWidth(nWidth), nHeight(nHeight) { - pQuad = new T[((nWidth + 1) / 2) * ((nHeight + 1) / 2)]; - } - ~YuvConverter() { - delete[] pQuad; - } - void PlanarToUVInterleaved(T *pFrame, int nPitch = 0) { - if (nPitch == 0) { - nPitch = nWidth; - } - - // sizes of source surface plane - int nSizePlaneY = nPitch * nHeight; - int nSizePlaneU = ((nPitch + 1) / 2) * ((nHeight + 1) / 2); - int nSizePlaneV = nSizePlaneU; - - T *puv = pFrame + nSizePlaneY; - if (nPitch == nWidth) { - memcpy(pQuad, puv, nSizePlaneU * sizeof(T)); - } else { - for (int i = 0; i < (nHeight + 1) / 2; i++) { - memcpy(pQuad + ((nWidth + 1) / 2) * i, puv + ((nPitch + 1) / 2) * i, ((nWidth + 1) / 2) * sizeof(T)); - } - } - T *pv = puv + nSizePlaneU; - for (int y = 0; y < (nHeight + 1) / 2; y++) { - for (int x = 0; x < (nWidth + 1) / 2; x++) { - puv[y * nPitch + x * 2] = pQuad[y * ((nWidth + 1) / 2) + x]; - puv[y * nPitch + x * 2 + 1] = pv[y * ((nPitch + 1) / 2) + x]; - } - } - } - void UVInterleavedToPlanar(T *pFrame, int nPitch = 0) { - if (nPitch == 0) { - nPitch = nWidth; - } - - // sizes of source surface plane - int nSizePlaneY = nPitch * nHeight; - int nSizePlaneU = ((nPitch + 1) / 2) * ((nHeight + 1) / 2); - int nSizePlaneV = nSizePlaneU; - - T *puv = pFrame + nSizePlaneY, - *pu = puv, - *pv = puv + nSizePlaneU; - - // split chroma from interleave to planar - for (int y = 0; y < (nHeight + 1) / 2; y++) { - for (int x = 0; x < (nWidth + 1) / 2; x++) { - pu[y * ((nPitch + 1) / 2) + x] = puv[y * nPitch + x * 2]; - pQuad[y * ((nWidth + 1) / 2) + x] = puv[y * nPitch + x * 2 + 1]; - } - } - if (nPitch == nWidth) { - memcpy(pv, pQuad, nSizePlaneV * sizeof(T)); - } else { - for (int i = 0; i < (nHeight + 1) / 2; i++) { - memcpy(pv + ((nPitch + 1) / 2) * i, pQuad + ((nWidth + 1) / 2) * i, ((nWidth + 1) / 2) * sizeof(T)); - } - } - } - -private: - T *pQuad; - int nWidth, nHeight; -}; - -/** -* @brief Class for writing IVF format header for AV1 codec -*/ -class IVFUtils { -public: - void WriteFileHeader(std::vector &vPacket, uint32_t nFourCC, uint32_t nWidth, uint32_t nHeight, uint32_t nFrameRateNum, uint32_t nFrameRateDen, uint32_t nFrameCnt) - { - char header[32]; - - header[0] = 'D'; - header[1] = 'K'; - header[2] = 'I'; - header[3] = 'F'; - mem_put_le16(header + 4, 0); // version - mem_put_le16(header + 6, 32); // header size - mem_put_le32(header + 8, nFourCC); // fourcc - mem_put_le16(header + 12, nWidth); // width - mem_put_le16(header + 14, nHeight); // height - mem_put_le32(header + 16, nFrameRateNum); // rate - mem_put_le32(header + 20, nFrameRateDen); // scale - mem_put_le32(header + 24, nFrameCnt); // length - mem_put_le32(header + 28, 0); // unused - - vPacket.insert(vPacket.end(), &header[0], &header[32]); - } - - void WriteFrameHeader(std::vector &vPacket, size_t nFrameSize, int64_t pts) - { - char header[12]; - mem_put_le32(header, (int)nFrameSize); - mem_put_le32(header + 4, (int)(pts & 0xFFFFFFFF)); - mem_put_le32(header + 8, (int)(pts >> 32)); - - vPacket.insert(vPacket.end(), &header[0], &header[12]); - } - -private: - static inline void mem_put_le32(void *vmem, int val) - { - unsigned char *mem = (unsigned char *)vmem; - mem[0] = (unsigned char)((val >> 0) & 0xff); - mem[1] = (unsigned char)((val >> 8) & 0xff); - mem[2] = (unsigned char)((val >> 16) & 0xff); - mem[3] = (unsigned char)((val >> 24) & 0xff); - } - - static inline void mem_put_le16(void *vmem, int val) - { - unsigned char *mem = (unsigned char *)vmem; - mem[0] = (unsigned char)((val >> 0) & 0xff); - mem[1] = (unsigned char)((val >> 8) & 0xff); - } - -}; - -/** -* @brief Utility class to measure elapsed time in seconds between the block of executed code -*/ -class StopWatch { -public: - void Start() { - t0 = std::chrono::high_resolution_clock::now(); - } - double Stop() { - return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch() - t0.time_since_epoch()).count() / 1.0e9; - } - -private: - std::chrono::high_resolution_clock::time_point t0; -}; - -template -class ConcurrentQueue -{ - public: - - ConcurrentQueue() {} - ConcurrentQueue(size_t size) : maxSize(size) {} - ConcurrentQueue(const ConcurrentQueue&) = delete; - ConcurrentQueue& operator=(const ConcurrentQueue&) = delete; - - void setSize(size_t s) { - maxSize = s; - } - - void push_back(const T& value) { - // Do not use a std::lock_guard here. We will need to explicitly - // unlock before notify_one as the other waiting thread will - // automatically try to acquire mutex once it wakes up - // (which will happen on notify_one) - std::unique_lock lock(m_mutex); - auto wasEmpty = m_List.empty(); - - while (full()) { - m_cond.wait(lock); - } - - m_List.push_back(value); - if (wasEmpty && !m_List.empty()) { - lock.unlock(); - m_cond.notify_one(); - } - } - - T pop_front() { - std::unique_lock lock(m_mutex); - - while (m_List.empty()) { - m_cond.wait(lock); - } - auto wasFull = full(); - T data = std::move(m_List.front()); - m_List.pop_front(); - - if (wasFull && !full()) { - lock.unlock(); - m_cond.notify_one(); - } - - return data; - } - - T front() { - std::unique_lock lock(m_mutex); - - while (m_List.empty()) { - m_cond.wait(lock); - } - - return m_List.front(); - } - - size_t size() { - std::unique_lock lock(m_mutex); - return m_List.size(); - } - - bool empty() { - std::unique_lock lock(m_mutex); - return m_List.empty(); - } - void clear() { - std::unique_lock lock(m_mutex); - m_List.clear(); - } - -private: - bool full() { - if (maxSize > 0 && m_List.size() == maxSize) - return true; - return false; - } - -private: - std::list m_List; - std::mutex m_mutex; - std::condition_variable m_cond; - size_t maxSize; -}; - -inline void CheckInputFile(const char *szInFilePath) { - std::ifstream fpIn(szInFilePath, std::ios::in | std::ios::binary); - if (fpIn.fail()) { - std::ostringstream err; - err << "Unable to open input file: " << szInFilePath << std::endl; - throw std::invalid_argument(err.str()); - } -} - -inline void ValidateResolution(int nWidth, int nHeight) { - - if (nWidth <= 0 || nHeight <= 0) { - std::ostringstream err; - err << "Please specify positive non zero resolution as -s WxH. Current resolution is " << nWidth << "x" << nHeight << std::endl; - throw std::invalid_argument(err.str()); - } -} - -template -void Nv12ToColor32(uint8_t *dpNv12, int nNv12Pitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 0); -template -void Nv12ToColor64(uint8_t *dpNv12, int nNv12Pitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 0); - -template -void P016ToColor32(uint8_t *dpP016, int nP016Pitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 4); -template -void P016ToColor64(uint8_t *dpP016, int nP016Pitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 4); - -template -void YUV444ToColor32(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 0); -template -void YUV444ToColor64(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 0); - -template -void YUV444P16ToColor32(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 4); -template -void YUV444P16ToColor64(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgra, int nBgraPitch, int nWidth, int nHeight, int iMatrix = 4); - -template -void Nv12ToColorPlanar(uint8_t *dpNv12, int nNv12Pitch, uint8_t *dpBgrp, int nBgrpPitch, int nWidth, int nHeight, int iMatrix = 0); -template -void P016ToColorPlanar(uint8_t *dpP016, int nP016Pitch, uint8_t *dpBgrp, int nBgrpPitch, int nWidth, int nHeight, int iMatrix = 4); - -template -void YUV444ToColorPlanar(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgrp, int nBgrpPitch, int nWidth, int nHeight, int iMatrix = 0); -template -void YUV444P16ToColorPlanar(uint8_t *dpYUV444, int nPitch, uint8_t *dpBgrp, int nBgrpPitch, int nWidth, int nHeight, int iMatrix = 4); - -void Bgra64ToP016(uint8_t *dpBgra, int nBgraPitch, uint8_t *dpP016, int nP016Pitch, int nWidth, int nHeight, int iMatrix = 4); - -void ConvertUInt8ToUInt16(uint8_t *dpUInt8, uint16_t *dpUInt16, int nSrcPitch, int nDestPitch, int nWidth, int nHeight); -void ConvertUInt16ToUInt8(uint16_t *dpUInt16, uint8_t *dpUInt8, int nSrcPitch, int nDestPitch, int nWidth, int nHeight); - -void ResizeNv12(unsigned char *dpDstNv12, int nDstPitch, int nDstWidth, int nDstHeight, unsigned char *dpSrcNv12, int nSrcPitch, int nSrcWidth, int nSrcHeight, unsigned char *dpDstNv12UV = nullptr); -void ResizeP016(unsigned char *dpDstP016, int nDstPitch, int nDstWidth, int nDstHeight, unsigned char *dpSrcP016, int nSrcPitch, int nSrcWidth, int nSrcHeight, unsigned char *dpDstP016UV = nullptr); - -void ScaleYUV420(unsigned char *dpDstY, unsigned char* dpDstU, unsigned char* dpDstV, int nDstPitch, int nDstChromaPitch, int nDstWidth, int nDstHeight, - unsigned char *dpSrcY, unsigned char* dpSrcU, unsigned char* dpSrcV, int nSrcPitch, int nSrcChromaPitch, int nSrcWidth, int nSrcHeight, bool bSemiplanar); - -#ifdef __cuda_cuda_h__ -void ComputeCRC(uint8_t *pBuffer, uint32_t *crcValue, CUstream_st *outputCUStream); -#endif diff --git a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvEncoderCLIOptions.h b/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvEncoderCLIOptions.h deleted file mode 100644 index 534e621a..00000000 --- a/libs/hwcodec/externals/Video_Codec_SDK_12.1.14/Samples/Utils/NvEncoderCLIOptions.h +++ /dev/null @@ -1,836 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include "../Utils/Logger.h" - -extern simplelogger::Logger *logger; - -#ifndef _WIN32 -inline bool operator==(const GUID &guid1, const GUID &guid2) { - return !memcmp(&guid1, &guid2, sizeof(GUID)); -} - -inline bool operator!=(const GUID &guid1, const GUID &guid2) { - return !(guid1 == guid2); -} -#endif - -/* - * Helper class for parsing generic encoder options and preparing encoder - * initialization parameters. This class also provides some utility methods - * which generate verbose descriptions of the provided set of encoder - * initialization parameters. - */ -class NvEncoderInitParam { -public: - NvEncoderInitParam(const char *szParam = "", - std::function *pfuncInit = NULL, bool _bLowLatency = false) - : strParam(szParam), bLowLatency(_bLowLatency) - { - if (pfuncInit) { - funcInit = *pfuncInit; - } - - std::transform(strParam.begin(), strParam.end(), strParam.begin(), tolower); - std::istringstream ss(strParam); - tokens = std::vector { - std::istream_iterator(ss), - std::istream_iterator() - }; - - for (unsigned i = 0; i < tokens.size(); i++) - { - if (tokens[i] == "-codec" && ++i != tokens.size()) - { - ParseString("-codec", tokens[i], vCodec, szCodecNames, &guidCodec); - continue; - } - if (tokens[i] == "-preset" && ++i != tokens.size()) { - ParseString("-preset", tokens[i], vPreset, szPresetNames, &guidPreset); - continue; - } - if (tokens[i] == "-tuninginfo" && ++i != tokens.size()) - { - ParseString("-tuninginfo", tokens[i], vTuningInfo, szTuningInfoNames, &m_TuningInfo); - continue; - } - } - } - virtual ~NvEncoderInitParam() {} - virtual bool IsCodecH264() { - return GetEncodeGUID() == NV_ENC_CODEC_H264_GUID; - } - - virtual bool IsCodecHEVC() { - return GetEncodeGUID() == NV_ENC_CODEC_HEVC_GUID; - } - - virtual bool IsCodecAV1() { - return GetEncodeGUID() == NV_ENC_CODEC_AV1_GUID; - } - - std::string GetHelpMessage(bool bMeOnly = false, bool bUnbuffered = false, bool bHide444 = false, bool bOutputInVidMem = false) - { - std::ostringstream oss; - - if (bOutputInVidMem && bMeOnly) - { - oss << "-codec Codec: " << "h264" << std::endl; - } - else - { - oss << "-codec Codec: " << szCodecNames << std::endl; - } - - oss << "-preset Preset: " << szPresetNames << std::endl - << "-profile H264: " << szH264ProfileNames; - - if (bOutputInVidMem && bMeOnly) - { - oss << std::endl; - } - else - { - oss << "; HEVC: " << szHevcProfileNames; - oss << "; AV1: " << szAV1ProfileNames << std::endl; - } - - if (!bMeOnly) - { - if (bLowLatency == false) - oss << "-tuninginfo TuningInfo: " << szTuningInfoNames << std::endl; - else - oss << "-tuninginfo TuningInfo: " << szLowLatencyTuningInfoNames << std::endl; - oss << "-multipass Multipass: " << szMultipass << std::endl; - } - - if (!bHide444 && !bLowLatency) - { - oss << "-444 (Only for RGB input) YUV444 encode. Not valid for AV1 Codec" << std::endl; - } - if (bMeOnly) return oss.str(); - oss << "-fps Frame rate" << std::endl; - - if (!bUnbuffered && !bLowLatency) - { - oss << "-bf Number of consecutive B-frames" << std::endl; - } - - if (!bLowLatency) - { - oss << "-rc Rate control mode: " << szRcModeNames << std::endl - << "-gop Length of GOP (Group of Pictures)" << std::endl - << "-bitrate Average bit rate, can be in unit of 1, K, M" << std::endl - << "Note: Fps or Average bit rate values for each session can be specified in the form of v1,v1,v3 (no space) for AppTransOneToN" << std::endl - << " If the number of 'bitrate' or 'fps' values specified are less than the number of sessions, then the last specified value will be considered for the remaining sessions" << std::endl - << "-maxbitrate Max bit rate, can be in unit of 1, K, M" << std::endl - << "-vbvbufsize VBV buffer size in bits, can be in unit of 1, K, M" << std::endl - << "-vbvinit VBV initial delay in bits, can be in unit of 1, K, M" << std::endl - << "-aq Enable spatial AQ and set its stength (range 1-15, 0-auto)" << std::endl - << "-temporalaq (No value) Enable temporal AQ" << std::endl - << "-cq Target constant quality level for VBR mode (range 1-51, 0-auto)" << std::endl; - } - if (!bUnbuffered && !bLowLatency) - { - oss << "-lookahead Maximum depth of lookahead (range 0-(31 - number of B frames))" << std::endl; - } - oss << "-qmin Min QP value" << std::endl - << "-qmax Max QP value" << std::endl - << "-initqp Initial QP value" << std::endl; - if (!bLowLatency) - { - oss << "-constqp QP value for constqp rate control mode" << std::endl - << "Note: QP value can be in the form of qp_of_P_B_I or qp_P,qp_B,qp_I (no space)" << std::endl; - } - if (bUnbuffered && !bLowLatency) - { - oss << "Note: Options -bf and -lookahead are unavailable for this app" << std::endl; - } - return oss.str(); - } - - /** - * @brief Generate and return a string describing the values of the main/common - * encoder initialization parameters - */ - std::string MainParamToString(const NV_ENC_INITIALIZE_PARAMS *pParams) { - std::ostringstream os; - os - << "Encoding Parameters:" - << std::endl << "\tcodec : " << ConvertValueToString(vCodec, szCodecNames, pParams->encodeGUID) - << std::endl << "\tpreset : " << ConvertValueToString(vPreset, szPresetNames, pParams->presetGUID); - if (pParams->tuningInfo) - { - os << std::endl << "\ttuningInfo : " << ConvertValueToString(vTuningInfo, szTuningInfoNames, pParams->tuningInfo); - } - os - << std::endl << "\tprofile : " << ConvertValueToString(vProfile, szProfileNames, pParams->encodeConfig->profileGUID) - << std::endl << "\tchroma : " << ConvertValueToString(vChroma, szChromaNames, (pParams->encodeGUID == NV_ENC_CODEC_H264_GUID) ? pParams->encodeConfig->encodeCodecConfig.h264Config.chromaFormatIDC : - (pParams->encodeGUID == NV_ENC_CODEC_HEVC_GUID) ? pParams->encodeConfig->encodeCodecConfig.hevcConfig.chromaFormatIDC : - pParams->encodeConfig->encodeCodecConfig.av1Config.chromaFormatIDC) - << std::endl << "\tbitdepth : " << ((pParams->encodeGUID == NV_ENC_CODEC_H264_GUID) ? 0 : (pParams->encodeGUID == NV_ENC_CODEC_HEVC_GUID) ? - pParams->encodeConfig->encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 : pParams->encodeConfig->encodeCodecConfig.av1Config.pixelBitDepthMinus8) + 8 - << std::endl << "\trc : " << ConvertValueToString(vRcMode, szRcModeNames, pParams->encodeConfig->rcParams.rateControlMode) - ; - if (pParams->encodeConfig->rcParams.rateControlMode == NV_ENC_PARAMS_RC_CONSTQP) { - os << " (P,B,I=" << pParams->encodeConfig->rcParams.constQP.qpInterP << "," << pParams->encodeConfig->rcParams.constQP.qpInterB << "," << pParams->encodeConfig->rcParams.constQP.qpIntra << ")"; - } - os - << std::endl << "\tfps : " << pParams->frameRateNum << "/" << pParams->frameRateDen - << std::endl << "\tgop : " << (pParams->encodeConfig->gopLength == NVENC_INFINITE_GOPLENGTH ? "INF" : std::to_string(pParams->encodeConfig->gopLength)) - << std::endl << "\tbf : " << pParams->encodeConfig->frameIntervalP - 1 - << std::endl << "\tmultipass : " << pParams->encodeConfig->rcParams.multiPass - << std::endl << "\tsize : " << pParams->encodeWidth << "x" << pParams->encodeHeight - << std::endl << "\tbitrate : " << pParams->encodeConfig->rcParams.averageBitRate - << std::endl << "\tmaxbitrate : " << pParams->encodeConfig->rcParams.maxBitRate - << std::endl << "\tvbvbufsize : " << pParams->encodeConfig->rcParams.vbvBufferSize - << std::endl << "\tvbvinit : " << pParams->encodeConfig->rcParams.vbvInitialDelay - << std::endl << "\taq : " << (pParams->encodeConfig->rcParams.enableAQ ? (pParams->encodeConfig->rcParams.aqStrength ? std::to_string(pParams->encodeConfig->rcParams.aqStrength) : "auto") : "disabled") - << std::endl << "\ttemporalaq : " << (pParams->encodeConfig->rcParams.enableTemporalAQ ? "enabled" : "disabled") - << std::endl << "\tlookahead : " << (pParams->encodeConfig->rcParams.enableLookahead ? std::to_string(pParams->encodeConfig->rcParams.lookaheadDepth) : "disabled") - << std::endl << "\tcq : " << (unsigned int)pParams->encodeConfig->rcParams.targetQuality - << std::endl << "\tqmin : P,B,I=" << (int)pParams->encodeConfig->rcParams.minQP.qpInterP << "," << (int)pParams->encodeConfig->rcParams.minQP.qpInterB << "," << (int)pParams->encodeConfig->rcParams.minQP.qpIntra - << std::endl << "\tqmax : P,B,I=" << (int)pParams->encodeConfig->rcParams.maxQP.qpInterP << "," << (int)pParams->encodeConfig->rcParams.maxQP.qpInterB << "," << (int)pParams->encodeConfig->rcParams.maxQP.qpIntra - << std::endl << "\tinitqp : P,B,I=" << (int)pParams->encodeConfig->rcParams.initialRCQP.qpInterP << "," << (int)pParams->encodeConfig->rcParams.initialRCQP.qpInterB << "," << (int)pParams->encodeConfig->rcParams.initialRCQP.qpIntra - ; - return os.str(); - } - -public: - virtual GUID GetEncodeGUID() { return guidCodec; } - virtual GUID GetPresetGUID() { return guidPreset; } - virtual NV_ENC_TUNING_INFO GetTuningInfo() { return m_TuningInfo; } - - /* - * @brief Set encoder initialization parameters based on input options - * This method parses the tokens formed from the command line options - * provided to the application and sets the fields from NV_ENC_INITIALIZE_PARAMS - * based on the supplied values. - */ - - virtual void setTransOneToN(bool isTransOneToN) - { - bTransOneToN = isTransOneToN; - } - - virtual void SetInitParams(NV_ENC_INITIALIZE_PARAMS *pParams, NV_ENC_BUFFER_FORMAT eBufferFormat) - { - NV_ENC_CONFIG &config = *pParams->encodeConfig; - int nGOPOption = 0, nBFramesOption = 0; - for (unsigned i = 0; i < tokens.size(); i++) - { - if ( - tokens[i] == "-codec" && ++i || - tokens[i] == "-preset" && ++i || - tokens[i] == "-tuninginfo" && ++i || - tokens[i] == "-multipass" && ++i != tokens.size() && ParseString("-multipass", tokens[i], vMultiPass, szMultipass, &config.rcParams.multiPass) || - tokens[i] == "-profile" && ++i != tokens.size() && (IsCodecH264() ? - ParseString("-profile", tokens[i], vH264Profile, szH264ProfileNames, &config.profileGUID) : IsCodecHEVC() ? - ParseString("-profile", tokens[i], vHevcProfile, szHevcProfileNames, &config.profileGUID) : - ParseString("-profile", tokens[i], vAV1Profile, szAV1ProfileNames, &config.profileGUID)) || - tokens[i] == "-rc" && ++i != tokens.size() && ParseString("-rc", tokens[i], vRcMode, szRcModeNames, &config.rcParams.rateControlMode) || - tokens[i] == "-fps" && ++i != tokens.size() && ParseInt("-fps", tokens[i], &pParams->frameRateNum) || - tokens[i] == "-bf" && ++i != tokens.size() && ParseInt("-bf", tokens[i], &config.frameIntervalP) && ++config.frameIntervalP && ++nBFramesOption || - tokens[i] == "-bitrate" && ++i != tokens.size() && ParseBitRate("-bitrate", tokens[i], &config.rcParams.averageBitRate) || - tokens[i] == "-maxbitrate" && ++i != tokens.size() && ParseBitRate("-maxbitrate", tokens[i], &config.rcParams.maxBitRate) || - tokens[i] == "-vbvbufsize" && ++i != tokens.size() && ParseBitRate("-vbvbufsize", tokens[i], &config.rcParams.vbvBufferSize) || - tokens[i] == "-vbvinit" && ++i != tokens.size() && ParseBitRate("-vbvinit", tokens[i], &config.rcParams.vbvInitialDelay) || - tokens[i] == "-cq" && ++i != tokens.size() && ParseInt("-cq", tokens[i], &config.rcParams.targetQuality) || - tokens[i] == "-initqp" && ++i != tokens.size() && ParseQp("-initqp", tokens[i], &config.rcParams.initialRCQP) && (config.rcParams.enableInitialRCQP = true) || - tokens[i] == "-qmin" && ++i != tokens.size() && ParseQp("-qmin", tokens[i], &config.rcParams.minQP) && (config.rcParams.enableMinQP = true) || - tokens[i] == "-qmax" && ++i != tokens.size() && ParseQp("-qmax", tokens[i], &config.rcParams.maxQP) && (config.rcParams.enableMaxQP = true) || - tokens[i] == "-constqp" && ++i != tokens.size() && ParseQp("-constqp", tokens[i], &config.rcParams.constQP) || - tokens[i] == "-temporalaq" && (config.rcParams.enableTemporalAQ = true) - ) - { - continue; - } - if (tokens[i] == "-lookahead" && ++i != tokens.size() && ParseInt("-lookahead", tokens[i], &config.rcParams.lookaheadDepth)) - { - config.rcParams.enableLookahead = config.rcParams.lookaheadDepth > 0; - continue; - } - int aqStrength; - if (tokens[i] == "-aq" && ++i != tokens.size() && ParseInt("-aq", tokens[i], &aqStrength)) { - config.rcParams.enableAQ = true; - config.rcParams.aqStrength = aqStrength; - continue; - } - - if (tokens[i] == "-gop" && ++i != tokens.size() && ParseInt("-gop", tokens[i], &config.gopLength)) - { - nGOPOption = 1; - if (IsCodecH264()) - { - config.encodeCodecConfig.h264Config.idrPeriod = config.gopLength; - } - else if (IsCodecHEVC()) - { - config.encodeCodecConfig.hevcConfig.idrPeriod = config.gopLength; - } - else - { - config.encodeCodecConfig.av1Config.idrPeriod = config.gopLength; - } - continue; - } - - if (tokens[i] == "-444") - { - if (IsCodecH264()) - { - config.encodeCodecConfig.h264Config.chromaFormatIDC = 3; - } - else if (IsCodecHEVC()) - { - config.encodeCodecConfig.hevcConfig.chromaFormatIDC = 3; - } - else - { - std::ostringstream errmessage; - errmessage << "Incorrect Parameter: YUV444 Input not supported with AV1 Codec" << std::endl; - throw std::invalid_argument(errmessage.str()); - } - continue; - } - - std::ostringstream errmessage; - errmessage << "Incorrect parameter: " << tokens[i] << std::endl; - errmessage << "Re-run the application with the -h option to get a list of the supported options."; - errmessage << std::endl; - - throw std::invalid_argument(errmessage.str()); - } - - if (IsCodecHEVC()) - { - if (eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT || eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) - { - config.encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 = 2; - } - } - - if (IsCodecAV1()) - { - if (eBufferFormat == NV_ENC_BUFFER_FORMAT_YUV420_10BIT) - { - config.encodeCodecConfig.av1Config.pixelBitDepthMinus8 = 2; - config.encodeCodecConfig.av1Config.inputPixelBitDepthMinus8 = 2; - } - } - - if (nGOPOption && nBFramesOption && (config.gopLength < ((uint32_t)config.frameIntervalP))) - { - std::ostringstream errmessage; - errmessage << "gopLength (" << config.gopLength << ") must be greater or equal to frameIntervalP (number of B frames + 1) (" << config.frameIntervalP << ")\n"; - throw std::invalid_argument(errmessage.str()); - } - - funcInit(pParams); - LOG(INFO) << NvEncoderInitParam().MainParamToString(pParams); - LOG(TRACE) << NvEncoderInitParam().FullParamToString(pParams); - } - -private: - /* - * Helper methods for parsing tokens (generated by splitting the command line) - * and performing conversions to the appropriate target type/value. - */ - template - bool ParseString(const std::string &strName, const std::string &strValue, const std::vector &vValue, const std::string &strValueNames, T *pValue) { - std::vector vstrValueName = split(strValueNames, ' '); - auto it = std::find(vstrValueName.begin(), vstrValueName.end(), strValue); - if (it == vstrValueName.end()) { - LOG(ERROR) << strName << " options: " << strValueNames; - return false; - } - *pValue = vValue[it - vstrValueName.begin()]; - return true; - } - template - std::string ConvertValueToString(const std::vector &vValue, const std::string &strValueNames, T value) { - auto it = std::find(vValue.begin(), vValue.end(), value); - if (it == vValue.end()) { - LOG(ERROR) << "Invalid value. Can't convert to one of " << strValueNames; - return std::string(); - } - return split(strValueNames, ' ')[it - vValue.begin()]; - } - bool ParseBitRate(const std::string &strName, const std::string &strValue, unsigned *pBitRate) { - if(bTransOneToN) - { - std::vector oneToNBitrate = split(strValue, ','); - std::string currBitrate; - if ((bitrateCnt + 1) > oneToNBitrate.size()) - { - currBitrate = oneToNBitrate[oneToNBitrate.size() - 1]; - } - else - { - currBitrate = oneToNBitrate[bitrateCnt]; - bitrateCnt++; - } - - try { - size_t l; - double r = std::stod(currBitrate, &l); - char c = currBitrate[l]; - if (c != 0 && c != 'k' && c != 'm') { - LOG(ERROR) << strName << " units: 1, K, M (lower case also allowed)"; - } - *pBitRate = (unsigned)((c == 'm' ? 1000000 : (c == 'k' ? 1000 : 1)) * r); - } - catch (std::invalid_argument) { - return false; - } - return true; - } - - else - { - try { - size_t l; - double r = std::stod(strValue, &l); - char c = strValue[l]; - if (c != 0 && c != 'k' && c != 'm') { - LOG(ERROR) << strName << " units: 1, K, M (lower case also allowed)"; - } - *pBitRate = (unsigned)((c == 'm' ? 1000000 : (c == 'k' ? 1000 : 1)) * r); - } - catch (std::invalid_argument) { - return false; - } - return true; - } - } - template - bool ParseInt(const std::string &strName, const std::string &strValue, T *pInt) { - if (bTransOneToN) - { - std::vector oneToNFps = split(strValue, ','); - std::string currFps; - if ((fpsCnt + 1) > oneToNFps.size()) - { - currFps = oneToNFps[oneToNFps.size() - 1]; - } - else - { - currFps = oneToNFps[fpsCnt]; - fpsCnt++; - } - - try { - *pInt = std::stoi(currFps); - } - catch (std::invalid_argument) { - LOG(ERROR) << strName << " need a value of positive number"; - return false; - } - return true; - } - else - { - try { - *pInt = std::stoi(strValue); - } - catch (std::invalid_argument) { - LOG(ERROR) << strName << " need a value of positive number"; - return false; - } - return true; - } - } - bool ParseQp(const std::string &strName, const std::string &strValue, NV_ENC_QP *pQp) { - std::vector vQp = split(strValue, ','); - try { - if (vQp.size() == 1) { - unsigned qp = (unsigned)std::stoi(vQp[0]); - *pQp = {qp, qp, qp}; - } else if (vQp.size() == 3) { - *pQp = {(unsigned)std::stoi(vQp[0]), (unsigned)std::stoi(vQp[1]), (unsigned)std::stoi(vQp[2])}; - } else { - LOG(ERROR) << strName << " qp_for_P_B_I or qp_P,qp_B,qp_I (no space is allowed)"; - return false; - } - } catch (std::invalid_argument) { - return false; - } - return true; - } - std::vector split(const std::string &s, char delim) { - std::stringstream ss(s); - std::string token; - std::vector tokens; - while (getline(ss, token, delim)) { - tokens.push_back(token); - } - return tokens; - } - -private: - std::string strParam; - std::function funcInit = [](NV_ENC_INITIALIZE_PARAMS *pParams){}; - std::vector tokens; - GUID guidCodec = NV_ENC_CODEC_H264_GUID; - GUID guidPreset = NV_ENC_PRESET_P3_GUID; - NV_ENC_TUNING_INFO m_TuningInfo = NV_ENC_TUNING_INFO_HIGH_QUALITY; - bool bLowLatency = false; - uint32_t bitrateCnt = 0; - uint32_t fpsCnt = 0; - bool bTransOneToN = 0; - - const char *szCodecNames = "h264 hevc av1"; - std::vector vCodec = std::vector { - NV_ENC_CODEC_H264_GUID, - NV_ENC_CODEC_HEVC_GUID, - NV_ENC_CODEC_AV1_GUID - }; - - const char *szChromaNames = "yuv420 yuv444"; - std::vector vChroma = std::vector - { - 1, 3 - }; - - const char *szPresetNames = "p1 p2 p3 p4 p5 p6 p7"; - std::vector vPreset = std::vector { - NV_ENC_PRESET_P1_GUID, - NV_ENC_PRESET_P2_GUID, - NV_ENC_PRESET_P3_GUID, - NV_ENC_PRESET_P4_GUID, - NV_ENC_PRESET_P5_GUID, - NV_ENC_PRESET_P6_GUID, - NV_ENC_PRESET_P7_GUID, - }; - - const char *szH264ProfileNames = "baseline main high high444"; - std::vector vH264Profile = std::vector { - NV_ENC_H264_PROFILE_BASELINE_GUID, - NV_ENC_H264_PROFILE_MAIN_GUID, - NV_ENC_H264_PROFILE_HIGH_GUID, - NV_ENC_H264_PROFILE_HIGH_444_GUID, - }; - const char *szHevcProfileNames = "main main10 frext"; - std::vector vHevcProfile = std::vector { - NV_ENC_HEVC_PROFILE_MAIN_GUID, - NV_ENC_HEVC_PROFILE_MAIN10_GUID, - NV_ENC_HEVC_PROFILE_FREXT_GUID, - }; - const char *szAV1ProfileNames = "main"; - std::vector vAV1Profile = std::vector{ - NV_ENC_AV1_PROFILE_MAIN_GUID, - }; - - const char *szProfileNames = "(default) auto baseline(h264) main(h264) high(h264) high444(h264)" - " stereo(h264) progressiv_high(h264) constrained_high(h264)" - " main(hevc) main10(hevc) frext(hevc)" - " main(av1) high(av1)"; - std::vector vProfile = std::vector { - GUID{}, - NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID, - NV_ENC_H264_PROFILE_BASELINE_GUID, - NV_ENC_H264_PROFILE_MAIN_GUID, - NV_ENC_H264_PROFILE_HIGH_GUID, - NV_ENC_H264_PROFILE_HIGH_444_GUID, - NV_ENC_H264_PROFILE_STEREO_GUID, - NV_ENC_H264_PROFILE_PROGRESSIVE_HIGH_GUID, - NV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID, - NV_ENC_HEVC_PROFILE_MAIN_GUID, - NV_ENC_HEVC_PROFILE_MAIN10_GUID, - NV_ENC_HEVC_PROFILE_FREXT_GUID, - NV_ENC_AV1_PROFILE_MAIN_GUID, - }; - - const char *szLowLatencyTuningInfoNames = "lowlatency ultralowlatency"; - const char *szTuningInfoNames = "hq lowlatency ultralowlatency lossless"; - std::vector vTuningInfo = std::vector{ - NV_ENC_TUNING_INFO_HIGH_QUALITY, - NV_ENC_TUNING_INFO_LOW_LATENCY, - NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY, - NV_ENC_TUNING_INFO_LOSSLESS - }; - - const char *szRcModeNames = "constqp vbr cbr"; - std::vector vRcMode = std::vector { - NV_ENC_PARAMS_RC_CONSTQP, - NV_ENC_PARAMS_RC_VBR, - NV_ENC_PARAMS_RC_CBR, - }; - - const char *szMultipass = "disabled qres fullres"; - std::vector vMultiPass = std::vector{ - NV_ENC_MULTI_PASS_DISABLED, - NV_ENC_TWO_PASS_QUARTER_RESOLUTION, - NV_ENC_TWO_PASS_FULL_RESOLUTION, - }; - - const char *szQpMapModeNames = "disabled emphasis_level_map delta_qp_map qp_map"; - std::vector vQpMapMode = std::vector { - NV_ENC_QP_MAP_DISABLED, - NV_ENC_QP_MAP_EMPHASIS, - NV_ENC_QP_MAP_DELTA, - NV_ENC_QP_MAP, - }; - - -public: - /* - * Generates and returns a string describing the values for each field in - * the NV_ENC_INITIALIZE_PARAMS structure (i.e. a description of the entire - * set of initialization parameters supplied to the API). - */ - std::string FullParamToString(const NV_ENC_INITIALIZE_PARAMS *pInitializeParams) { - std::ostringstream os; - os << "NV_ENC_INITIALIZE_PARAMS:" << std::endl - << "encodeGUID: " << ConvertValueToString(vCodec, szCodecNames, pInitializeParams->encodeGUID) << std::endl - << "presetGUID: " << ConvertValueToString(vPreset, szPresetNames, pInitializeParams->presetGUID) << std::endl; - if (pInitializeParams->tuningInfo) - { - os << "tuningInfo: " << ConvertValueToString(vTuningInfo, szTuningInfoNames, pInitializeParams->tuningInfo) << std::endl; - } - os - << "encodeWidth: " << pInitializeParams->encodeWidth << std::endl - << "encodeHeight: " << pInitializeParams->encodeHeight << std::endl - << "darWidth: " << pInitializeParams->darWidth << std::endl - << "darHeight: " << pInitializeParams->darHeight << std::endl - << "frameRateNum: " << pInitializeParams->frameRateNum << std::endl - << "frameRateDen: " << pInitializeParams->frameRateDen << std::endl - << "enableEncodeAsync: " << pInitializeParams->enableEncodeAsync << std::endl - << "reportSliceOffsets: " << pInitializeParams->reportSliceOffsets << std::endl - << "enableSubFrameWrite: " << pInitializeParams->enableSubFrameWrite << std::endl - << "enableExternalMEHints: " << pInitializeParams->enableExternalMEHints << std::endl - << "enableMEOnlyMode: " << pInitializeParams->enableMEOnlyMode << std::endl - << "enableWeightedPrediction: " << pInitializeParams->enableWeightedPrediction << std::endl - << "maxEncodeWidth: " << pInitializeParams->maxEncodeWidth << std::endl - << "maxEncodeHeight: " << pInitializeParams->maxEncodeHeight << std::endl - << "maxMEHintCountsPerBlock: " << pInitializeParams->maxMEHintCountsPerBlock << std::endl - ; - NV_ENC_CONFIG *pConfig = pInitializeParams->encodeConfig; - os << "NV_ENC_CONFIG:" << std::endl - << "profile: " << ConvertValueToString(vProfile, szProfileNames, pConfig->profileGUID) << std::endl - << "gopLength: " << pConfig->gopLength << std::endl - << "frameIntervalP: " << pConfig->frameIntervalP << std::endl - << "monoChromeEncoding: " << pConfig->monoChromeEncoding << std::endl - << "frameFieldMode: " << pConfig->frameFieldMode << std::endl - << "mvPrecision: " << pConfig->mvPrecision << std::endl - << "NV_ENC_RC_PARAMS:" << std::endl - << " rateControlMode: 0x" << std::hex << pConfig->rcParams.rateControlMode << std::dec << std::endl - << " constQP: " << pConfig->rcParams.constQP.qpInterP << ", " << pConfig->rcParams.constQP.qpInterB << ", " << pConfig->rcParams.constQP.qpIntra << std::endl - << " averageBitRate: " << pConfig->rcParams.averageBitRate << std::endl - << " maxBitRate: " << pConfig->rcParams.maxBitRate << std::endl - << " vbvBufferSize: " << pConfig->rcParams.vbvBufferSize << std::endl - << " vbvInitialDelay: " << pConfig->rcParams.vbvInitialDelay << std::endl - << " enableMinQP: " << pConfig->rcParams.enableMinQP << std::endl - << " enableMaxQP: " << pConfig->rcParams.enableMaxQP << std::endl - << " enableInitialRCQP: " << pConfig->rcParams.enableInitialRCQP << std::endl - << " enableAQ: " << pConfig->rcParams.enableAQ << std::endl - << " qpMapMode: " << ConvertValueToString(vQpMapMode, szQpMapModeNames, pConfig->rcParams.qpMapMode) << std::endl - << " multipass: " << ConvertValueToString(vMultiPass, szMultipass, pConfig->rcParams.multiPass) << std::endl - << " enableLookahead: " << pConfig->rcParams.enableLookahead << std::endl - << " disableIadapt: " << pConfig->rcParams.disableIadapt << std::endl - << " disableBadapt: " << pConfig->rcParams.disableBadapt << std::endl - << " enableTemporalAQ: " << pConfig->rcParams.enableTemporalAQ << std::endl - << " zeroReorderDelay: " << pConfig->rcParams.zeroReorderDelay << std::endl - << " enableNonRefP: " << pConfig->rcParams.enableNonRefP << std::endl - << " strictGOPTarget: " << pConfig->rcParams.strictGOPTarget << std::endl - << " aqStrength: " << pConfig->rcParams.aqStrength << std::endl - << " minQP: " << pConfig->rcParams.minQP.qpInterP << ", " << pConfig->rcParams.minQP.qpInterB << ", " << pConfig->rcParams.minQP.qpIntra << std::endl - << " maxQP: " << pConfig->rcParams.maxQP.qpInterP << ", " << pConfig->rcParams.maxQP.qpInterB << ", " << pConfig->rcParams.maxQP.qpIntra << std::endl - << " initialRCQP: " << pConfig->rcParams.initialRCQP.qpInterP << ", " << pConfig->rcParams.initialRCQP.qpInterB << ", " << pConfig->rcParams.initialRCQP.qpIntra << std::endl - << " temporallayerIdxMask: " << pConfig->rcParams.temporallayerIdxMask << std::endl - << " temporalLayerQP: " << (int)pConfig->rcParams.temporalLayerQP[0] << ", " << (int)pConfig->rcParams.temporalLayerQP[1] << ", " << (int)pConfig->rcParams.temporalLayerQP[2] << ", " << (int)pConfig->rcParams.temporalLayerQP[3] << ", " << (int)pConfig->rcParams.temporalLayerQP[4] << ", " << (int)pConfig->rcParams.temporalLayerQP[5] << ", " << (int)pConfig->rcParams.temporalLayerQP[6] << ", " << (int)pConfig->rcParams.temporalLayerQP[7] << std::endl - << " targetQuality: " << pConfig->rcParams.targetQuality << std::endl - << " lookaheadDepth: " << pConfig->rcParams.lookaheadDepth << std::endl; - if (pInitializeParams->encodeGUID == NV_ENC_CODEC_H264_GUID) { - os - << "NV_ENC_CODEC_CONFIG (H264):" << std::endl - << " enableStereoMVC: " << pConfig->encodeCodecConfig.h264Config.enableStereoMVC << std::endl - << " hierarchicalPFrames: " << pConfig->encodeCodecConfig.h264Config.hierarchicalPFrames << std::endl - << " hierarchicalBFrames: " << pConfig->encodeCodecConfig.h264Config.hierarchicalBFrames << std::endl - << " outputBufferingPeriodSEI: " << pConfig->encodeCodecConfig.h264Config.outputBufferingPeriodSEI << std::endl - << " outputPictureTimingSEI: " << pConfig->encodeCodecConfig.h264Config.outputPictureTimingSEI << std::endl - << " outputAUD: " << pConfig->encodeCodecConfig.h264Config.outputAUD << std::endl - << " disableSPSPPS: " << pConfig->encodeCodecConfig.h264Config.disableSPSPPS << std::endl - << " outputFramePackingSEI: " << pConfig->encodeCodecConfig.h264Config.outputFramePackingSEI << std::endl - << " outputRecoveryPointSEI: " << pConfig->encodeCodecConfig.h264Config.outputRecoveryPointSEI << std::endl - << " enableIntraRefresh: " << pConfig->encodeCodecConfig.h264Config.enableIntraRefresh << std::endl - << " enableConstrainedEncoding: " << pConfig->encodeCodecConfig.h264Config.enableConstrainedEncoding << std::endl - << " repeatSPSPPS: " << pConfig->encodeCodecConfig.h264Config.repeatSPSPPS << std::endl - << " enableVFR: " << pConfig->encodeCodecConfig.h264Config.enableVFR << std::endl - << " enableLTR: " << pConfig->encodeCodecConfig.h264Config.enableLTR << std::endl - << " qpPrimeYZeroTransformBypassFlag: " << pConfig->encodeCodecConfig.h264Config.qpPrimeYZeroTransformBypassFlag << std::endl - << " useConstrainedIntraPred: " << pConfig->encodeCodecConfig.h264Config.useConstrainedIntraPred << std::endl - << " level: " << pConfig->encodeCodecConfig.h264Config.level << std::endl - << " idrPeriod: " << pConfig->encodeCodecConfig.h264Config.idrPeriod << std::endl - << " separateColourPlaneFlag: " << pConfig->encodeCodecConfig.h264Config.separateColourPlaneFlag << std::endl - << " disableDeblockingFilterIDC: " << pConfig->encodeCodecConfig.h264Config.disableDeblockingFilterIDC << std::endl - << " numTemporalLayers: " << pConfig->encodeCodecConfig.h264Config.numTemporalLayers << std::endl - << " spsId: " << pConfig->encodeCodecConfig.h264Config.spsId << std::endl - << " ppsId: " << pConfig->encodeCodecConfig.h264Config.ppsId << std::endl - << " adaptiveTransformMode: " << pConfig->encodeCodecConfig.h264Config.adaptiveTransformMode << std::endl - << " fmoMode: " << pConfig->encodeCodecConfig.h264Config.fmoMode << std::endl - << " bdirectMode: " << pConfig->encodeCodecConfig.h264Config.bdirectMode << std::endl - << " entropyCodingMode: " << pConfig->encodeCodecConfig.h264Config.entropyCodingMode << std::endl - << " stereoMode: " << pConfig->encodeCodecConfig.h264Config.stereoMode << std::endl - << " intraRefreshPeriod: " << pConfig->encodeCodecConfig.h264Config.intraRefreshPeriod << std::endl - << " intraRefreshCnt: " << pConfig->encodeCodecConfig.h264Config.intraRefreshCnt << std::endl - << " maxNumRefFrames: " << pConfig->encodeCodecConfig.h264Config.maxNumRefFrames << std::endl - << " sliceMode: " << pConfig->encodeCodecConfig.h264Config.sliceMode << std::endl - << " sliceModeData: " << pConfig->encodeCodecConfig.h264Config.sliceModeData << std::endl - << " NV_ENC_CONFIG_H264_VUI_PARAMETERS:" << std::endl - << " overscanInfoPresentFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.overscanInfoPresentFlag << std::endl - << " overscanInfo: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.overscanInfo << std::endl - << " videoSignalTypePresentFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.videoSignalTypePresentFlag << std::endl - << " videoFormat: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.videoFormat << std::endl - << " videoFullRangeFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag << std::endl - << " colourDescriptionPresentFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.colourDescriptionPresentFlag << std::endl - << " colourPrimaries: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.colourPrimaries << std::endl - << " transferCharacteristics: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.transferCharacteristics << std::endl - << " colourMatrix: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.colourMatrix << std::endl - << " chromaSampleLocationFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.chromaSampleLocationFlag << std::endl - << " chromaSampleLocationTop: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.chromaSampleLocationTop << std::endl - << " chromaSampleLocationBot: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.chromaSampleLocationBot << std::endl - << " bitstreamRestrictionFlag: " << pConfig->encodeCodecConfig.h264Config.h264VUIParameters.bitstreamRestrictionFlag << std::endl - << " ltrNumFrames: " << pConfig->encodeCodecConfig.h264Config.ltrNumFrames << std::endl - << " ltrTrustMode: " << pConfig->encodeCodecConfig.h264Config.ltrTrustMode << std::endl - << " chromaFormatIDC: " << pConfig->encodeCodecConfig.h264Config.chromaFormatIDC << std::endl - << " maxTemporalLayers: " << pConfig->encodeCodecConfig.h264Config.maxTemporalLayers << std::endl; - } else if (pInitializeParams->encodeGUID == NV_ENC_CODEC_HEVC_GUID) { - os - << "NV_ENC_CODEC_CONFIG (HEVC):" << std::endl - << " level: " << pConfig->encodeCodecConfig.hevcConfig.level << std::endl - << " tier: " << pConfig->encodeCodecConfig.hevcConfig.tier << std::endl - << " minCUSize: " << pConfig->encodeCodecConfig.hevcConfig.minCUSize << std::endl - << " maxCUSize: " << pConfig->encodeCodecConfig.hevcConfig.maxCUSize << std::endl - << " useConstrainedIntraPred: " << pConfig->encodeCodecConfig.hevcConfig.useConstrainedIntraPred << std::endl - << " disableDeblockAcrossSliceBoundary: " << pConfig->encodeCodecConfig.hevcConfig.disableDeblockAcrossSliceBoundary << std::endl - << " outputBufferingPeriodSEI: " << pConfig->encodeCodecConfig.hevcConfig.outputBufferingPeriodSEI << std::endl - << " outputPictureTimingSEI: " << pConfig->encodeCodecConfig.hevcConfig.outputPictureTimingSEI << std::endl - << " outputAUD: " << pConfig->encodeCodecConfig.hevcConfig.outputAUD << std::endl - << " enableLTR: " << pConfig->encodeCodecConfig.hevcConfig.enableLTR << std::endl - << " disableSPSPPS: " << pConfig->encodeCodecConfig.hevcConfig.disableSPSPPS << std::endl - << " repeatSPSPPS: " << pConfig->encodeCodecConfig.hevcConfig.repeatSPSPPS << std::endl - << " enableIntraRefresh: " << pConfig->encodeCodecConfig.hevcConfig.enableIntraRefresh << std::endl - << " chromaFormatIDC: " << pConfig->encodeCodecConfig.hevcConfig.chromaFormatIDC << std::endl - << " pixelBitDepthMinus8: " << pConfig->encodeCodecConfig.hevcConfig.pixelBitDepthMinus8 << std::endl - << " idrPeriod: " << pConfig->encodeCodecConfig.hevcConfig.idrPeriod << std::endl - << " intraRefreshPeriod: " << pConfig->encodeCodecConfig.hevcConfig.intraRefreshPeriod << std::endl - << " intraRefreshCnt: " << pConfig->encodeCodecConfig.hevcConfig.intraRefreshCnt << std::endl - << " maxNumRefFramesInDPB: " << pConfig->encodeCodecConfig.hevcConfig.maxNumRefFramesInDPB << std::endl - << " ltrNumFrames: " << pConfig->encodeCodecConfig.hevcConfig.ltrNumFrames << std::endl - << " vpsId: " << pConfig->encodeCodecConfig.hevcConfig.vpsId << std::endl - << " spsId: " << pConfig->encodeCodecConfig.hevcConfig.spsId << std::endl - << " ppsId: " << pConfig->encodeCodecConfig.hevcConfig.ppsId << std::endl - << " sliceMode: " << pConfig->encodeCodecConfig.hevcConfig.sliceMode << std::endl - << " sliceModeData: " << pConfig->encodeCodecConfig.hevcConfig.sliceModeData << std::endl - << " maxTemporalLayersMinus1: " << pConfig->encodeCodecConfig.hevcConfig.maxTemporalLayersMinus1 << std::endl - << " NV_ENC_CONFIG_HEVC_VUI_PARAMETERS:" << std::endl - << " overscanInfoPresentFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.overscanInfoPresentFlag << std::endl - << " overscanInfo: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.overscanInfo << std::endl - << " videoSignalTypePresentFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.videoSignalTypePresentFlag << std::endl - << " videoFormat: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFormat << std::endl - << " videoFullRangeFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag << std::endl - << " colourDescriptionPresentFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.colourDescriptionPresentFlag << std::endl - << " colourPrimaries: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.colourPrimaries << std::endl - << " transferCharacteristics: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.transferCharacteristics << std::endl - << " colourMatrix: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.colourMatrix << std::endl - << " chromaSampleLocationFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.chromaSampleLocationFlag << std::endl - << " chromaSampleLocationTop: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.chromaSampleLocationTop << std::endl - << " chromaSampleLocationBot: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.chromaSampleLocationBot << std::endl - << " bitstreamRestrictionFlag: " << pConfig->encodeCodecConfig.hevcConfig.hevcVUIParameters.bitstreamRestrictionFlag << std::endl - << " ltrTrustMode: " << pConfig->encodeCodecConfig.hevcConfig.ltrTrustMode << std::endl; - } else if (pInitializeParams->encodeGUID == NV_ENC_CODEC_AV1_GUID) { - os - << "NV_ENC_CODEC_CONFIG (AV1):" << std::endl - << " level: " << pConfig->encodeCodecConfig.av1Config.level << std::endl - << " tier: " << pConfig->encodeCodecConfig.av1Config.tier << std::endl - << " minPartSize: " << pConfig->encodeCodecConfig.av1Config.minPartSize << std::endl - << " maxPartSize: " << pConfig->encodeCodecConfig.av1Config.maxPartSize << std::endl - << " outputAnnexBFormat: " << pConfig->encodeCodecConfig.av1Config.outputAnnexBFormat << std::endl - << " enableTimingInfo: " << pConfig->encodeCodecConfig.av1Config.enableTimingInfo << std::endl - << " enableDecoderModelInfo: " << pConfig->encodeCodecConfig.av1Config.enableDecoderModelInfo << std::endl - << " enableFrameIdNumbers: " << pConfig->encodeCodecConfig.av1Config.enableFrameIdNumbers << std::endl - << " disableSeqHdr: " << pConfig->encodeCodecConfig.av1Config.disableSeqHdr << std::endl - << " repeatSeqHdr: " << pConfig->encodeCodecConfig.av1Config.repeatSeqHdr << std::endl - << " enableIntraRefresh: " << pConfig->encodeCodecConfig.av1Config.enableIntraRefresh << std::endl - << " chromaFormatIDC: " << pConfig->encodeCodecConfig.av1Config.chromaFormatIDC << std::endl - << " enableBitstreamPadding: " << pConfig->encodeCodecConfig.av1Config.enableBitstreamPadding << std::endl - << " enableCustomTileConfig: " << pConfig->encodeCodecConfig.av1Config.enableCustomTileConfig << std::endl - << " enableFilmGrainParams: " << pConfig->encodeCodecConfig.av1Config.enableFilmGrainParams << std::endl - << " inputPixelBitDepthMinus8: " << pConfig->encodeCodecConfig.av1Config.inputPixelBitDepthMinus8 << std::endl - << " pixelBitDepthMinus8: " << pConfig->encodeCodecConfig.av1Config.pixelBitDepthMinus8 << std::endl - << " idrPeriod: " << pConfig->encodeCodecConfig.av1Config.idrPeriod << std::endl - << " intraRefreshPeriod: " << pConfig->encodeCodecConfig.av1Config.intraRefreshPeriod << std::endl - << " intraRefreshCnt: " << pConfig->encodeCodecConfig.av1Config.intraRefreshCnt << std::endl - << " maxNumRefFramesInDPB: " << pConfig->encodeCodecConfig.av1Config.maxNumRefFramesInDPB << std::endl - << " numTileColumns: " << pConfig->encodeCodecConfig.av1Config.numTileColumns << std::endl - << " numTileRows: " << pConfig->encodeCodecConfig.av1Config.numTileRows << std::endl - << " maxTemporalLayersMinus1: " << pConfig->encodeCodecConfig.av1Config.maxTemporalLayersMinus1 << std::endl - << " colorPrimaries: " << pConfig->encodeCodecConfig.av1Config.colorPrimaries << std::endl - << " transferCharacteristics: " << pConfig->encodeCodecConfig.av1Config.transferCharacteristics << std::endl - << " matrixCoefficients: " << pConfig->encodeCodecConfig.av1Config.matrixCoefficients << std::endl - << " colorRange: " << pConfig->encodeCodecConfig.av1Config.colorRange << std::endl - << " chromaSamplePosition: " << pConfig->encodeCodecConfig.av1Config.chromaSamplePosition << std::endl - << " useBFramesAsRef: " << pConfig->encodeCodecConfig.av1Config.useBFramesAsRef << std::endl - << " numFwdRefs: " << pConfig->encodeCodecConfig.av1Config.numFwdRefs << std::endl - << " numBwdRefs: " << pConfig->encodeCodecConfig.av1Config.numBwdRefs << std::endl; - if (pConfig->encodeCodecConfig.av1Config.filmGrainParams != NULL) - { - os - << " NV_ENC_FILM_GRAIN_PARAMS_AV1:" << std::endl - << " applyGrain: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->applyGrain << std::endl - << " chromaScalingFromLuma: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->chromaScalingFromLuma << std::endl - << " overlapFlag: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->overlapFlag << std::endl - << " clipToRestrictedRange: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->clipToRestrictedRange << std::endl - << " grainScalingMinus8: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->grainScalingMinus8 << std::endl - << " arCoeffLag: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->arCoeffLag << std::endl - << " numYPoints: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->numYPoints << std::endl - << " numCbPoints: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->numCbPoints << std::endl - << " numCrPoints: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->numCrPoints << std::endl - << " arCoeffShiftMinus6: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->arCoeffShiftMinus6 << std::endl - << " grainScaleShift: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->grainScaleShift << std::endl - << " cbMult: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->cbMult << std::endl - << " cbLumaMult: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->cbLumaMult << std::endl - << " cbOffset: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->cbOffset << std::endl - << " crMult: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->crMult << std::endl - << " crLumaMult: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->crLumaMult << std::endl - << " crOffset: " << pConfig->encodeCodecConfig.av1Config.filmGrainParams->crOffset << std::endl; - } - } - - return os.str(); - } -}; diff --git a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuda.h b/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuda.h deleted file mode 100644 index ff81e62f..00000000 --- a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuda.h +++ /dev/null @@ -1,602 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2016 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#if !defined(FFNV_DYNLINK_CUDA_H) && !defined(CUDA_VERSION) -#define FFNV_DYNLINK_CUDA_H - -#include -#include - -#define CUDA_VERSION 7050 - -#if defined(_WIN32) || defined(__CYGWIN__) -#define CUDAAPI __stdcall -#else -#define CUDAAPI -#endif - -#define CU_CTX_SCHED_BLOCKING_SYNC 4 - -typedef int CUdevice; -#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined(__LP64__) || defined(__aarch64__) -typedef unsigned long long CUdeviceptr; -#else -typedef unsigned int CUdeviceptr; -#endif -typedef unsigned long long CUtexObject; - -typedef struct CUarray_st *CUarray; -typedef struct CUctx_st *CUcontext; -typedef struct CUstream_st *CUstream; -typedef struct CUevent_st *CUevent; -typedef struct CUfunc_st *CUfunction; -typedef struct CUmod_st *CUmodule; -typedef struct CUmipmappedArray_st *CUmipmappedArray; -typedef struct CUgraphicsResource_st *CUgraphicsResource; -typedef struct CUextMemory_st *CUexternalMemory; -typedef struct CUextSemaphore_st *CUexternalSemaphore; -typedef struct CUeglStreamConnection_st *CUeglStreamConnection; - -typedef struct CUlinkState_st *CUlinkState; - -typedef enum cudaError_enum { - CUDA_SUCCESS = 0, - CUDA_ERROR_INVALID_VALUE = 1, - CUDA_ERROR_OUT_OF_MEMORY = 2, - CUDA_ERROR_NOT_INITIALIZED = 3, - CUDA_ERROR_DEINITIALIZED = 4, - CUDA_ERROR_PROFILER_DISABLED = 5, - CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6, - CUDA_ERROR_PROFILER_ALREADY_STARTED = 7, - CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8, - CUDA_ERROR_STUB_LIBRARY = 34, - CUDA_ERROR_NO_DEVICE = 100, - CUDA_ERROR_INVALID_DEVICE = 101, - CUDA_ERROR_DEVICE_NOT_LICENSED = 102, - CUDA_ERROR_INVALID_IMAGE = 200, - CUDA_ERROR_INVALID_CONTEXT = 201, - CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202, - CUDA_ERROR_MAP_FAILED = 205, - CUDA_ERROR_UNMAP_FAILED = 206, - CUDA_ERROR_ARRAY_IS_MAPPED = 207, - CUDA_ERROR_ALREADY_MAPPED = 208, - CUDA_ERROR_NO_BINARY_FOR_GPU = 209, - CUDA_ERROR_ALREADY_ACQUIRED = 210, - CUDA_ERROR_NOT_MAPPED = 211, - CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212, - CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213, - CUDA_ERROR_ECC_UNCORRECTABLE = 214, - CUDA_ERROR_UNSUPPORTED_LIMIT = 215, - CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216, - CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217, - CUDA_ERROR_INVALID_PTX = 218, - CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219, - CUDA_ERROR_NVLINK_UNCORRECTABLE = 220, - CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221, - CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222, - CUDA_ERROR_JIT_COMPILATION_DISABLED = 223, - CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = 224, - CUDA_ERROR_INVALID_SOURCE = 300, - CUDA_ERROR_FILE_NOT_FOUND = 301, - CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302, - CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303, - CUDA_ERROR_OPERATING_SYSTEM = 304, - CUDA_ERROR_INVALID_HANDLE = 400, - CUDA_ERROR_ILLEGAL_STATE = 401, - CUDA_ERROR_NOT_FOUND = 500, - CUDA_ERROR_NOT_READY = 600, - CUDA_ERROR_ILLEGAL_ADDRESS = 700, - CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701, - CUDA_ERROR_LAUNCH_TIMEOUT = 702, - CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703, - CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704, - CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705, - CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708, - CUDA_ERROR_CONTEXT_IS_DESTROYED = 709, - CUDA_ERROR_ASSERT = 710, - CUDA_ERROR_TOO_MANY_PEERS = 711, - CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712, - CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713, - CUDA_ERROR_HARDWARE_STACK_ERROR = 714, - CUDA_ERROR_ILLEGAL_INSTRUCTION = 715, - CUDA_ERROR_MISALIGNED_ADDRESS = 716, - CUDA_ERROR_INVALID_ADDRESS_SPACE = 717, - CUDA_ERROR_INVALID_PC = 718, - CUDA_ERROR_LAUNCH_FAILED = 719, - CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 720, - CUDA_ERROR_NOT_PERMITTED = 800, - CUDA_ERROR_NOT_SUPPORTED = 801, - CUDA_ERROR_SYSTEM_NOT_READY = 802, - CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 803, - CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 804, - CUDA_ERROR_MPS_CONNECTION_FAILED = 805, - CUDA_ERROR_MPS_RPC_FAILURE = 806, - CUDA_ERROR_MPS_SERVER_NOT_READY = 807, - CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = 808, - CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = 809, - CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900, - CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 901, - CUDA_ERROR_STREAM_CAPTURE_MERGE = 902, - CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 903, - CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 904, - CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 905, - CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 906, - CUDA_ERROR_CAPTURED_EVENT = 907, - CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 908, - CUDA_ERROR_TIMEOUT = 909, - CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 910, - CUDA_ERROR_EXTERNAL_DEVICE = 911, - CUDA_ERROR_UNKNOWN = 999 -} CUresult; - -/** - * Device properties (subset) - */ -typedef enum CUdevice_attribute_enum { - CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13, - CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14, - CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16, - CU_DEVICE_ATTRIBUTE_INTEGRATED = 18, - CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19, - CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20, - CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31, - CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33, - CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34, - CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35, - CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36, - CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37, - CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40, - CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41, - CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50, - CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51, - CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75, - CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76, - CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83, - CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84, - CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85, -} CUdevice_attribute; - -typedef enum CUarray_format_enum { - CU_AD_FORMAT_UNSIGNED_INT8 = 0x01, - CU_AD_FORMAT_UNSIGNED_INT16 = 0x02, - CU_AD_FORMAT_UNSIGNED_INT32 = 0x03, - CU_AD_FORMAT_SIGNED_INT8 = 0x08, - CU_AD_FORMAT_SIGNED_INT16 = 0x09, - CU_AD_FORMAT_SIGNED_INT32 = 0x0a, - CU_AD_FORMAT_HALF = 0x10, - CU_AD_FORMAT_FLOAT = 0x20 -} CUarray_format; - -typedef enum CUmemorytype_enum { - CU_MEMORYTYPE_HOST = 1, - CU_MEMORYTYPE_DEVICE = 2, - CU_MEMORYTYPE_ARRAY = 3 -} CUmemorytype; - -typedef enum CUlimit_enum { - CU_LIMIT_STACK_SIZE = 0, - CU_LIMIT_PRINTF_FIFO_SIZE = 1, - CU_LIMIT_MALLOC_HEAP_SIZE = 2, - CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3, - CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4 -} CUlimit; - -typedef enum CUresourcetype_enum { - CU_RESOURCE_TYPE_ARRAY = 0x00, - CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01, - CU_RESOURCE_TYPE_LINEAR = 0x02, - CU_RESOURCE_TYPE_PITCH2D = 0x03 -} CUresourcetype; - -typedef enum CUaddress_mode_enum { - CU_TR_ADDRESS_MODE_WRAP = 0, - CU_TR_ADDRESS_MODE_CLAMP = 1, - CU_TR_ADDRESS_MODE_MIRROR = 2, - CU_TR_ADDRESS_MODE_BORDER = 3 -} CUaddress_mode; - -typedef enum CUfilter_mode_enum { - CU_TR_FILTER_MODE_POINT = 0, - CU_TR_FILTER_MODE_LINEAR = 1 -} CUfilter_mode; - -typedef enum CUgraphicsRegisterFlags_enum { - CU_GRAPHICS_REGISTER_FLAGS_NONE = 0, - CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 1, - CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 2, - CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 4, - CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 8 -} CUgraphicsRegisterFlags; - -typedef enum CUexternalMemoryHandleType_enum { - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1, - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2, - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3, - CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4, - CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5, -} CUexternalMemoryHandleType; - -typedef enum CUexternalSemaphoreHandleType_enum { - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1, - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2, - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3, - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4, - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9, - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10, -} CUexternalSemaphoreHandleType; - -typedef enum CUjit_option_enum -{ - CU_JIT_MAX_REGISTERS = 0, - CU_JIT_THREADS_PER_BLOCK = 1, - CU_JIT_WALL_TIME = 2, - CU_JIT_INFO_LOG_BUFFER = 3, - CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4, - CU_JIT_ERROR_LOG_BUFFER = 5, - CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6, - CU_JIT_OPTIMIZATION_LEVEL = 7, - CU_JIT_TARGET_FROM_CUCONTEXT = 8, - CU_JIT_TARGET = 9, - CU_JIT_FALLBACK_STRATEGY = 10, - CU_JIT_GENERATE_DEBUG_INFO = 11, - CU_JIT_LOG_VERBOSE = 12, - CU_JIT_GENERATE_LINE_INFO = 13, - CU_JIT_CACHE_MODE = 14, - CU_JIT_NEW_SM3X_OPT = 15, - CU_JIT_FAST_COMPILE = 16, - CU_JIT_GLOBAL_SYMBOL_NAMES = 17, - CU_JIT_GLOBAL_SYMBOL_ADDRESSES = 18, - CU_JIT_GLOBAL_SYMBOL_COUNT = 19, - CU_JIT_NUM_OPTIONS -} CUjit_option; - -typedef enum CUjitInputType_enum -{ - CU_JIT_INPUT_CUBIN = 0, - CU_JIT_INPUT_PTX = 1, - CU_JIT_INPUT_FATBINARY = 2, - CU_JIT_INPUT_OBJECT = 3, - CU_JIT_INPUT_LIBRARY = 4, - CU_JIT_NUM_INPUT_TYPES -} CUjitInputType; - -typedef enum CUeglFrameType -{ - CU_EGL_FRAME_TYPE_ARRAY = 0, - CU_EGL_FRAME_TYPE_PITCH = 1, -} CUeglFrameType; - -typedef enum CUeglColorFormat -{ - CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0x00, - CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 0x01, - CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = 0x15, - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = 0x17, - CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = 0x19, -} CUeglColorFormat; - -typedef enum CUd3d11DeviceList_enum -{ - CU_D3D11_DEVICE_LIST_ALL = 1, - CU_D3D11_DEVICE_LIST_CURRENT_FRAME = 2, - CU_D3D11_DEVICE_LIST_NEXT_FRAME = 3, -} CUd3d11DeviceList; - -#ifndef CU_UUID_HAS_BEEN_DEFINED -#define CU_UUID_HAS_BEEN_DEFINED -typedef struct CUuuid_st { - char bytes[16]; -} CUuuid; -#endif - -typedef struct CUDA_MEMCPY2D_st { - size_t srcXInBytes; - size_t srcY; - CUmemorytype srcMemoryType; - const void *srcHost; - CUdeviceptr srcDevice; - CUarray srcArray; - size_t srcPitch; - - size_t dstXInBytes; - size_t dstY; - CUmemorytype dstMemoryType; - void *dstHost; - CUdeviceptr dstDevice; - CUarray dstArray; - size_t dstPitch; - - size_t WidthInBytes; - size_t Height; -} CUDA_MEMCPY2D; - -typedef struct CUDA_RESOURCE_DESC_st { - CUresourcetype resType; - union { - struct { - CUarray hArray; - } array; - struct { - CUmipmappedArray hMipmappedArray; - } mipmap; - struct { - CUdeviceptr devPtr; - CUarray_format format; - unsigned int numChannels; - size_t sizeInBytes; - } linear; - struct { - CUdeviceptr devPtr; - CUarray_format format; - unsigned int numChannels; - size_t width; - size_t height; - size_t pitchInBytes; - } pitch2D; - struct { - int reserved[32]; - } reserved; - } res; - unsigned int flags; -} CUDA_RESOURCE_DESC; - -typedef struct CUDA_TEXTURE_DESC_st { - CUaddress_mode addressMode[3]; - CUfilter_mode filterMode; - unsigned int flags; - unsigned int maxAnisotropy; - CUfilter_mode mipmapFilterMode; - float mipmapLevelBias; - float minMipmapLevelClamp; - float maxMipmapLevelClamp; - float borderColor[4]; - int reserved[12]; -} CUDA_TEXTURE_DESC; - -/* Unused type */ -typedef struct CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC; - -typedef unsigned int GLenum; -typedef unsigned int GLuint; -/* - * Prefix type name to avoid collisions. Clients using these types - * will include the real headers with real definitions. - */ -typedef int32_t ffnv_EGLint; -typedef void *ffnv_EGLStreamKHR; - -typedef enum CUGLDeviceList_enum { - CU_GL_DEVICE_LIST_ALL = 1, - CU_GL_DEVICE_LIST_CURRENT_FRAME = 2, - CU_GL_DEVICE_LIST_NEXT_FRAME = 3, -} CUGLDeviceList; - -typedef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st { - CUexternalMemoryHandleType type; - union { - int fd; - struct { - void *handle; - const void *name; - } win32; - } handle; - unsigned long long size; - unsigned int flags; - unsigned int reserved[16]; -} CUDA_EXTERNAL_MEMORY_HANDLE_DESC; - -typedef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st { - unsigned long long offset; - unsigned long long size; - unsigned int flags; - unsigned int reserved[16]; -} CUDA_EXTERNAL_MEMORY_BUFFER_DESC; - -typedef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st { - CUexternalSemaphoreHandleType type; - union { - int fd; - struct { - void *handle; - const void *name; - } win32; - } handle; - unsigned int flags; - unsigned int reserved[16]; -} CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC; - -typedef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st { - struct { - struct { - unsigned long long value; - } fence; - unsigned int reserved[16]; - } params; - unsigned int flags; - unsigned int reserved[16]; -} CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS; - -typedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS; - -typedef struct CUDA_ARRAY_DESCRIPTOR_st { - size_t Width; - size_t Height; - - CUarray_format Format; - unsigned int NumChannels; -} CUDA_ARRAY_DESCRIPTOR; - -typedef struct CUDA_ARRAY3D_DESCRIPTOR_st { - size_t Width; - size_t Height; - size_t Depth; - - CUarray_format Format; - unsigned int NumChannels; - unsigned int Flags; -} CUDA_ARRAY3D_DESCRIPTOR; - -typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st { - unsigned long long offset; - CUDA_ARRAY3D_DESCRIPTOR arrayDesc; - unsigned int numLevels; - unsigned int reserved[16]; -} CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC; - -#define CU_EGL_FRAME_MAX_PLANES 3 -typedef struct CUeglFrame_st { - union { - CUarray pArray[CU_EGL_FRAME_MAX_PLANES]; - void* pPitch[CU_EGL_FRAME_MAX_PLANES]; - } frame; - unsigned int width; - unsigned int height; - unsigned int depth; - unsigned int pitch; - unsigned int planeCount; - unsigned int numChannels; - CUeglFrameType frameType; - CUeglColorFormat eglColorFormat; - CUarray_format cuFormat; -} CUeglFrame; - -#define CU_STREAM_DEFAULT 0 -#define CU_STREAM_NON_BLOCKING 1 - -#define CU_EVENT_DEFAULT 0 -#define CU_EVENT_BLOCKING_SYNC 1 -#define CU_EVENT_DISABLE_TIMING 2 - -#define CU_EVENT_WAIT_DEFAULT 0 -#define CU_EVENT_WAIT_EXTERNAL 1 - -#define CU_TRSF_READ_AS_INTEGER 1 - -typedef void CUDAAPI CUstreamCallback(CUstream hStream, CUresult status, void *userdata); - -typedef CUresult CUDAAPI tcuInit(unsigned int Flags); -typedef CUresult CUDAAPI tcuDriverGetVersion(int *driverVersion); -typedef CUresult CUDAAPI tcuDeviceGetCount(int *count); -typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal); -typedef CUresult CUDAAPI tcuDeviceGetAttribute(int *pi, CUdevice_attribute attrib, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceGetName(char *name, int len, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceGetUuid(CUuuid *uuid, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceGetUuid_v2(CUuuid *uuid, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId); -typedef CUresult CUDAAPI tcuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev); -typedef CUresult CUDAAPI tcuDeviceComputeCapability(int *major, int *minor, CUdevice dev); -typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext *pctx, unsigned int flags, CUdevice dev); -typedef CUresult CUDAAPI tcuCtxGetCurrent(CUcontext *pctx); -typedef CUresult CUDAAPI tcuCtxSetLimit(CUlimit limit, size_t value); -typedef CUresult CUDAAPI tcuCtxPushCurrent_v2(CUcontext pctx); -typedef CUresult CUDAAPI tcuCtxPopCurrent_v2(CUcontext *pctx); -typedef CUresult CUDAAPI tcuCtxDestroy_v2(CUcontext ctx); -typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr *dptr, size_t bytesize); -typedef CUresult CUDAAPI tcuMemAllocPitch_v2(CUdeviceptr *dptr, size_t *pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes); -typedef CUresult CUDAAPI tcuMemAllocManaged(CUdeviceptr *dptr, size_t bytesize, unsigned int flags); -typedef CUresult CUDAAPI tcuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream); -typedef CUresult CUDAAPI tcuMemFree_v2(CUdeviceptr dptr); -typedef CUresult CUDAAPI tcuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t bytesize); -typedef CUresult CUDAAPI tcuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t bytesize, CUstream hStream); -typedef CUresult CUDAAPI tcuMemcpy2D_v2(const CUDA_MEMCPY2D *pcopy); -typedef CUresult CUDAAPI tcuMemcpy2DAsync_v2(const CUDA_MEMCPY2D *pcopy, CUstream hStream); -typedef CUresult CUDAAPI tcuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount); -typedef CUresult CUDAAPI tcuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream); -typedef CUresult CUDAAPI tcuMemcpyDtoH_v2(void *dstHost, CUdeviceptr srcDevice, size_t ByteCount); -typedef CUresult CUDAAPI tcuMemcpyDtoHAsync_v2(void *dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream); -typedef CUresult CUDAAPI tcuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount); -typedef CUresult CUDAAPI tcuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream); -typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr); -typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr); -typedef CUresult CUDAAPI tcuCtxGetDevice(CUdevice *device); - -typedef CUresult CUDAAPI tcuDevicePrimaryCtxRetain(CUcontext *pctx, CUdevice dev); -typedef CUresult CUDAAPI tcuDevicePrimaryCtxRelease(CUdevice dev); -typedef CUresult CUDAAPI tcuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags); -typedef CUresult CUDAAPI tcuDevicePrimaryCtxGetState(CUdevice dev, unsigned int *flags, int *active); -typedef CUresult CUDAAPI tcuDevicePrimaryCtxReset(CUdevice dev); - -typedef CUresult CUDAAPI tcuStreamCreate(CUstream *phStream, unsigned int flags); -typedef CUresult CUDAAPI tcuStreamQuery(CUstream hStream); -typedef CUresult CUDAAPI tcuStreamSynchronize(CUstream hStream); -typedef CUresult CUDAAPI tcuStreamDestroy_v2(CUstream hStream); -typedef CUresult CUDAAPI tcuStreamAddCallback(CUstream hStream, CUstreamCallback *callback, void *userdata, unsigned int flags); -typedef CUresult CUDAAPI tcuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int flags); -typedef CUresult CUDAAPI tcuEventCreate(CUevent *phEvent, unsigned int flags); -typedef CUresult CUDAAPI tcuEventDestroy_v2(CUevent hEvent); -typedef CUresult CUDAAPI tcuEventSynchronize(CUevent hEvent); -typedef CUresult CUDAAPI tcuEventQuery(CUevent hEvent); -typedef CUresult CUDAAPI tcuEventRecord(CUevent hEvent, CUstream hStream); - -typedef CUresult CUDAAPI tcuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra); -typedef CUresult CUDAAPI tcuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut); -typedef CUresult CUDAAPI tcuLinkAddData(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues); -typedef CUresult CUDAAPI tcuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut); -typedef CUresult CUDAAPI tcuLinkDestroy(CUlinkState state); -typedef CUresult CUDAAPI tcuModuleLoadData(CUmodule* module, const void* image); -typedef CUresult CUDAAPI tcuModuleUnload(CUmodule hmod); -typedef CUresult CUDAAPI tcuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name); -typedef CUresult CUDAAPI tcuModuleGetGlobal(CUdeviceptr *dptr, size_t *bytes, CUmodule hmod, const char* name); -typedef CUresult CUDAAPI tcuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc); -typedef CUresult CUDAAPI tcuTexObjectDestroy(CUtexObject texObject); - -typedef CUresult CUDAAPI tcuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList); -typedef CUresult CUDAAPI tcuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags); -typedef CUresult CUDAAPI tcuGraphicsUnregisterResource(CUgraphicsResource resource); -typedef CUresult CUDAAPI tcuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream); -typedef CUresult CUDAAPI tcuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream); -typedef CUresult CUDAAPI tcuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel); -typedef CUresult CUDAAPI tcuGraphicsResourceGetMappedPointer(CUdeviceptr *devPtrOut, size_t *sizeOut, CUgraphicsResource resource); -typedef CUresult CUDAAPI tcuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags); - -typedef CUresult CUDAAPI tcuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc); -typedef CUresult CUDAAPI tcuDestroyExternalMemory(CUexternalMemory extMem); -typedef CUresult CUDAAPI tcuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc); -typedef CUresult CUDAAPI tcuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc); -typedef CUresult CUDAAPI tcuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level); -typedef CUresult CUDAAPI tcuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray); - -typedef CUresult CUDAAPI tcuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc); -typedef CUresult CUDAAPI tcuDestroyExternalSemaphore(CUexternalSemaphore extSem); -typedef CUresult CUDAAPI tcuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream); -typedef CUresult CUDAAPI tcuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream); - -typedef CUresult CUDAAPI tcuArrayCreate(CUarray *pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray); -typedef CUresult CUDAAPI tcuArray3DCreate(CUarray *pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray); -typedef CUresult CUDAAPI tcuArrayDestroy(CUarray hArray); - -typedef CUresult CUDAAPI tcuEGLStreamProducerConnect(CUeglStreamConnection* conn, ffnv_EGLStreamKHR stream, ffnv_EGLint width, ffnv_EGLint height); -typedef CUresult CUDAAPI tcuEGLStreamProducerDisconnect(CUeglStreamConnection* conn); -typedef CUresult CUDAAPI tcuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn); -typedef CUresult CUDAAPI tcuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream); -typedef CUresult CUDAAPI tcuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream); - -typedef CUresult CUDAAPI tcuD3D11GetDevice(CUdevice *device, void *dxgiAdapter); -typedef CUresult CUDAAPI tcuD3D11GetDevices(unsigned int *deviceCountOut, CUdevice *devices, unsigned int deviceCount, void *d3d11device, CUd3d11DeviceList listType); -typedef CUresult CUDAAPI tcuGraphicsD3D11RegisterResource(CUgraphicsResource *cudaResourceOut, void *d3d11Resource, unsigned int flags); -#endif diff --git a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuviddec.h b/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuviddec.h deleted file mode 100644 index 28053943..00000000 --- a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_cuviddec.h +++ /dev/null @@ -1,1184 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/*****************************************************************************************************/ -//! \file cuviddec.h -//! NVDECODE API provides video decoding interface to NVIDIA GPU devices. -//! This file contains constants, structure definitions and function prototypes used for decoding. -/*****************************************************************************************************/ - -#if !defined(__CUDA_VIDEO_H__) -#define __CUDA_VIDEO_H__ - -#if defined(_WIN64) || defined(__LP64__) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) -#if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) || (CUDA_FORCE_API_VERSION >= 3020)) -#define __CUVID_DEVPTR64 -#endif -#endif - -#define NVDECAPI_MAJOR_VERSION 12 -#define NVDECAPI_MINOR_VERSION 1 - -#define NVDECAPI_VERSION (NVDECAPI_MAJOR_VERSION | (NVDECAPI_MINOR_VERSION << 24)) - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__CYGWIN__) -typedef unsigned int tcu_ulong; -#else -typedef unsigned long tcu_ulong; -#endif - -typedef void *CUvideodecoder; -typedef struct _CUcontextlock_st *CUvideoctxlock; - -/*********************************************************************************/ -//! \enum cudaVideoCodec -//! Video codec enums -//! These enums are used in CUVIDDECODECREATEINFO and CUVIDDECODECAPS structures -/*********************************************************************************/ -typedef enum cudaVideoCodec_enum { - cudaVideoCodec_MPEG1=0, /**< MPEG1 */ - cudaVideoCodec_MPEG2, /**< MPEG2 */ - cudaVideoCodec_MPEG4, /**< MPEG4 */ - cudaVideoCodec_VC1, /**< VC1 */ - cudaVideoCodec_H264, /**< H264 */ - cudaVideoCodec_JPEG, /**< JPEG */ - cudaVideoCodec_H264_SVC, /**< H264-SVC */ - cudaVideoCodec_H264_MVC, /**< H264-MVC */ - cudaVideoCodec_HEVC, /**< HEVC */ - cudaVideoCodec_VP8, /**< VP8 */ - cudaVideoCodec_VP9, /**< VP9 */ - cudaVideoCodec_AV1, /**< AV1 */ - cudaVideoCodec_NumCodecs, /**< Max codecs */ - // Uncompressed YUV - cudaVideoCodec_YUV420 = (('I'<<24)|('Y'<<16)|('U'<<8)|('V')), /**< Y,U,V (4:2:0) */ - cudaVideoCodec_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,V,U (4:2:0) */ - cudaVideoCodec_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,UV (4:2:0) */ - cudaVideoCodec_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), /**< YUYV/YUY2 (4:2:2) */ - cudaVideoCodec_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')) /**< UYVY (4:2:2) */ -} cudaVideoCodec; - -/*********************************************************************************/ -//! \enum cudaVideoSurfaceFormat -//! Video surface format enums used for output format of decoded output -//! These enums are used in CUVIDDECODECREATEINFO structure -/*********************************************************************************/ -typedef enum cudaVideoSurfaceFormat_enum { - cudaVideoSurfaceFormat_NV12=0, /**< Semi-Planar YUV [Y plane followed by interleaved UV plane] */ - cudaVideoSurfaceFormat_P016=1, /**< 16 bit Semi-Planar YUV [Y plane followed by interleaved UV plane]. - Can be used for 10 bit(6LSB bits 0), 12 bit (4LSB bits 0) */ - cudaVideoSurfaceFormat_YUV444=2, /**< Planar YUV [Y plane followed by U and V planes] */ - cudaVideoSurfaceFormat_YUV444_16Bit=3, /**< 16 bit Planar YUV [Y plane followed by U and V planes]. - Can be used for 10 bit(6LSB bits 0), 12 bit (4LSB bits 0) */ -} cudaVideoSurfaceFormat; - -/******************************************************************************************************************/ -//! \enum cudaVideoDeinterlaceMode -//! Deinterlacing mode enums -//! These enums are used in CUVIDDECODECREATEINFO structure -//! Use cudaVideoDeinterlaceMode_Weave for progressive content and for content that doesn't need deinterlacing -//! cudaVideoDeinterlaceMode_Adaptive needs more video memory than other DImodes -/******************************************************************************************************************/ -typedef enum cudaVideoDeinterlaceMode_enum { - cudaVideoDeinterlaceMode_Weave=0, /**< Weave both fields (no deinterlacing) */ - cudaVideoDeinterlaceMode_Bob, /**< Drop one field */ - cudaVideoDeinterlaceMode_Adaptive /**< Adaptive deinterlacing */ -} cudaVideoDeinterlaceMode; - -/**************************************************************************************************************/ -//! \enum cudaVideoChromaFormat -//! Chroma format enums -//! These enums are used in CUVIDDECODECREATEINFO and CUVIDDECODECAPS structures -/**************************************************************************************************************/ -typedef enum cudaVideoChromaFormat_enum { - cudaVideoChromaFormat_Monochrome=0, /**< MonoChrome */ - cudaVideoChromaFormat_420, /**< YUV 4:2:0 */ - cudaVideoChromaFormat_422, /**< YUV 4:2:2 */ - cudaVideoChromaFormat_444 /**< YUV 4:4:4 */ -} cudaVideoChromaFormat; - -/*************************************************************************************************************/ -//! \enum cudaVideoCreateFlags -//! Decoder flag enums to select preferred decode path -//! cudaVideoCreate_Default and cudaVideoCreate_PreferCUVID are most optimized, use these whenever possible -/*************************************************************************************************************/ -typedef enum cudaVideoCreateFlags_enum { - cudaVideoCreate_Default = 0x00, /**< Default operation mode: use dedicated video engines */ - cudaVideoCreate_PreferCUDA = 0x01, /**< Use CUDA-based decoder (requires valid vidLock object for multi-threading) */ - cudaVideoCreate_PreferDXVA = 0x02, /**< Go through DXVA internally if possible (requires D3D9 interop) */ - cudaVideoCreate_PreferCUVID = 0x04 /**< Use dedicated video engines directly */ -} cudaVideoCreateFlags; - - -/*************************************************************************/ -//! \enum cuvidDecodeStatus -//! Decode status enums -//! These enums are used in CUVIDGETDECODESTATUS structure -/*************************************************************************/ -typedef enum cuvidDecodeStatus_enum -{ - cuvidDecodeStatus_Invalid = 0, // Decode status is not valid - cuvidDecodeStatus_InProgress = 1, // Decode is in progress - cuvidDecodeStatus_Success = 2, // Decode is completed without any errors - // 3 to 7 enums are reserved for future use - cuvidDecodeStatus_Error = 8, // Decode is completed with an error (error is not concealed) - cuvidDecodeStatus_Error_Concealed = 9, // Decode is completed with an error and error is concealed -} cuvidDecodeStatus; - -/**************************************************************************************************************/ -//! \struct CUVIDDECODECAPS; -//! This structure is used in cuvidGetDecoderCaps API -/**************************************************************************************************************/ -typedef struct _CUVIDDECODECAPS -{ - cudaVideoCodec eCodecType; /**< IN: cudaVideoCodec_XXX */ - cudaVideoChromaFormat eChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */ - unsigned int nBitDepthMinus8; /**< IN: The Value "BitDepth minus 8" */ - unsigned int reserved1[3]; /**< Reserved for future use - set to zero */ - - unsigned char bIsSupported; /**< OUT: 1 if codec supported, 0 if not supported */ - unsigned char nNumNVDECs; /**< OUT: Number of NVDECs that can support IN params */ - unsigned short nOutputFormatMask; /**< OUT: each bit represents corresponding cudaVideoSurfaceFormat enum */ - unsigned int nMaxWidth; /**< OUT: Max supported coded width in pixels */ - unsigned int nMaxHeight; /**< OUT: Max supported coded height in pixels */ - unsigned int nMaxMBCount; /**< OUT: Max supported macroblock count - CodedWidth*CodedHeight/256 must be <= nMaxMBCount */ - unsigned short nMinWidth; /**< OUT: Min supported coded width in pixels */ - unsigned short nMinHeight; /**< OUT: Min supported coded height in pixels */ - unsigned char bIsHistogramSupported; /**< OUT: 1 if Y component histogram output is supported, 0 if not - Note: histogram is computed on original picture data before - any post-processing like scaling, cropping, etc. is applied */ - unsigned char nCounterBitDepth; /**< OUT: histogram counter bit depth */ - unsigned short nMaxHistogramBins; /**< OUT: Max number of histogram bins */ - unsigned int reserved3[10]; /**< Reserved for future use - set to zero */ -} CUVIDDECODECAPS; - -/**************************************************************************************************************/ -//! \struct CUVIDDECODECREATEINFO -//! This structure is used in cuvidCreateDecoder API -/**************************************************************************************************************/ -typedef struct _CUVIDDECODECREATEINFO -{ - tcu_ulong ulWidth; /**< IN: Coded sequence width in pixels */ - tcu_ulong ulHeight; /**< IN: Coded sequence height in pixels */ - tcu_ulong ulNumDecodeSurfaces; /**< IN: Maximum number of internal decode surfaces */ - cudaVideoCodec CodecType; /**< IN: cudaVideoCodec_XXX */ - cudaVideoChromaFormat ChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */ - tcu_ulong ulCreationFlags; /**< IN: Decoder creation flags (cudaVideoCreateFlags_XXX) */ - tcu_ulong bitDepthMinus8; /**< IN: The value "BitDepth minus 8" */ - tcu_ulong ulIntraDecodeOnly; /**< IN: Set 1 only if video has all intra frames (default value is 0). This will - optimize video memory for Intra frames only decoding. The support is limited - to specific codecs - H264, HEVC, VP9, the flag will be ignored for codecs which - are not supported. However decoding might fail if the flag is enabled in case - of supported codecs for regular bit streams having P and/or B frames. */ - tcu_ulong ulMaxWidth; /**< IN: Coded sequence max width in pixels used with reconfigure Decoder */ - tcu_ulong ulMaxHeight; /**< IN: Coded sequence max height in pixels used with reconfigure Decoder */ - tcu_ulong Reserved1; /**< Reserved for future use - set to zero */ - /** - * IN: area of the frame that should be displayed - */ - struct { - short left; - short top; - short right; - short bottom; - } display_area; - - cudaVideoSurfaceFormat OutputFormat; /**< IN: cudaVideoSurfaceFormat_XXX */ - cudaVideoDeinterlaceMode DeinterlaceMode; /**< IN: cudaVideoDeinterlaceMode_XXX */ - tcu_ulong ulTargetWidth; /**< IN: Post-processed output width (Should be aligned to 2) */ - tcu_ulong ulTargetHeight; /**< IN: Post-processed output height (Should be aligned to 2) */ - tcu_ulong ulNumOutputSurfaces; /**< IN: Maximum number of output surfaces simultaneously mapped */ - CUvideoctxlock vidLock; /**< IN: If non-NULL, context lock used for synchronizing ownership of - the cuda context. Needed for cudaVideoCreate_PreferCUDA decode */ - /** - * IN: target rectangle in the output frame (for aspect ratio conversion) - * if a null rectangle is specified, {0,0,ulTargetWidth,ulTargetHeight} will be used - */ - struct { - short left; - short top; - short right; - short bottom; - } target_rect; - - tcu_ulong enableHistogram; /**< IN: enable histogram output, if supported */ - tcu_ulong Reserved2[4]; /**< Reserved for future use - set to zero */ -} CUVIDDECODECREATEINFO; - -/*********************************************************/ -//! \struct CUVIDH264DPBENTRY -//! H.264 DPB entry -//! This structure is used in CUVIDH264PICPARAMS structure -/*********************************************************/ -typedef struct _CUVIDH264DPBENTRY -{ - int PicIdx; /**< picture index of reference frame */ - int FrameIdx; /**< frame_num(short-term) or LongTermFrameIdx(long-term) */ - int is_long_term; /**< 0=short term reference, 1=long term reference */ - int not_existing; /**< non-existing reference frame (corresponding PicIdx should be set to -1) */ - int used_for_reference; /**< 0=unused, 1=top_field, 2=bottom_field, 3=both_fields */ - int FieldOrderCnt[2]; /**< field order count of top and bottom fields */ -} CUVIDH264DPBENTRY; - -/************************************************************/ -//! \struct CUVIDH264MVCEXT -//! H.264 MVC picture parameters ext -//! This structure is used in CUVIDH264PICPARAMS structure -/************************************************************/ -typedef struct _CUVIDH264MVCEXT -{ - int num_views_minus1; /**< Max number of coded views minus 1 in video : Range - 0 to 1023 */ - int view_id; /**< view identifier */ - unsigned char inter_view_flag; /**< 1 if used for inter-view prediction, 0 if not */ - unsigned char num_inter_view_refs_l0; /**< number of inter-view ref pics in RefPicList0 */ - unsigned char num_inter_view_refs_l1; /**< number of inter-view ref pics in RefPicList1 */ - unsigned char MVCReserved8Bits; /**< Reserved bits */ - int InterViewRefsL0[16]; /**< view id of the i-th view component for inter-view prediction in RefPicList0 */ - int InterViewRefsL1[16]; /**< view id of the i-th view component for inter-view prediction in RefPicList1 */ -} CUVIDH264MVCEXT; - -/*********************************************************/ -//! \struct CUVIDH264SVCEXT -//! H.264 SVC picture parameters ext -//! This structure is used in CUVIDH264PICPARAMS structure -/*********************************************************/ -typedef struct _CUVIDH264SVCEXT -{ - unsigned char profile_idc; - unsigned char level_idc; - unsigned char DQId; - unsigned char DQIdMax; - unsigned char disable_inter_layer_deblocking_filter_idc; - unsigned char ref_layer_chroma_phase_y_plus1; - signed char inter_layer_slice_alpha_c0_offset_div2; - signed char inter_layer_slice_beta_offset_div2; - - unsigned short DPBEntryValidFlag; - unsigned char inter_layer_deblocking_filter_control_present_flag; - unsigned char extended_spatial_scalability_idc; - unsigned char adaptive_tcoeff_level_prediction_flag; - unsigned char slice_header_restriction_flag; - unsigned char chroma_phase_x_plus1_flag; - unsigned char chroma_phase_y_plus1; - - unsigned char tcoeff_level_prediction_flag; - unsigned char constrained_intra_resampling_flag; - unsigned char ref_layer_chroma_phase_x_plus1_flag; - unsigned char store_ref_base_pic_flag; - unsigned char Reserved8BitsA; - unsigned char Reserved8BitsB; - - short scaled_ref_layer_left_offset; - short scaled_ref_layer_top_offset; - short scaled_ref_layer_right_offset; - short scaled_ref_layer_bottom_offset; - unsigned short Reserved16Bits; - struct _CUVIDPICPARAMS *pNextLayer; /**< Points to the picparams for the next layer to be decoded. - Linked list ends at the target layer. */ - int bRefBaseLayer; /**< whether to store ref base pic */ -} CUVIDH264SVCEXT; - -/******************************************************/ -//! \struct CUVIDH264PICPARAMS -//! H.264 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/******************************************************/ -typedef struct _CUVIDH264PICPARAMS -{ - // SPS - int log2_max_frame_num_minus4; - int pic_order_cnt_type; - int log2_max_pic_order_cnt_lsb_minus4; - int delta_pic_order_always_zero_flag; - int frame_mbs_only_flag; - int direct_8x8_inference_flag; - int num_ref_frames; // NOTE: shall meet level 4.1 restrictions - unsigned char residual_colour_transform_flag; - unsigned char bit_depth_luma_minus8; // Must be 0 (only 8-bit supported) - unsigned char bit_depth_chroma_minus8; // Must be 0 (only 8-bit supported) - unsigned char qpprime_y_zero_transform_bypass_flag; - // PPS - int entropy_coding_mode_flag; - int pic_order_present_flag; - int num_ref_idx_l0_active_minus1; - int num_ref_idx_l1_active_minus1; - int weighted_pred_flag; - int weighted_bipred_idc; - int pic_init_qp_minus26; - int deblocking_filter_control_present_flag; - int redundant_pic_cnt_present_flag; - int transform_8x8_mode_flag; - int MbaffFrameFlag; - int constrained_intra_pred_flag; - int chroma_qp_index_offset; - int second_chroma_qp_index_offset; - int ref_pic_flag; - int frame_num; - int CurrFieldOrderCnt[2]; - // DPB - CUVIDH264DPBENTRY dpb[16]; // List of reference frames within the DPB - // Quantization Matrices (raster-order) - unsigned char WeightScale4x4[6][16]; - unsigned char WeightScale8x8[2][64]; - // FMO/ASO - unsigned char fmo_aso_enable; - unsigned char num_slice_groups_minus1; - unsigned char slice_group_map_type; - signed char pic_init_qs_minus26; - unsigned int slice_group_change_rate_minus1; - union - { - unsigned long long slice_group_map_addr; - const unsigned char *pMb2SliceGroupMap; - } fmo; - unsigned int Reserved[12]; - // SVC/MVC - union - { - CUVIDH264MVCEXT mvcext; - CUVIDH264SVCEXT svcext; - }; -} CUVIDH264PICPARAMS; - - -/********************************************************/ -//! \struct CUVIDMPEG2PICPARAMS -//! MPEG-2 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/********************************************************/ -typedef struct _CUVIDMPEG2PICPARAMS -{ - int ForwardRefIdx; // Picture index of forward reference (P/B-frames) - int BackwardRefIdx; // Picture index of backward reference (B-frames) - int picture_coding_type; - int full_pel_forward_vector; - int full_pel_backward_vector; - int f_code[2][2]; - int intra_dc_precision; - int frame_pred_frame_dct; - int concealment_motion_vectors; - int q_scale_type; - int intra_vlc_format; - int alternate_scan; - int top_field_first; - // Quantization matrices (raster order) - unsigned char QuantMatrixIntra[64]; - unsigned char QuantMatrixInter[64]; -} CUVIDMPEG2PICPARAMS; - -// MPEG-4 has VOP types instead of Picture types -#define I_VOP 0 -#define P_VOP 1 -#define B_VOP 2 -#define S_VOP 3 - -/*******************************************************/ -//! \struct CUVIDMPEG4PICPARAMS -//! MPEG-4 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/*******************************************************/ -typedef struct _CUVIDMPEG4PICPARAMS -{ - int ForwardRefIdx; // Picture index of forward reference (P/B-frames) - int BackwardRefIdx; // Picture index of backward reference (B-frames) - // VOL - int video_object_layer_width; - int video_object_layer_height; - int vop_time_increment_bitcount; - int top_field_first; - int resync_marker_disable; - int quant_type; - int quarter_sample; - int short_video_header; - int divx_flags; - // VOP - int vop_coding_type; - int vop_coded; - int vop_rounding_type; - int alternate_vertical_scan_flag; - int interlaced; - int vop_fcode_forward; - int vop_fcode_backward; - int trd[2]; - int trb[2]; - // Quantization matrices (raster order) - unsigned char QuantMatrixIntra[64]; - unsigned char QuantMatrixInter[64]; - int gmc_enabled; -} CUVIDMPEG4PICPARAMS; - -/********************************************************/ -//! \struct CUVIDVC1PICPARAMS -//! VC1 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/********************************************************/ -typedef struct _CUVIDVC1PICPARAMS -{ - int ForwardRefIdx; /**< Picture index of forward reference (P/B-frames) */ - int BackwardRefIdx; /**< Picture index of backward reference (B-frames) */ - int FrameWidth; /**< Actual frame width */ - int FrameHeight; /**< Actual frame height */ - // PICTURE - int intra_pic_flag; /**< Set to 1 for I,BI frames */ - int ref_pic_flag; /**< Set to 1 for I,P frames */ - int progressive_fcm; /**< Progressive frame */ - // SEQUENCE - int profile; - int postprocflag; - int pulldown; - int interlace; - int tfcntrflag; - int finterpflag; - int psf; - int multires; - int syncmarker; - int rangered; - int maxbframes; - // ENTRYPOINT - int panscan_flag; - int refdist_flag; - int extended_mv; - int dquant; - int vstransform; - int loopfilter; - int fastuvmc; - int overlap; - int quantizer; - int extended_dmv; - int range_mapy_flag; - int range_mapy; - int range_mapuv_flag; - int range_mapuv; - int rangeredfrm; // range reduction state -} CUVIDVC1PICPARAMS; - -/***********************************************************/ -//! \struct CUVIDJPEGPICPARAMS -//! JPEG picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/***********************************************************/ -typedef struct _CUVIDJPEGPICPARAMS -{ - int Reserved; -} CUVIDJPEGPICPARAMS; - - -/*******************************************************/ -//! \struct CUVIDHEVCPICPARAMS -//! HEVC picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/*******************************************************/ -typedef struct _CUVIDHEVCPICPARAMS -{ - // sps - int pic_width_in_luma_samples; - int pic_height_in_luma_samples; - unsigned char log2_min_luma_coding_block_size_minus3; - unsigned char log2_diff_max_min_luma_coding_block_size; - unsigned char log2_min_transform_block_size_minus2; - unsigned char log2_diff_max_min_transform_block_size; - unsigned char pcm_enabled_flag; - unsigned char log2_min_pcm_luma_coding_block_size_minus3; - unsigned char log2_diff_max_min_pcm_luma_coding_block_size; - unsigned char pcm_sample_bit_depth_luma_minus1; - - unsigned char pcm_sample_bit_depth_chroma_minus1; - unsigned char pcm_loop_filter_disabled_flag; - unsigned char strong_intra_smoothing_enabled_flag; - unsigned char max_transform_hierarchy_depth_intra; - unsigned char max_transform_hierarchy_depth_inter; - unsigned char amp_enabled_flag; - unsigned char separate_colour_plane_flag; - unsigned char log2_max_pic_order_cnt_lsb_minus4; - - unsigned char num_short_term_ref_pic_sets; - unsigned char long_term_ref_pics_present_flag; - unsigned char num_long_term_ref_pics_sps; - unsigned char sps_temporal_mvp_enabled_flag; - unsigned char sample_adaptive_offset_enabled_flag; - unsigned char scaling_list_enable_flag; - unsigned char IrapPicFlag; - unsigned char IdrPicFlag; - - unsigned char bit_depth_luma_minus8; - unsigned char bit_depth_chroma_minus8; - //sps/pps extension fields - unsigned char log2_max_transform_skip_block_size_minus2; - unsigned char log2_sao_offset_scale_luma; - unsigned char log2_sao_offset_scale_chroma; - unsigned char high_precision_offsets_enabled_flag; - unsigned char reserved1[10]; - - // pps - unsigned char dependent_slice_segments_enabled_flag; - unsigned char slice_segment_header_extension_present_flag; - unsigned char sign_data_hiding_enabled_flag; - unsigned char cu_qp_delta_enabled_flag; - unsigned char diff_cu_qp_delta_depth; - signed char init_qp_minus26; - signed char pps_cb_qp_offset; - signed char pps_cr_qp_offset; - - unsigned char constrained_intra_pred_flag; - unsigned char weighted_pred_flag; - unsigned char weighted_bipred_flag; - unsigned char transform_skip_enabled_flag; - unsigned char transquant_bypass_enabled_flag; - unsigned char entropy_coding_sync_enabled_flag; - unsigned char log2_parallel_merge_level_minus2; - unsigned char num_extra_slice_header_bits; - - unsigned char loop_filter_across_tiles_enabled_flag; - unsigned char loop_filter_across_slices_enabled_flag; - unsigned char output_flag_present_flag; - unsigned char num_ref_idx_l0_default_active_minus1; - unsigned char num_ref_idx_l1_default_active_minus1; - unsigned char lists_modification_present_flag; - unsigned char cabac_init_present_flag; - unsigned char pps_slice_chroma_qp_offsets_present_flag; - - unsigned char deblocking_filter_override_enabled_flag; - unsigned char pps_deblocking_filter_disabled_flag; - signed char pps_beta_offset_div2; - signed char pps_tc_offset_div2; - unsigned char tiles_enabled_flag; - unsigned char uniform_spacing_flag; - unsigned char num_tile_columns_minus1; - unsigned char num_tile_rows_minus1; - - unsigned short column_width_minus1[21]; - unsigned short row_height_minus1[21]; - - // sps and pps extension HEVC-main 444 - unsigned char sps_range_extension_flag; - unsigned char transform_skip_rotation_enabled_flag; - unsigned char transform_skip_context_enabled_flag; - unsigned char implicit_rdpcm_enabled_flag; - - unsigned char explicit_rdpcm_enabled_flag; - unsigned char extended_precision_processing_flag; - unsigned char intra_smoothing_disabled_flag; - unsigned char persistent_rice_adaptation_enabled_flag; - - unsigned char cabac_bypass_alignment_enabled_flag; - unsigned char pps_range_extension_flag; - unsigned char cross_component_prediction_enabled_flag; - unsigned char chroma_qp_offset_list_enabled_flag; - - unsigned char diff_cu_chroma_qp_offset_depth; - unsigned char chroma_qp_offset_list_len_minus1; - signed char cb_qp_offset_list[6]; - - signed char cr_qp_offset_list[6]; - unsigned char reserved2[2]; - - unsigned int reserved3[8]; - - // RefPicSets - int NumBitsForShortTermRPSInSlice; - int NumDeltaPocsOfRefRpsIdx; - int NumPocTotalCurr; - int NumPocStCurrBefore; - int NumPocStCurrAfter; - int NumPocLtCurr; - int CurrPicOrderCntVal; - int RefPicIdx[16]; // [refpic] Indices of valid reference pictures (-1 if unused for reference) - int PicOrderCntVal[16]; // [refpic] - unsigned char IsLongTerm[16]; // [refpic] 0=not a long-term reference, 1=long-term reference - unsigned char RefPicSetStCurrBefore[8]; // [0..NumPocStCurrBefore-1] -> refpic (0..15) - unsigned char RefPicSetStCurrAfter[8]; // [0..NumPocStCurrAfter-1] -> refpic (0..15) - unsigned char RefPicSetLtCurr[8]; // [0..NumPocLtCurr-1] -> refpic (0..15) - unsigned char RefPicSetInterLayer0[8]; - unsigned char RefPicSetInterLayer1[8]; - unsigned int reserved4[12]; - - // scaling lists (diag order) - unsigned char ScalingList4x4[6][16]; // [matrixId][i] - unsigned char ScalingList8x8[6][64]; // [matrixId][i] - unsigned char ScalingList16x16[6][64]; // [matrixId][i] - unsigned char ScalingList32x32[2][64]; // [matrixId][i] - unsigned char ScalingListDCCoeff16x16[6]; // [matrixId] - unsigned char ScalingListDCCoeff32x32[2]; // [matrixId] -} CUVIDHEVCPICPARAMS; - - -/***********************************************************/ -//! \struct CUVIDVP8PICPARAMS -//! VP8 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/***********************************************************/ -typedef struct _CUVIDVP8PICPARAMS -{ - int width; - int height; - unsigned int first_partition_size; - //Frame Indexes - unsigned char LastRefIdx; - unsigned char GoldenRefIdx; - unsigned char AltRefIdx; - union { - struct { - unsigned char frame_type : 1; /**< 0 = KEYFRAME, 1 = INTERFRAME */ - unsigned char version : 3; - unsigned char show_frame : 1; - unsigned char update_mb_segmentation_data : 1; /**< Must be 0 if segmentation is not enabled */ - unsigned char Reserved2Bits : 2; - }vp8_frame_tag; - unsigned char wFrameTagFlags; - }; - unsigned char Reserved1[4]; - unsigned int Reserved2[3]; -} CUVIDVP8PICPARAMS; - -/***********************************************************/ -//! \struct CUVIDVP9PICPARAMS -//! VP9 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/***********************************************************/ -typedef struct _CUVIDVP9PICPARAMS -{ - unsigned int width; - unsigned int height; - - //Frame Indices - unsigned char LastRefIdx; - unsigned char GoldenRefIdx; - unsigned char AltRefIdx; - unsigned char colorSpace; - - unsigned short profile : 3; - unsigned short frameContextIdx : 2; - unsigned short frameType : 1; - unsigned short showFrame : 1; - unsigned short errorResilient : 1; - unsigned short frameParallelDecoding : 1; - unsigned short subSamplingX : 1; - unsigned short subSamplingY : 1; - unsigned short intraOnly : 1; - unsigned short allow_high_precision_mv : 1; - unsigned short refreshEntropyProbs : 1; - unsigned short reserved2Bits : 2; - - unsigned short reserved16Bits; - - unsigned char refFrameSignBias[4]; - - unsigned char bitDepthMinus8Luma; - unsigned char bitDepthMinus8Chroma; - unsigned char loopFilterLevel; - unsigned char loopFilterSharpness; - - unsigned char modeRefLfEnabled; - unsigned char log2_tile_columns; - unsigned char log2_tile_rows; - - unsigned char segmentEnabled : 1; - unsigned char segmentMapUpdate : 1; - unsigned char segmentMapTemporalUpdate : 1; - unsigned char segmentFeatureMode : 1; - unsigned char reserved4Bits : 4; - - - unsigned char segmentFeatureEnable[8][4]; - short segmentFeatureData[8][4]; - unsigned char mb_segment_tree_probs[7]; - unsigned char segment_pred_probs[3]; - unsigned char reservedSegment16Bits[2]; - - int qpYAc; - int qpYDc; - int qpChDc; - int qpChAc; - - unsigned int activeRefIdx[3]; - unsigned int resetFrameContext; - unsigned int mcomp_filter_type; - unsigned int mbRefLfDelta[4]; - unsigned int mbModeLfDelta[2]; - unsigned int frameTagSize; - unsigned int offsetToDctParts; - unsigned int reserved128Bits[4]; - -} CUVIDVP9PICPARAMS; - -/***********************************************************/ -//! \struct CUVIDAV1PICPARAMS -//! AV1 picture parameters -//! This structure is used in CUVIDPICPARAMS structure -/***********************************************************/ -typedef struct _CUVIDAV1PICPARAMS -{ - unsigned int width; // coded width, if superres enabled then it is upscaled width - unsigned int height; // coded height - unsigned int frame_offset; // defined as order_hint in AV1 specification - int decodePicIdx; // decoded output pic index, if film grain enabled, it will keep decoded (without film grain) output - // It can be used as reference frame for future frames - - // sequence header - unsigned int profile : 3; // 0 = profile0, 1 = profile1, 2 = profile2 - unsigned int use_128x128_superblock : 1; // superblock size 0:64x64, 1: 128x128 - unsigned int subsampling_x : 1; // (subsampling_x, _y) 1,1 = 420, 1,0 = 422, 0,0 = 444 - unsigned int subsampling_y : 1; - unsigned int mono_chrome : 1; // for monochrome content, mono_chrome = 1 and (subsampling_x, _y) should be 1,1 - unsigned int bit_depth_minus8 : 4; // bit depth minus 8 - unsigned int enable_filter_intra : 1; // tool enable in seq level, 0 : disable 1: frame header control - unsigned int enable_intra_edge_filter : 1; // intra edge filtering process, 0 : disable 1: enabled - unsigned int enable_interintra_compound : 1; // interintra, 0 : not present 1: present - unsigned int enable_masked_compound : 1; // 1: mode info for inter blocks may contain the syntax element compound_type. - // 0: syntax element compound_type will not be present - unsigned int enable_dual_filter : 1; // vertical and horiz filter selection, 1: enable and 0: disable - unsigned int enable_order_hint : 1; // order hint, and related tools, 1: enable and 0: disable - unsigned int order_hint_bits_minus1 : 3; // is used to compute OrderHintBits - unsigned int enable_jnt_comp : 1; // joint compound modes, 1: enable and 0: disable - unsigned int enable_superres : 1; // superres in seq level, 0 : disable 1: frame level control - unsigned int enable_cdef : 1; // cdef filtering in seq level, 0 : disable 1: frame level control - unsigned int enable_restoration : 1; // loop restoration filtering in seq level, 0 : disable 1: frame level control - unsigned int enable_fgs : 1; // defined as film_grain_params_present in AV1 specification - unsigned int reserved0_7bits : 7; // reserved bits; must be set to 0 - - // frame header - unsigned int frame_type : 2 ; // 0:Key frame, 1:Inter frame, 2:intra only, 3:s-frame - unsigned int show_frame : 1 ; // show_frame = 1 implies that frame should be immediately output once decoded - unsigned int disable_cdf_update : 1; // CDF update during symbol decoding, 1: disabled, 0: enabled - unsigned int allow_screen_content_tools : 1; // 1: intra blocks may use palette encoding, 0: palette encoding is never used - unsigned int force_integer_mv : 1; // 1: motion vectors will always be integers, 0: can contain fractional bits - unsigned int coded_denom : 3; // coded_denom of the superres scale as specified in AV1 specification - unsigned int allow_intrabc : 1; // 1: intra block copy may be used, 0: intra block copy is not allowed - unsigned int allow_high_precision_mv : 1; // 1/8 precision mv enable - unsigned int interp_filter : 3; // interpolation filter. Refer to section 6.8.9 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned int switchable_motion_mode : 1; // defined as is_motion_mode_switchable in AV1 specification - unsigned int use_ref_frame_mvs : 1; // 1: current frame can use the previous frame mv information, 0: will not use. - unsigned int disable_frame_end_update_cdf : 1; // 1: indicates that the end of frame CDF update is disabled - unsigned int delta_q_present : 1; // quantizer index delta values are present in the block level - unsigned int delta_q_res : 2; // left shift which should be applied to decoded quantizer index delta values - unsigned int using_qmatrix : 1; // 1: quantizer matrix will be used to compute quantizers - unsigned int coded_lossless : 1; // 1: all segments use lossless coding - unsigned int use_superres : 1; // 1: superres enabled for frame - unsigned int tx_mode : 2; // 0: ONLY4x4,1:LARGEST,2:SELECT - unsigned int reference_mode : 1; // 0: SINGLE, 1: SELECT - unsigned int allow_warped_motion : 1; // 1: allow_warped_motion may be present, 0: allow_warped_motion will not be present - unsigned int reduced_tx_set : 1; // 1: frame is restricted to subset of the full set of transform types, 0: no such restriction - unsigned int skip_mode : 1; // 1: most of the mode info is skipped, 0: mode info is not skipped - unsigned int reserved1_3bits : 3; // reserved bits; must be set to 0 - - // tiling info - unsigned int num_tile_cols : 8; // number of tiles across the frame., max is 64 - unsigned int num_tile_rows : 8; // number of tiles down the frame., max is 64 - unsigned int context_update_tile_id : 16; // specifies which tile to use for the CDF update - unsigned short tile_widths[64]; // Width of each column in superblocks - unsigned short tile_heights[64]; // height of each row in superblocks - - // CDEF - refer to section 6.10.14 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned char cdef_damping_minus_3 : 2; // controls the amount of damping in the deringing filter - unsigned char cdef_bits : 2; // the number of bits needed to specify which CDEF filter to apply - unsigned char reserved2_4bits : 4; // reserved bits; must be set to 0 - unsigned char cdef_y_strength[8]; // 0-3 bits: y_pri_strength, 4-7 bits y_sec_strength - unsigned char cdef_uv_strength[8]; // 0-3 bits: uv_pri_strength, 4-7 bits uv_sec_strength - - // SkipModeFrames - unsigned char SkipModeFrame0 : 4; // specifies the frames to use for compound prediction when skip_mode is equal to 1. - unsigned char SkipModeFrame1 : 4; - - // qp information - refer to section 6.8.11 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned char base_qindex; // indicates the base frame qindex. Defined as base_q_idx in AV1 specification - char qp_y_dc_delta_q; // indicates the Y DC quantizer relative to base_q_idx. Defined as DeltaQYDc in AV1 specification - char qp_u_dc_delta_q; // indicates the U DC quantizer relative to base_q_idx. Defined as DeltaQUDc in AV1 specification - char qp_v_dc_delta_q; // indicates the V DC quantizer relative to base_q_idx. Defined as DeltaQVDc in AV1 specification - char qp_u_ac_delta_q; // indicates the U AC quantizer relative to base_q_idx. Defined as DeltaQUAc in AV1 specification - char qp_v_ac_delta_q; // indicates the V AC quantizer relative to base_q_idx. Defined as DeltaQVAc in AV1 specification - unsigned char qm_y; // specifies the level in the quantizer matrix that should be used for luma plane decoding - unsigned char qm_u; // specifies the level in the quantizer matrix that should be used for chroma U plane decoding - unsigned char qm_v; // specifies the level in the quantizer matrix that should be used for chroma V plane decoding - - // segmentation - refer to section 6.8.13 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned char segmentation_enabled : 1; // 1 indicates that this frame makes use of the segmentation tool - unsigned char segmentation_update_map : 1; // 1 indicates that the segmentation map are updated during the decoding of this frame - unsigned char segmentation_update_data : 1; // 1 indicates that new parameters are about to be specified for each segment - unsigned char segmentation_temporal_update : 1; // 1 indicates that the updates to the segmentation map are coded relative to the existing segmentation map - unsigned char reserved3_4bits : 4; // reserved bits; must be set to 0 - short segmentation_feature_data[8][8]; // specifies the feature data for a segment feature - unsigned char segmentation_feature_mask[8]; // indicates that the corresponding feature is unused or feature value is coded - - // loopfilter - refer to section 6.8.10 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned char loop_filter_level[2]; // contains loop filter strength values - unsigned char loop_filter_level_u; // loop filter strength value of U plane - unsigned char loop_filter_level_v; // loop filter strength value of V plane - unsigned char loop_filter_sharpness; // indicates the sharpness level - char loop_filter_ref_deltas[8]; // contains the adjustment needed for the filter level based on the chosen reference frame - char loop_filter_mode_deltas[2]; // contains the adjustment needed for the filter level based on the chosen mode - unsigned char loop_filter_delta_enabled : 1; // indicates that the filter level depends on the mode and reference frame used to predict a block - unsigned char loop_filter_delta_update : 1; // indicates that additional syntax elements are present that specify which mode and - // reference frame deltas are to be updated - unsigned char delta_lf_present : 1; // specifies whether loop filter delta values are present in the block level - unsigned char delta_lf_res : 2; // specifies the left shift to apply to the decoded loop filter values - unsigned char delta_lf_multi : 1; // separate loop filter deltas for Hy,Vy,U,V edges - unsigned char reserved4_2bits : 2; // reserved bits; must be set to 0 - - // restoration - refer to section 6.10.15 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned char lr_unit_size[3]; // specifies the size of loop restoration units: 0: 32, 1: 64, 2: 128, 3: 256 - unsigned char lr_type[3] ; // used to compute FrameRestorationType - - // reference frames - unsigned char primary_ref_frame; // specifies which reference frame contains the CDF values and other state that should be - // loaded at the start of the frame - unsigned char ref_frame_map[8]; // frames in dpb that can be used as reference for current or future frames - - unsigned char temporal_layer_id : 4; // temporal layer id - unsigned char spatial_layer_id : 4; // spatial layer id - - unsigned char reserved5_32bits[4]; // reserved bits; must be set to 0 - - // ref frame list - struct - { - unsigned int width; - unsigned int height; - unsigned char index; - unsigned char reserved24Bits[3]; // reserved bits; must be set to 0 - } ref_frame[7]; // frames used as reference frame for current frame. - - // global motion - struct { - unsigned char invalid : 1; - unsigned char wmtype : 2; // defined as GmType in AV1 specification - unsigned char reserved5Bits : 5; // reserved bits; must be set to 0 - char reserved24Bits[3]; // reserved bits; must be set to 0 - int wmmat[6]; // defined as gm_params[] in AV1 specification - } global_motion[7]; // global motion params for reference frames - - // film grain params - refer to section 6.8.20 of the AV1 specification Version 1.0.0 with Errata 1 - unsigned short apply_grain : 1; - unsigned short overlap_flag : 1; - unsigned short scaling_shift_minus8 : 2; - unsigned short chroma_scaling_from_luma : 1; - unsigned short ar_coeff_lag : 2; - unsigned short ar_coeff_shift_minus6 : 2; - unsigned short grain_scale_shift : 2; - unsigned short clip_to_restricted_range : 1; - unsigned short reserved6_4bits : 4; // reserved bits; must be set to 0 - unsigned char num_y_points; - unsigned char scaling_points_y[14][2]; - unsigned char num_cb_points; - unsigned char scaling_points_cb[10][2]; - unsigned char num_cr_points; - unsigned char scaling_points_cr[10][2]; - unsigned char reserved7_8bits; // reserved bits; must be set to 0 - unsigned short random_seed; - short ar_coeffs_y[24]; - short ar_coeffs_cb[25]; - short ar_coeffs_cr[25]; - unsigned char cb_mult; - unsigned char cb_luma_mult; - short cb_offset; - unsigned char cr_mult; - unsigned char cr_luma_mult; - short cr_offset; - - int reserved[7]; // reserved bits; must be set to 0 -} CUVIDAV1PICPARAMS; - -/******************************************************************************************/ -//! \struct CUVIDPICPARAMS -//! Picture parameters for decoding -//! This structure is used in cuvidDecodePicture API -//! IN for cuvidDecodePicture -/******************************************************************************************/ -typedef struct _CUVIDPICPARAMS -{ - int PicWidthInMbs; /**< IN: Coded frame size in macroblocks */ - int FrameHeightInMbs; /**< IN: Coded frame height in macroblocks */ - int CurrPicIdx; /**< IN: Output index of the current picture */ - int field_pic_flag; /**< IN: 0=frame picture, 1=field picture */ - int bottom_field_flag; /**< IN: 0=top field, 1=bottom field (ignored if field_pic_flag=0) */ - int second_field; /**< IN: Second field of a complementary field pair */ - // Bitstream data - unsigned int nBitstreamDataLen; /**< IN: Number of bytes in bitstream data buffer */ - const unsigned char *pBitstreamData; /**< IN: Ptr to bitstream data for this picture (slice-layer) */ - unsigned int nNumSlices; /**< IN: Number of slices in this picture */ - const unsigned int *pSliceDataOffsets; /**< IN: nNumSlices entries, contains offset of each slice within - the bitstream data buffer */ - int ref_pic_flag; /**< IN: This picture is a reference picture */ - int intra_pic_flag; /**< IN: This picture is entirely intra coded */ - unsigned int Reserved[30]; /**< Reserved for future use */ - // IN: Codec-specific data - union { - CUVIDMPEG2PICPARAMS mpeg2; /**< Also used for MPEG-1 */ - CUVIDH264PICPARAMS h264; - CUVIDVC1PICPARAMS vc1; - CUVIDMPEG4PICPARAMS mpeg4; - CUVIDJPEGPICPARAMS jpeg; - CUVIDHEVCPICPARAMS hevc; - CUVIDVP8PICPARAMS vp8; - CUVIDVP9PICPARAMS vp9; - CUVIDAV1PICPARAMS av1; - unsigned int CodecReserved[1024]; - } CodecSpecific; -} CUVIDPICPARAMS; - - -/******************************************************/ -//! \struct CUVIDPROCPARAMS -//! Picture parameters for postprocessing -//! This structure is used in cuvidMapVideoFrame API -/******************************************************/ -typedef struct _CUVIDPROCPARAMS -{ - int progressive_frame; /**< IN: Input is progressive (deinterlace_mode will be ignored) */ - int second_field; /**< IN: Output the second field (ignored if deinterlace mode is Weave) */ - int top_field_first; /**< IN: Input frame is top field first (1st field is top, 2nd field is bottom) */ - int unpaired_field; /**< IN: Input only contains one field (2nd field is invalid) */ - // The fields below are used for raw YUV input - unsigned int reserved_flags; /**< Reserved for future use (set to zero) */ - unsigned int reserved_zero; /**< Reserved (set to zero) */ - unsigned long long raw_input_dptr; /**< IN: Input CUdeviceptr for raw YUV extensions */ - unsigned int raw_input_pitch; /**< IN: pitch in bytes of raw YUV input (should be aligned appropriately) */ - unsigned int raw_input_format; /**< IN: Input YUV format (cudaVideoCodec_enum) */ - unsigned long long raw_output_dptr; /**< IN: Output CUdeviceptr for raw YUV extensions */ - unsigned int raw_output_pitch; /**< IN: pitch in bytes of raw YUV output (should be aligned appropriately) */ - unsigned int Reserved1; /**< Reserved for future use (set to zero) */ - CUstream output_stream; /**< IN: stream object used by cuvidMapVideoFrame */ - unsigned int Reserved[46]; /**< Reserved for future use (set to zero) */ - unsigned long long *histogram_dptr; /**< OUT: Output CUdeviceptr for histogram extensions */ - void *Reserved2[1]; /**< Reserved for future use (set to zero) */ -} CUVIDPROCPARAMS; - -/*********************************************************************************************************/ -//! \struct CUVIDGETDECODESTATUS -//! Struct for reporting decode status. -//! This structure is used in cuvidGetDecodeStatus API. -/*********************************************************************************************************/ -typedef struct _CUVIDGETDECODESTATUS -{ - cuvidDecodeStatus decodeStatus; - unsigned int reserved[31]; - void *pReserved[8]; -} CUVIDGETDECODESTATUS; - -/****************************************************/ -//! \struct CUVIDRECONFIGUREDECODERINFO -//! Struct for decoder reset -//! This structure is used in cuvidReconfigureDecoder() API -/****************************************************/ -typedef struct _CUVIDRECONFIGUREDECODERINFO -{ - unsigned int ulWidth; /**< IN: Coded sequence width in pixels, MUST be < = ulMaxWidth defined at CUVIDDECODECREATEINFO */ - unsigned int ulHeight; /**< IN: Coded sequence height in pixels, MUST be < = ulMaxHeight defined at CUVIDDECODECREATEINFO */ - unsigned int ulTargetWidth; /**< IN: Post processed output width */ - unsigned int ulTargetHeight; /**< IN: Post Processed output height */ - unsigned int ulNumDecodeSurfaces; /**< IN: Maximum number of internal decode surfaces */ - unsigned int reserved1[12]; /**< Reserved for future use. Set to Zero */ - /** - * IN: Area of frame to be displayed. Use-case : Source Cropping - */ - struct { - short left; - short top; - short right; - short bottom; - } display_area; - /** - * IN: Target Rectangle in the OutputFrame. Use-case : Aspect ratio Conversion - */ - struct { - short left; - short top; - short right; - short bottom; - } target_rect; - unsigned int reserved2[11]; /**< Reserved for future use. Set to Zero */ -} CUVIDRECONFIGUREDECODERINFO; - - -/***********************************************************************************************************/ -//! VIDEO_DECODER -//! -//! In order to minimize decode latencies, there should be always at least 2 pictures in the decode -//! queue at any time, in order to make sure that all decode engines are always busy. -//! -//! Overall data flow: -//! - cuvidGetDecoderCaps(...) -//! - cuvidCreateDecoder(...) -//! - For each picture: -//! + cuvidDecodePicture(N) -//! + cuvidMapVideoFrame(N-4) -//! + do some processing in cuda -//! + cuvidUnmapVideoFrame(N-4) -//! + cuvidDecodePicture(N+1) -//! + cuvidMapVideoFrame(N-3) -//! + ... -//! - cuvidDestroyDecoder(...) -//! -//! NOTE: -//! - When the cuda context is created from a D3D device, the D3D device must also be created -//! with the D3DCREATE_MULTITHREADED flag. -//! - There is a limit to how many pictures can be mapped simultaneously (ulNumOutputSurfaces) -//! - cuvidDecodePicture may block the calling thread if there are too many pictures pending -//! in the decode queue -/***********************************************************************************************************/ - - -/**********************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidGetDecoderCaps(CUVIDDECODECAPS *pdc) -//! Queries decode capabilities of NVDEC-HW based on CodecType, ChromaFormat and BitDepthMinus8 parameters. -//! 1. Application fills IN parameters CodecType, ChromaFormat and BitDepthMinus8 of CUVIDDECODECAPS structure -//! 2. On calling cuvidGetDecoderCaps, driver fills OUT parameters if the IN parameters are supported -//! If IN parameters passed to the driver are not supported by NVDEC-HW, then all OUT params are set to 0. -//! E.g. on Geforce GTX 960: -//! App fills - eCodecType = cudaVideoCodec_H264; eChromaFormat = cudaVideoChromaFormat_420; nBitDepthMinus8 = 0; -//! Given IN parameters are supported, hence driver fills: bIsSupported = 1; nMinWidth = 48; nMinHeight = 16; -//! nMaxWidth = 4096; nMaxHeight = 4096; nMaxMBCount = 65536; -//! CodedWidth*CodedHeight/256 must be less than or equal to nMaxMBCount -/**********************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidGetDecoderCaps(CUVIDDECODECAPS *pdc); - -/*****************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci) -//! Create the decoder object based on pdci. A handle to the created decoder is returned -/*****************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci); - -/*****************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder) -//! Destroy the decoder object -/*****************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder); - -/*****************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams) -//! Decode a single picture (field or frame) -//! Kicks off HW decoding -/*****************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams); - -/************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidGetDecodeStatus(CUvideodecoder hDecoder, int nPicIdx); -//! Get the decode status for frame corresponding to nPicIdx -//! API is supported for Maxwell and above generation GPUs. -//! API is currently supported for HEVC, H264 and JPEG codecs. -//! API returns CUDA_ERROR_NOT_SUPPORTED error code for unsupported GPU or codec. -/************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidGetDecodeStatus(CUvideodecoder hDecoder, int nPicIdx, CUVIDGETDECODESTATUS* pDecodeStatus); - -/*********************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidReconfigureDecoder(CUvideodecoder hDecoder, CUVIDRECONFIGUREDECODERINFO *pDecReconfigParams) -//! Used to reuse single decoder for multiple clips. Currently supports resolution change, resize params, display area -//! params, target area params change for same codec. Must be called during CUVIDPARSERPARAMS::pfnSequenceCallback -/*********************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidReconfigureDecoder(CUvideodecoder hDecoder, CUVIDRECONFIGUREDECODERINFO *pDecReconfigParams); - - -#if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL) -/************************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr, -//! unsigned int *pPitch, CUVIDPROCPARAMS *pVPP); -//! Post-process and map video frame corresponding to nPicIdx for use in cuda. Returns cuda device pointer and associated -//! pitch of the video frame -/************************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, - unsigned int *pDevPtr, unsigned int *pPitch, - CUVIDPROCPARAMS *pVPP); - -/*****************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr) -//! Unmap a previously mapped video frame -/*****************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr); -#endif - -/****************************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr, -//! unsigned int * pPitch, CUVIDPROCPARAMS *pVPP); -//! Post-process and map video frame corresponding to nPicIdx for use in cuda. Returns cuda device pointer and associated -//! pitch of the video frame -/****************************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr, - unsigned int *pPitch, CUVIDPROCPARAMS *pVPP); - -/**************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr); -//! Unmap a previously mapped video frame -/**************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr); - -#if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL) -#define tcuvidMapVideoFrame tcuvidMapVideoFrame64 -#define tcuvidUnmapVideoFrame tcuvidUnmapVideoFrame64 -#endif - - - -/********************************************************************************************************************/ -//! -//! Context-locking: to facilitate multi-threaded implementations, the following 4 functions -//! provide a simple mutex-style host synchronization. If a non-NULL context is specified -//! in CUVIDDECODECREATEINFO, the codec library will acquire the mutex associated with the given -//! context before making any cuda calls. -//! A multi-threaded application could create a lock associated with a context handle so that -//! multiple threads can safely share the same cuda context: -//! - use cuCtxPopCurrent immediately after context creation in order to create a 'floating' context -//! that can be passed to cuvidCtxLockCreate. -//! - When using a floating context, all cuda calls should only be made within a cuvidCtxLock/cuvidCtxUnlock section. -//! -//! NOTE: This is a safer alternative to cuCtxPushCurrent and cuCtxPopCurrent, and is not related to video -//! decoder in any way (implemented as a critical section associated with cuCtx{Push|Pop}Current calls). -/********************************************************************************************************************/ - -/********************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx) -//! This API is used to create CtxLock object -/********************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx); - -/********************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidCtxLockDestroy(CUvideoctxlock lck) -//! This API is used to free CtxLock object -/********************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCtxLockDestroy(CUvideoctxlock lck); - -/********************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags) -//! This API is used to acquire ctxlock -/********************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags); - -/********************************************************************************************************************/ -//! \fn CUresult CUDAAPI cuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags) -//! This API is used to release ctxlock -/********************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags); - -/**********************************************************************************************/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif // __CUDA_VIDEO_H__ diff --git a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_loader.h b/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_loader.h deleted file mode 100644 index 37a092d1..00000000 --- a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_loader.h +++ /dev/null @@ -1,481 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2016 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef FFNV_CUDA_DYNLINK_LOADER_H -#define FFNV_CUDA_DYNLINK_LOADER_H - -#include - -#include "dynlink_cuda.h" -#include "dynlink_nvcuvid.h" -#include "nvEncodeAPI.h" - -#if defined(_WIN32) && (!defined(FFNV_LOAD_FUNC) || !defined(FFNV_SYM_FUNC) || !defined(FFNV_LIB_HANDLE)) -# include -#endif - -#ifndef FFNV_LIB_HANDLE -# if defined(_WIN32) -# define FFNV_LIB_HANDLE HMODULE -# else -# define FFNV_LIB_HANDLE void* -# endif -#endif - -#if defined(_WIN32) || defined(__CYGWIN__) -# define CUDA_LIBNAME "nvcuda.dll" -# define NVCUVID_LIBNAME "nvcuvid.dll" -# if defined(_WIN64) || defined(__CYGWIN64__) -# define NVENC_LIBNAME "nvEncodeAPI64.dll" -# else -# define NVENC_LIBNAME "nvEncodeAPI.dll" -# endif -#else -# define CUDA_LIBNAME "libcuda.so.1" -# define NVCUVID_LIBNAME "libnvcuvid.so.1" -# define NVENC_LIBNAME "libnvidia-encode.so.1" -#endif - -#if !defined(FFNV_LOAD_FUNC) || !defined(FFNV_SYM_FUNC) -# ifdef _WIN32 -# define FFNV_LOAD_FUNC(path) LoadLibrary(TEXT(path)) -# define FFNV_SYM_FUNC(lib, sym) GetProcAddress((lib), (sym)) -# define FFNV_FREE_FUNC(lib) FreeLibrary(lib) -# else -# include -# define FFNV_LOAD_FUNC(path) dlopen((path), RTLD_LAZY) -# define FFNV_SYM_FUNC(lib, sym) dlsym((lib), (sym)) -# define FFNV_FREE_FUNC(lib) dlclose(lib) -# endif -#endif - -#if !defined(FFNV_LOG_FUNC) || !defined(FFNV_DEBUG_LOG_FUNC) -# include -# define FFNV_LOG_FUNC(logctx, msg, ...) fprintf(stderr, (msg), __VA_ARGS__) -# define FFNV_DEBUG_LOG_FUNC(logctx, msg, ...) -#endif - -#define LOAD_LIBRARY(l, path) \ - do { \ - if (!((l) = FFNV_LOAD_FUNC(path))) { \ - FFNV_LOG_FUNC(logctx, "Cannot load %s\n", path); \ - ret = -1; \ - goto error; \ - } \ - FFNV_DEBUG_LOG_FUNC(logctx, "Loaded lib: %s\n", path); \ - } while (0) - -#define LOAD_SYMBOL(fun, tp, symbol) \ - do { \ - if (!((f->fun) = (tp*)FFNV_SYM_FUNC(f->lib, symbol))) { \ - FFNV_LOG_FUNC(logctx, "Cannot load %s\n", symbol); \ - ret = -1; \ - goto error; \ - } \ - FFNV_DEBUG_LOG_FUNC(logctx, "Loaded sym: %s\n", symbol); \ - } while (0) - -#define LOAD_SYMBOL_OPT(fun, tp, symbol) \ - do { \ - if (!((f->fun) = (tp*)FFNV_SYM_FUNC(f->lib, symbol))) { \ - FFNV_DEBUG_LOG_FUNC(logctx, "Cannot load optional %s\n", symbol); \ - } else { \ - FFNV_DEBUG_LOG_FUNC(logctx, "Loaded sym: %s\n", symbol); \ - } \ - } while (0) - -#define GENERIC_LOAD_FUNC_PREAMBLE(T, n, N) \ - T *f; \ - int ret; \ - \ - n##_free_functions(functions); \ - \ - f = *functions = (T*)calloc(1, sizeof(*f)); \ - if (!f) \ - return -1; \ - \ - LOAD_LIBRARY(f->lib, N); - -#define GENERIC_LOAD_FUNC_FINALE(n) \ - return 0; \ -error: \ - n##_free_functions(functions); \ - return ret; - -#define GENERIC_FREE_FUNC() \ - if (!functions) \ - return; \ - if (*functions && (*functions)->lib) \ - FFNV_FREE_FUNC((*functions)->lib); \ - free(*functions); \ - *functions = NULL; - -#ifdef FFNV_DYNLINK_CUDA_H -typedef struct CudaFunctions { - tcuInit *cuInit; - tcuDriverGetVersion *cuDriverGetVersion; - tcuDeviceGetCount *cuDeviceGetCount; - tcuDeviceGet *cuDeviceGet; - tcuDeviceGetAttribute *cuDeviceGetAttribute; - tcuDeviceGetName *cuDeviceGetName; - tcuDeviceGetUuid *cuDeviceGetUuid; - tcuDeviceGetUuid_v2 *cuDeviceGetUuid_v2; - tcuDeviceGetLuid *cuDeviceGetLuid; - tcuDeviceGetByPCIBusId *cuDeviceGetByPCIBusId; - tcuDeviceGetPCIBusId *cuDeviceGetPCIBusId; - tcuDeviceComputeCapability *cuDeviceComputeCapability; - tcuCtxCreate_v2 *cuCtxCreate; - tcuCtxGetCurrent *cuCtxGetCurrent; - tcuCtxSetLimit *cuCtxSetLimit; - tcuCtxPushCurrent_v2 *cuCtxPushCurrent; - tcuCtxPopCurrent_v2 *cuCtxPopCurrent; - tcuCtxDestroy_v2 *cuCtxDestroy; - tcuMemAlloc_v2 *cuMemAlloc; - tcuMemAllocPitch_v2 *cuMemAllocPitch; - tcuMemAllocManaged *cuMemAllocManaged; - tcuMemsetD8Async *cuMemsetD8Async; - tcuMemFree_v2 *cuMemFree; - tcuMemcpy *cuMemcpy; - tcuMemcpyAsync *cuMemcpyAsync; - tcuMemcpy2D_v2 *cuMemcpy2D; - tcuMemcpy2DAsync_v2 *cuMemcpy2DAsync; - tcuMemcpyHtoD_v2 *cuMemcpyHtoD; - tcuMemcpyHtoDAsync_v2 *cuMemcpyHtoDAsync; - tcuMemcpyDtoH_v2 *cuMemcpyDtoH; - tcuMemcpyDtoHAsync_v2 *cuMemcpyDtoHAsync; - tcuMemcpyDtoD_v2 *cuMemcpyDtoD; - tcuMemcpyDtoDAsync_v2 *cuMemcpyDtoDAsync; - tcuGetErrorName *cuGetErrorName; - tcuGetErrorString *cuGetErrorString; - tcuCtxGetDevice *cuCtxGetDevice; - - tcuDevicePrimaryCtxRetain *cuDevicePrimaryCtxRetain; - tcuDevicePrimaryCtxRelease *cuDevicePrimaryCtxRelease; - tcuDevicePrimaryCtxSetFlags *cuDevicePrimaryCtxSetFlags; - tcuDevicePrimaryCtxGetState *cuDevicePrimaryCtxGetState; - tcuDevicePrimaryCtxReset *cuDevicePrimaryCtxReset; - - tcuStreamCreate *cuStreamCreate; - tcuStreamQuery *cuStreamQuery; - tcuStreamSynchronize *cuStreamSynchronize; - tcuStreamDestroy_v2 *cuStreamDestroy; - tcuStreamAddCallback *cuStreamAddCallback; - tcuStreamWaitEvent *cuStreamWaitEvent; - tcuEventCreate *cuEventCreate; - tcuEventDestroy_v2 *cuEventDestroy; - tcuEventSynchronize *cuEventSynchronize; - tcuEventQuery *cuEventQuery; - tcuEventRecord *cuEventRecord; - - tcuLaunchKernel *cuLaunchKernel; - tcuLinkCreate *cuLinkCreate; - tcuLinkAddData *cuLinkAddData; - tcuLinkComplete *cuLinkComplete; - tcuLinkDestroy *cuLinkDestroy; - tcuModuleLoadData *cuModuleLoadData; - tcuModuleUnload *cuModuleUnload; - tcuModuleGetFunction *cuModuleGetFunction; - tcuModuleGetGlobal *cuModuleGetGlobal; - tcuTexObjectCreate *cuTexObjectCreate; - tcuTexObjectDestroy *cuTexObjectDestroy; - - tcuGLGetDevices_v2 *cuGLGetDevices; - tcuGraphicsGLRegisterImage *cuGraphicsGLRegisterImage; - tcuGraphicsUnregisterResource *cuGraphicsUnregisterResource; - tcuGraphicsMapResources *cuGraphicsMapResources; - tcuGraphicsUnmapResources *cuGraphicsUnmapResources; - tcuGraphicsSubResourceGetMappedArray *cuGraphicsSubResourceGetMappedArray; - tcuGraphicsResourceGetMappedPointer *cuGraphicsResourceGetMappedPointer; - tcuGraphicsResourceSetMapFlags_v2 *cuGraphicsResourceSetMapFlags; - - tcuImportExternalMemory *cuImportExternalMemory; - tcuDestroyExternalMemory *cuDestroyExternalMemory; - tcuExternalMemoryGetMappedBuffer *cuExternalMemoryGetMappedBuffer; - tcuExternalMemoryGetMappedMipmappedArray *cuExternalMemoryGetMappedMipmappedArray; - tcuMipmappedArrayDestroy *cuMipmappedArrayDestroy; - - tcuMipmappedArrayGetLevel *cuMipmappedArrayGetLevel; - - tcuImportExternalSemaphore *cuImportExternalSemaphore; - tcuDestroyExternalSemaphore *cuDestroyExternalSemaphore; - tcuSignalExternalSemaphoresAsync *cuSignalExternalSemaphoresAsync; - tcuWaitExternalSemaphoresAsync *cuWaitExternalSemaphoresAsync; - - tcuArrayCreate *cuArrayCreate; - tcuArray3DCreate *cuArray3DCreate; - tcuArrayDestroy *cuArrayDestroy; - - tcuEGLStreamProducerConnect *cuEGLStreamProducerConnect; - tcuEGLStreamProducerDisconnect *cuEGLStreamProducerDisconnect; - tcuEGLStreamConsumerDisconnect *cuEGLStreamConsumerDisconnect; - tcuEGLStreamProducerPresentFrame *cuEGLStreamProducerPresentFrame; - tcuEGLStreamProducerReturnFrame *cuEGLStreamProducerReturnFrame; - -#if defined(_WIN32) || defined(__CYGWIN__) - tcuD3D11GetDevice *cuD3D11GetDevice; - tcuD3D11GetDevices *cuD3D11GetDevices; - tcuGraphicsD3D11RegisterResource *cuGraphicsD3D11RegisterResource; -#endif - - FFNV_LIB_HANDLE lib; -} CudaFunctions; -#else -typedef struct CudaFunctions CudaFunctions; -#endif - -typedef struct CuvidFunctions { - tcuvidGetDecoderCaps *cuvidGetDecoderCaps; - tcuvidCreateDecoder *cuvidCreateDecoder; - tcuvidDestroyDecoder *cuvidDestroyDecoder; - tcuvidDecodePicture *cuvidDecodePicture; - tcuvidGetDecodeStatus *cuvidGetDecodeStatus; - tcuvidReconfigureDecoder *cuvidReconfigureDecoder; - tcuvidMapVideoFrame *cuvidMapVideoFrame; - tcuvidUnmapVideoFrame *cuvidUnmapVideoFrame; - tcuvidCtxLockCreate *cuvidCtxLockCreate; - tcuvidCtxLockDestroy *cuvidCtxLockDestroy; - tcuvidCtxLock *cuvidCtxLock; - tcuvidCtxUnlock *cuvidCtxUnlock; - -#if !defined(__APPLE__) - tcuvidCreateVideoSource *cuvidCreateVideoSource; - tcuvidCreateVideoSourceW *cuvidCreateVideoSourceW; - tcuvidDestroyVideoSource *cuvidDestroyVideoSource; - tcuvidSetVideoSourceState *cuvidSetVideoSourceState; - tcuvidGetVideoSourceState *cuvidGetVideoSourceState; - tcuvidGetSourceVideoFormat *cuvidGetSourceVideoFormat; - tcuvidGetSourceAudioFormat *cuvidGetSourceAudioFormat; -#endif - tcuvidCreateVideoParser *cuvidCreateVideoParser; - tcuvidParseVideoData *cuvidParseVideoData; - tcuvidDestroyVideoParser *cuvidDestroyVideoParser; - - FFNV_LIB_HANDLE lib; -} CuvidFunctions; - -typedef NVENCSTATUS NVENCAPI tNvEncodeAPICreateInstance(NV_ENCODE_API_FUNCTION_LIST *functionList); -typedef NVENCSTATUS NVENCAPI tNvEncodeAPIGetMaxSupportedVersion(uint32_t* version); - -typedef struct NvencFunctions { - tNvEncodeAPICreateInstance *NvEncodeAPICreateInstance; - tNvEncodeAPIGetMaxSupportedVersion *NvEncodeAPIGetMaxSupportedVersion; - - FFNV_LIB_HANDLE lib; -} NvencFunctions; - -#ifdef FFNV_DYNLINK_CUDA_H -static inline void cuda_free_functions(CudaFunctions **functions) -{ - GENERIC_FREE_FUNC(); -} -#endif - -static inline void cuvid_free_functions(CuvidFunctions **functions) -{ - GENERIC_FREE_FUNC(); -} - -static inline void nvenc_free_functions(NvencFunctions **functions) -{ - GENERIC_FREE_FUNC(); -} - -#ifdef FFNV_DYNLINK_CUDA_H -static inline int cuda_load_functions(CudaFunctions **functions, void *logctx) -{ - (void)logctx; - GENERIC_LOAD_FUNC_PREAMBLE(CudaFunctions, cuda, CUDA_LIBNAME); - - LOAD_SYMBOL(cuInit, tcuInit, "cuInit"); - LOAD_SYMBOL(cuDriverGetVersion, tcuDriverGetVersion, "cuDriverGetVersion"); - LOAD_SYMBOL(cuDeviceGetCount, tcuDeviceGetCount, "cuDeviceGetCount"); - LOAD_SYMBOL(cuDeviceGet, tcuDeviceGet, "cuDeviceGet"); - LOAD_SYMBOL(cuDeviceGetAttribute, tcuDeviceGetAttribute, "cuDeviceGetAttribute"); - LOAD_SYMBOL(cuDeviceGetName, tcuDeviceGetName, "cuDeviceGetName"); - LOAD_SYMBOL(cuDeviceComputeCapability, tcuDeviceComputeCapability, "cuDeviceComputeCapability"); - LOAD_SYMBOL(cuCtxCreate, tcuCtxCreate_v2, "cuCtxCreate_v2"); - LOAD_SYMBOL(cuCtxGetCurrent, tcuCtxGetCurrent, "cuCtxGetCurrent"); - LOAD_SYMBOL(cuCtxSetLimit, tcuCtxSetLimit, "cuCtxSetLimit"); - LOAD_SYMBOL(cuCtxPushCurrent, tcuCtxPushCurrent_v2, "cuCtxPushCurrent_v2"); - LOAD_SYMBOL(cuCtxPopCurrent, tcuCtxPopCurrent_v2, "cuCtxPopCurrent_v2"); - LOAD_SYMBOL(cuCtxDestroy, tcuCtxDestroy_v2, "cuCtxDestroy_v2"); - LOAD_SYMBOL(cuMemAlloc, tcuMemAlloc_v2, "cuMemAlloc_v2"); - LOAD_SYMBOL(cuMemAllocPitch, tcuMemAllocPitch_v2, "cuMemAllocPitch_v2"); - LOAD_SYMBOL(cuMemAllocManaged, tcuMemAllocManaged, "cuMemAllocManaged"); - LOAD_SYMBOL(cuMemsetD8Async, tcuMemsetD8Async, "cuMemsetD8Async"); - LOAD_SYMBOL(cuMemFree, tcuMemFree_v2, "cuMemFree_v2"); - LOAD_SYMBOL(cuMemcpy, tcuMemcpy, "cuMemcpy"); - LOAD_SYMBOL(cuMemcpyAsync, tcuMemcpyAsync, "cuMemcpyAsync"); - LOAD_SYMBOL(cuMemcpy2D, tcuMemcpy2D_v2, "cuMemcpy2D_v2"); - LOAD_SYMBOL(cuMemcpy2DAsync, tcuMemcpy2DAsync_v2, "cuMemcpy2DAsync_v2"); - LOAD_SYMBOL(cuMemcpyHtoD, tcuMemcpyHtoD_v2, "cuMemcpyHtoD_v2"); - LOAD_SYMBOL(cuMemcpyHtoDAsync, tcuMemcpyHtoDAsync_v2, "cuMemcpyHtoDAsync_v2"); - LOAD_SYMBOL(cuMemcpyDtoH, tcuMemcpyDtoH_v2, "cuMemcpyDtoH_v2"); - LOAD_SYMBOL(cuMemcpyDtoHAsync, tcuMemcpyDtoHAsync_v2, "cuMemcpyDtoHAsync_v2"); - LOAD_SYMBOL(cuMemcpyDtoD, tcuMemcpyDtoD_v2, "cuMemcpyDtoD_v2"); - LOAD_SYMBOL(cuMemcpyDtoDAsync, tcuMemcpyDtoDAsync_v2, "cuMemcpyDtoDAsync_v2"); - LOAD_SYMBOL(cuGetErrorName, tcuGetErrorName, "cuGetErrorName"); - LOAD_SYMBOL(cuGetErrorString, tcuGetErrorString, "cuGetErrorString"); - LOAD_SYMBOL(cuCtxGetDevice, tcuCtxGetDevice, "cuCtxGetDevice"); - - LOAD_SYMBOL(cuDevicePrimaryCtxRetain, tcuDevicePrimaryCtxRetain, "cuDevicePrimaryCtxRetain"); - LOAD_SYMBOL(cuDevicePrimaryCtxRelease, tcuDevicePrimaryCtxRelease, "cuDevicePrimaryCtxRelease"); - LOAD_SYMBOL(cuDevicePrimaryCtxSetFlags, tcuDevicePrimaryCtxSetFlags, "cuDevicePrimaryCtxSetFlags"); - LOAD_SYMBOL(cuDevicePrimaryCtxGetState, tcuDevicePrimaryCtxGetState, "cuDevicePrimaryCtxGetState"); - LOAD_SYMBOL(cuDevicePrimaryCtxReset, tcuDevicePrimaryCtxReset, "cuDevicePrimaryCtxReset"); - - LOAD_SYMBOL(cuStreamCreate, tcuStreamCreate, "cuStreamCreate"); - LOAD_SYMBOL(cuStreamQuery, tcuStreamQuery, "cuStreamQuery"); - LOAD_SYMBOL(cuStreamSynchronize, tcuStreamSynchronize, "cuStreamSynchronize"); - LOAD_SYMBOL(cuStreamDestroy, tcuStreamDestroy_v2, "cuStreamDestroy_v2"); - LOAD_SYMBOL(cuStreamAddCallback, tcuStreamAddCallback, "cuStreamAddCallback"); - LOAD_SYMBOL(cuStreamWaitEvent, tcuStreamWaitEvent, "cuStreamWaitEvent"); - LOAD_SYMBOL(cuEventCreate, tcuEventCreate, "cuEventCreate"); - LOAD_SYMBOL(cuEventDestroy, tcuEventDestroy_v2, "cuEventDestroy_v2"); - LOAD_SYMBOL(cuEventSynchronize, tcuEventSynchronize, "cuEventSynchronize"); - LOAD_SYMBOL(cuEventQuery, tcuEventQuery, "cuEventQuery"); - LOAD_SYMBOL(cuEventRecord, tcuEventRecord, "cuEventRecord"); - - LOAD_SYMBOL(cuLaunchKernel, tcuLaunchKernel, "cuLaunchKernel"); - LOAD_SYMBOL(cuLinkCreate, tcuLinkCreate, "cuLinkCreate"); - LOAD_SYMBOL(cuLinkAddData, tcuLinkAddData, "cuLinkAddData"); - LOAD_SYMBOL(cuLinkComplete, tcuLinkComplete, "cuLinkComplete"); - LOAD_SYMBOL(cuLinkDestroy, tcuLinkDestroy, "cuLinkDestroy"); - LOAD_SYMBOL(cuModuleLoadData, tcuModuleLoadData, "cuModuleLoadData"); - LOAD_SYMBOL(cuModuleUnload, tcuModuleUnload, "cuModuleUnload"); - LOAD_SYMBOL(cuModuleGetFunction, tcuModuleGetFunction, "cuModuleGetFunction"); - LOAD_SYMBOL(cuModuleGetGlobal, tcuModuleGetGlobal, "cuModuleGetGlobal"); - LOAD_SYMBOL(cuTexObjectCreate, tcuTexObjectCreate, "cuTexObjectCreate"); - LOAD_SYMBOL(cuTexObjectDestroy, tcuTexObjectDestroy, "cuTexObjectDestroy"); - - LOAD_SYMBOL(cuGLGetDevices, tcuGLGetDevices_v2, "cuGLGetDevices_v2"); - LOAD_SYMBOL(cuGraphicsGLRegisterImage, tcuGraphicsGLRegisterImage, "cuGraphicsGLRegisterImage"); - LOAD_SYMBOL(cuGraphicsUnregisterResource, tcuGraphicsUnregisterResource, "cuGraphicsUnregisterResource"); - LOAD_SYMBOL(cuGraphicsMapResources, tcuGraphicsMapResources, "cuGraphicsMapResources"); - LOAD_SYMBOL(cuGraphicsUnmapResources, tcuGraphicsUnmapResources, "cuGraphicsUnmapResources"); - LOAD_SYMBOL(cuGraphicsSubResourceGetMappedArray, tcuGraphicsSubResourceGetMappedArray, "cuGraphicsSubResourceGetMappedArray"); - LOAD_SYMBOL(cuGraphicsResourceGetMappedPointer, tcuGraphicsResourceGetMappedPointer, "cuGraphicsResourceGetMappedPointer_v2"); - LOAD_SYMBOL(cuGraphicsResourceSetMapFlags, tcuGraphicsResourceSetMapFlags_v2, "cuGraphicsResourceSetMapFlags_v2"); - - LOAD_SYMBOL_OPT(cuDeviceGetUuid, tcuDeviceGetUuid, "cuDeviceGetUuid"); - LOAD_SYMBOL_OPT(cuDeviceGetUuid_v2, tcuDeviceGetUuid_v2, "cuDeviceGetUuid_v2"); - LOAD_SYMBOL_OPT(cuDeviceGetLuid, tcuDeviceGetLuid, "cuDeviceGetLuid"); - LOAD_SYMBOL_OPT(cuDeviceGetByPCIBusId, tcuDeviceGetByPCIBusId, "cuDeviceGetByPCIBusId"); - LOAD_SYMBOL_OPT(cuDeviceGetPCIBusId, tcuDeviceGetPCIBusId, "cuDeviceGetPCIBusId"); - LOAD_SYMBOL_OPT(cuImportExternalMemory, tcuImportExternalMemory, "cuImportExternalMemory"); - LOAD_SYMBOL_OPT(cuDestroyExternalMemory, tcuDestroyExternalMemory, "cuDestroyExternalMemory"); - LOAD_SYMBOL_OPT(cuExternalMemoryGetMappedBuffer, tcuExternalMemoryGetMappedBuffer, "cuExternalMemoryGetMappedBuffer"); - LOAD_SYMBOL_OPT(cuExternalMemoryGetMappedMipmappedArray, tcuExternalMemoryGetMappedMipmappedArray, "cuExternalMemoryGetMappedMipmappedArray"); - LOAD_SYMBOL_OPT(cuMipmappedArrayGetLevel, tcuMipmappedArrayGetLevel, "cuMipmappedArrayGetLevel"); - LOAD_SYMBOL_OPT(cuMipmappedArrayDestroy, tcuMipmappedArrayDestroy, "cuMipmappedArrayDestroy"); - - LOAD_SYMBOL_OPT(cuImportExternalSemaphore, tcuImportExternalSemaphore, "cuImportExternalSemaphore"); - LOAD_SYMBOL_OPT(cuDestroyExternalSemaphore, tcuDestroyExternalSemaphore, "cuDestroyExternalSemaphore"); - LOAD_SYMBOL_OPT(cuSignalExternalSemaphoresAsync, tcuSignalExternalSemaphoresAsync, "cuSignalExternalSemaphoresAsync"); - LOAD_SYMBOL_OPT(cuWaitExternalSemaphoresAsync, tcuWaitExternalSemaphoresAsync, "cuWaitExternalSemaphoresAsync"); - - LOAD_SYMBOL(cuArrayCreate, tcuArrayCreate, "cuArrayCreate_v2"); - LOAD_SYMBOL(cuArray3DCreate, tcuArray3DCreate, "cuArray3DCreate_v2"); - LOAD_SYMBOL(cuArrayDestroy, tcuArrayDestroy, "cuArrayDestroy"); - - LOAD_SYMBOL_OPT(cuEGLStreamProducerConnect, tcuEGLStreamProducerConnect, "cuEGLStreamProducerConnect"); - LOAD_SYMBOL_OPT(cuEGLStreamProducerDisconnect, tcuEGLStreamProducerDisconnect, "cuEGLStreamProducerDisconnect"); - LOAD_SYMBOL_OPT(cuEGLStreamConsumerDisconnect, tcuEGLStreamConsumerDisconnect, "cuEGLStreamConsumerDisconnect"); - LOAD_SYMBOL_OPT(cuEGLStreamProducerPresentFrame, tcuEGLStreamProducerPresentFrame, "cuEGLStreamProducerPresentFrame"); - LOAD_SYMBOL_OPT(cuEGLStreamProducerReturnFrame, tcuEGLStreamProducerReturnFrame, "cuEGLStreamProducerReturnFrame"); - -#if defined(_WIN32) || defined(__CYGWIN__) - LOAD_SYMBOL(cuD3D11GetDevice, tcuD3D11GetDevice, "cuD3D11GetDevice"); - LOAD_SYMBOL(cuD3D11GetDevices, tcuD3D11GetDevices, "cuD3D11GetDevices"); - LOAD_SYMBOL(cuGraphicsD3D11RegisterResource, tcuGraphicsD3D11RegisterResource, "cuGraphicsD3D11RegisterResource"); -#endif - - GENERIC_LOAD_FUNC_FINALE(cuda); -} -#endif - -static inline int cuvid_load_functions(CuvidFunctions **functions, void *logctx) -{ - (void)logctx; - GENERIC_LOAD_FUNC_PREAMBLE(CuvidFunctions, cuvid, NVCUVID_LIBNAME); - - LOAD_SYMBOL_OPT(cuvidGetDecoderCaps, tcuvidGetDecoderCaps, "cuvidGetDecoderCaps"); - LOAD_SYMBOL(cuvidCreateDecoder, tcuvidCreateDecoder, "cuvidCreateDecoder"); - LOAD_SYMBOL(cuvidDestroyDecoder, tcuvidDestroyDecoder, "cuvidDestroyDecoder"); - LOAD_SYMBOL(cuvidDecodePicture, tcuvidDecodePicture, "cuvidDecodePicture"); - LOAD_SYMBOL(cuvidGetDecodeStatus, tcuvidGetDecodeStatus, "cuvidGetDecodeStatus"); - LOAD_SYMBOL(cuvidReconfigureDecoder, tcuvidReconfigureDecoder, "cuvidReconfigureDecoder"); -#ifdef __CUVID_DEVPTR64 - LOAD_SYMBOL(cuvidMapVideoFrame, tcuvidMapVideoFrame, "cuvidMapVideoFrame64"); - LOAD_SYMBOL(cuvidUnmapVideoFrame, tcuvidUnmapVideoFrame, "cuvidUnmapVideoFrame64"); -#else - LOAD_SYMBOL(cuvidMapVideoFrame, tcuvidMapVideoFrame, "cuvidMapVideoFrame"); - LOAD_SYMBOL(cuvidUnmapVideoFrame, tcuvidUnmapVideoFrame, "cuvidUnmapVideoFrame"); -#endif - LOAD_SYMBOL(cuvidCtxLockCreate, tcuvidCtxLockCreate, "cuvidCtxLockCreate"); - LOAD_SYMBOL(cuvidCtxLockDestroy, tcuvidCtxLockDestroy, "cuvidCtxLockDestroy"); - LOAD_SYMBOL(cuvidCtxLock, tcuvidCtxLock, "cuvidCtxLock"); - LOAD_SYMBOL(cuvidCtxUnlock, tcuvidCtxUnlock, "cuvidCtxUnlock"); - -#if !defined(__APPLE__) - LOAD_SYMBOL(cuvidCreateVideoSource, tcuvidCreateVideoSource, "cuvidCreateVideoSource"); - LOAD_SYMBOL(cuvidCreateVideoSourceW, tcuvidCreateVideoSourceW, "cuvidCreateVideoSourceW"); - LOAD_SYMBOL(cuvidDestroyVideoSource, tcuvidDestroyVideoSource, "cuvidDestroyVideoSource"); - LOAD_SYMBOL(cuvidSetVideoSourceState, tcuvidSetVideoSourceState, "cuvidSetVideoSourceState"); - LOAD_SYMBOL(cuvidGetVideoSourceState, tcuvidGetVideoSourceState, "cuvidGetVideoSourceState"); - LOAD_SYMBOL(cuvidGetSourceVideoFormat, tcuvidGetSourceVideoFormat, "cuvidGetSourceVideoFormat"); - LOAD_SYMBOL(cuvidGetSourceAudioFormat, tcuvidGetSourceAudioFormat, "cuvidGetSourceAudioFormat"); -#endif - LOAD_SYMBOL(cuvidCreateVideoParser, tcuvidCreateVideoParser, "cuvidCreateVideoParser"); - LOAD_SYMBOL(cuvidParseVideoData, tcuvidParseVideoData, "cuvidParseVideoData"); - LOAD_SYMBOL(cuvidDestroyVideoParser, tcuvidDestroyVideoParser, "cuvidDestroyVideoParser"); - - GENERIC_LOAD_FUNC_FINALE(cuvid); -} - -static inline int nvenc_load_functions(NvencFunctions **functions, void *logctx) -{ - (void)logctx; - GENERIC_LOAD_FUNC_PREAMBLE(NvencFunctions, nvenc, NVENC_LIBNAME); - - LOAD_SYMBOL(NvEncodeAPICreateInstance, tNvEncodeAPICreateInstance, "NvEncodeAPICreateInstance"); - LOAD_SYMBOL(NvEncodeAPIGetMaxSupportedVersion, tNvEncodeAPIGetMaxSupportedVersion, "NvEncodeAPIGetMaxSupportedVersion"); - - GENERIC_LOAD_FUNC_FINALE(nvenc); -} - -#undef GENERIC_LOAD_FUNC_PREAMBLE -#undef LOAD_LIBRARY -#undef LOAD_SYMBOL -#undef GENERIC_LOAD_FUNC_FINALE -#undef GENERIC_FREE_FUNC -#undef CUDA_LIBNAME -#undef NVCUVID_LIBNAME -#undef NVENC_LIBNAME - -#endif - diff --git a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_nvcuvid.h b/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_nvcuvid.h deleted file mode 100644 index d6d84ec3..00000000 --- a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/dynlink_nvcuvid.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/********************************************************************************************************************/ -//! \file nvcuvid.h -//! NVDECODE API provides video decoding interface to NVIDIA GPU devices. -//! \date 2015-2022 -//! This file contains the interface constants, structure definitions and function prototypes. -/********************************************************************************************************************/ - -#if !defined(__NVCUVID_H__) -#define __NVCUVID_H__ - -#include "dynlink_cuviddec.h" - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#define MAX_CLOCK_TS 3 - -/***********************************************/ -//! -//! High-level helper APIs for video sources -//! -/***********************************************/ - -typedef void *CUvideosource; -typedef void *CUvideoparser; -typedef long long CUvideotimestamp; - - -/************************************************************************/ -//! \enum cudaVideoState -//! Video source state enums -//! Used in cuvidSetVideoSourceState and cuvidGetVideoSourceState APIs -/************************************************************************/ -typedef enum { - cudaVideoState_Error = -1, /**< Error state (invalid source) */ - cudaVideoState_Stopped = 0, /**< Source is stopped (or reached end-of-stream) */ - cudaVideoState_Started = 1 /**< Source is running and delivering data */ -} cudaVideoState; - -/************************************************************************/ -//! \enum cudaAudioCodec -//! Audio compression enums -//! Used in CUAUDIOFORMAT structure -/************************************************************************/ -typedef enum { - cudaAudioCodec_MPEG1=0, /**< MPEG-1 Audio */ - cudaAudioCodec_MPEG2, /**< MPEG-2 Audio */ - cudaAudioCodec_MP3, /**< MPEG-1 Layer III Audio */ - cudaAudioCodec_AC3, /**< Dolby Digital (AC3) Audio */ - cudaAudioCodec_LPCM, /**< PCM Audio */ - cudaAudioCodec_AAC, /**< AAC Audio */ -} cudaAudioCodec; - -/************************************************************************/ -//! \ingroup STRUCTS -//! \struct HEVCTIMECODESET -//! Used to store Time code extracted from Time code SEI in HEVC codec -/************************************************************************/ -typedef struct _HEVCTIMECODESET -{ - unsigned int time_offset_value; - unsigned short n_frames; - unsigned char clock_timestamp_flag; - unsigned char units_field_based_flag; - unsigned char counting_type; - unsigned char full_timestamp_flag; - unsigned char discontinuity_flag; - unsigned char cnt_dropped_flag; - unsigned char seconds_value; - unsigned char minutes_value; - unsigned char hours_value; - unsigned char seconds_flag; - unsigned char minutes_flag; - unsigned char hours_flag; - unsigned char time_offset_length; - unsigned char reserved; -} HEVCTIMECODESET; - -/************************************************************************/ -//! \ingroup STRUCTS -//! \struct HEVCSEITIMECODE -//! Used to extract Time code SEI in HEVC codec -/************************************************************************/ -typedef struct _HEVCSEITIMECODE -{ - HEVCTIMECODESET time_code_set[MAX_CLOCK_TS]; - unsigned char num_clock_ts; -} HEVCSEITIMECODE; - -/**********************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUSEIMESSAGE; -//! Used in CUVIDSEIMESSAGEINFO structure -/**********************************************************************************/ -typedef struct _CUSEIMESSAGE -{ - unsigned char sei_message_type; /**< OUT: SEI Message Type */ - unsigned char reserved[3]; - unsigned int sei_message_size; /**< OUT: SEI Message Size */ -} CUSEIMESSAGE; - -/************************************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDEOFORMAT -//! Video format -//! Used in cuvidGetSourceVideoFormat API -/************************************************************************************************/ -typedef struct -{ - cudaVideoCodec codec; /**< OUT: Compression format */ - /** - * OUT: frame rate = numerator / denominator (for example: 30000/1001) - */ - struct { - /**< OUT: frame rate numerator (0 = unspecified or variable frame rate) */ - unsigned int numerator; - /**< OUT: frame rate denominator (0 = unspecified or variable frame rate) */ - unsigned int denominator; - } frame_rate; - unsigned char progressive_sequence; /**< OUT: 0=interlaced, 1=progressive */ - unsigned char bit_depth_luma_minus8; /**< OUT: high bit depth luma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */ - unsigned char bit_depth_chroma_minus8; /**< OUT: high bit depth chroma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */ - unsigned char min_num_decode_surfaces; /**< OUT: Minimum number of decode surfaces to be allocated for correct - decoding. The client can send this value in ulNumDecodeSurfaces - (in CUVIDDECODECREATEINFO structure). - This guarantees correct functionality and optimal video memory - usage but not necessarily the best performance, which depends on - the design of the overall application. The optimal number of - decode surfaces (in terms of performance and memory utilization) - should be decided by experimentation for each application, but it - cannot go below min_num_decode_surfaces. - If this value is used for ulNumDecodeSurfaces then it must be - returned to parser during sequence callback. */ - unsigned int coded_width; /**< OUT: coded frame width in pixels */ - unsigned int coded_height; /**< OUT: coded frame height in pixels */ - /** - * area of the frame that should be displayed - * typical example: - * coded_width = 1920, coded_height = 1088 - * display_area = { 0,0,1920,1080 } - */ - struct { - int left; /**< OUT: left position of display rect */ - int top; /**< OUT: top position of display rect */ - int right; /**< OUT: right position of display rect */ - int bottom; /**< OUT: bottom position of display rect */ - } display_area; - cudaVideoChromaFormat chroma_format; /**< OUT: Chroma format */ - unsigned int bitrate; /**< OUT: video bitrate (bps, 0=unknown) */ - /** - * OUT: Display Aspect Ratio = x:y (4:3, 16:9, etc) - */ - struct { - int x; - int y; - } display_aspect_ratio; - /** - * Video Signal Description - * Refer section E.2.1 (VUI parameters semantics) of H264 spec file - */ - struct { - unsigned char video_format : 3; /**< OUT: 0-Component, 1-PAL, 2-NTSC, 3-SECAM, 4-MAC, 5-Unspecified */ - unsigned char video_full_range_flag : 1; /**< OUT: indicates the black level and luma and chroma range */ - unsigned char reserved_zero_bits : 4; /**< Reserved bits */ - unsigned char color_primaries; /**< OUT: chromaticity coordinates of source primaries */ - unsigned char transfer_characteristics; /**< OUT: opto-electronic transfer characteristic of the source picture */ - unsigned char matrix_coefficients; /**< OUT: used in deriving luma and chroma signals from RGB primaries */ - } video_signal_description; - unsigned int seqhdr_data_length; /**< OUT: Additional bytes following (CUVIDEOFORMATEX) */ -} CUVIDEOFORMAT; - -/****************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDOPERATINGPOINTINFO -//! Operating point information of scalable bitstream -/****************************************************************/ -typedef struct -{ - cudaVideoCodec codec; - union - { - struct - { - unsigned char operating_points_cnt; - unsigned char reserved24_bits[3]; - unsigned short operating_points_idc[32]; - } av1; - unsigned char CodecReserved[1024]; - }; -} CUVIDOPERATINGPOINTINFO; - -/**********************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDSEIMESSAGEINFO -//! Used in cuvidParseVideoData API with PFNVIDSEIMSGCALLBACK pfnGetSEIMsg -/**********************************************************************************/ -typedef struct _CUVIDSEIMESSAGEINFO -{ - void *pSEIData; /**< OUT: SEI Message Data */ - CUSEIMESSAGE *pSEIMessage; /**< OUT: SEI Message Info */ - unsigned int sei_message_count; /**< OUT: SEI Message Count */ - unsigned int picIdx; /**< OUT: SEI Message Pic Index */ -} CUVIDSEIMESSAGEINFO; - -/****************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDAV1SEQHDR -//! AV1 specific sequence header information -/****************************************************************/ -typedef struct { - unsigned int max_width; - unsigned int max_height; - unsigned char reserved[1016]; -} CUVIDAV1SEQHDR; - -/****************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDEOFORMATEX -//! Video format including raw sequence header information -//! Used in cuvidGetSourceVideoFormat API -/****************************************************************/ -typedef struct -{ - CUVIDEOFORMAT format; /**< OUT: CUVIDEOFORMAT structure */ - union { - CUVIDAV1SEQHDR av1; - unsigned char raw_seqhdr_data[1024]; /**< OUT: Sequence header data */ - }; -} CUVIDEOFORMATEX; - -/****************************************************************/ -//! \ingroup STRUCTS -//! \struct CUAUDIOFORMAT -//! Audio formats -//! Used in cuvidGetSourceAudioFormat API -/****************************************************************/ -typedef struct -{ - cudaAudioCodec codec; /**< OUT: Compression format */ - unsigned int channels; /**< OUT: number of audio channels */ - unsigned int samplespersec; /**< OUT: sampling frequency */ - unsigned int bitrate; /**< OUT: For uncompressed, can also be used to determine bits per sample */ - unsigned int reserved1; /**< Reserved for future use */ - unsigned int reserved2; /**< Reserved for future use */ -} CUAUDIOFORMAT; - - -/***************************************************************/ -//! \enum CUvideopacketflags -//! Data packet flags -//! Used in CUVIDSOURCEDATAPACKET structure -/***************************************************************/ -typedef enum { - CUVID_PKT_ENDOFSTREAM = 0x01, /**< Set when this is the last packet for this stream */ - CUVID_PKT_TIMESTAMP = 0x02, /**< Timestamp is valid */ - CUVID_PKT_DISCONTINUITY = 0x04, /**< Set when a discontinuity has to be signalled */ - CUVID_PKT_ENDOFPICTURE = 0x08, /**< Set when the packet contains exactly one frame or one field */ - CUVID_PKT_NOTIFY_EOS = 0x10, /**< If this flag is set along with CUVID_PKT_ENDOFSTREAM, an additional (dummy) - display callback will be invoked with null value of CUVIDPARSERDISPINFO which - should be interpreted as end of the stream. */ -} CUvideopacketflags; - -/*****************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDSOURCEDATAPACKET -//! Data Packet -//! Used in cuvidParseVideoData API -//! IN for cuvidParseVideoData -/*****************************************************************************/ -typedef struct _CUVIDSOURCEDATAPACKET -{ - tcu_ulong flags; /**< IN: Combination of CUVID_PKT_XXX flags */ - tcu_ulong payload_size; /**< IN: number of bytes in the payload (may be zero if EOS flag is set) */ - const unsigned char *payload; /**< IN: Pointer to packet payload data (may be NULL if EOS flag is set) */ - CUvideotimestamp timestamp; /**< IN: Presentation time stamp (10MHz clock), only valid if - CUVID_PKT_TIMESTAMP flag is set */ -} CUVIDSOURCEDATAPACKET; - -// Callback for packet delivery -typedef int (CUDAAPI *PFNVIDSOURCECALLBACK)(void *, CUVIDSOURCEDATAPACKET *); - -/**************************************************************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDSOURCEPARAMS -//! Describes parameters needed in cuvidCreateVideoSource API -//! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported -//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed. -/**************************************************************************************************************************/ -typedef struct _CUVIDSOURCEPARAMS -{ - unsigned int ulClockRate; /**< IN: Time stamp units in Hz (0=default=10000000Hz) */ - unsigned int bAnnexb : 1; /**< IN: AV1 annexB stream */ - unsigned int uReserved : 31; /**< Reserved for future use - set to zero */ - unsigned int uReserved1[6]; /**< Reserved for future use - set to zero */ - void *pUserData; /**< IN: User private data passed in to the data handlers */ - PFNVIDSOURCECALLBACK pfnVideoDataHandler; /**< IN: Called to deliver video packets */ - PFNVIDSOURCECALLBACK pfnAudioDataHandler; /**< IN: Called to deliver audio packets. */ - void *pvReserved2[8]; /**< Reserved for future use - set to NULL */ -} CUVIDSOURCEPARAMS; - - -/**********************************************/ -//! \ingroup ENUMS -//! \enum CUvideosourceformat_flags -//! CUvideosourceformat_flags -//! Used in cuvidGetSourceVideoFormat API -/**********************************************/ -typedef enum { - CUVID_FMT_EXTFORMATINFO = 0x100 /**< Return extended format structure (CUVIDEOFORMATEX) */ -} CUvideosourceformat_flags; - -#if !defined(__APPLE__) -/***************************************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams) -//! Create CUvideosource object. CUvideosource spawns demultiplexer thread that provides two callbacks: -//! pfnVideoDataHandler() and pfnAudioDataHandler() -//! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported -//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed. -/***************************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams); - -/***************************************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams) -//! Create video source -/***************************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams); - -/********************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj) -//! Destroy video source -/********************************************************************/ -typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj); - -/******************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state) -//! Set video source state to: -//! cudaVideoState_Started - to signal the source to run and deliver data -//! cudaVideoState_Stopped - to stop the source from delivering the data -//! cudaVideoState_Error - invalid source -/******************************************************************************************/ -typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state); - -/******************************************************************************************/ -//! \ingroup FUNCTS -//! \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj) -//! Get video source state -//! Returns: -//! cudaVideoState_Started - if Source is running and delivering data -//! cudaVideoState_Stopped - if Source is stopped or reached end-of-stream -//! cudaVideoState_Error - if Source is in error state -/******************************************************************************************/ -typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj); - -/******************************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags) -//! Gets video source format in pvidfmt, flags is set to combination of CUvideosourceformat_flags as per requirement -/******************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags); - -/**************************************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags) -//! Get audio source format -//! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported -//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed. -/**************************************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags); - -#endif -/**********************************************************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDPARSERDISPINFO -//! Used in cuvidParseVideoData API with PFNVIDDISPLAYCALLBACK pfnDisplayPicture -/**********************************************************************************/ -typedef struct _CUVIDPARSERDISPINFO -{ - int picture_index; /**< OUT: Index of the current picture */ - int progressive_frame; /**< OUT: 1 if progressive frame; 0 otherwise */ - int top_field_first; /**< OUT: 1 if top field is displayed first; 0 otherwise */ - int repeat_first_field; /**< OUT: Number of additional fields (1=ivtc, 2=frame doubling, 4=frame tripling, - -1=unpaired field) */ - CUvideotimestamp timestamp; /**< OUT: Presentation time stamp */ -} CUVIDPARSERDISPINFO; - -/***********************************************************************************************************************/ -//! Parser callbacks -//! The parser will call these synchronously from within cuvidParseVideoData(), whenever there is sequence change or a picture -//! is ready to be decoded and/or displayed. First argument in functions is "void *pUserData" member of structure CUVIDSOURCEPARAMS -//! Return values from these callbacks are interpreted as below. If the callbacks return failure, it will be propagated by -//! cuvidParseVideoData() to the application. -//! Parser picks default operating point as 0 and outputAllLayers flag as 0 if PFNVIDOPPOINTCALLBACK is not set or return value is -//! -1 or invalid operating point. -//! PFNVIDSEQUENCECALLBACK : 0: fail, 1: succeeded, > 1: override dpb size of parser (set by CUVIDPARSERPARAMS::ulMaxNumDecodeSurfaces -//! while creating parser) -//! PFNVIDDECODECALLBACK : 0: fail, >=1: succeeded -//! PFNVIDDISPLAYCALLBACK : 0: fail, >=1: succeeded -//! PFNVIDOPPOINTCALLBACK : <0: fail, >=0: succeeded (bit 0-9: OperatingPoint, bit 10-10: outputAllLayers, bit 11-30: reserved) -//! PFNVIDSEIMSGCALLBACK : 0: fail, >=1: succeeded -/***********************************************************************************************************************/ -typedef int (CUDAAPI *PFNVIDSEQUENCECALLBACK)(void *, CUVIDEOFORMAT *); -typedef int (CUDAAPI *PFNVIDDECODECALLBACK)(void *, CUVIDPICPARAMS *); -typedef int (CUDAAPI *PFNVIDDISPLAYCALLBACK)(void *, CUVIDPARSERDISPINFO *); -typedef int (CUDAAPI *PFNVIDOPPOINTCALLBACK)(void *, CUVIDOPERATINGPOINTINFO*); -typedef int (CUDAAPI *PFNVIDSEIMSGCALLBACK) (void *, CUVIDSEIMESSAGEINFO *); - -/**************************************/ -//! \ingroup STRUCTS -//! \struct CUVIDPARSERPARAMS -//! Used in cuvidCreateVideoParser API -/**************************************/ -typedef struct _CUVIDPARSERPARAMS -{ - cudaVideoCodec CodecType; /**< IN: cudaVideoCodec_XXX */ - unsigned int ulMaxNumDecodeSurfaces; /**< IN: Max # of decode surfaces (parser will cycle through these) */ - unsigned int ulClockRate; /**< IN: Timestamp units in Hz (0=default=10000000Hz) */ - unsigned int ulErrorThreshold; /**< IN: % Error threshold (0-100) for calling pfnDecodePicture (100=always - IN: call pfnDecodePicture even if picture bitstream is fully corrupted) */ - unsigned int ulMaxDisplayDelay; /**< IN: Max display queue delay (improves pipelining of decode with display) - 0=no delay (recommended values: 2..4) */ - unsigned int bAnnexb : 1; /**< IN: AV1 annexB stream */ - unsigned int uReserved : 31; /**< Reserved for future use - set to zero */ - unsigned int uReserved1[4]; /**< IN: Reserved for future use - set to 0 */ - void *pUserData; /**< IN: User data for callbacks */ - PFNVIDSEQUENCECALLBACK pfnSequenceCallback; /**< IN: Called before decoding frames and/or whenever there is a fmt change */ - PFNVIDDECODECALLBACK pfnDecodePicture; /**< IN: Called when a picture is ready to be decoded (decode order) */ - PFNVIDDISPLAYCALLBACK pfnDisplayPicture; /**< IN: Called whenever a picture is ready to be displayed (display order) */ - PFNVIDOPPOINTCALLBACK pfnGetOperatingPoint; /**< IN: Called from AV1 sequence header to get operating point of a AV1 - scalable bitstream */ - PFNVIDSEIMSGCALLBACK pfnGetSEIMsg; /**< IN: Called when all SEI messages are parsed for particular frame */ - void *pvReserved2[5]; /**< Reserved for future use - set to NULL */ - CUVIDEOFORMATEX *pExtVideoInfo; /**< IN: [Optional] sequence header data from system layer */ -} CUVIDPARSERPARAMS; - -/************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams) -//! Create video parser object and initialize -/************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams); - -/************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket) -//! Parse the video data from source data packet in pPacket -//! Extracts parameter sets like SPS, PPS, bitstream etc. from pPacket and -//! calls back pfnDecodePicture with CUVIDPICPARAMS data for kicking of HW decoding -//! calls back pfnSequenceCallback with CUVIDEOFORMAT data for initial sequence header or when -//! the decoder encounters a video format change -//! calls back pfnDisplayPicture with CUVIDPARSERDISPINFO data to display a video frame -/************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket); - -/************************************************************************************************/ -//! \ingroup FUNCTS -//! \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj) -//! Destroy the video parser -/************************************************************************************************/ -typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj); - -/**********************************************************************************************/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif // __NVCUVID_H__ diff --git a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/nvEncodeAPI.h b/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/nvEncodeAPI.h deleted file mode 100644 index f91ec9ad..00000000 --- a/libs/hwcodec/externals/nv-codec-headers_n12.1.14.0/include/ffnvcodec/nvEncodeAPI.h +++ /dev/null @@ -1,4451 +0,0 @@ -/* - * This copyright notice applies to this header file only: - * - * Copyright (c) 2010-2023 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the software, and to permit persons to whom the - * software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file nvEncodeAPI.h - * NVIDIA GPUs - beginning with the Kepler generation - contain a hardware-based encoder - * (referred to as NVENC) which provides fully-accelerated hardware-based video encoding. - * NvEncodeAPI provides the interface for NVIDIA video encoder (NVENC). - * \date 2011-2022 - * This file contains the interface constants, structure definitions and function prototypes. - */ - -#ifndef _NV_ENCODEAPI_H_ -#define _NV_ENCODEAPI_H_ - -#include - -#ifdef _WIN32 -#include -#endif - -#ifdef _MSC_VER -#ifndef _STDINT -typedef __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; -typedef unsigned short uint16_t; -#endif -#else -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup ENCODER_STRUCTURE NvEncodeAPI Data structures - * @{ - */ - -#if defined(_WIN32) || defined(__CYGWIN__) -#define NVENCAPI __stdcall -#else -#define NVENCAPI -#endif - -#ifdef _WIN32 -typedef RECT NVENC_RECT; -#else -// ========================================================================================= -#if !defined(GUID) && !defined(GUID_DEFINED) -#define GUID_DEFINED -/*! - * \struct GUID - * Abstracts the GUID structure for non-windows platforms. - */ -// ========================================================================================= -typedef struct _GUID -{ - uint32_t Data1; /**< [in]: Specifies the first 8 hexadecimal digits of the GUID. */ - uint16_t Data2; /**< [in]: Specifies the first group of 4 hexadecimal digits. */ - uint16_t Data3; /**< [in]: Specifies the second group of 4 hexadecimal digits. */ - uint8_t Data4[8]; /**< [in]: Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. - The remaining 6 bytes contain the final 12 hexadecimal digits. */ -} GUID, *LPGUID; -#endif // GUID - -/** - * \struct _NVENC_RECT - * Defines a Rectangle. Used in ::NV_ENC_PREPROCESS_FRAME. - */ -typedef struct _NVENC_RECT -{ - uint32_t left; /**< [in]: X coordinate of the upper left corner of rectangular area to be specified. */ - uint32_t top; /**< [in]: Y coordinate of the upper left corner of the rectangular area to be specified. */ - uint32_t right; /**< [in]: X coordinate of the bottom right corner of the rectangular area to be specified. */ - uint32_t bottom; /**< [in]: Y coordinate of the bottom right corner of the rectangular area to be specified. */ -} NVENC_RECT; - -#endif // _WIN32 - -/** @} */ /* End of GUID and NVENC_RECT structure grouping*/ - -typedef void* NV_ENC_INPUT_PTR; /**< NVENCODE API input buffer */ -typedef void* NV_ENC_OUTPUT_PTR; /**< NVENCODE API output buffer*/ -typedef void* NV_ENC_REGISTERED_PTR; /**< A Resource that has been registered with NVENCODE API*/ -typedef void* NV_ENC_CUSTREAM_PTR; /**< Pointer to CUstream*/ - -#define NVENCAPI_MAJOR_VERSION 12 -#define NVENCAPI_MINOR_VERSION 1 - -#define NVENCAPI_VERSION (NVENCAPI_MAJOR_VERSION | (NVENCAPI_MINOR_VERSION << 24)) - -/** - * Macro to generate per-structure version for use with API. - */ -#define NVENCAPI_STRUCT_VERSION(ver) ((uint32_t)NVENCAPI_VERSION | ((ver)<<16) | (0x7 << 28)) - - -#define NVENC_INFINITE_GOPLENGTH 0xffffffff - -#define NV_MAX_SEQ_HDR_LEN (512) - -#ifdef __GNUC__ -#define NV_ENC_DEPRECATED __attribute__ ((deprecated("WILL BE REMOVED IN A FUTURE VIDEO CODEC SDK VERSION"))) -#elif defined(_MSC_VER) -#define NV_ENC_DEPRECATED __declspec(deprecated("WILL BE REMOVED IN A FUTURE VIDEO CODEC SDK VERSION")) -#endif - -// ========================================================================================= -// Encode Codec GUIDS supported by the NvEncodeAPI interface. -// ========================================================================================= - -// {6BC82762-4E63-4ca4-AA85-1E50F321F6BF} -static const GUID NV_ENC_CODEC_H264_GUID = -{ 0x6bc82762, 0x4e63, 0x4ca4, { 0xaa, 0x85, 0x1e, 0x50, 0xf3, 0x21, 0xf6, 0xbf } }; - -// {790CDC88-4522-4d7b-9425-BDA9975F7603} -static const GUID NV_ENC_CODEC_HEVC_GUID = -{ 0x790cdc88, 0x4522, 0x4d7b, { 0x94, 0x25, 0xbd, 0xa9, 0x97, 0x5f, 0x76, 0x3 } }; - -// {0A352289-0AA7-4759-862D-5D15CD16D254} -static const GUID NV_ENC_CODEC_AV1_GUID = -{ 0x0a352289, 0x0aa7, 0x4759, { 0x86, 0x2d, 0x5d, 0x15, 0xcd, 0x16, 0xd2, 0x54 } }; - - - -// ========================================================================================= -// * Encode Profile GUIDS supported by the NvEncodeAPI interface. -// ========================================================================================= - -// {BFD6F8E7-233C-4341-8B3E-4818523803F4} -static const GUID NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID = -{ 0xbfd6f8e7, 0x233c, 0x4341, { 0x8b, 0x3e, 0x48, 0x18, 0x52, 0x38, 0x3, 0xf4 } }; - -// {0727BCAA-78C4-4c83-8C2F-EF3DFF267C6A} -static const GUID NV_ENC_H264_PROFILE_BASELINE_GUID = -{ 0x727bcaa, 0x78c4, 0x4c83, { 0x8c, 0x2f, 0xef, 0x3d, 0xff, 0x26, 0x7c, 0x6a } }; - -// {60B5C1D4-67FE-4790-94D5-C4726D7B6E6D} -static const GUID NV_ENC_H264_PROFILE_MAIN_GUID = -{ 0x60b5c1d4, 0x67fe, 0x4790, { 0x94, 0xd5, 0xc4, 0x72, 0x6d, 0x7b, 0x6e, 0x6d } }; - -// {E7CBC309-4F7A-4b89-AF2A-D537C92BE310} -static const GUID NV_ENC_H264_PROFILE_HIGH_GUID = -{ 0xe7cbc309, 0x4f7a, 0x4b89, { 0xaf, 0x2a, 0xd5, 0x37, 0xc9, 0x2b, 0xe3, 0x10 } }; - -// {7AC663CB-A598-4960-B844-339B261A7D52} -static const GUID NV_ENC_H264_PROFILE_HIGH_444_GUID = -{ 0x7ac663cb, 0xa598, 0x4960, { 0xb8, 0x44, 0x33, 0x9b, 0x26, 0x1a, 0x7d, 0x52 } }; - -// {40847BF5-33F7-4601-9084-E8FE3C1DB8B7} -static const GUID NV_ENC_H264_PROFILE_STEREO_GUID = -{ 0x40847bf5, 0x33f7, 0x4601, { 0x90, 0x84, 0xe8, 0xfe, 0x3c, 0x1d, 0xb8, 0xb7 } }; - -// {B405AFAC-F32B-417B-89C4-9ABEED3E5978} -static const GUID NV_ENC_H264_PROFILE_PROGRESSIVE_HIGH_GUID = -{ 0xb405afac, 0xf32b, 0x417b, { 0x89, 0xc4, 0x9a, 0xbe, 0xed, 0x3e, 0x59, 0x78 } }; - -// {AEC1BD87-E85B-48f2-84C3-98BCA6285072} -static const GUID NV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID = -{ 0xaec1bd87, 0xe85b, 0x48f2, { 0x84, 0xc3, 0x98, 0xbc, 0xa6, 0x28, 0x50, 0x72 } }; - -// {B514C39A-B55B-40fa-878F-F1253B4DFDEC} -static const GUID NV_ENC_HEVC_PROFILE_MAIN_GUID = -{ 0xb514c39a, 0xb55b, 0x40fa, { 0x87, 0x8f, 0xf1, 0x25, 0x3b, 0x4d, 0xfd, 0xec } }; - -// {fa4d2b6c-3a5b-411a-8018-0a3f5e3c9be5} -static const GUID NV_ENC_HEVC_PROFILE_MAIN10_GUID = -{ 0xfa4d2b6c, 0x3a5b, 0x411a, { 0x80, 0x18, 0x0a, 0x3f, 0x5e, 0x3c, 0x9b, 0xe5 } }; - -// For HEVC Main 444 8 bit and HEVC Main 444 10 bit profiles only -// {51ec32b5-1b4c-453c-9cbd-b616bd621341} -static const GUID NV_ENC_HEVC_PROFILE_FREXT_GUID = -{ 0x51ec32b5, 0x1b4c, 0x453c, { 0x9c, 0xbd, 0xb6, 0x16, 0xbd, 0x62, 0x13, 0x41 } }; - -// {5f2a39f5-f14e-4f95-9a9e-b76d568fcf97} -static const GUID NV_ENC_AV1_PROFILE_MAIN_GUID = -{ 0x5f2a39f5, 0xf14e, 0x4f95, { 0x9a, 0x9e, 0xb7, 0x6d, 0x56, 0x8f, 0xcf, 0x97 } }; - -// ========================================================================================= -// * Preset GUIDS supported by the NvEncodeAPI interface. -// ========================================================================================= -// Performance degrades and quality improves as we move from P1 to P7. Presets P3 to P7 for H264 and Presets P2 to P7 for HEVC have B frames enabled by default -// for HIGH_QUALITY and LOSSLESS tuning info, and will not work with Weighted Prediction enabled. In case Weighted Prediction is required, disable B frames by -// setting frameIntervalP = 1 -// {FC0A8D3E-45F8-4CF8-80C7-298871590EBF} -static const GUID NV_ENC_PRESET_P1_GUID = -{ 0xfc0a8d3e, 0x45f8, 0x4cf8, { 0x80, 0xc7, 0x29, 0x88, 0x71, 0x59, 0xe, 0xbf } }; - -// {F581CFB8-88D6-4381-93F0-DF13F9C27DAB} -static const GUID NV_ENC_PRESET_P2_GUID = -{ 0xf581cfb8, 0x88d6, 0x4381, { 0x93, 0xf0, 0xdf, 0x13, 0xf9, 0xc2, 0x7d, 0xab } }; - -// {36850110-3A07-441F-94D5-3670631F91F6} -static const GUID NV_ENC_PRESET_P3_GUID = -{ 0x36850110, 0x3a07, 0x441f, { 0x94, 0xd5, 0x36, 0x70, 0x63, 0x1f, 0x91, 0xf6 } }; - -// {90A7B826-DF06-4862-B9D2-CD6D73A08681} -static const GUID NV_ENC_PRESET_P4_GUID = -{ 0x90a7b826, 0xdf06, 0x4862, { 0xb9, 0xd2, 0xcd, 0x6d, 0x73, 0xa0, 0x86, 0x81 } }; - -// {21C6E6B4-297A-4CBA-998F-B6CBDE72ADE3} -static const GUID NV_ENC_PRESET_P5_GUID = -{ 0x21c6e6b4, 0x297a, 0x4cba, { 0x99, 0x8f, 0xb6, 0xcb, 0xde, 0x72, 0xad, 0xe3 } }; - -// {8E75C279-6299-4AB6-8302-0B215A335CF5} -static const GUID NV_ENC_PRESET_P6_GUID = -{ 0x8e75c279, 0x6299, 0x4ab6, { 0x83, 0x2, 0xb, 0x21, 0x5a, 0x33, 0x5c, 0xf5 } }; - -// {84848C12-6F71-4C13-931B-53E283F57974} -static const GUID NV_ENC_PRESET_P7_GUID = -{ 0x84848c12, 0x6f71, 0x4c13, { 0x93, 0x1b, 0x53, 0xe2, 0x83, 0xf5, 0x79, 0x74 } }; - -/** - * \addtogroup ENCODER_STRUCTURE NvEncodeAPI Data structures - * @{ - */ - -/** - * Input frame encode modes - */ -typedef enum _NV_ENC_PARAMS_FRAME_FIELD_MODE -{ - NV_ENC_PARAMS_FRAME_FIELD_MODE_FRAME = 0x01, /**< Frame mode */ - NV_ENC_PARAMS_FRAME_FIELD_MODE_FIELD = 0x02, /**< Field mode */ - NV_ENC_PARAMS_FRAME_FIELD_MODE_MBAFF = 0x03 /**< MB adaptive frame/field */ -} NV_ENC_PARAMS_FRAME_FIELD_MODE; - -/** - * Rate Control Modes - */ -typedef enum _NV_ENC_PARAMS_RC_MODE -{ - NV_ENC_PARAMS_RC_CONSTQP = 0x0, /**< Constant QP mode */ - NV_ENC_PARAMS_RC_VBR = 0x1, /**< Variable bitrate mode */ - NV_ENC_PARAMS_RC_CBR = 0x2, /**< Constant bitrate mode */ -} NV_ENC_PARAMS_RC_MODE; - -/** - * Multi Pass encoding - */ -typedef enum _NV_ENC_MULTI_PASS -{ - NV_ENC_MULTI_PASS_DISABLED = 0x0, /**< Single Pass */ - NV_ENC_TWO_PASS_QUARTER_RESOLUTION = 0x1, /**< Two Pass encoding is enabled where first Pass is quarter resolution */ - NV_ENC_TWO_PASS_FULL_RESOLUTION = 0x2, /**< Two Pass encoding is enabled where first Pass is full resolution */ -} NV_ENC_MULTI_PASS; - -/** - * Restore Encoder state - */ -typedef enum _NV_ENC_STATE_RESTORE_TYPE -{ - NV_ENC_STATE_RESTORE_FULL = 0x01, /**< Restore full encoder state */ - NV_ENC_STATE_RESTORE_RATE_CONTROL = 0x02, /**< Restore only rate control state */ - NV_ENC_STATE_RESTORE_ENCODE = 0x03, /**< Restore full encoder state except for rate control state */ -} NV_ENC_STATE_RESTORE_TYPE; - -typedef enum _NV_ENC_OUTPUT_STATS_LEVEL -{ - NV_ENC_OUTPUT_STATS_NONE = 0, /** No output stats */ - NV_ENC_OUTPUT_STATS_BLOCK_LEVEL = 1, /** Output stats for every block. - Block represents a CTB for HEVC, macroblock for H.264, super block for AV1 */ - NV_ENC_OUTPUT_STATS_ROW_LEVEL = 2, /** Output stats for every row. - Row represents a CTB row for HEVC, macroblock row for H.264, super block row for AV1 */ -} NV_ENC_OUTPUT_STATS_LEVEL; - -/** - * Emphasis Levels - */ -typedef enum _NV_ENC_EMPHASIS_MAP_LEVEL -{ - NV_ENC_EMPHASIS_MAP_LEVEL_0 = 0x0, /**< Emphasis Map Level 0, for zero Delta QP value */ - NV_ENC_EMPHASIS_MAP_LEVEL_1 = 0x1, /**< Emphasis Map Level 1, for very low Delta QP value */ - NV_ENC_EMPHASIS_MAP_LEVEL_2 = 0x2, /**< Emphasis Map Level 2, for low Delta QP value */ - NV_ENC_EMPHASIS_MAP_LEVEL_3 = 0x3, /**< Emphasis Map Level 3, for medium Delta QP value */ - NV_ENC_EMPHASIS_MAP_LEVEL_4 = 0x4, /**< Emphasis Map Level 4, for high Delta QP value */ - NV_ENC_EMPHASIS_MAP_LEVEL_5 = 0x5 /**< Emphasis Map Level 5, for very high Delta QP value */ -} NV_ENC_EMPHASIS_MAP_LEVEL; - -/** - * QP MAP MODE - */ -typedef enum _NV_ENC_QP_MAP_MODE -{ - NV_ENC_QP_MAP_DISABLED = 0x0, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap have no effect. */ - NV_ENC_QP_MAP_EMPHASIS = 0x1, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as Emphasis level. Currently this is only supported for H264 */ - NV_ENC_QP_MAP_DELTA = 0x2, /**< Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as QP delta map. */ - NV_ENC_QP_MAP = 0x3, /**< Currently This is not supported. Value in NV_ENC_PIC_PARAMS::qpDeltaMap will be treated as QP value. */ -} NV_ENC_QP_MAP_MODE; - -/** - * Input picture structure - */ -typedef enum _NV_ENC_PIC_STRUCT -{ - NV_ENC_PIC_STRUCT_FRAME = 0x01, /**< Progressive frame */ - NV_ENC_PIC_STRUCT_FIELD_TOP_BOTTOM = 0x02, /**< Field encoding top field first */ - NV_ENC_PIC_STRUCT_FIELD_BOTTOM_TOP = 0x03 /**< Field encoding bottom field first */ -} NV_ENC_PIC_STRUCT; - -/** - * Display picture structure - * Currently, this enum is only used for deciding the number of clock timestamp sets in Picture Timing SEI / Time Code SEI - * Otherwise, this has no impact on encoder behavior - */ -typedef enum _NV_ENC_DISPLAY_PIC_STRUCT -{ - NV_ENC_PIC_STRUCT_DISPLAY_FRAME = 0x00, /**< Field encoding top field first */ - NV_ENC_PIC_STRUCT_DISPLAY_FIELD_TOP_BOTTOM = 0x01, /**< Field encoding top field first */ - NV_ENC_PIC_STRUCT_DISPLAY_FIELD_BOTTOM_TOP = 0x02, /**< Field encoding bottom field first */ - NV_ENC_PIC_STRUCT_DISPLAY_FRAME_DOUBLING = 0x03, /**< Frame doubling */ - NV_ENC_PIC_STRUCT_DISPLAY_FRAME_TRIPLING = 0x04 /**< Field tripling */ -} NV_ENC_DISPLAY_PIC_STRUCT; - -/** - * Input picture type - */ -typedef enum _NV_ENC_PIC_TYPE -{ - NV_ENC_PIC_TYPE_P = 0x0, /**< Forward predicted */ - NV_ENC_PIC_TYPE_B = 0x01, /**< Bi-directionally predicted picture */ - NV_ENC_PIC_TYPE_I = 0x02, /**< Intra predicted picture */ - NV_ENC_PIC_TYPE_IDR = 0x03, /**< IDR picture */ - NV_ENC_PIC_TYPE_BI = 0x04, /**< Bi-directionally predicted with only Intra MBs */ - NV_ENC_PIC_TYPE_SKIPPED = 0x05, /**< Picture is skipped */ - NV_ENC_PIC_TYPE_INTRA_REFRESH = 0x06, /**< First picture in intra refresh cycle */ - NV_ENC_PIC_TYPE_NONREF_P = 0x07, /**< Non reference P picture */ - NV_ENC_PIC_TYPE_UNKNOWN = 0xFF /**< Picture type unknown */ -} NV_ENC_PIC_TYPE; - -/** - * Motion vector precisions - */ -typedef enum _NV_ENC_MV_PRECISION -{ - NV_ENC_MV_PRECISION_DEFAULT = 0x0, /**< Driver selects Quarter-Pel motion vector precision by default */ - NV_ENC_MV_PRECISION_FULL_PEL = 0x01, /**< Full-Pel motion vector precision */ - NV_ENC_MV_PRECISION_HALF_PEL = 0x02, /**< Half-Pel motion vector precision */ - NV_ENC_MV_PRECISION_QUARTER_PEL = 0x03 /**< Quarter-Pel motion vector precision */ -} NV_ENC_MV_PRECISION; - - -/** - * Input buffer formats - */ -typedef enum _NV_ENC_BUFFER_FORMAT -{ - NV_ENC_BUFFER_FORMAT_UNDEFINED = 0x00000000, /**< Undefined buffer format */ - - NV_ENC_BUFFER_FORMAT_NV12 = 0x00000001, /**< Semi-Planar YUV [Y plane followed by interleaved UV plane] */ - NV_ENC_BUFFER_FORMAT_YV12 = 0x00000010, /**< Planar YUV [Y plane followed by V and U planes] */ - NV_ENC_BUFFER_FORMAT_IYUV = 0x00000100, /**< Planar YUV [Y plane followed by U and V planes] */ - NV_ENC_BUFFER_FORMAT_YUV444 = 0x00001000, /**< Planar YUV [Y plane followed by U and V planes] */ - NV_ENC_BUFFER_FORMAT_YUV420_10BIT = 0x00010000, /**< 10 bit Semi-Planar YUV [Y plane followed by interleaved UV plane]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data. */ - NV_ENC_BUFFER_FORMAT_YUV444_10BIT = 0x00100000, /**< 10 bit Planar YUV444 [Y plane followed by U and V planes]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data. */ - NV_ENC_BUFFER_FORMAT_ARGB = 0x01000000, /**< 8 bit Packed A8R8G8B8. This is a word-ordered format - where a pixel is represented by a 32-bit word with B - in the lowest 8 bits, G in the next 8 bits, R in the - 8 bits after that and A in the highest 8 bits. */ - NV_ENC_BUFFER_FORMAT_ARGB10 = 0x02000000, /**< 10 bit Packed A2R10G10B10. This is a word-ordered format - where a pixel is represented by a 32-bit word with B - in the lowest 10 bits, G in the next 10 bits, R in the - 10 bits after that and A in the highest 2 bits. */ - NV_ENC_BUFFER_FORMAT_AYUV = 0x04000000, /**< 8 bit Packed A8Y8U8V8. This is a word-ordered format - where a pixel is represented by a 32-bit word with V - in the lowest 8 bits, U in the next 8 bits, Y in the - 8 bits after that and A in the highest 8 bits. */ - NV_ENC_BUFFER_FORMAT_ABGR = 0x10000000, /**< 8 bit Packed A8B8G8R8. This is a word-ordered format - where a pixel is represented by a 32-bit word with R - in the lowest 8 bits, G in the next 8 bits, B in the - 8 bits after that and A in the highest 8 bits. */ - NV_ENC_BUFFER_FORMAT_ABGR10 = 0x20000000, /**< 10 bit Packed A2B10G10R10. This is a word-ordered format - where a pixel is represented by a 32-bit word with R - in the lowest 10 bits, G in the next 10 bits, B in the - 10 bits after that and A in the highest 2 bits. */ - NV_ENC_BUFFER_FORMAT_U8 = 0x40000000, /**< Buffer format representing one-dimensional buffer. - This format should be used only when registering the - resource as output buffer, which will be used to write - the encoded bit stream or H.264 ME only mode output. */ -} NV_ENC_BUFFER_FORMAT; - -#define NV_ENC_BUFFER_FORMAT_NV12_PL NV_ENC_BUFFER_FORMAT_NV12 -#define NV_ENC_BUFFER_FORMAT_YV12_PL NV_ENC_BUFFER_FORMAT_YV12 -#define NV_ENC_BUFFER_FORMAT_IYUV_PL NV_ENC_BUFFER_FORMAT_IYUV -#define NV_ENC_BUFFER_FORMAT_YUV444_PL NV_ENC_BUFFER_FORMAT_YUV444 - -/** - * Encoding levels - */ -typedef enum _NV_ENC_LEVEL -{ - NV_ENC_LEVEL_AUTOSELECT = 0, - - NV_ENC_LEVEL_H264_1 = 10, - NV_ENC_LEVEL_H264_1b = 9, - NV_ENC_LEVEL_H264_11 = 11, - NV_ENC_LEVEL_H264_12 = 12, - NV_ENC_LEVEL_H264_13 = 13, - NV_ENC_LEVEL_H264_2 = 20, - NV_ENC_LEVEL_H264_21 = 21, - NV_ENC_LEVEL_H264_22 = 22, - NV_ENC_LEVEL_H264_3 = 30, - NV_ENC_LEVEL_H264_31 = 31, - NV_ENC_LEVEL_H264_32 = 32, - NV_ENC_LEVEL_H264_4 = 40, - NV_ENC_LEVEL_H264_41 = 41, - NV_ENC_LEVEL_H264_42 = 42, - NV_ENC_LEVEL_H264_5 = 50, - NV_ENC_LEVEL_H264_51 = 51, - NV_ENC_LEVEL_H264_52 = 52, - NV_ENC_LEVEL_H264_60 = 60, - NV_ENC_LEVEL_H264_61 = 61, - NV_ENC_LEVEL_H264_62 = 62, - - NV_ENC_LEVEL_HEVC_1 = 30, - NV_ENC_LEVEL_HEVC_2 = 60, - NV_ENC_LEVEL_HEVC_21 = 63, - NV_ENC_LEVEL_HEVC_3 = 90, - NV_ENC_LEVEL_HEVC_31 = 93, - NV_ENC_LEVEL_HEVC_4 = 120, - NV_ENC_LEVEL_HEVC_41 = 123, - NV_ENC_LEVEL_HEVC_5 = 150, - NV_ENC_LEVEL_HEVC_51 = 153, - NV_ENC_LEVEL_HEVC_52 = 156, - NV_ENC_LEVEL_HEVC_6 = 180, - NV_ENC_LEVEL_HEVC_61 = 183, - NV_ENC_LEVEL_HEVC_62 = 186, - - NV_ENC_TIER_HEVC_MAIN = 0, - NV_ENC_TIER_HEVC_HIGH = 1, - - NV_ENC_LEVEL_AV1_2 = 0, - NV_ENC_LEVEL_AV1_21 = 1, - NV_ENC_LEVEL_AV1_22 = 2, - NV_ENC_LEVEL_AV1_23 = 3, - NV_ENC_LEVEL_AV1_3 = 4, - NV_ENC_LEVEL_AV1_31 = 5, - NV_ENC_LEVEL_AV1_32 = 6, - NV_ENC_LEVEL_AV1_33 = 7, - NV_ENC_LEVEL_AV1_4 = 8, - NV_ENC_LEVEL_AV1_41 = 9, - NV_ENC_LEVEL_AV1_42 = 10, - NV_ENC_LEVEL_AV1_43 = 11, - NV_ENC_LEVEL_AV1_5 = 12, - NV_ENC_LEVEL_AV1_51 = 13, - NV_ENC_LEVEL_AV1_52 = 14, - NV_ENC_LEVEL_AV1_53 = 15, - NV_ENC_LEVEL_AV1_6 = 16, - NV_ENC_LEVEL_AV1_61 = 17, - NV_ENC_LEVEL_AV1_62 = 18, - NV_ENC_LEVEL_AV1_63 = 19, - NV_ENC_LEVEL_AV1_7 = 20, - NV_ENC_LEVEL_AV1_71 = 21, - NV_ENC_LEVEL_AV1_72 = 22, - NV_ENC_LEVEL_AV1_73 = 23, - NV_ENC_LEVEL_AV1_AUTOSELECT , - - NV_ENC_TIER_AV1_0 = 0, - NV_ENC_TIER_AV1_1 = 1 -} NV_ENC_LEVEL; - -/** - * Error Codes - */ -typedef enum _NVENCSTATUS -{ - /** - * This indicates that API call returned with no errors. - */ - NV_ENC_SUCCESS, - - /** - * This indicates that no encode capable devices were detected. - */ - NV_ENC_ERR_NO_ENCODE_DEVICE, - - /** - * This indicates that devices pass by the client is not supported. - */ - NV_ENC_ERR_UNSUPPORTED_DEVICE, - - /** - * This indicates that the encoder device supplied by the client is not - * valid. - */ - NV_ENC_ERR_INVALID_ENCODERDEVICE, - - /** - * This indicates that device passed to the API call is invalid. - */ - NV_ENC_ERR_INVALID_DEVICE, - - /** - * This indicates that device passed to the API call is no longer available and - * needs to be reinitialized. The clients need to destroy the current encoder - * session by freeing the allocated input output buffers and destroying the device - * and create a new encoding session. - */ - NV_ENC_ERR_DEVICE_NOT_EXIST, - - /** - * This indicates that one or more of the pointers passed to the API call - * is invalid. - */ - NV_ENC_ERR_INVALID_PTR, - - /** - * This indicates that completion event passed in ::NvEncEncodePicture() call - * is invalid. - */ - NV_ENC_ERR_INVALID_EVENT, - - /** - * This indicates that one or more of the parameter passed to the API call - * is invalid. - */ - NV_ENC_ERR_INVALID_PARAM, - - /** - * This indicates that an API call was made in wrong sequence/order. - */ - NV_ENC_ERR_INVALID_CALL, - - /** - * This indicates that the API call failed because it was unable to allocate - * enough memory to perform the requested operation. - */ - NV_ENC_ERR_OUT_OF_MEMORY, - - /** - * This indicates that the encoder has not been initialized with - * ::NvEncInitializeEncoder() or that initialization has failed. - * The client cannot allocate input or output buffers or do any encoding - * related operation before successfully initializing the encoder. - */ - NV_ENC_ERR_ENCODER_NOT_INITIALIZED, - - /** - * This indicates that an unsupported parameter was passed by the client. - */ - NV_ENC_ERR_UNSUPPORTED_PARAM, - - /** - * This indicates that the ::NvEncLockBitstream() failed to lock the output - * buffer. This happens when the client makes a non blocking lock call to - * access the output bitstream by passing NV_ENC_LOCK_BITSTREAM::doNotWait flag. - * This is not a fatal error and client should retry the same operation after - * few milliseconds. - */ - NV_ENC_ERR_LOCK_BUSY, - - /** - * This indicates that the size of the user buffer passed by the client is - * insufficient for the requested operation. - */ - NV_ENC_ERR_NOT_ENOUGH_BUFFER, - - /** - * This indicates that an invalid struct version was used by the client. - */ - NV_ENC_ERR_INVALID_VERSION, - - /** - * This indicates that ::NvEncMapInputResource() API failed to map the client - * provided input resource. - */ - NV_ENC_ERR_MAP_FAILED, - - /** - * This indicates encode driver requires more input buffers to produce an output - * bitstream. If this error is returned from ::NvEncEncodePicture() API, this - * is not a fatal error. If the client is encoding with B frames then, - * ::NvEncEncodePicture() API might be buffering the input frame for re-ordering. - * - * A client operating in synchronous mode cannot call ::NvEncLockBitstream() - * API on the output bitstream buffer if ::NvEncEncodePicture() returned the - * ::NV_ENC_ERR_NEED_MORE_INPUT error code. - * The client must continue providing input frames until encode driver returns - * ::NV_ENC_SUCCESS. After receiving ::NV_ENC_SUCCESS status the client can call - * ::NvEncLockBitstream() API on the output buffers in the same order in which - * it has called ::NvEncEncodePicture(). - */ - NV_ENC_ERR_NEED_MORE_INPUT, - - /** - * This indicates that the HW encoder is busy encoding and is unable to encode - * the input. The client should call ::NvEncEncodePicture() again after few - * milliseconds. - */ - NV_ENC_ERR_ENCODER_BUSY, - - /** - * This indicates that the completion event passed in ::NvEncEncodePicture() - * API has not been registered with encoder driver using ::NvEncRegisterAsyncEvent(). - */ - NV_ENC_ERR_EVENT_NOT_REGISTERD, - - /** - * This indicates that an unknown internal error has occurred. - */ - NV_ENC_ERR_GENERIC, - - /** - * This indicates that the client is attempting to use a feature - * that is not available for the license type for the current system. - */ - NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY, - - /** - * This indicates that the client is attempting to use a feature - * that is not implemented for the current version. - */ - NV_ENC_ERR_UNIMPLEMENTED, - - /** - * This indicates that the ::NvEncRegisterResource API failed to register the resource. - */ - NV_ENC_ERR_RESOURCE_REGISTER_FAILED, - - /** - * This indicates that the client is attempting to unregister a resource - * that has not been successfully registered. - */ - NV_ENC_ERR_RESOURCE_NOT_REGISTERED, - - /** - * This indicates that the client is attempting to unmap a resource - * that has not been successfully mapped. - */ - NV_ENC_ERR_RESOURCE_NOT_MAPPED, - - /** - * This indicates encode driver requires more output buffers to write an output - * bitstream. If this error is returned from ::NvEncRestoreEncoderState() API, this - * is not a fatal error. If the client is encoding with B frames then, - * ::NvEncRestoreEncoderState() API might be requiring the extra output buffer for accomodating overlay frame output in a separate buffer, for AV1 codec. - * In this case, client must call NvEncRestoreEncoderState() API again with NV_ENC_RESTORE_ENCODER_STATE_PARAMS::outputBitstream as input along with - * the parameters in the previous call. When operating in asynchronous mode of encoding, client must also specify NV_ENC_RESTORE_ENCODER_STATE_PARAMS::completionEvent. - */ - NV_ENC_ERR_NEED_MORE_OUTPUT, - -} NVENCSTATUS; - -/** - * Encode Picture encode flags. - */ -typedef enum _NV_ENC_PIC_FLAGS -{ - NV_ENC_PIC_FLAG_FORCEINTRA = 0x1, /**< Encode the current picture as an Intra picture */ - NV_ENC_PIC_FLAG_FORCEIDR = 0x2, /**< Encode the current picture as an IDR picture. - This flag is only valid when Picture type decision is taken by the Encoder - [_NV_ENC_INITIALIZE_PARAMS::enablePTD == 1]. */ - NV_ENC_PIC_FLAG_OUTPUT_SPSPPS = 0x4, /**< Write the sequence and picture header in encoded bitstream of the current picture */ - NV_ENC_PIC_FLAG_EOS = 0x8, /**< Indicates end of the input stream */ - NV_ENC_PIC_FLAG_DISABLE_ENC_STATE_ADVANCE = 0x10, /**< Do not advance encoder state during encode */ - NV_ENC_PIC_FLAG_OUTPUT_RECON_FRAME = 0x20, /**< Write reconstructed frame */ -} NV_ENC_PIC_FLAGS; - -/** - * Memory heap to allocate input and output buffers. - */ -typedef enum _NV_ENC_MEMORY_HEAP -{ - NV_ENC_MEMORY_HEAP_AUTOSELECT = 0, /**< Memory heap to be decided by the encoder driver based on the usage */ - NV_ENC_MEMORY_HEAP_VID = 1, /**< Memory heap is in local video memory */ - NV_ENC_MEMORY_HEAP_SYSMEM_CACHED = 2, /**< Memory heap is in cached system memory */ - NV_ENC_MEMORY_HEAP_SYSMEM_UNCACHED = 3 /**< Memory heap is in uncached system memory */ -} NV_ENC_MEMORY_HEAP; - -/** - * B-frame used as reference modes - */ -typedef enum _NV_ENC_BFRAME_REF_MODE -{ - NV_ENC_BFRAME_REF_MODE_DISABLED = 0x0, /**< B frame is not used for reference */ - NV_ENC_BFRAME_REF_MODE_EACH = 0x1, /**< Each B-frame will be used for reference */ - NV_ENC_BFRAME_REF_MODE_MIDDLE = 0x2, /**< Only(Number of B-frame)/2 th B-frame will be used for reference */ -} NV_ENC_BFRAME_REF_MODE; - -/** - * H.264 entropy coding modes. - */ -typedef enum _NV_ENC_H264_ENTROPY_CODING_MODE -{ - NV_ENC_H264_ENTROPY_CODING_MODE_AUTOSELECT = 0x0, /**< Entropy coding mode is auto selected by the encoder driver */ - NV_ENC_H264_ENTROPY_CODING_MODE_CABAC = 0x1, /**< Entropy coding mode is CABAC */ - NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC = 0x2 /**< Entropy coding mode is CAVLC */ -} NV_ENC_H264_ENTROPY_CODING_MODE; - -/** - * H.264 specific BDirect modes - */ -typedef enum _NV_ENC_H264_BDIRECT_MODE -{ - NV_ENC_H264_BDIRECT_MODE_AUTOSELECT = 0x0, /**< BDirect mode is auto selected by the encoder driver */ - NV_ENC_H264_BDIRECT_MODE_DISABLE = 0x1, /**< Disable BDirect mode */ - NV_ENC_H264_BDIRECT_MODE_TEMPORAL = 0x2, /**< Temporal BDirect mode */ - NV_ENC_H264_BDIRECT_MODE_SPATIAL = 0x3 /**< Spatial BDirect mode */ -} NV_ENC_H264_BDIRECT_MODE; - -/** - * H.264 specific FMO usage - */ -typedef enum _NV_ENC_H264_FMO_MODE -{ - NV_ENC_H264_FMO_AUTOSELECT = 0x0, /**< FMO usage is auto selected by the encoder driver */ - NV_ENC_H264_FMO_ENABLE = 0x1, /**< Enable FMO */ - NV_ENC_H264_FMO_DISABLE = 0x2, /**< Disable FMO */ -} NV_ENC_H264_FMO_MODE; - -/** - * H.264 specific Adaptive Transform modes - */ -typedef enum _NV_ENC_H264_ADAPTIVE_TRANSFORM_MODE -{ - NV_ENC_H264_ADAPTIVE_TRANSFORM_AUTOSELECT = 0x0, /**< Adaptive Transform 8x8 mode is auto selected by the encoder driver*/ - NV_ENC_H264_ADAPTIVE_TRANSFORM_DISABLE = 0x1, /**< Adaptive Transform 8x8 mode disabled */ - NV_ENC_H264_ADAPTIVE_TRANSFORM_ENABLE = 0x2, /**< Adaptive Transform 8x8 mode should be used */ -} NV_ENC_H264_ADAPTIVE_TRANSFORM_MODE; - -/** - * Stereo frame packing modes. - */ -typedef enum _NV_ENC_STEREO_PACKING_MODE -{ - NV_ENC_STEREO_PACKING_MODE_NONE = 0x0, /**< No Stereo packing required */ - NV_ENC_STEREO_PACKING_MODE_CHECKERBOARD = 0x1, /**< Checkerboard mode for packing stereo frames */ - NV_ENC_STEREO_PACKING_MODE_COLINTERLEAVE = 0x2, /**< Column Interleave mode for packing stereo frames */ - NV_ENC_STEREO_PACKING_MODE_ROWINTERLEAVE = 0x3, /**< Row Interleave mode for packing stereo frames */ - NV_ENC_STEREO_PACKING_MODE_SIDEBYSIDE = 0x4, /**< Side-by-side mode for packing stereo frames */ - NV_ENC_STEREO_PACKING_MODE_TOPBOTTOM = 0x5, /**< Top-Bottom mode for packing stereo frames */ - NV_ENC_STEREO_PACKING_MODE_FRAMESEQ = 0x6 /**< Frame Sequential mode for packing stereo frames */ -} NV_ENC_STEREO_PACKING_MODE; - -/** - * Input Resource type - */ -typedef enum _NV_ENC_INPUT_RESOURCE_TYPE -{ - NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX = 0x0, /**< input resource type is a directx9 surface*/ - NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR = 0x1, /**< input resource type is a cuda device pointer surface*/ - NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY = 0x2, /**< input resource type is a cuda array surface. - This array must be a 2D array and the CUDA_ARRAY3D_SURFACE_LDST - flag must have been specified when creating it. */ - NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEX = 0x3 /**< input resource type is an OpenGL texture */ -} NV_ENC_INPUT_RESOURCE_TYPE; - -/** - * Buffer usage - */ -typedef enum _NV_ENC_BUFFER_USAGE -{ - NV_ENC_INPUT_IMAGE = 0x0, /**< Registered surface will be used for input image */ - NV_ENC_OUTPUT_MOTION_VECTOR = 0x1, /**< Registered surface will be used for output of H.264 ME only mode. - This buffer usage type is not supported for HEVC ME only mode. */ - NV_ENC_OUTPUT_BITSTREAM = 0x2, /**< Registered surface will be used for output bitstream in encoding */ - NV_ENC_OUTPUT_RECON = 0x4, /**< Registered surface will be used for output reconstructed frame in encoding */ -} NV_ENC_BUFFER_USAGE; - -/** - * Encoder Device type - */ -typedef enum _NV_ENC_DEVICE_TYPE -{ - NV_ENC_DEVICE_TYPE_DIRECTX = 0x0, /**< encode device type is a directx9 device */ - NV_ENC_DEVICE_TYPE_CUDA = 0x1, /**< encode device type is a cuda device */ - NV_ENC_DEVICE_TYPE_OPENGL = 0x2 /**< encode device type is an OpenGL device. - Use of this device type is supported only on Linux */ -} NV_ENC_DEVICE_TYPE; - -/** - * Number of reference frames - */ -typedef enum _NV_ENC_NUM_REF_FRAMES -{ - NV_ENC_NUM_REF_FRAMES_AUTOSELECT = 0x0, /**< Number of reference frames is auto selected by the encoder driver */ - NV_ENC_NUM_REF_FRAMES_1 = 0x1, /**< Number of reference frames equal to 1 */ - NV_ENC_NUM_REF_FRAMES_2 = 0x2, /**< Number of reference frames equal to 2 */ - NV_ENC_NUM_REF_FRAMES_3 = 0x3, /**< Number of reference frames equal to 3 */ - NV_ENC_NUM_REF_FRAMES_4 = 0x4, /**< Number of reference frames equal to 4 */ - NV_ENC_NUM_REF_FRAMES_5 = 0x5, /**< Number of reference frames equal to 5 */ - NV_ENC_NUM_REF_FRAMES_6 = 0x6, /**< Number of reference frames equal to 6 */ - NV_ENC_NUM_REF_FRAMES_7 = 0x7 /**< Number of reference frames equal to 7 */ -} NV_ENC_NUM_REF_FRAMES; - -/** - * Encoder capabilities enumeration. - */ -typedef enum _NV_ENC_CAPS -{ - /** - * Maximum number of B-Frames supported. - */ - NV_ENC_CAPS_NUM_MAX_BFRAMES, - - /** - * Rate control modes supported. - * \n The API return value is a bitmask of the values in NV_ENC_PARAMS_RC_MODE. - */ - NV_ENC_CAPS_SUPPORTED_RATECONTROL_MODES, - - /** - * Indicates HW support for field mode encoding. - * \n 0 : Interlaced mode encoding is not supported. - * \n 1 : Interlaced field mode encoding is supported. - * \n 2 : Interlaced frame encoding and field mode encoding are both supported. - */ - NV_ENC_CAPS_SUPPORT_FIELD_ENCODING, - - /** - * Indicates HW support for monochrome mode encoding. - * \n 0 : Monochrome mode not supported. - * \n 1 : Monochrome mode supported. - */ - NV_ENC_CAPS_SUPPORT_MONOCHROME, - - /** - * Indicates HW support for FMO. - * \n 0 : FMO not supported. - * \n 1 : FMO supported. - */ - NV_ENC_CAPS_SUPPORT_FMO, - - /** - * Indicates HW capability for Quarter pel motion estimation. - * \n 0 : Quarter-Pel Motion Estimation not supported. - * \n 1 : Quarter-Pel Motion Estimation supported. - */ - NV_ENC_CAPS_SUPPORT_QPELMV, - - /** - * H.264 specific. Indicates HW support for BDirect modes. - * \n 0 : BDirect mode encoding not supported. - * \n 1 : BDirect mode encoding supported. - */ - NV_ENC_CAPS_SUPPORT_BDIRECT_MODE, - - /** - * H264 specific. Indicates HW support for CABAC entropy coding mode. - * \n 0 : CABAC entropy coding not supported. - * \n 1 : CABAC entropy coding supported. - */ - NV_ENC_CAPS_SUPPORT_CABAC, - - /** - * Indicates HW support for Adaptive Transform. - * \n 0 : Adaptive Transform not supported. - * \n 1 : Adaptive Transform supported. - */ - NV_ENC_CAPS_SUPPORT_ADAPTIVE_TRANSFORM, - - /** - * Indicates HW support for Multi View Coding. - * \n 0 : Multi View Coding not supported. - * \n 1 : Multi View Coding supported. - */ - NV_ENC_CAPS_SUPPORT_STEREO_MVC, - - /** - * Indicates HW support for encoding Temporal layers. - * \n 0 : Encoding Temporal layers not supported. - * \n 1 : Encoding Temporal layers supported. - */ - NV_ENC_CAPS_NUM_MAX_TEMPORAL_LAYERS, - - /** - * Indicates HW support for Hierarchical P frames. - * \n 0 : Hierarchical P frames not supported. - * \n 1 : Hierarchical P frames supported. - */ - NV_ENC_CAPS_SUPPORT_HIERARCHICAL_PFRAMES, - - /** - * Indicates HW support for Hierarchical B frames. - * \n 0 : Hierarchical B frames not supported. - * \n 1 : Hierarchical B frames supported. - */ - NV_ENC_CAPS_SUPPORT_HIERARCHICAL_BFRAMES, - - /** - * Maximum Encoding level supported (See ::NV_ENC_LEVEL for details). - */ - NV_ENC_CAPS_LEVEL_MAX, - - /** - * Minimum Encoding level supported (See ::NV_ENC_LEVEL for details). - */ - NV_ENC_CAPS_LEVEL_MIN, - - /** - * Indicates HW support for separate colour plane encoding. - * \n 0 : Separate colour plane encoding not supported. - * \n 1 : Separate colour plane encoding supported. - */ - NV_ENC_CAPS_SEPARATE_COLOUR_PLANE, - - /** - * Maximum output width supported. - */ - NV_ENC_CAPS_WIDTH_MAX, - - /** - * Maximum output height supported. - */ - NV_ENC_CAPS_HEIGHT_MAX, - - /** - * Indicates Temporal Scalability Support. - * \n 0 : Temporal SVC encoding not supported. - * \n 1 : Temporal SVC encoding supported. - */ - NV_ENC_CAPS_SUPPORT_TEMPORAL_SVC, - - /** - * Indicates Dynamic Encode Resolution Change Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Dynamic Encode Resolution Change not supported. - * \n 1 : Dynamic Encode Resolution Change supported. - */ - NV_ENC_CAPS_SUPPORT_DYN_RES_CHANGE, - - /** - * Indicates Dynamic Encode Bitrate Change Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Dynamic Encode bitrate change not supported. - * \n 1 : Dynamic Encode bitrate change supported. - */ - NV_ENC_CAPS_SUPPORT_DYN_BITRATE_CHANGE, - - /** - * Indicates Forcing Constant QP On The Fly Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Forcing constant QP on the fly not supported. - * \n 1 : Forcing constant QP on the fly supported. - */ - NV_ENC_CAPS_SUPPORT_DYN_FORCE_CONSTQP, - - /** - * Indicates Dynamic rate control mode Change Support. - * \n 0 : Dynamic rate control mode change not supported. - * \n 1 : Dynamic rate control mode change supported. - */ - NV_ENC_CAPS_SUPPORT_DYN_RCMODE_CHANGE, - - /** - * Indicates Subframe readback support for slice-based encoding. If this feature is supported, it can be enabled by setting enableSubFrameWrite = 1. - * \n 0 : Subframe readback not supported. - * \n 1 : Subframe readback supported. - */ - NV_ENC_CAPS_SUPPORT_SUBFRAME_READBACK, - - /** - * Indicates Constrained Encoding mode support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Constrained encoding mode not supported. - * \n 1 : Constrained encoding mode supported. - * If this mode is supported client can enable this during initialization. - * Client can then force a picture to be coded as constrained picture where - * in-loop filtering is disabled across slice boundaries and prediction vectors for inter - * macroblocks in each slice will be restricted to the slice region. - */ - NV_ENC_CAPS_SUPPORT_CONSTRAINED_ENCODING, - - /** - * Indicates Intra Refresh Mode Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Intra Refresh Mode not supported. - * \n 1 : Intra Refresh Mode supported. - */ - NV_ENC_CAPS_SUPPORT_INTRA_REFRESH, - - /** - * Indicates Custom VBV Buffer Size support. It can be used for capping frame size. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Custom VBV buffer size specification from client, not supported. - * \n 1 : Custom VBV buffer size specification from client, supported. - */ - NV_ENC_CAPS_SUPPORT_CUSTOM_VBV_BUF_SIZE, - - /** - * Indicates Dynamic Slice Mode Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Dynamic Slice Mode not supported. - * \n 1 : Dynamic Slice Mode supported. - */ - NV_ENC_CAPS_SUPPORT_DYNAMIC_SLICE_MODE, - - /** - * Indicates Reference Picture Invalidation Support. - * Support added from NvEncodeAPI version 2.0. - * \n 0 : Reference Picture Invalidation not supported. - * \n 1 : Reference Picture Invalidation supported. - */ - NV_ENC_CAPS_SUPPORT_REF_PIC_INVALIDATION, - - /** - * Indicates support for Pre-Processing. - * The API return value is a bitmask of the values defined in ::NV_ENC_PREPROC_FLAGS - */ - NV_ENC_CAPS_PREPROC_SUPPORT, - - /** - * Indicates support Async mode. - * \n 0 : Async Encode mode not supported. - * \n 1 : Async Encode mode supported. - */ - NV_ENC_CAPS_ASYNC_ENCODE_SUPPORT, - - /** - * Maximum MBs per frame supported. - */ - NV_ENC_CAPS_MB_NUM_MAX, - - /** - * Maximum aggregate throughput in MBs per sec. - */ - NV_ENC_CAPS_MB_PER_SEC_MAX, - - /** - * Indicates HW support for YUV444 mode encoding. - * \n 0 : YUV444 mode encoding not supported. - * \n 1 : YUV444 mode encoding supported. - */ - NV_ENC_CAPS_SUPPORT_YUV444_ENCODE, - - /** - * Indicates HW support for lossless encoding. - * \n 0 : lossless encoding not supported. - * \n 1 : lossless encoding supported. - */ - NV_ENC_CAPS_SUPPORT_LOSSLESS_ENCODE, - - /** - * Indicates HW support for Sample Adaptive Offset. - * \n 0 : SAO not supported. - * \n 1 : SAO encoding supported. - */ - NV_ENC_CAPS_SUPPORT_SAO, - - /** - * Indicates HW support for Motion Estimation Only Mode. - * \n 0 : MEOnly Mode not supported. - * \n 1 : MEOnly Mode supported for I and P frames. - * \n 2 : MEOnly Mode supported for I, P and B frames. - */ - NV_ENC_CAPS_SUPPORT_MEONLY_MODE, - - /** - * Indicates HW support for lookahead encoding (enableLookahead=1). - * \n 0 : Lookahead not supported. - * \n 1 : Lookahead supported. - */ - NV_ENC_CAPS_SUPPORT_LOOKAHEAD, - - /** - * Indicates HW support for temporal AQ encoding (enableTemporalAQ=1). - * \n 0 : Temporal AQ not supported. - * \n 1 : Temporal AQ supported. - */ - NV_ENC_CAPS_SUPPORT_TEMPORAL_AQ, - /** - * Indicates HW support for 10 bit encoding. - * \n 0 : 10 bit encoding not supported. - * \n 1 : 10 bit encoding supported. - */ - NV_ENC_CAPS_SUPPORT_10BIT_ENCODE, - /** - * Maximum number of Long Term Reference frames supported - */ - NV_ENC_CAPS_NUM_MAX_LTR_FRAMES, - - /** - * Indicates HW support for Weighted Prediction. - * \n 0 : Weighted Prediction not supported. - * \n 1 : Weighted Prediction supported. - */ - NV_ENC_CAPS_SUPPORT_WEIGHTED_PREDICTION, - - - /** - * On managed (vGPU) platforms (Windows only), this API, in conjunction with other GRID Management APIs, can be used - * to estimate the residual capacity of the hardware encoder on the GPU as a percentage of the total available encoder capacity. - * This API can be called at any time; i.e. during the encode session or before opening the encode session. - * If the available encoder capacity is returned as zero, applications may choose to switch to software encoding - * and continue to call this API (e.g. polling once per second) until capacity becomes available. - * - * On bare metal (non-virtualized GPU) and linux platforms, this API always returns 100. - */ - NV_ENC_CAPS_DYNAMIC_QUERY_ENCODER_CAPACITY, - - /** - * Indicates B as reference support. - * \n 0 : B as reference is not supported. - * \n 1 : each B-Frame as reference is supported. - * \n 2 : only Middle B-frame as reference is supported. - */ - NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE, - - /** - * Indicates HW support for Emphasis Level Map based delta QP computation. - * \n 0 : Emphasis Level Map based delta QP not supported. - * \n 1 : Emphasis Level Map based delta QP is supported. - */ - NV_ENC_CAPS_SUPPORT_EMPHASIS_LEVEL_MAP, - - /** - * Minimum input width supported. - */ - NV_ENC_CAPS_WIDTH_MIN, - - /** - * Minimum input height supported. - */ - NV_ENC_CAPS_HEIGHT_MIN, - - /** - * Indicates HW support for multiple reference frames. - */ - NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES, - - /** - * Indicates HW support for HEVC with alpha encoding. - * \n 0 : HEVC with alpha encoding not supported. - * \n 1 : HEVC with alpha encoding is supported. - */ - NV_ENC_CAPS_SUPPORT_ALPHA_LAYER_ENCODING, - - /** - * Indicates number of Encoding engines present on GPU. - */ - NV_ENC_CAPS_NUM_ENCODER_ENGINES, - - /** - * Indicates single slice intra refresh support. - */ - NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH, - - /** - * Indicates encoding without advancing the state support. - */ - NV_ENC_CAPS_DISABLE_ENC_STATE_ADVANCE, - - /** - * Indicates reconstructed output support. - */ - NV_ENC_CAPS_OUTPUT_RECON_SURFACE, - - /** - * Indicates encoded frame output stats support for every block. Block represents a CTB for HEVC, macroblock for H.264 and super block for AV1. - */ - NV_ENC_CAPS_OUTPUT_BLOCK_STATS, - - /** - * Indicates encoded frame output stats support for every row. Row represents a CTB row for HEVC, macroblock row for H.264 and super block row for AV1. - */ - NV_ENC_CAPS_OUTPUT_ROW_STATS, - - /** - * Reserved - Not to be used by clients. - */ - NV_ENC_CAPS_EXPOSED_COUNT - -} NV_ENC_CAPS; - -/** - * HEVC CU SIZE - */ -typedef enum _NV_ENC_HEVC_CUSIZE -{ - NV_ENC_HEVC_CUSIZE_AUTOSELECT = 0, - NV_ENC_HEVC_CUSIZE_8x8 = 1, - NV_ENC_HEVC_CUSIZE_16x16 = 2, - NV_ENC_HEVC_CUSIZE_32x32 = 3, - NV_ENC_HEVC_CUSIZE_64x64 = 4, -}NV_ENC_HEVC_CUSIZE; - -/** -* AV1 PART SIZE -*/ -typedef enum _NV_ENC_AV1_PART_SIZE -{ - NV_ENC_AV1_PART_SIZE_AUTOSELECT = 0, - NV_ENC_AV1_PART_SIZE_4x4 = 1, - NV_ENC_AV1_PART_SIZE_8x8 = 2, - NV_ENC_AV1_PART_SIZE_16x16 = 3, - NV_ENC_AV1_PART_SIZE_32x32 = 4, - NV_ENC_AV1_PART_SIZE_64x64 = 5, -}NV_ENC_AV1_PART_SIZE; - -/** -* Enums related to fields in VUI parameters. -*/ -typedef enum _NV_ENC_VUI_VIDEO_FORMAT -{ - NV_ENC_VUI_VIDEO_FORMAT_COMPONENT = 0, - NV_ENC_VUI_VIDEO_FORMAT_PAL = 1, - NV_ENC_VUI_VIDEO_FORMAT_NTSC = 2, - NV_ENC_VUI_VIDEO_FORMAT_SECAM = 3, - NV_ENC_VUI_VIDEO_FORMAT_MAC = 4, - NV_ENC_VUI_VIDEO_FORMAT_UNSPECIFIED = 5, -}NV_ENC_VUI_VIDEO_FORMAT; - -typedef enum _NV_ENC_VUI_COLOR_PRIMARIES -{ - NV_ENC_VUI_COLOR_PRIMARIES_UNDEFINED = 0, - NV_ENC_VUI_COLOR_PRIMARIES_BT709 = 1, - NV_ENC_VUI_COLOR_PRIMARIES_UNSPECIFIED = 2, - NV_ENC_VUI_COLOR_PRIMARIES_RESERVED = 3, - NV_ENC_VUI_COLOR_PRIMARIES_BT470M = 4, - NV_ENC_VUI_COLOR_PRIMARIES_BT470BG = 5, - NV_ENC_VUI_COLOR_PRIMARIES_SMPTE170M = 6, - NV_ENC_VUI_COLOR_PRIMARIES_SMPTE240M = 7, - NV_ENC_VUI_COLOR_PRIMARIES_FILM = 8, - NV_ENC_VUI_COLOR_PRIMARIES_BT2020 = 9, - NV_ENC_VUI_COLOR_PRIMARIES_SMPTE428 = 10, - NV_ENC_VUI_COLOR_PRIMARIES_SMPTE431 = 11, - NV_ENC_VUI_COLOR_PRIMARIES_SMPTE432 = 12, - NV_ENC_VUI_COLOR_PRIMARIES_JEDEC_P22 = 22, -}NV_ENC_VUI_COLOR_PRIMARIES; - -typedef enum _NV_ENC_VUI_TRANSFER_CHARACTERISTIC -{ - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_UNDEFINED = 0, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT709 = 1, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_RESERVED = 3, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470M = 4, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT470BG = 5, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE170M = 6, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE240M = 7, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_LINEAR = 8, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG = 9, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_LOG_SQRT = 10, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_IEC61966_2_4 = 11, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT1361_ECG = 12, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SRGB = 13, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_10 = 14, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_BT2020_12 = 15, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE2084 = 16, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE428 = 17, - NV_ENC_VUI_TRANSFER_CHARACTERISTIC_ARIB_STD_B67 = 18, -}NV_ENC_VUI_TRANSFER_CHARACTERISTIC; - -typedef enum _NV_ENC_VUI_MATRIX_COEFFS -{ - NV_ENC_VUI_MATRIX_COEFFS_RGB = 0, - NV_ENC_VUI_MATRIX_COEFFS_BT709 = 1, - NV_ENC_VUI_MATRIX_COEFFS_UNSPECIFIED = 2, - NV_ENC_VUI_MATRIX_COEFFS_RESERVED = 3, - NV_ENC_VUI_MATRIX_COEFFS_FCC = 4, - NV_ENC_VUI_MATRIX_COEFFS_BT470BG = 5, - NV_ENC_VUI_MATRIX_COEFFS_SMPTE170M = 6, - NV_ENC_VUI_MATRIX_COEFFS_SMPTE240M = 7, - NV_ENC_VUI_MATRIX_COEFFS_YCGCO = 8, - NV_ENC_VUI_MATRIX_COEFFS_BT2020_NCL = 9, - NV_ENC_VUI_MATRIX_COEFFS_BT2020_CL = 10, - NV_ENC_VUI_MATRIX_COEFFS_SMPTE2085 = 11, -}NV_ENC_VUI_MATRIX_COEFFS; - -/** - * Input struct for querying Encoding capabilities. - */ -typedef struct _NV_ENC_CAPS_PARAM -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_CAPS_PARAM_VER */ - NV_ENC_CAPS capsToQuery; /**< [in]: Specifies the encode capability to be queried. Client should pass a member for ::NV_ENC_CAPS enum. */ - uint32_t reserved[62]; /**< [in]: Reserved and must be set to 0 */ -} NV_ENC_CAPS_PARAM; - -/** NV_ENC_CAPS_PARAM struct version. */ -#define NV_ENC_CAPS_PARAM_VER NVENCAPI_STRUCT_VERSION(1) - - -/** - * Restore encoder state parameters - */ -typedef struct _NV_ENC_RESTORE_ENCODER_STATE_PARAMS -{ - uint32_t version; /**< [in]: Struct version. */ - uint32_t bufferIdx; /**< [in]: State buffer index to which the encoder state will be restored */ - NV_ENC_STATE_RESTORE_TYPE state; /**< [in]: State type to restore */ - NV_ENC_OUTPUT_PTR outputBitstream; /**< [in]: Specifies the output buffer pointer, for AV1 encode only. - Application must call NvEncRestoreEncoderState() API with _NV_ENC_RESTORE_ENCODER_STATE_PARAMS::outputBitstream and - _NV_ENC_RESTORE_ENCODER_STATE_PARAMS::completionEvent as input when an earlier call to this API returned "NV_ENC_ERR_NEED_MORE_OUTPUT", for AV1 encode. */ - void* completionEvent; /**< [in]: Specifies the completion event when asynchronous mode of encoding is enabled. Used for AV1 encode only. */ - uint32_t reserved1[64]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_RESTORE_ENCODER_STATE_PARAMS; - -/** NV_ENC_RESTORE_ENCODER_STATE_PARAMS struct version. */ -#define NV_ENC_RESTORE_ENCODER_STATE_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Encoded frame information parameters for every block. - */ -typedef struct _NV_ENC_OUTPUT_STATS_BLOCK -{ - uint32_t version; /**< [in]: Struct version */ - uint8_t QP; /**< [out]: QP of the block */ - uint8_t reserved[3]; /**< [in]: Reserved and must be set to 0 */ - uint32_t bitcount; /**< [out]: Bitcount of the block */ - uint32_t reserved1[13]; /**< [in]: Reserved and must be set to 0 */ -} NV_ENC_OUTPUT_STATS_BLOCK; - -/** NV_ENC_OUTPUT_STATS_BLOCK struct version. */ -#define NV_ENC_OUTPUT_STATS_BLOCK_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Encoded frame information parameters for every row. - */ -typedef struct _NV_ENC_OUTPUT_STATS_ROW -{ - uint32_t version; /**< [in]: Struct version */ - uint8_t QP; /**< [out]: QP of the row */ - uint8_t reserved[3]; /**< [in]: Reserved and must be set to 0 */ - uint32_t bitcount; /**< [out]: Bitcount of the row */ - uint32_t reserved1[13]; /**< [in]: Reserved and must be set to 0 */ -} NV_ENC_OUTPUT_STATS_ROW; - -/** NV_ENC_OUTPUT_STATS_ROW struct version. */ -#define NV_ENC_OUTPUT_STATS_ROW_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Encoder Output parameters - */ -typedef struct _NV_ENC_ENCODE_OUT_PARAMS -{ - uint32_t version; /**< [out]: Struct version. */ - uint32_t bitstreamSizeInBytes; /**< [out]: Encoded bitstream size in bytes */ - uint32_t reserved[62]; /**< [out]: Reserved and must be set to 0 */ -} NV_ENC_ENCODE_OUT_PARAMS; - -/** NV_ENC_ENCODE_OUT_PARAMS struct version. */ -#define NV_ENC_ENCODE_OUT_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Lookahead picture parameters - */ -typedef struct _NV_ENC_LOOKAHEAD_PIC_PARAMS -{ - uint32_t version; /**< [in]: Struct version. */ - NV_ENC_INPUT_PTR inputBuffer; /**< [in]: Specifies the input buffer pointer. Client must use a pointer obtained from ::NvEncCreateInputBuffer() or ::NvEncMapInputResource() APIs.*/ - NV_ENC_PIC_TYPE pictureType; /**< [in]: Specifies input picture type. Client required to be set explicitly by the client if the client has not set NV_ENC_INITALIZE_PARAMS::enablePTD to 1 while calling NvInitializeEncoder. */ - uint32_t reserved[64]; /**< [in]: Reserved and must be set to 0 */ - void* reserved1[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_LOOKAHEAD_PIC_PARAMS; - -/** NV_ENC_LOOKAHEAD_PIC_PARAMS struct version. */ -#define NV_ENC_LOOKAHEAD_PIC_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Creation parameters for input buffer. - */ -typedef struct _NV_ENC_CREATE_INPUT_BUFFER -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_CREATE_INPUT_BUFFER_VER */ - uint32_t width; /**< [in]: Input frame width */ - uint32_t height; /**< [in]: Input frame height */ - NV_ENC_MEMORY_HEAP memoryHeap; /**< [in]: Deprecated. Do not use */ - NV_ENC_BUFFER_FORMAT bufferFmt; /**< [in]: Input buffer format */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0 */ - NV_ENC_INPUT_PTR inputBuffer; /**< [out]: Pointer to input buffer */ - void* pSysMemBuffer; /**< [in]: Pointer to existing system memory buffer */ - uint32_t reserved1[57]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[63]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CREATE_INPUT_BUFFER; - -/** NV_ENC_CREATE_INPUT_BUFFER struct version. */ -#define NV_ENC_CREATE_INPUT_BUFFER_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Creation parameters for output bitstream buffer. - */ -typedef struct _NV_ENC_CREATE_BITSTREAM_BUFFER -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_CREATE_BITSTREAM_BUFFER_VER */ - uint32_t size; /**< [in]: Deprecated. Do not use */ - NV_ENC_MEMORY_HEAP memoryHeap; /**< [in]: Deprecated. Do not use */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0 */ - NV_ENC_OUTPUT_PTR bitstreamBuffer; /**< [out]: Pointer to the output bitstream buffer */ - void* bitstreamBufferPtr; /**< [out]: Reserved and should not be used */ - uint32_t reserved1[58]; /**< [in]: Reserved and should be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and should be set to NULL */ -} NV_ENC_CREATE_BITSTREAM_BUFFER; - -/** NV_ENC_CREATE_BITSTREAM_BUFFER struct version. */ -#define NV_ENC_CREATE_BITSTREAM_BUFFER_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Structs needed for ME only mode. - */ -typedef struct _NV_ENC_MVECTOR -{ - int16_t mvx; /**< the x component of MV in quarter-pel units */ - int16_t mvy; /**< the y component of MV in quarter-pel units */ -} NV_ENC_MVECTOR; - -/** - * Motion vector structure per macroblock for H264 motion estimation. - */ -typedef struct _NV_ENC_H264_MV_DATA -{ - NV_ENC_MVECTOR mv[4]; /**< up to 4 vectors for 8x8 partition */ - uint8_t mbType; /**< 0 (I), 1 (P), 2 (IPCM), 3 (B) */ - uint8_t partitionType; /**< Specifies the block partition type. 0:16x16, 1:8x8, 2:16x8, 3:8x16 */ - uint16_t reserved; /**< reserved padding for alignment */ - uint32_t mbCost; -} NV_ENC_H264_MV_DATA; - -/** - * Motion vector structure per CU for HEVC motion estimation. - */ -typedef struct _NV_ENC_HEVC_MV_DATA -{ - NV_ENC_MVECTOR mv[4]; /**< up to 4 vectors within a CU */ - uint8_t cuType; /**< 0 (I), 1(P) */ - uint8_t cuSize; /**< 0: 8x8, 1: 16x16, 2: 32x32, 3: 64x64 */ - uint8_t partitionMode; /**< The CU partition mode - 0 (2Nx2N), 1 (2NxN), 2(Nx2N), 3 (NxN), - 4 (2NxnU), 5 (2NxnD), 6(nLx2N), 7 (nRx2N) */ - uint8_t lastCUInCTB; /**< Marker to separate CUs in the current CTB from CUs in the next CTB */ -} NV_ENC_HEVC_MV_DATA; - -/** - * Creation parameters for output motion vector buffer for ME only mode. - */ -typedef struct _NV_ENC_CREATE_MV_BUFFER -{ - uint32_t version; /**< [in]: Struct version. Must be set to NV_ENC_CREATE_MV_BUFFER_VER */ - NV_ENC_OUTPUT_PTR mvBuffer; /**< [out]: Pointer to the output motion vector buffer */ - uint32_t reserved1[255]; /**< [in]: Reserved and should be set to 0 */ - void* reserved2[63]; /**< [in]: Reserved and should be set to NULL */ -} NV_ENC_CREATE_MV_BUFFER; - -/** NV_ENC_CREATE_MV_BUFFER struct version*/ -#define NV_ENC_CREATE_MV_BUFFER_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * QP value for frames - */ -typedef struct _NV_ENC_QP -{ - uint32_t qpInterP; /**< [in]: Specifies QP value for P-frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ - uint32_t qpInterB; /**< [in]: Specifies QP value for B-frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ - uint32_t qpIntra; /**< [in]: Specifies QP value for Intra Frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ -} NV_ENC_QP; - -/** - * Rate Control Configuration Parameters - */ - typedef struct _NV_ENC_RC_PARAMS - { - uint32_t version; - NV_ENC_PARAMS_RC_MODE rateControlMode; /**< [in]: Specifies the rate control mode. Check support for various rate control modes using ::NV_ENC_CAPS_SUPPORTED_RATECONTROL_MODES caps. */ - NV_ENC_QP constQP; /**< [in]: Specifies the initial QP to be used for encoding, these values would be used for all frames if in Constant QP mode. */ - uint32_t averageBitRate; /**< [in]: Specifies the average bitrate(in bits/sec) used for encoding. */ - uint32_t maxBitRate; /**< [in]: Specifies the maximum bitrate for the encoded output. This is used for VBR and ignored for CBR mode. */ - uint32_t vbvBufferSize; /**< [in]: Specifies the VBV(HRD) buffer size. in bits. Set 0 to use the default VBV buffer size. */ - uint32_t vbvInitialDelay; /**< [in]: Specifies the VBV(HRD) initial delay in bits. Set 0 to use the default VBV initial delay .*/ - uint32_t enableMinQP :1; /**< [in]: Set this to 1 if minimum QP used for rate control. */ - uint32_t enableMaxQP :1; /**< [in]: Set this to 1 if maximum QP used for rate control. */ - uint32_t enableInitialRCQP :1; /**< [in]: Set this to 1 if user supplied initial QP is used for rate control. */ - uint32_t enableAQ :1; /**< [in]: Set this to 1 to enable adaptive quantization (Spatial). */ - uint32_t reservedBitField1 :1; /**< [in]: Reserved bitfields and must be set to 0. */ - uint32_t enableLookahead :1; /**< [in]: Set this to 1 to enable lookahead with depth (if lookahead is enabled, input frames must remain available to the encoder until encode completion) */ - uint32_t disableIadapt :1; /**< [in]: Set this to 1 to disable adaptive I-frame insertion at scene cuts (only has an effect when lookahead is enabled) */ - uint32_t disableBadapt :1; /**< [in]: Set this to 1 to disable adaptive B-frame decision (only has an effect when lookahead is enabled) */ - uint32_t enableTemporalAQ :1; /**< [in]: Set this to 1 to enable temporal AQ */ - uint32_t zeroReorderDelay :1; /**< [in]: Set this to 1 to indicate zero latency operation (no reordering delay, num_reorder_frames=0) */ - uint32_t enableNonRefP :1; /**< [in]: Set this to 1 to enable automatic insertion of non-reference P-frames (no effect if enablePTD=0) */ - uint32_t strictGOPTarget :1; /**< [in]: Set this to 1 to minimize GOP-to-GOP rate fluctuations */ - uint32_t aqStrength :4; /**< [in]: When AQ (Spatial) is enabled (i.e. NV_ENC_RC_PARAMS::enableAQ is set), this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive). - If not set, strength is auto selected by driver. */ - uint32_t enableExtLookahead :1; /**< [in]: Set this to 1 to enable lookahead externally. - Application must call NvEncLookahead() for NV_ENC_RC_PARAMS::lookaheadDepth number of frames, - before calling NvEncEncodePicture() for the first frame */ - uint32_t reservedBitFields :15; /**< [in]: Reserved bitfields and must be set to 0 */ - NV_ENC_QP minQP; /**< [in]: Specifies the minimum QP used for rate control. Client must set NV_ENC_CONFIG::enableMinQP to 1. */ - NV_ENC_QP maxQP; /**< [in]: Specifies the maximum QP used for rate control. Client must set NV_ENC_CONFIG::enableMaxQP to 1. */ - NV_ENC_QP initialRCQP; /**< [in]: Specifies the initial QP hint used for rate control. The parameter is just used as hint to influence the QP difference between I,P and B frames. - Client must set NV_ENC_CONFIG::enableInitialRCQP to 1. */ - uint32_t temporallayerIdxMask; /**< [in]: Specifies the temporal layers (as a bitmask) whose QPs have changed. Valid max bitmask is [2^NV_ENC_CAPS_NUM_MAX_TEMPORAL_LAYERS - 1]. - Applicable only for constant QP mode (NV_ENC_RC_PARAMS::rateControlMode = NV_ENC_PARAMS_RC_CONSTQP). */ - uint8_t temporalLayerQP[8]; /**< [in]: Specifies the temporal layer QPs used for rate control. Temporal layer index is used as the array index. - Applicable only for constant QP mode (NV_ENC_RC_PARAMS::rateControlMode = NV_ENC_PARAMS_RC_CONSTQP). */ - uint8_t targetQuality; /**< [in]: Target CQ (Constant Quality) level for VBR mode (range 0-51 with 0-automatic) */ - uint8_t targetQualityLSB; /**< [in]: Fractional part of target quality (as 8.8 fixed point format) */ - uint16_t lookaheadDepth; /**< [in]: Maximum depth of lookahead with range 0-(31 - number of B frames). - lookaheadDepth is only used if enableLookahead=1.*/ - uint8_t lowDelayKeyFrameScale; /**< [in]: Specifies the ratio of I frame bits to P frame bits in case of single frame VBV and CBR rate control mode, - is set to 2 by default for low latency tuning info and 1 by default for ultra low latency tuning info */ - int8_t yDcQPIndexOffset; /**< [in]: Specifies the value of 'deltaQ_y_dc' in AV1.*/ - int8_t uDcQPIndexOffset; /**< [in]: Specifies the value of 'deltaQ_u_dc' in AV1.*/ - int8_t vDcQPIndexOffset; /**< [in]: Specifies the value of 'deltaQ_v_dc' in AV1 (for future use only - deltaQ_v_dc is currently always internally set to same value as deltaQ_u_dc). */ - NV_ENC_QP_MAP_MODE qpMapMode; /**< [in]: This flag is used to interpret values in array specified by NV_ENC_PIC_PARAMS::qpDeltaMap. - Set this to NV_ENC_QP_MAP_EMPHASIS to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as Emphasis Level Map. - Emphasis Level can be assigned any value specified in enum NV_ENC_EMPHASIS_MAP_LEVEL. - Emphasis Level Map is used to specify regions to be encoded at varying levels of quality. - The hardware encoder adjusts the quantization within the image as per the provided emphasis map, - by adjusting the quantization parameter (QP) assigned to each macroblock. This adjustment is commonly called "Delta QP". - The adjustment depends on the absolute QP decided by the rate control algorithm, and is applied after the rate control has decided each macroblock's QP. - Since the Delta QP overrides rate control, enabling Emphasis Level Map may violate bitrate and VBV buffer size constraints. - Emphasis Level Map is useful in situations where client has a priori knowledge of the image complexity (e.g. via use of NVFBC's Classification feature) and encoding those high-complexity areas at higher quality (lower QP) is important, even at the possible cost of violating bitrate/VBV buffer size constraints - This feature is not supported when AQ( Spatial/Temporal) is enabled. - This feature is only supported for H264 codec currently. - - Set this to NV_ENC_QP_MAP_DELTA to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as QP Delta. This specifies QP modifier to be applied on top of the QP chosen by rate control - - Set this to NV_ENC_QP_MAP_DISABLED to ignore NV_ENC_PIC_PARAMS::qpDeltaMap values. In this case, qpDeltaMap should be set to NULL. - - Other values are reserved for future use.*/ - NV_ENC_MULTI_PASS multiPass; /**< [in]: This flag is used to enable multi-pass encoding for a given ::NV_ENC_PARAMS_RC_MODE. This flag is not valid for H264 and HEVC MEOnly mode */ - uint32_t alphaLayerBitrateRatio; /**< [in]: Specifies the ratio in which bitrate should be split between base and alpha layer. A value 'x' for this field will split the target bitrate in a ratio of x : 1 between base and alpha layer. - The default split ratio is 15.*/ - int8_t cbQPIndexOffset; /**< [in]: Specifies the value of 'chroma_qp_index_offset' in H264 / 'pps_cb_qp_offset' in HEVC / 'deltaQ_u_ac' in AV1.*/ - int8_t crQPIndexOffset; /**< [in]: Specifies the value of 'second_chroma_qp_index_offset' in H264 / 'pps_cr_qp_offset' in HEVC / 'deltaQ_v_ac' in AV1 (for future use only - deltaQ_v_ac is currently always internally set to same value as deltaQ_u_ac). */ - uint16_t reserved2; - uint32_t reserved[4]; - } NV_ENC_RC_PARAMS; - -/** macro for constructing the version field of ::_NV_ENC_RC_PARAMS */ -#define NV_ENC_RC_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -#define MAX_NUM_CLOCK_TS 3 - -/** -* Clock Timestamp set parameters -* For H264, this structure is used to populate Picture Timing SEI when NV_ENC_CONFIG_H264::enableTimeCode is set to 1. -* For HEVC, this structure is used to populate Time Code SEI when NV_ENC_CONFIG_HEVC::enableTimeCodeSEI is set to 1. -* For more details, refer to Annex D of ITU-T Specification. -*/ - -typedef struct _NV_ENC_CLOCK_TIMESTAMP_SET -{ - uint32_t countingType : 1; /**< [in] Specifies the 'counting_type' */ - uint32_t discontinuityFlag : 1; /**< [in] Specifies the 'discontinuity_flag' */ - uint32_t cntDroppedFrames : 1; /**< [in] Specifies the 'cnt_dropped_flag' */ - uint32_t nFrames : 8; /**< [in] Specifies the value of 'n_frames' */ - uint32_t secondsValue : 6; /**< [in] Specifies the 'seconds_value' */ - uint32_t minutesValue : 6; /**< [in] Specifies the 'minutes_value' */ - uint32_t hoursValue : 5; /**< [in] Specifies the 'hours_value' */ - uint32_t reserved2 : 4; /**< [in] Reserved and must be set to 0 */ - uint32_t timeOffset; /**< [in] Specifies the 'time_offset_value' */ -} NV_ENC_CLOCK_TIMESTAMP_SET; - -typedef struct _NV_ENC_TIME_CODE -{ - NV_ENC_DISPLAY_PIC_STRUCT displayPicStruct; /**< [in] Display picStruct */ - NV_ENC_CLOCK_TIMESTAMP_SET clockTimestamp[MAX_NUM_CLOCK_TS]; /**< [in] Clock Timestamp set */ -} NV_ENC_TIME_CODE; - - -/** - * \struct _NV_ENC_CONFIG_H264_VUI_PARAMETERS - * H264 Video Usability Info parameters - */ -typedef struct _NV_ENC_CONFIG_H264_VUI_PARAMETERS -{ - uint32_t overscanInfoPresentFlag; /**< [in]: If set to 1 , it specifies that the overscanInfo is present */ - uint32_t overscanInfo; /**< [in]: Specifies the overscan info(as defined in Annex E of the ITU-T Specification). */ - uint32_t videoSignalTypePresentFlag; /**< [in]: If set to 1, it specifies that the videoFormat, videoFullRangeFlag and colourDescriptionPresentFlag are present. */ - NV_ENC_VUI_VIDEO_FORMAT videoFormat; /**< [in]: Specifies the source video format(as defined in Annex E of the ITU-T Specification).*/ - uint32_t videoFullRangeFlag; /**< [in]: Specifies the output range of the luma and chroma samples(as defined in Annex E of the ITU-T Specification). */ - uint32_t colourDescriptionPresentFlag; /**< [in]: If set to 1, it specifies that the colourPrimaries, transferCharacteristics and colourMatrix are present. */ - NV_ENC_VUI_COLOR_PRIMARIES colourPrimaries; /**< [in]: Specifies color primaries for converting to RGB(as defined in Annex E of the ITU-T Specification) */ - NV_ENC_VUI_TRANSFER_CHARACTERISTIC transferCharacteristics; /**< [in]: Specifies the opto-electronic transfer characteristics to use (as defined in Annex E of the ITU-T Specification) */ - NV_ENC_VUI_MATRIX_COEFFS colourMatrix; /**< [in]: Specifies the matrix coefficients used in deriving the luma and chroma from the RGB primaries (as defined in Annex E of the ITU-T Specification). */ - uint32_t chromaSampleLocationFlag; /**< [in]: If set to 1 , it specifies that the chromaSampleLocationTop and chromaSampleLocationBot are present.*/ - uint32_t chromaSampleLocationTop; /**< [in]: Specifies the chroma sample location for top field(as defined in Annex E of the ITU-T Specification) */ - uint32_t chromaSampleLocationBot; /**< [in]: Specifies the chroma sample location for bottom field(as defined in Annex E of the ITU-T Specification) */ - uint32_t bitstreamRestrictionFlag; /**< [in]: If set to 1, it specifies the bitstream restriction parameters are present in the bitstream.*/ - uint32_t timingInfoPresentFlag; /**< [in]: If set to 1, it specifies that the timingInfo is present and the 'numUnitInTicks' and 'timeScale' fields are specified by the application. */ - /**< [in]: If not set, the timingInfo may still be present with timing related fields calculated internally basedon the frame rate specified by the application. */ - uint32_t numUnitInTicks; /**< [in]: Specifies the number of time units of the clock(as defined in Annex E of the ITU-T Specification). */ - uint32_t timeScale; /**< [in]: Specifies the frquency of the clock(as defined in Annex E of the ITU-T Specification). */ - uint32_t reserved[12]; /**< [in]: Reserved and must be set to 0 */ -}NV_ENC_CONFIG_H264_VUI_PARAMETERS; - -typedef NV_ENC_CONFIG_H264_VUI_PARAMETERS NV_ENC_CONFIG_HEVC_VUI_PARAMETERS; - -/** - * \struct _NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE - * External motion vector hint counts per block type. - * H264 and AV1 support multiple hint while HEVC supports one hint for each valid candidate. - */ -typedef struct _NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE -{ - uint32_t numCandsPerBlk16x16 : 4; /**< [in]: Supported for H264, HEVC. It Specifies the number of candidates per 16x16 block. */ - uint32_t numCandsPerBlk16x8 : 4; /**< [in]: Supported for H264 only. Specifies the number of candidates per 16x8 block. */ - uint32_t numCandsPerBlk8x16 : 4; /**< [in]: Supported for H264 only. Specifies the number of candidates per 8x16 block. */ - uint32_t numCandsPerBlk8x8 : 4; /**< [in]: Supported for H264, HEVC. Specifies the number of candidates per 8x8 block. */ - uint32_t numCandsPerSb : 8; /**< [in]: Supported for AV1 only. Specifies the number of candidates per SB. */ - uint32_t reserved : 8; /**< [in]: Reserved for padding. */ - uint32_t reserved1[3]; /**< [in]: Reserved for future use. */ -} NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE; - - -/** - * \struct _NVENC_EXTERNAL_ME_HINT - * External Motion Vector hint structure for H264 and HEVC. - */ -typedef struct _NVENC_EXTERNAL_ME_HINT -{ - int32_t mvx : 12; /**< [in]: Specifies the x component of integer pixel MV (relative to current MB) S12.0. */ - int32_t mvy : 10; /**< [in]: Specifies the y component of integer pixel MV (relative to current MB) S10.0 .*/ - int32_t refidx : 5; /**< [in]: Specifies the reference index (31=invalid). Current we support only 1 reference frame per direction for external hints, so \p refidx must be 0. */ - int32_t dir : 1; /**< [in]: Specifies the direction of motion estimation . 0=L0 1=L1.*/ - int32_t partType : 2; /**< [in]: Specifies the block partition type.0=16x16 1=16x8 2=8x16 3=8x8 (blocks in partition must be consecutive).*/ - int32_t lastofPart : 1; /**< [in]: Set to 1 for the last MV of (sub) partition */ - int32_t lastOfMB : 1; /**< [in]: Set to 1 for the last MV of macroblock. */ -} NVENC_EXTERNAL_ME_HINT; - -/** - * \struct _NVENC_EXTERNAL_ME_SB_HINT - * External Motion Vector SB hint structure for AV1 - */ -typedef struct _NVENC_EXTERNAL_ME_SB_HINT -{ - int16_t refidx : 5; /**< [in]: Specifies the reference index (31=invalid) */ - int16_t direction : 1; /**< [in]: Specifies the direction of motion estimation . 0=L0 1=L1.*/ - int16_t bi : 1; /**< [in]: Specifies reference mode 0=single mv, 1=compound mv */ - int16_t partition_type : 3; /**< [in]: Specifies the partition type: 0: 2NX2N, 1:2NxN, 2:Nx2N. reserved 3bits for future modes */ - int16_t x8 : 3; /**< [in]: Specifies the current partition's top left x position in 8 pixel unit */ - int16_t last_of_cu : 1; /**< [in]: Set to 1 for the last MV current CU */ - int16_t last_of_sb : 1; /**< [in]: Set to 1 for the last MV of current SB */ - int16_t reserved0 : 1; /**< [in]: Reserved and must be set to 0 */ - int16_t mvx : 14; /**< [in]: Specifies the x component of integer pixel MV (relative to current MB) S12.2. */ - int16_t cu_size : 2; /**< [in]: Specifies the CU size: 0: 8x8, 1: 16x16, 2:32x32, 3:64x64 */ - int16_t mvy : 12; /**< [in]: Specifies the y component of integer pixel MV (relative to current MB) S10.2 .*/ - int16_t y8 : 3; /**< [in]: Specifies the current partition's top left y position in 8 pixel unit */ - int16_t reserved1 : 1; /**< [in]: Reserved and must be set to 0 */ -} NVENC_EXTERNAL_ME_SB_HINT; - -/** - * \struct _NV_ENC_CONFIG_H264 - * H264 encoder configuration parameters - */ -typedef struct _NV_ENC_CONFIG_H264 -{ - uint32_t enableTemporalSVC :1; /**< [in]: Set to 1 to enable SVC temporal*/ - uint32_t enableStereoMVC :1; /**< [in]: Set to 1 to enable stereo MVC*/ - uint32_t hierarchicalPFrames :1; /**< [in]: Set to 1 to enable hierarchical P Frames */ - uint32_t hierarchicalBFrames :1; /**< [in]: Set to 1 to enable hierarchical B Frames */ - uint32_t outputBufferingPeriodSEI :1; /**< [in]: Set to 1 to write SEI buffering period syntax in the bitstream */ - uint32_t outputPictureTimingSEI :1; /**< [in]: Set to 1 to write SEI picture timing syntax in the bitstream. */ - uint32_t outputAUD :1; /**< [in]: Set to 1 to write access unit delimiter syntax in bitstream */ - uint32_t disableSPSPPS :1; /**< [in]: Set to 1 to disable writing of Sequence and Picture parameter info in bitstream */ - uint32_t outputFramePackingSEI :1; /**< [in]: Set to 1 to enable writing of frame packing arrangement SEI messages to bitstream */ - uint32_t outputRecoveryPointSEI :1; /**< [in]: Set to 1 to enable writing of recovery point SEI message */ - uint32_t enableIntraRefresh :1; /**< [in]: Set to 1 to enable gradual decoder refresh or intra refresh. If the GOP structure uses B frames this will be ignored */ - uint32_t enableConstrainedEncoding :1; /**< [in]: Set this to 1 to enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices. - Constrained encoding works only with rectangular slices. - Check support for constrained encoding using ::NV_ENC_CAPS_SUPPORT_CONSTRAINED_ENCODING caps. */ - uint32_t repeatSPSPPS :1; /**< [in]: Set to 1 to enable writing of Sequence and Picture parameter for every IDR frame */ - uint32_t enableVFR :1; /**< [in]: Setting enableVFR=1 currently only sets the fixed_frame_rate_flag=0 in the VUI but otherwise - has no impact on the encoder behavior. For more details please refer to E.1 VUI syntax of H.264 standard. Note, however, that NVENC does not support VFR encoding and rate control. */ - uint32_t enableLTR :1; /**< [in]: Set to 1 to enable LTR (Long Term Reference) frame support. LTR can be used in two modes: "LTR Trust" mode and "LTR Per Picture" mode. - LTR Trust mode: In this mode, ltrNumFrames pictures after IDR are automatically marked as LTR. This mode is enabled by setting ltrTrustMode = 1. - Use of LTR Trust mode is strongly discouraged as this mode may be deprecated in future. - LTR Per Picture mode: In this mode, client can control whether the current picture should be marked as LTR. Enable this mode by setting - ltrTrustMode = 0 and ltrMarkFrame = 1 for the picture to be marked as LTR. This is the preferred mode - for using LTR. - Note that LTRs are not supported if encoding session is configured with B-frames */ - uint32_t qpPrimeYZeroTransformBypassFlag :1; /**< [in]: To enable lossless encode set this to 1, set QP to 0 and RC_mode to NV_ENC_PARAMS_RC_CONSTQP and profile to HIGH_444_PREDICTIVE_PROFILE. - Check support for lossless encoding using ::NV_ENC_CAPS_SUPPORT_LOSSLESS_ENCODE caps. */ - uint32_t useConstrainedIntraPred :1; /**< [in]: Set 1 to enable constrained intra prediction. */ - uint32_t enableFillerDataInsertion :1; /**< [in]: Set to 1 to enable insertion of filler data in the bitstream. - This flag will take effect only when CBR rate control mode is in use and both - NV_ENC_INITIALIZE_PARAMS::frameRateNum and - NV_ENC_INITIALIZE_PARAMS::frameRateDen are set to non-zero - values. Setting this field when - NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is also set - is currently not supported and will make ::NvEncInitializeEncoder() - return an error. */ - uint32_t disableSVCPrefixNalu :1; /**< [in]: Set to 1 to disable writing of SVC Prefix NALU preceding each slice in bitstream. - Applicable only when temporal SVC is enabled (NV_ENC_CONFIG_H264::enableTemporalSVC = 1). */ - uint32_t enableScalabilityInfoSEI :1; /**< [in]: Set to 1 to enable writing of Scalability Information SEI message preceding each IDR picture in bitstream - Applicable only when temporal SVC is enabled (NV_ENC_CONFIG_H264::enableTemporalSVC = 1). */ - uint32_t singleSliceIntraRefresh :1; /**< [in]: Set to 1 to maintain single slice in frames during intra refresh. - Check support for single slice intra refresh using ::NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH caps. - This flag will be ignored if the value returned for ::NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH caps is false. */ - uint32_t enableTimeCode :1; /**< [in]: Set to 1 to enable writing of clock timestamp sets in picture timing SEI. Note that this flag will be ignored for D3D12 interface. */ - uint32_t reservedBitFields :10; /**< [in]: Reserved bitfields and must be set to 0 */ - uint32_t level; /**< [in]: Specifies the encoding level. Client is recommended to set this to NV_ENC_LEVEL_AUTOSELECT in order to enable the NvEncodeAPI interface to select the correct level. */ - uint32_t idrPeriod; /**< [in]: Specifies the IDR interval. If not set, this is made equal to gopLength in NV_ENC_CONFIG.Low latency application client can set IDR interval to NVENC_INFINITE_GOPLENGTH so that IDR frames are not inserted automatically. */ - uint32_t separateColourPlaneFlag; /**< [in]: Set to 1 to enable 4:4:4 separate colour planes */ - uint32_t disableDeblockingFilterIDC; /**< [in]: Specifies the deblocking filter mode. Permissible value range: [0,2]. This flag corresponds - to the flag disable_deblocking_filter_idc specified in section 7.4.3 of H.264 specification, - which specifies whether the operation of the deblocking filter shall be disabled across some - block edges of the slice and specifies for which edges the filtering is disabled. See section - 7.4.3 of H.264 specification for more details.*/ - uint32_t numTemporalLayers; /**< [in]: Specifies number of temporal layers to be used for hierarchical coding / temporal SVC. Valid value range is [1,::NV_ENC_CAPS_NUM_MAX_TEMPORAL_LAYERS] */ - uint32_t spsId; /**< [in]: Specifies the SPS id of the sequence header */ - uint32_t ppsId; /**< [in]: Specifies the PPS id of the picture header */ - NV_ENC_H264_ADAPTIVE_TRANSFORM_MODE adaptiveTransformMode; /**< [in]: Specifies the AdaptiveTransform Mode. Check support for AdaptiveTransform mode using ::NV_ENC_CAPS_SUPPORT_ADAPTIVE_TRANSFORM caps. */ - NV_ENC_H264_FMO_MODE fmoMode; /**< [in]: Specified the FMO Mode. Check support for FMO using ::NV_ENC_CAPS_SUPPORT_FMO caps. */ - NV_ENC_H264_BDIRECT_MODE bdirectMode; /**< [in]: Specifies the BDirect mode. Check support for BDirect mode using ::NV_ENC_CAPS_SUPPORT_BDIRECT_MODE caps.*/ - NV_ENC_H264_ENTROPY_CODING_MODE entropyCodingMode; /**< [in]: Specifies the entropy coding mode. Check support for CABAC mode using ::NV_ENC_CAPS_SUPPORT_CABAC caps. */ - NV_ENC_STEREO_PACKING_MODE stereoMode; /**< [in]: Specifies the stereo frame packing mode which is to be signaled in frame packing arrangement SEI */ - uint32_t intraRefreshPeriod; /**< [in]: Specifies the interval between successive intra refresh if enableIntrarefresh is set. Requires enableIntraRefresh to be set. - Will be disabled if NV_ENC_CONFIG::gopLength is not set to NVENC_INFINITE_GOPLENGTH. */ - uint32_t intraRefreshCnt; /**< [in]: Specifies the length of intra refresh in number of frames for periodic intra refresh. This value should be smaller than intraRefreshPeriod */ - uint32_t maxNumRefFrames; /**< [in]: Specifies the DPB size used for encoding. Setting it to 0 will let driver use the default DPB size. - The low latency application which wants to invalidate reference frame as an error resilience tool - is recommended to use a large DPB size so that the encoder can keep old reference frames which can be used if recent - frames are invalidated. */ - uint32_t sliceMode; /**< [in]: This parameter in conjunction with sliceModeData specifies the way in which the picture is divided into slices - sliceMode = 0 MB based slices, sliceMode = 1 Byte based slices, sliceMode = 2 MB row based slices, sliceMode = 3 numSlices in Picture. - When forceIntraRefreshWithFrameCnt is set it will have priority over sliceMode setting - When sliceMode == 0 and sliceModeData == 0 whole picture will be coded with one slice */ - uint32_t sliceModeData; /**< [in]: Specifies the parameter needed for sliceMode. For: - sliceMode = 0, sliceModeData specifies # of MBs in each slice (except last slice) - sliceMode = 1, sliceModeData specifies maximum # of bytes in each slice (except last slice) - sliceMode = 2, sliceModeData specifies # of MB rows in each slice (except last slice) - sliceMode = 3, sliceModeData specifies number of slices in the picture. Driver will divide picture into slices optimally */ - NV_ENC_CONFIG_H264_VUI_PARAMETERS h264VUIParameters; /**< [in]: Specifies the H264 video usability info parameters */ - uint32_t ltrNumFrames; /**< [in]: Specifies the number of LTR frames. This parameter has different meaning in two LTR modes. - In "LTR Trust" mode (ltrTrustMode = 1), encoder will mark the first ltrNumFrames base layer reference frames within each IDR interval as LTR. - In "LTR Per Picture" mode (ltrTrustMode = 0 and ltrMarkFrame = 1), ltrNumFrames specifies maximum number of LTR frames in DPB. */ - uint32_t ltrTrustMode; /**< [in]: Specifies the LTR operating mode. See comments near NV_ENC_CONFIG_H264::enableLTR for description of the two modes. - Set to 1 to use "LTR Trust" mode of LTR operation. Clients are discouraged to use "LTR Trust" mode as this mode may - be deprecated in future releases. - Set to 0 when using "LTR Per Picture" mode of LTR operation. */ - uint32_t chromaFormatIDC; /**< [in]: Specifies the chroma format. Should be set to 1 for yuv420 input, 3 for yuv444 input. - Check support for YUV444 encoding using ::NV_ENC_CAPS_SUPPORT_YUV444_ENCODE caps.*/ - uint32_t maxTemporalLayers; /**< [in]: Specifies the max temporal layer used for temporal SVC / hierarchical coding. - Defaut value of this field is NV_ENC_CAPS::NV_ENC_CAPS_NUM_MAX_TEMPORAL_LAYERS. Note that the value NV_ENC_CONFIG_H264::maxNumRefFrames should - be greater than or equal to (NV_ENC_CONFIG_H264::maxTemporalLayers - 2) * 2, for NV_ENC_CONFIG_H264::maxTemporalLayers >= 2.*/ - NV_ENC_BFRAME_REF_MODE useBFramesAsRef; /**< [in]: Specifies the B-Frame as reference mode. Check support for useBFramesAsRef mode using ::NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE caps.*/ - NV_ENC_NUM_REF_FRAMES numRefL0; /**< [in]: Specifies max number of reference frames in reference picture list L0, that can be used by hardware for prediction of a frame. - Check support for numRefL0 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ - NV_ENC_NUM_REF_FRAMES numRefL1; /**< [in]: Specifies max number of reference frames in reference picture list L1, that can be used by hardware for prediction of a frame. - Check support for numRefL1 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ - - uint32_t reserved1[267]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG_H264; - -/** - * \struct _NV_ENC_CONFIG_HEVC - * HEVC encoder configuration parameters to be set during initialization. - */ -typedef struct _NV_ENC_CONFIG_HEVC -{ - uint32_t level; /**< [in]: Specifies the level of the encoded bitstream.*/ - uint32_t tier; /**< [in]: Specifies the level tier of the encoded bitstream.*/ - NV_ENC_HEVC_CUSIZE minCUSize; /**< [in]: Specifies the minimum size of luma coding unit.*/ - NV_ENC_HEVC_CUSIZE maxCUSize; /**< [in]: Specifies the maximum size of luma coding unit. Currently NVENC SDK only supports maxCUSize equal to NV_ENC_HEVC_CUSIZE_32x32.*/ - uint32_t useConstrainedIntraPred :1; /**< [in]: Set 1 to enable constrained intra prediction. */ - uint32_t disableDeblockAcrossSliceBoundary :1; /**< [in]: Set 1 to disable in loop filtering across slice boundary.*/ - uint32_t outputBufferingPeriodSEI :1; /**< [in]: Set 1 to write SEI buffering period syntax in the bitstream */ - uint32_t outputPictureTimingSEI :1; /**< [in]: Set 1 to write SEI picture timing syntax in the bitstream */ - uint32_t outputAUD :1; /**< [in]: Set 1 to write Access Unit Delimiter syntax. */ - uint32_t enableLTR :1; /**< [in]: Set to 1 to enable LTR (Long Term Reference) frame support. LTR can be used in two modes: "LTR Trust" mode and "LTR Per Picture" mode. - LTR Trust mode: In this mode, ltrNumFrames pictures after IDR are automatically marked as LTR. This mode is enabled by setting ltrTrustMode = 1. - Use of LTR Trust mode is strongly discouraged as this mode may be deprecated in future releases. - LTR Per Picture mode: In this mode, client can control whether the current picture should be marked as LTR. Enable this mode by setting - ltrTrustMode = 0 and ltrMarkFrame = 1 for the picture to be marked as LTR. This is the preferred mode - for using LTR. - Note that LTRs are not supported if encoding session is configured with B-frames */ - uint32_t disableSPSPPS :1; /**< [in]: Set 1 to disable VPS, SPS and PPS signaling in the bitstream. */ - uint32_t repeatSPSPPS :1; /**< [in]: Set 1 to output VPS,SPS and PPS for every IDR frame.*/ - uint32_t enableIntraRefresh :1; /**< [in]: Set 1 to enable gradual decoder refresh or intra refresh. If the GOP structure uses B frames this will be ignored */ - uint32_t chromaFormatIDC :2; /**< [in]: Specifies the chroma format. Should be set to 1 for yuv420 input, 3 for yuv444 input.*/ - uint32_t pixelBitDepthMinus8 :3; /**< [in]: Specifies pixel bit depth minus 8. Should be set to 0 for 8 bit input, 2 for 10 bit input.*/ - uint32_t enableFillerDataInsertion :1; /**< [in]: Set to 1 to enable insertion of filler data in the bitstream. - This flag will take effect only when CBR rate control mode is in use and both - NV_ENC_INITIALIZE_PARAMS::frameRateNum and - NV_ENC_INITIALIZE_PARAMS::frameRateDen are set to non-zero - values. Setting this field when - NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is also set - is currently not supported and will make ::NvEncInitializeEncoder() - return an error. */ - uint32_t enableConstrainedEncoding :1; /**< [in]: Set this to 1 to enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices. - Constrained encoding works only with rectangular slices. - Check support for constrained encoding using ::NV_ENC_CAPS_SUPPORT_CONSTRAINED_ENCODING caps. */ - uint32_t enableAlphaLayerEncoding :1; /**< [in]: Set this to 1 to enable HEVC encode with alpha layer. */ - uint32_t singleSliceIntraRefresh :1; /**< [in]: Set this to 1 to maintain single slice frames during intra refresh. - Check support for single slice intra refresh using ::NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH caps. - This flag will be ignored if the value returned for ::NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH caps is false. */ - uint32_t outputRecoveryPointSEI :1; /**< [in]: Set to 1 to enable writing of recovery point SEI message */ - uint32_t outputTimeCodeSEI :1; /**< [in]: Set 1 to write SEI time code syntax in the bitstream. Note that this flag will be ignored for D3D12 interface.*/ - uint32_t reserved :12; /**< [in]: Reserved bitfields.*/ - uint32_t idrPeriod; /**< [in]: Specifies the IDR interval. If not set, this is made equal to gopLength in NV_ENC_CONFIG. Low latency application client can set IDR interval to NVENC_INFINITE_GOPLENGTH so that IDR frames are not inserted automatically. */ - uint32_t intraRefreshPeriod; /**< [in]: Specifies the interval between successive intra refresh if enableIntrarefresh is set. Requires enableIntraRefresh to be set. - Will be disabled if NV_ENC_CONFIG::gopLength is not set to NVENC_INFINITE_GOPLENGTH. */ - uint32_t intraRefreshCnt; /**< [in]: Specifies the length of intra refresh in number of frames for periodic intra refresh. This value should be smaller than intraRefreshPeriod */ - uint32_t maxNumRefFramesInDPB; /**< [in]: Specifies the maximum number of references frames in the DPB.*/ - uint32_t ltrNumFrames; /**< [in]: This parameter has different meaning in two LTR modes. - In "LTR Trust" mode (ltrTrustMode = 1), encoder will mark the first ltrNumFrames base layer reference frames within each IDR interval as LTR. - In "LTR Per Picture" mode (ltrTrustMode = 0 and ltrMarkFrame = 1), ltrNumFrames specifies maximum number of LTR frames in DPB. - These ltrNumFrames acts as a guidance to the encoder and are not necessarily honored. To achieve a right balance between the encoding - quality and keeping LTR frames in the DPB queue, the encoder can internally limit the number of LTR frames. - The number of LTR frames actually used depends upon the encoding preset being used; Faster encoding presets will use fewer LTR frames.*/ - uint32_t vpsId; /**< [in]: Specifies the VPS id of the video parameter set */ - uint32_t spsId; /**< [in]: Specifies the SPS id of the sequence header */ - uint32_t ppsId; /**< [in]: Specifies the PPS id of the picture header */ - uint32_t sliceMode; /**< [in]: This parameter in conjunction with sliceModeData specifies the way in which the picture is divided into slices - sliceMode = 0 CTU based slices, sliceMode = 1 Byte based slices, sliceMode = 2 CTU row based slices, sliceMode = 3, numSlices in Picture - When sliceMode == 0 and sliceModeData == 0 whole picture will be coded with one slice */ - uint32_t sliceModeData; /**< [in]: Specifies the parameter needed for sliceMode. For: - sliceMode = 0, sliceModeData specifies # of CTUs in each slice (except last slice) - sliceMode = 1, sliceModeData specifies maximum # of bytes in each slice (except last slice) - sliceMode = 2, sliceModeData specifies # of CTU rows in each slice (except last slice) - sliceMode = 3, sliceModeData specifies number of slices in the picture. Driver will divide picture into slices optimally */ - uint32_t maxTemporalLayersMinus1; /**< [in]: Specifies the max temporal layer used for hierarchical coding. */ - NV_ENC_CONFIG_HEVC_VUI_PARAMETERS hevcVUIParameters; /**< [in]: Specifies the HEVC video usability info parameters */ - uint32_t ltrTrustMode; /**< [in]: Specifies the LTR operating mode. See comments near NV_ENC_CONFIG_HEVC::enableLTR for description of the two modes. - Set to 1 to use "LTR Trust" mode of LTR operation. Clients are discouraged to use "LTR Trust" mode as this mode may - be deprecated in future releases. - Set to 0 when using "LTR Per Picture" mode of LTR operation. */ - NV_ENC_BFRAME_REF_MODE useBFramesAsRef; /**< [in]: Specifies the B-Frame as reference mode. Check support for useBFramesAsRef mode using ::NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE caps.*/ - NV_ENC_NUM_REF_FRAMES numRefL0; /**< [in]: Specifies max number of reference frames in reference picture list L0, that can be used by hardware for prediction of a frame. - Check support for numRefL0 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ - NV_ENC_NUM_REF_FRAMES numRefL1; /**< [in]: Specifies max number of reference frames in reference picture list L1, that can be used by hardware for prediction of a frame. - Check support for numRefL1 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ - uint32_t reserved1[214]; /**< [in]: Reserved and must be set to 0.*/ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG_HEVC; - -#define NV_MAX_TILE_COLS_AV1 64 -#define NV_MAX_TILE_ROWS_AV1 64 - -/** - * \struct _NV_ENC_FILM_GRAIN_PARAMS_AV1 - * AV1 Film Grain Parameters structure - */ - -typedef struct _NV_ENC_FILM_GRAIN_PARAMS_AV1 -{ - uint32_t applyGrain :1; /**< [in]: Set to 1 to specify film grain should be added to frame */ - uint32_t chromaScalingFromLuma :1; /**< [in]: Set to 1 to specify the chroma scaling is inferred from luma scaling */ - uint32_t overlapFlag :1; /**< [in]: Set to 1 to indicate that overlap between film grain blocks should be applied*/ - uint32_t clipToRestrictedRange :1; /**< [in]: Set to 1 to clip values to restricted (studio) range after adding film grain */ - uint32_t grainScalingMinus8 :2; /**< [in]: Represents the shift - 8 applied to the values of the chroma component */ - uint32_t arCoeffLag :2; /**< [in]: Specifies the number of auto-regressive coefficients for luma and chroma */ - uint32_t numYPoints :4; /**< [in]: Specifies the number of points for the piecewise linear scaling function of the luma component */ - uint32_t numCbPoints :4; /**< [in]: Specifies the number of points for the piecewise linear scaling function of the cb component */ - uint32_t numCrPoints :4; /**< [in]: Specifies the number of points for the piecewise linear scaling function of the cr component */ - uint32_t arCoeffShiftMinus6 :2; /**< [in]: specifies the range of the auto-regressive coefficients */ - uint32_t grainScaleShift :2; /**< [in]: Specifies how much the Gaussian random numbers should be scaled down during the grain synthesi process */ - uint32_t reserved1 :8; /**< [in]: Reserved bits field - should be set to 0 */ - uint8_t pointYValue[14]; /**< [in]: pointYValue[i]: x coordinate for i-th point of luma piecewise linear scaling function. Values on a scale of 0...255 */ - uint8_t pointYScaling[14]; /**< [in]: pointYScaling[i]: i-th point output value of luma piecewise linear scaling function */ - uint8_t pointCbValue[10]; /**< [in]: pointCbValue[i]: x coordinate for i-th point of cb piecewise linear scaling function. Values on a scale of 0...255 */ - uint8_t pointCbScaling[10]; /**< [in]: pointCbScaling[i]: i-th point output value of cb piecewise linear scaling function */ - uint8_t pointCrValue[10]; /**< [in]: pointCrValue[i]: x coordinate for i-th point of cr piecewise linear scaling function. Values on a scale of 0...255 */ - uint8_t pointCrScaling[10]; /**< [in]: pointCrScaling[i]: i-th point output value of cr piecewise linear scaling function */ - uint8_t arCoeffsYPlus128[24]; /**< [in]: Specifies auto-regressive coefficients used for the Y plane */ - uint8_t arCoeffsCbPlus128[25]; /**< [in]: Specifies auto-regressive coefficients used for the U plane */ - uint8_t arCoeffsCrPlus128[25]; /**< [in]: Specifies auto-regressive coefficients used for the V plane */ - uint8_t reserved2[2]; /**< [in]: Reserved bytes - should be set to 0 */ - uint8_t cbMult; /**< [in]: Represents a multiplier for the cb component used in derivation of the input index to the cb component scaling function */ - uint8_t cbLumaMult; /**< [in]: represents a multiplier for the average luma component used in derivation of the input index to the cb component scaling function. */ - uint16_t cbOffset; /**< [in]: Represents an offset used in derivation of the input index to the cb component scaling function */ - uint8_t crMult; /**< [in]: Represents a multiplier for the cr component used in derivation of the input index to the cr component scaling function */ - uint8_t crLumaMult; /**< [in]: represents a multiplier for the average luma component used in derivation of the input index to the cr component scaling function. */ - uint16_t crOffset; /**< [in]: Represents an offset used in derivation of the input index to the cr component scaling function */ -} NV_ENC_FILM_GRAIN_PARAMS_AV1; - -/** -* \struct _NV_ENC_CONFIG_AV1 -* AV1 encoder configuration parameters to be set during initialization. -*/ -typedef struct _NV_ENC_CONFIG_AV1 -{ - uint32_t level; /**< [in]: Specifies the level of the encoded bitstream.*/ - uint32_t tier; /**< [in]: Specifies the level tier of the encoded bitstream.*/ - NV_ENC_AV1_PART_SIZE minPartSize; /**< [in]: Specifies the minimum size of luma coding block partition.*/ - NV_ENC_AV1_PART_SIZE maxPartSize; /**< [in]: Specifies the maximum size of luma coding block partition.*/ - uint32_t outputAnnexBFormat : 1; /**< [in]: Set 1 to use Annex B format for bitstream output.*/ - uint32_t enableTimingInfo : 1; /**< [in]: Set 1 to write Timing Info into sequence/frame headers */ - uint32_t enableDecoderModelInfo : 1; /**< [in]: Set 1 to write Decoder Model Info into sequence/frame headers */ - uint32_t enableFrameIdNumbers : 1; /**< [in]: Set 1 to write Frame id numbers in bitstream */ - uint32_t disableSeqHdr : 1; /**< [in]: Set 1 to disable Sequence Header signaling in the bitstream. */ - uint32_t repeatSeqHdr : 1; /**< [in]: Set 1 to output Sequence Header for every Key frame.*/ - uint32_t enableIntraRefresh : 1; /**< [in]: Set 1 to enable gradual decoder refresh or intra refresh. If the GOP structure uses B frames this will be ignored */ - uint32_t chromaFormatIDC : 2; /**< [in]: Specifies the chroma format. Should be set to 1 for yuv420 input (yuv444 input currently not supported).*/ - uint32_t enableBitstreamPadding : 1; /**< [in]: Set 1 to enable bitstream padding. */ - uint32_t enableCustomTileConfig : 1; /**< [in]: Set 1 to enable custom tile configuration: numTileColumns and numTileRows must have non zero values and tileWidths and tileHeights must point to a valid address */ - uint32_t enableFilmGrainParams : 1; /**< [in]: Set 1 to enable custom film grain parameters: filmGrainParams must point to a valid address */ - uint32_t inputPixelBitDepthMinus8 : 3; /**< [in]: Specifies pixel bit depth minus 8 of video input. Should be set to 0 for 8 bit input, 2 for 10 bit input.*/ - uint32_t pixelBitDepthMinus8 : 3; /**< [in]: Specifies pixel bit depth minus 8 of encoded video. Should be set to 0 for 8 bit, 2 for 10 bit. - HW will do the bitdepth conversion internally from inputPixelBitDepthMinus8 -> pixelBitDepthMinus8 if bit dpeths differ - Support for 8 bit input to 10 bit encode conversion only */ - uint32_t reserved : 14; /**< [in]: Reserved bitfields.*/ - uint32_t idrPeriod; /**< [in]: Specifies the IDR/Key frame interval. If not set, this is made equal to gopLength in NV_ENC_CONFIG.Low latency application client can set IDR interval to NVENC_INFINITE_GOPLENGTH so that IDR frames are not inserted automatically. */ - uint32_t intraRefreshPeriod; /**< [in]: Specifies the interval between successive intra refresh if enableIntrarefresh is set. Requires enableIntraRefresh to be set. - Will be disabled if NV_ENC_CONFIG::gopLength is not set to NVENC_INFINITE_GOPLENGTH. */ - uint32_t intraRefreshCnt; /**< [in]: Specifies the length of intra refresh in number of frames for periodic intra refresh. This value should be smaller than intraRefreshPeriod */ - uint32_t maxNumRefFramesInDPB; /**< [in]: Specifies the maximum number of references frames in the DPB.*/ - uint32_t numTileColumns; /**< [in]: This parameter in conjunction with the flag enableCustomTileConfig and the array tileWidths[] specifies the way in which the picture is divided into tile columns. - When enableCustomTileConfig == 0, the picture will be uniformly divided into numTileColumns tile columns. If numTileColumns is not a power of 2, - it will be rounded down to the next power of 2 value. If numTileColumns == 0, the picture will be coded with the smallest number of vertical tiles as allowed by standard. - When enableCustomTileConfig == 1, numTileColumns must be > 0 and <= NV_MAX_TILE_COLS_AV1 and tileWidths must point to a valid array of numTileColumns entries. - Entry i specifies the width in 64x64 CTU unit of tile colum i. The sum of all the entries should be equal to the picture width in 64x64 CTU units. */ - uint32_t numTileRows; /**< [in]: This parameter in conjunction with the flag enableCustomTileConfig and the array tileHeights[] specifies the way in which the picture is divided into tiles rows - When enableCustomTileConfig == 0, the picture will be uniformly divided into numTileRows tile rows. If numTileRows is not a power of 2, - it will be rounded down to the next power of 2 value. If numTileRows == 0, the picture will be coded with the smallest number of horizontal tiles as allowed by standard. - When enableCustomTileConfig == 1, numTileRows must be > 0 and <= NV_MAX_TILE_ROWS_AV1 and tileHeights must point to a valid array of numTileRows entries. - Entry i specifies the height in 64x64 CTU unit of tile row i. The sum of all the entries should be equal to the picture hieght in 64x64 CTU units. */ - uint32_t *tileWidths; /**< [in]: If enableCustomTileConfig == 1, tileWidths[i] specifies the width of tile column i in 64x64 CTU unit, with 0 <= i <= numTileColumns -1. */ - uint32_t *tileHeights; /**< [in]: If enableCustomTileConfig == 1, tileHeights[i] specifies the height of tile row i in 64x64 CTU unit, with 0 <= i <= numTileRows -1. */ - uint32_t maxTemporalLayersMinus1; /**< [in]: Specifies the max temporal layer used for hierarchical coding. */ - NV_ENC_VUI_COLOR_PRIMARIES colorPrimaries; /**< [in]: as defined in section of ISO/IEC 23091-4/ITU-T H.273 */ - NV_ENC_VUI_TRANSFER_CHARACTERISTIC transferCharacteristics; /**< [in]: as defined in section of ISO/IEC 23091-4/ITU-T H.273 */ - NV_ENC_VUI_MATRIX_COEFFS matrixCoefficients; /**< [in]: as defined in section of ISO/IEC 23091-4/ITU-T H.273 */ - uint32_t colorRange; /**< [in]: 0: studio swing representation - 1: full swing representation */ - uint32_t chromaSamplePosition; /**< [in]: 0: unknown - 1: Horizontally collocated with luma (0,0) sample, between two vertical samples - 2: Co-located with luma (0,0) sample */ - NV_ENC_BFRAME_REF_MODE useBFramesAsRef; /**< [in]: Specifies the B-Frame as reference mode. Check support for useBFramesAsRef mode using ::NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE caps.*/ - NV_ENC_FILM_GRAIN_PARAMS_AV1 *filmGrainParams; /**< [in]: If enableFilmGrainParams == 1, filmGrainParams must point to a valid NV_ENC_FILM_GRAIN_PARAMS_AV1 structure */ - NV_ENC_NUM_REF_FRAMES numFwdRefs; /**< [in]: Specifies max number of forward reference frame used for prediction of a frame. It must be in range 1-4 (Last, Last2, last3 and Golden). It's a suggestive value not necessarily be honored always. */ - NV_ENC_NUM_REF_FRAMES numBwdRefs; /**< [in]: Specifies max number of L1 list reference frame used for prediction of a frame. It must be in range 1-3 (Backward, Altref2, Altref). It's a suggestive value not necessarily be honored always. */ - uint32_t reserved1[235]; /**< [in]: Reserved and must be set to 0.*/ - void* reserved2[62]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG_AV1; - -/** - * \struct _NV_ENC_CONFIG_H264_MEONLY - * H264 encoder configuration parameters for ME only Mode - * - */ -typedef struct _NV_ENC_CONFIG_H264_MEONLY -{ - uint32_t disablePartition16x16 :1; /**< [in]: Disable Motion Estimation on 16x16 blocks*/ - uint32_t disablePartition8x16 :1; /**< [in]: Disable Motion Estimation on 8x16 blocks*/ - uint32_t disablePartition16x8 :1; /**< [in]: Disable Motion Estimation on 16x8 blocks*/ - uint32_t disablePartition8x8 :1; /**< [in]: Disable Motion Estimation on 8x8 blocks*/ - uint32_t disableIntraSearch :1; /**< [in]: Disable Intra search during Motion Estimation*/ - uint32_t bStereoEnable :1; /**< [in]: Enable Stereo Mode for Motion Estimation where each view is independently executed*/ - uint32_t reserved :26; /**< [in]: Reserved and must be set to 0 */ - uint32_t reserved1 [255]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG_H264_MEONLY; - - -/** - * \struct _NV_ENC_CONFIG_HEVC_MEONLY - * HEVC encoder configuration parameters for ME only Mode - * - */ -typedef struct _NV_ENC_CONFIG_HEVC_MEONLY -{ - uint32_t reserved [256]; /**< [in]: Reserved and must be set to 0 */ - void* reserved1[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG_HEVC_MEONLY; - -/** - * \struct _NV_ENC_CODEC_CONFIG - * Codec-specific encoder configuration parameters to be set during initialization. - */ -typedef union _NV_ENC_CODEC_CONFIG -{ - NV_ENC_CONFIG_H264 h264Config; /**< [in]: Specifies the H.264-specific encoder configuration. */ - NV_ENC_CONFIG_HEVC hevcConfig; /**< [in]: Specifies the HEVC-specific encoder configuration. */ - NV_ENC_CONFIG_AV1 av1Config; /**< [in]: Specifies the AV1-specific encoder configuration. */ - NV_ENC_CONFIG_H264_MEONLY h264MeOnlyConfig; /**< [in]: Specifies the H.264-specific ME only encoder configuration. */ - NV_ENC_CONFIG_HEVC_MEONLY hevcMeOnlyConfig; /**< [in]: Specifies the HEVC-specific ME only encoder configuration. */ - uint32_t reserved[320]; /**< [in]: Reserved and must be set to 0 */ -} NV_ENC_CODEC_CONFIG; - - -/** - * \struct _NV_ENC_CONFIG - * Encoder configuration parameters to be set during initialization. - */ -typedef struct _NV_ENC_CONFIG -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_CONFIG_VER. */ - GUID profileGUID; /**< [in]: Specifies the codec profile GUID. If client specifies \p NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID the NvEncodeAPI interface will select the appropriate codec profile. */ - uint32_t gopLength; /**< [in]: Specifies the number of pictures in one GOP. Low latency application client can set goplength to NVENC_INFINITE_GOPLENGTH so that keyframes are not inserted automatically. */ - int32_t frameIntervalP; /**< [in]: Specifies the GOP pattern as follows: \p frameIntervalP = 0: I, 1: IPP, 2: IBP, 3: IBBP If goplength is set to NVENC_INFINITE_GOPLENGTH \p frameIntervalP should be set to 1. */ - uint32_t monoChromeEncoding; /**< [in]: Set this to 1 to enable monochrome encoding for this session. */ - NV_ENC_PARAMS_FRAME_FIELD_MODE frameFieldMode; /**< [in]: Specifies the frame/field mode. - Check support for field encoding using ::NV_ENC_CAPS_SUPPORT_FIELD_ENCODING caps. - Using a frameFieldMode other than NV_ENC_PARAMS_FRAME_FIELD_MODE_FRAME for RGB input is not supported. */ - NV_ENC_MV_PRECISION mvPrecision; /**< [in]: Specifies the desired motion vector prediction precision. */ - NV_ENC_RC_PARAMS rcParams; /**< [in]: Specifies the rate control parameters for the current encoding session. */ - NV_ENC_CODEC_CONFIG encodeCodecConfig; /**< [in]: Specifies the codec specific config parameters through this union. */ - uint32_t reserved [278]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_CONFIG; - -/** macro for constructing the version field of ::_NV_ENC_CONFIG */ -#define NV_ENC_CONFIG_VER (NVENCAPI_STRUCT_VERSION(8) | ( 1u<<31 )) - -/** - * Tuning information of NVENC encoding (TuningInfo is not applicable to H264 and HEVC MEOnly mode). - */ -typedef enum NV_ENC_TUNING_INFO -{ - NV_ENC_TUNING_INFO_UNDEFINED = 0, /**< Undefined tuningInfo. Invalid value for encoding. */ - NV_ENC_TUNING_INFO_HIGH_QUALITY = 1, /**< Tune presets for latency tolerant encoding.*/ - NV_ENC_TUNING_INFO_LOW_LATENCY = 2, /**< Tune presets for low latency streaming.*/ - NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY = 3, /**< Tune presets for ultra low latency streaming.*/ - NV_ENC_TUNING_INFO_LOSSLESS = 4, /**< Tune presets for lossless encoding.*/ - NV_ENC_TUNING_INFO_COUNT /**< Count number of tuningInfos. Invalid value. */ -}NV_ENC_TUNING_INFO; - -/** - * Split Encoding Modes (Split Encoding is not applicable to H264). - */ -typedef enum _NV_ENC_SPLIT_ENCODE_MODE -{ - NV_ENC_SPLIT_AUTO_MODE = 0, /**< Default value, split frame forced mode disabled, split frame auto mode enabled */ - NV_ENC_SPLIT_AUTO_FORCED_MODE = 1, /**< Split frame forced mode enabled with number of strips automatically selected by driver to best fit configuration */ - NV_ENC_SPLIT_TWO_FORCED_MODE = 2, /**< Forced 2-strip split frame encoding (if NVENC number > 1, 1-strip encode otherwise) */ - NV_ENC_SPLIT_THREE_FORCED_MODE = 3, /**< Forced 3-strip split frame encoding (if NVENC number > 2, NVENC number of strips otherwise) */ - NV_ENC_SPLIT_DISABLE_MODE = 15, /**< Both split frame auto mode and forced mode are disabled */ -} NV_ENC_SPLIT_ENCODE_MODE; - -/** - * \struct _NV_ENC_INITIALIZE_PARAMS - * Encode Session Initialization parameters. - */ -typedef struct _NV_ENC_INITIALIZE_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_INITIALIZE_PARAMS_VER. */ - GUID encodeGUID; /**< [in]: Specifies the Encode GUID for which the encoder is being created. ::NvEncInitializeEncoder() API will fail if this is not set, or set to unsupported value. */ - GUID presetGUID; /**< [in]: Specifies the preset for encoding. If the preset GUID is set then , the preset configuration will be applied before any other parameter. */ - uint32_t encodeWidth; /**< [in]: Specifies the encode width. If not set ::NvEncInitializeEncoder() API will fail. */ - uint32_t encodeHeight; /**< [in]: Specifies the encode height. If not set ::NvEncInitializeEncoder() API will fail. */ - uint32_t darWidth; /**< [in]: Specifies the display aspect ratio width (H264/HEVC) or the render width (AV1). */ - uint32_t darHeight; /**< [in]: Specifies the display aspect ratio height (H264/HEVC) or the render height (AV1). */ - uint32_t frameRateNum; /**< [in]: Specifies the numerator for frame rate used for encoding in frames per second ( Frame rate = frameRateNum / frameRateDen ). */ - uint32_t frameRateDen; /**< [in]: Specifies the denominator for frame rate used for encoding in frames per second ( Frame rate = frameRateNum / frameRateDen ). */ - uint32_t enableEncodeAsync; /**< [in]: Set this to 1 to enable asynchronous mode and is expected to use events to get picture completion notification. */ - uint32_t enablePTD; /**< [in]: Set this to 1 to enable the Picture Type Decision is be taken by the NvEncodeAPI interface. */ - uint32_t reportSliceOffsets :1; /**< [in]: Set this to 1 to enable reporting slice offsets in ::_NV_ENC_LOCK_BITSTREAM. NV_ENC_INITIALIZE_PARAMS::enableEncodeAsync must be set to 0 to use this feature. Client must set this to 0 if NV_ENC_CONFIG_H264::sliceMode is 1 on Kepler GPUs */ - uint32_t enableSubFrameWrite :1; /**< [in]: Set this to 1 to write out available bitstream to memory at subframe intervals. - If enableSubFrameWrite = 1, then the hardware encoder returns data as soon as a slice (H264/HEVC) or tile (AV1) has completed encoding. - This results in better encoding latency, but the downside is that the application has to keep polling via a call to nvEncLockBitstream API continuously to see if any encoded slice/tile data is available. - Use this mode if you feel that the marginal reduction in latency from sub-frame encoding is worth the increase in complexity due to CPU-based polling. */ - uint32_t enableExternalMEHints :1; /**< [in]: Set to 1 to enable external ME hints for the current frame. For NV_ENC_INITIALIZE_PARAMS::enablePTD=1 with B frames, programming L1 hints is optional for B frames since Client doesn't know internal GOP structure. - NV_ENC_PIC_PARAMS::meHintRefPicDist should preferably be set with enablePTD=1. */ - uint32_t enableMEOnlyMode :1; /**< [in]: Set to 1 to enable ME Only Mode .*/ - uint32_t enableWeightedPrediction :1; /**< [in]: Set this to 1 to enable weighted prediction. Not supported if encode session is configured for B-Frames (i.e. NV_ENC_CONFIG::frameIntervalP > 1 or preset >=P3 when tuningInfo = ::NV_ENC_TUNING_INFO_HIGH_QUALITY or - tuningInfo = ::NV_ENC_TUNING_INFO_LOSSLESS. This is because preset >=p3 internally enables B frames when tuningInfo = ::NV_ENC_TUNING_INFO_HIGH_QUALITY or ::NV_ENC_TUNING_INFO_LOSSLESS). */ - uint32_t splitEncodeMode :4; /**< [in]: Split Encoding mode in NVENC (Split Encoding is not applicable to H264). - Not supported if any of the following features: weighted prediction, alpha layer encoding, - subframe mode, output into video memory buffer, picture timing/buffering period SEI message - insertion with DX12 interface are enabled in case of HEVC. - For AV1, split encoding is not supported when output into video memory buffer is enabled. */ - uint32_t enableOutputInVidmem :1; /**< [in]: Set this to 1 to enable output of NVENC in video memory buffer created by application. This feature is not supported for HEVC ME only mode. */ - uint32_t enableReconFrameOutput :1; /**< [in]: Set this to 1 to enable reconstructed frame output. */ - uint32_t enableOutputStats :1; /**< [in]: Set this to 1 to enable encoded frame output stats. Client must allocate buffer of size equal to number of blocks multiplied by the size of - NV_ENC_OUTPUT_STATS_BLOCK struct in system memory and assign to NV_ENC_LOCK_BITSTREAM::encodedOutputStatsPtr to receive the encoded frame output stats.*/ - uint32_t reservedBitFields :20; /**< [in]: Reserved bitfields and must be set to 0 */ - uint32_t privDataSize; /**< [in]: Reserved private data buffer size and must be set to 0 */ - void* privData; /**< [in]: Reserved private data buffer and must be set to NULL */ - NV_ENC_CONFIG* encodeConfig; /**< [in]: Specifies the advanced codec specific structure. If client has sent a valid codec config structure, it will override parameters set by the NV_ENC_INITIALIZE_PARAMS::presetGUID parameter. If set to NULL the NvEncodeAPI interface will use the NV_ENC_INITIALIZE_PARAMS::presetGUID to set the codec specific parameters. - Client can also optionally query the NvEncodeAPI interface to get codec specific parameters for a presetGUID using ::NvEncGetEncodePresetConfigEx() API. It can then modify (if required) some of the codec config parameters and send down a custom config structure as part of ::_NV_ENC_INITIALIZE_PARAMS. - Even in this case client is recommended to pass the same preset guid it has used in ::NvEncGetEncodePresetConfigEx() API to query the config structure; as NV_ENC_INITIALIZE_PARAMS::presetGUID. This will not override the custom config structure but will be used to determine other Encoder HW specific parameters not exposed in the API. */ - uint32_t maxEncodeWidth; /**< [in]: Maximum encode width to be used for current Encode session. - Client should allocate output buffers according to this dimension for dynamic resolution change. If set to 0, Encoder will not allow dynamic resolution change. */ - uint32_t maxEncodeHeight; /**< [in]: Maximum encode height to be allowed for current Encode session. - Client should allocate output buffers according to this dimension for dynamic resolution change. If set to 0, Encode will not allow dynamic resolution change. */ - NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE maxMEHintCountsPerBlock[2]; /**< [in]: If Client wants to pass external motion vectors in NV_ENC_PIC_PARAMS::meExternalHints buffer it must specify the maximum number of hint candidates per block per direction for the encode session. - The NV_ENC_INITIALIZE_PARAMS::maxMEHintCountsPerBlock[0] is for L0 predictors and NV_ENC_INITIALIZE_PARAMS::maxMEHintCountsPerBlock[1] is for L1 predictors. - This client must also set NV_ENC_INITIALIZE_PARAMS::enableExternalMEHints to 1. */ - NV_ENC_TUNING_INFO tuningInfo; /**< [in]: Tuning Info of NVENC encoding(TuningInfo is not applicable to H264 and HEVC meonly mode). */ - NV_ENC_BUFFER_FORMAT bufferFormat; /**< [in]: Input buffer format. Used only when DX12 interface type is used */ - uint32_t numStateBuffers; /**< [in]: Number of state buffers to allocate to save encoder state. Set this to value greater than zero to enable encoding without advancing the encoder state. */ - NV_ENC_OUTPUT_STATS_LEVEL outputStatsLevel; /**< [in]: Specifies the level for encoded frame output stats, when NV_ENC_INITIALIZE_PARAMS::enableOutputStats is set to 1. - Client should allocate buffer of size equal to number of blocks multiplied by the size of NV_ENC_OUTPUT_STATS_BLOCK struct - if NV_ENC_INITIALIZE_PARAMS::outputStatsLevel is set to NV_ENC_OUTPUT_STATS_BLOCK or number of rows multiplied by the size of - NV_ENC_OUTPUT_STATS_ROW struct if NV_ENC_INITIALIZE_PARAMS::outputStatsLevel is set to NV_ENC_OUTPUT_STATS_ROW - in system memory and assign to NV_ENC_LOCK_BITSTREAM::encodedOutputStatsPtr to receive the encoded frame output stats. */ - uint32_t reserved [285]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_INITIALIZE_PARAMS; - -/** macro for constructing the version field of ::_NV_ENC_INITIALIZE_PARAMS */ -#define NV_ENC_INITIALIZE_PARAMS_VER (NVENCAPI_STRUCT_VERSION(6) | ( 1u<<31 )) - - -/** - * \struct _NV_ENC_RECONFIGURE_PARAMS - * Encode Session Reconfigured parameters. - */ -typedef struct _NV_ENC_RECONFIGURE_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_RECONFIGURE_PARAMS_VER. */ - NV_ENC_INITIALIZE_PARAMS reInitEncodeParams; /**< [in]: Encoder session re-initialization parameters. - If reInitEncodeParams.encodeConfig is NULL and - reInitEncodeParams.presetGUID is the same as the preset - GUID specified on the call to NvEncInitializeEncoder(), - EncodeAPI will continue to use the existing encode - configuration. - If reInitEncodeParams.encodeConfig is NULL and - reInitEncodeParams.presetGUID is different from the preset - GUID specified on the call to NvEncInitializeEncoder(), - EncodeAPI will try to use the default configuration for - the preset specified by reInitEncodeParams.presetGUID. - In this case, reconfiguration may fail if the new - configuration is incompatible with the existing - configuration (e.g. the new configuration results in - a change in the GOP structure). */ - uint32_t resetEncoder :1; /**< [in]: This resets the rate control states and other internal encoder states. This should be used only with an IDR frame. - If NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1, encoder will force the frame type to IDR */ - uint32_t forceIDR :1; /**< [in]: Encode the current picture as an IDR picture. This flag is only valid when Picture type decision is taken by the Encoder - [_NV_ENC_INITIALIZE_PARAMS::enablePTD == 1]. */ - uint32_t reserved :30; - -}NV_ENC_RECONFIGURE_PARAMS; - -/** macro for constructing the version field of ::_NV_ENC_RECONFIGURE_PARAMS */ -#define NV_ENC_RECONFIGURE_PARAMS_VER (NVENCAPI_STRUCT_VERSION(1) | ( 1u<<31 )) - -/** - * \struct _NV_ENC_PRESET_CONFIG - * Encoder preset config - */ -typedef struct _NV_ENC_PRESET_CONFIG -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_PRESET_CONFIG_VER. */ - NV_ENC_CONFIG presetCfg; /**< [out]: preset config returned by the Nvidia Video Encoder interface. */ - uint32_t reserved1[255]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -}NV_ENC_PRESET_CONFIG; - -/** macro for constructing the version field of ::_NV_ENC_PRESET_CONFIG */ -#define NV_ENC_PRESET_CONFIG_VER (NVENCAPI_STRUCT_VERSION(4) | ( 1u<<31 )) - - -/** - * \struct _NV_ENC_PIC_PARAMS_MVC - * MVC-specific parameters to be sent on a per-frame basis. - */ -typedef struct _NV_ENC_PIC_PARAMS_MVC -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_PIC_PARAMS_MVC_VER. */ - uint32_t viewID; /**< [in]: Specifies the view ID associated with the current input view. */ - uint32_t temporalID; /**< [in]: Specifies the temporal ID associated with the current input view. */ - uint32_t priorityID; /**< [in]: Specifies the priority ID associated with the current input view. Reserved and ignored by the NvEncodeAPI interface. */ - uint32_t reserved1[12]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[8]; /**< [in]: Reserved and must be set to NULL. */ -}NV_ENC_PIC_PARAMS_MVC; - -/** macro for constructing the version field of ::_NV_ENC_PIC_PARAMS_MVC */ -#define NV_ENC_PIC_PARAMS_MVC_VER NVENCAPI_STRUCT_VERSION(1) - - -/** - * \union _NV_ENC_PIC_PARAMS_H264_EXT - * H264 extension picture parameters - */ -typedef union _NV_ENC_PIC_PARAMS_H264_EXT -{ - NV_ENC_PIC_PARAMS_MVC mvcPicParams; /**< [in]: Specifies the MVC picture parameters. */ - uint32_t reserved1[32]; /**< [in]: Reserved and must be set to 0. */ -}NV_ENC_PIC_PARAMS_H264_EXT; - -/** - * \struct _NV_ENC_SEI_PAYLOAD - * User SEI message - */ -typedef struct _NV_ENC_SEI_PAYLOAD -{ - uint32_t payloadSize; /**< [in] SEI payload size in bytes. SEI payload must be byte aligned, as described in Annex D */ - uint32_t payloadType; /**< [in] SEI payload types and syntax can be found in Annex D of the H.264 Specification. */ - uint8_t *payload; /**< [in] pointer to user data */ -} NV_ENC_SEI_PAYLOAD; - -#define NV_ENC_H264_SEI_PAYLOAD NV_ENC_SEI_PAYLOAD - -/** - * \struct _NV_ENC_PIC_PARAMS_H264 - * H264 specific enc pic params. sent on a per frame basis. - */ -typedef struct _NV_ENC_PIC_PARAMS_H264 -{ - uint32_t displayPOCSyntax; /**< [in]: Specifies the display POC syntax This is required to be set if client is handling the picture type decision. */ - uint32_t reserved3; /**< [in]: Reserved and must be set to 0 */ - uint32_t refPicFlag; /**< [in]: Set to 1 for a reference picture. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t colourPlaneId; /**< [in]: Specifies the colour plane ID associated with the current input. */ - uint32_t forceIntraRefreshWithFrameCnt; /**< [in]: Forces an intra refresh with duration equal to intraRefreshFrameCnt. - When outputRecoveryPointSEI is set this is value is used for recovery_frame_cnt in recovery point SEI message - forceIntraRefreshWithFrameCnt cannot be used if B frames are used in the GOP structure specified */ - uint32_t constrainedFrame :1; /**< [in]: Set to 1 if client wants to encode this frame with each slice completely independent of other slices in the frame. - NV_ENC_INITIALIZE_PARAMS::enableConstrainedEncoding should be set to 1 */ - uint32_t sliceModeDataUpdate :1; /**< [in]: Set to 1 if client wants to change the sliceModeData field to specify new sliceSize Parameter - When forceIntraRefreshWithFrameCnt is set it will have priority over sliceMode setting */ - uint32_t ltrMarkFrame :1; /**< [in]: Set to 1 if client wants to mark this frame as LTR */ - uint32_t ltrUseFrames :1; /**< [in]: Set to 1 if client allows encoding this frame using the LTR frames specified in ltrFrameBitmap */ - uint32_t reservedBitFields :28; /**< [in]: Reserved bit fields and must be set to 0 */ - uint8_t* sliceTypeData; /**< [in]: Deprecated. */ - uint32_t sliceTypeArrayCnt; /**< [in]: Deprecated. */ - uint32_t seiPayloadArrayCnt; /**< [in]: Specifies the number of elements allocated in seiPayloadArray array. */ - NV_ENC_SEI_PAYLOAD* seiPayloadArray; /**< [in]: Array of SEI payloads which will be inserted for this frame. */ - uint32_t sliceMode; /**< [in]: This parameter in conjunction with sliceModeData specifies the way in which the picture is divided into slices - sliceMode = 0 MB based slices, sliceMode = 1 Byte based slices, sliceMode = 2 MB row based slices, sliceMode = 3, numSlices in Picture - When forceIntraRefreshWithFrameCnt is set it will have priority over sliceMode setting - When sliceMode == 0 and sliceModeData == 0 whole picture will be coded with one slice */ - uint32_t sliceModeData; /**< [in]: Specifies the parameter needed for sliceMode. For: - sliceMode = 0, sliceModeData specifies # of MBs in each slice (except last slice) - sliceMode = 1, sliceModeData specifies maximum # of bytes in each slice (except last slice) - sliceMode = 2, sliceModeData specifies # of MB rows in each slice (except last slice) - sliceMode = 3, sliceModeData specifies number of slices in the picture. Driver will divide picture into slices optimally */ - uint32_t ltrMarkFrameIdx; /**< [in]: Specifies the long term referenceframe index to use for marking this frame as LTR.*/ - uint32_t ltrUseFrameBitmap; /**< [in]: Specifies the associated bitmap of LTR frame indices to use when encoding this frame. */ - uint32_t ltrUsageMode; /**< [in]: Not supported. Reserved for future use and must be set to 0. */ - uint32_t forceIntraSliceCount; /**< [in]: Specifies the number of slices to be forced to Intra in the current picture. - This option along with forceIntraSliceIdx[] array needs to be used with sliceMode = 3 only */ - uint32_t *forceIntraSliceIdx; /**< [in]: Slice indices to be forced to intra in the current picture. Each slice index should be <= num_slices_in_picture -1. Index starts from 0 for first slice. - The number of entries in this array should be equal to forceIntraSliceCount */ - NV_ENC_PIC_PARAMS_H264_EXT h264ExtPicParams; /**< [in]: Specifies the H264 extension config parameters using this config. */ - NV_ENC_TIME_CODE timeCode; /**< [in]: Specifies the clock timestamp sets used in picture timing SEI. Applicable only when NV_ENC_CONFIG_H264::enableTimeCode is set to 1. */ - uint32_t reserved [203]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[61]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_PIC_PARAMS_H264; - -/** - * \struct _NV_ENC_PIC_PARAMS_HEVC - * HEVC specific enc pic params. sent on a per frame basis. - */ -typedef struct _NV_ENC_PIC_PARAMS_HEVC -{ - uint32_t displayPOCSyntax; /**< [in]: Specifies the display POC syntax This is required to be set if client is handling the picture type decision. */ - uint32_t refPicFlag; /**< [in]: Set to 1 for a reference picture. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t temporalId; /**< [in]: Specifies the temporal id of the picture */ - uint32_t forceIntraRefreshWithFrameCnt; /**< [in]: Forces an intra refresh with duration equal to intraRefreshFrameCnt. - When outputRecoveryPointSEI is set this is value is used for recovery_frame_cnt in recovery point SEI message - forceIntraRefreshWithFrameCnt cannot be used if B frames are used in the GOP structure specified */ - uint32_t constrainedFrame :1; /**< [in]: Set to 1 if client wants to encode this frame with each slice completely independent of other slices in the frame. - NV_ENC_INITIALIZE_PARAMS::enableConstrainedEncoding should be set to 1 */ - uint32_t sliceModeDataUpdate :1; /**< [in]: Set to 1 if client wants to change the sliceModeData field to specify new sliceSize Parameter - When forceIntraRefreshWithFrameCnt is set it will have priority over sliceMode setting */ - uint32_t ltrMarkFrame :1; /**< [in]: Set to 1 if client wants to mark this frame as LTR */ - uint32_t ltrUseFrames :1; /**< [in]: Set to 1 if client allows encoding this frame using the LTR frames specified in ltrFrameBitmap */ - uint32_t reservedBitFields :28; /**< [in]: Reserved bit fields and must be set to 0 */ - uint8_t* sliceTypeData; /**< [in]: Array which specifies the slice type used to force intra slice for a particular slice. Currently supported only for NV_ENC_CONFIG_H264::sliceMode == 3. - Client should allocate array of size sliceModeData where sliceModeData is specified in field of ::_NV_ENC_CONFIG_H264 - Array element with index n corresponds to nth slice. To force a particular slice to intra client should set corresponding array element to NV_ENC_SLICE_TYPE_I - all other array elements should be set to NV_ENC_SLICE_TYPE_DEFAULT */ - uint32_t sliceTypeArrayCnt; /**< [in]: Client should set this to the number of elements allocated in sliceTypeData array. If sliceTypeData is NULL then this should be set to 0 */ - uint32_t sliceMode; /**< [in]: This parameter in conjunction with sliceModeData specifies the way in which the picture is divided into slices - sliceMode = 0 CTU based slices, sliceMode = 1 Byte based slices, sliceMode = 2 CTU row based slices, sliceMode = 3, numSlices in Picture - When forceIntraRefreshWithFrameCnt is set it will have priority over sliceMode setting - When sliceMode == 0 and sliceModeData == 0 whole picture will be coded with one slice */ - uint32_t sliceModeData; /**< [in]: Specifies the parameter needed for sliceMode. For: - sliceMode = 0, sliceModeData specifies # of CTUs in each slice (except last slice) - sliceMode = 1, sliceModeData specifies maximum # of bytes in each slice (except last slice) - sliceMode = 2, sliceModeData specifies # of CTU rows in each slice (except last slice) - sliceMode = 3, sliceModeData specifies number of slices in the picture. Driver will divide picture into slices optimally */ - uint32_t ltrMarkFrameIdx; /**< [in]: Specifies the long term reference frame index to use for marking this frame as LTR.*/ - uint32_t ltrUseFrameBitmap; /**< [in]: Specifies the associated bitmap of LTR frame indices to use when encoding this frame. */ - uint32_t ltrUsageMode; /**< [in]: Not supported. Reserved for future use and must be set to 0. */ - uint32_t seiPayloadArrayCnt; /**< [in]: Specifies the number of elements allocated in seiPayloadArray array. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0. */ - NV_ENC_SEI_PAYLOAD* seiPayloadArray; /**< [in]: Array of SEI payloads which will be inserted for this frame. */ - NV_ENC_TIME_CODE timeCode; /**< [in]: Specifies the clock timestamp sets used in time code SEI. Applicable only when NV_ENC_CONFIG_HEVC::enableTimeCodeSEI is set to 1. */ - uint32_t reserved2 [237]; /**< [in]: Reserved and must be set to 0. */ - void* reserved3[61]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_PIC_PARAMS_HEVC; - -#define NV_ENC_AV1_OBU_PAYLOAD NV_ENC_SEI_PAYLOAD - -/** -* \struct _NV_ENC_PIC_PARAMS_AV1 -* AV1 specific enc pic params. sent on a per frame basis. -*/ -typedef struct _NV_ENC_PIC_PARAMS_AV1 -{ - uint32_t displayPOCSyntax; /**< [in]: Specifies the display POC syntax This is required to be set if client is handling the picture type decision. */ - uint32_t refPicFlag; /**< [in]: Set to 1 for a reference picture. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t temporalId; /**< [in]: Specifies the temporal id of the picture */ - uint32_t forceIntraRefreshWithFrameCnt; /**< [in]: Forces an intra refresh with duration equal to intraRefreshFrameCnt. - forceIntraRefreshWithFrameCnt cannot be used if B frames are used in the GOP structure specified */ - uint32_t goldenFrameFlag : 1; /**< [in]: Encode frame as Golden Frame. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t arfFrameFlag : 1; /**< [in]: Encode frame as Alternate Reference Frame. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t arf2FrameFlag : 1; /**< [in]: Encode frame as Alternate Reference 2 Frame. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t bwdFrameFlag : 1; /**< [in]: Encode frame as Backward Reference Frame. This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t overlayFrameFlag : 1; /**< [in]: Encode frame as overlay frame. A previously encoded frame with the same displayPOCSyntax value should be present in reference frame buffer. - This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t showExistingFrameFlag : 1; /**< [in]: When ovelayFrameFlag is set to 1, this flag controls the value of the show_existing_frame syntax element associated with the overlay frame. - This flag is added to the interface as a placeholder. Its value is ignored for now and always assumed to be set to 1. - This is ignored if NV_ENC_INITIALIZE_PARAMS::enablePTD is set to 1. */ - uint32_t errorResilientModeFlag : 1; /**< [in]: encode frame independently from previously encoded frames */ - - uint32_t tileConfigUpdate : 1; /**< [in]: Set to 1 if client wants to overwrite the default tile configuration with the tile parameters specified below - When forceIntraRefreshWithFrameCnt is set it will have priority over tileConfigUpdate setting */ - uint32_t enableCustomTileConfig : 1; /**< [in]: Set 1 to enable custom tile configuration: numTileColumns and numTileRows must have non zero values and tileWidths and tileHeights must point to a valid address */ - uint32_t filmGrainParamsUpdate : 1; /**< [in]: Set to 1 if client wants to update previous film grain parameters: filmGrainParams must point to a valid address and encoder must have been configured with film grain enabled */ - uint32_t reservedBitFields : 22; /**< [in]: Reserved bitfields and must be set to 0 */ - uint32_t numTileColumns; /**< [in]: This parameter in conjunction with the flag enableCustomTileConfig and the array tileWidths[] specifies the way in which the picture is divided into tile columns. - When enableCustomTileConfig == 0, the picture will be uniformly divided into numTileColumns tile columns. If numTileColumns is not a power of 2, - it will be rounded down to the next power of 2 value. If numTileColumns == 0, the picture will be coded with the smallest number of vertical tiles as allowed by standard. - When enableCustomTileConfig == 1, numTileColumns must be > 0 and <= NV_MAX_TILE_COLS_AV1 and tileWidths must point to a valid array of numTileColumns entries. - Entry i specifies the width in 64x64 CTU unit of tile colum i. The sum of all the entries should be equal to the picture width in 64x64 CTU units. */ - uint32_t numTileRows; /**< [in]: This parameter in conjunction with the flag enableCustomTileConfig and the array tileHeights[] specifies the way in which the picture is divided into tiles rows - When enableCustomTileConfig == 0, the picture will be uniformly divided into numTileRows tile rows. If numTileRows is not a power of 2, - it will be rounded down to the next power of 2 value. If numTileRows == 0, the picture will be coded with the smallest number of horizontal tiles as allowed by standard. - When enableCustomTileConfig == 1, numTileRows must be > 0 and <= NV_MAX_TILE_ROWS_AV1 and tileHeights must point to a valid array of numTileRows entries. - Entry i specifies the height in 64x64 CTU unit of tile row i. The sum of all the entries should be equal to the picture hieght in 64x64 CTU units. */ - uint32_t *tileWidths; /**< [in]: If enableCustomTileConfig == 1, tileWidths[i] specifies the width of tile column i in 64x64 CTU unit, with 0 <= i <= numTileColumns -1. */ - uint32_t *tileHeights; /**< [in]: If enableCustomTileConfig == 1, tileHeights[i] specifies the height of tile row i in 64x64 CTU unit, with 0 <= i <= numTileRows -1. */ - uint32_t obuPayloadArrayCnt; /**< [in]: Specifies the number of elements allocated in obuPayloadArray array. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0. */ - NV_ENC_AV1_OBU_PAYLOAD* obuPayloadArray; /**< [in]: Array of OBU payloads which will be inserted for this frame. */ - NV_ENC_FILM_GRAIN_PARAMS_AV1 *filmGrainParams; /**< [in]: If filmGrainParamsUpdate == 1, filmGrainParams must point to a valid NV_ENC_FILM_GRAIN_PARAMS_AV1 structure */ - uint32_t reserved2[247]; /**< [in]: Reserved and must be set to 0. */ - void* reserved3[61]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_PIC_PARAMS_AV1; - -/** - * Codec specific per-picture encoding parameters. - */ -typedef union _NV_ENC_CODEC_PIC_PARAMS -{ - NV_ENC_PIC_PARAMS_H264 h264PicParams; /**< [in]: H264 encode picture params. */ - NV_ENC_PIC_PARAMS_HEVC hevcPicParams; /**< [in]: HEVC encode picture params. */ - NV_ENC_PIC_PARAMS_AV1 av1PicParams; /**< [in]: AV1 encode picture params. */ - uint32_t reserved[256]; /**< [in]: Reserved and must be set to 0. */ -} NV_ENC_CODEC_PIC_PARAMS; - - -/** - * \struct _NV_ENC_PIC_PARAMS - * Encoding parameters that need to be sent on a per frame basis. - */ -typedef struct _NV_ENC_PIC_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_PIC_PARAMS_VER. */ - uint32_t inputWidth; /**< [in]: Specifies the input frame width */ - uint32_t inputHeight; /**< [in]: Specifies the input frame height */ - uint32_t inputPitch; /**< [in]: Specifies the input buffer pitch. If pitch value is not known, set this to inputWidth. */ - uint32_t encodePicFlags; /**< [in]: Specifies bit-wise OR of encode picture flags. See ::NV_ENC_PIC_FLAGS enum. */ - uint32_t frameIdx; /**< [in]: Specifies the frame index associated with the input frame [optional]. */ - uint64_t inputTimeStamp; /**< [in]: Specifies opaque data which is associated with the encoded frame, but not actually encoded in the output bitstream. - This opaque data can be used later to uniquely refer to the corresponding encoded frame. For example, it can be used - for identifying the frame to be invalidated in the reference picture buffer, if lost at the client. */ - uint64_t inputDuration; /**< [in]: Specifies duration of the input picture */ - NV_ENC_INPUT_PTR inputBuffer; /**< [in]: Specifies the input buffer pointer. Client must use a pointer obtained from ::NvEncCreateInputBuffer() or ::NvEncMapInputResource() APIs.*/ - NV_ENC_OUTPUT_PTR outputBitstream; /**< [in]: Specifies the output buffer pointer. - If NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is set to 0, specifies the pointer to output buffer. Client should use a pointer obtained from ::NvEncCreateBitstreamBuffer() API. - If NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is set to 1, client should allocate buffer in video memory for NV_ENC_ENCODE_OUT_PARAMS struct and encoded bitstream data. Client - should use a pointer obtained from ::NvEncMapInputResource() API, when mapping this output buffer and assign it to NV_ENC_PIC_PARAMS::outputBitstream. - First 256 bytes of this buffer should be interpreted as NV_ENC_ENCODE_OUT_PARAMS struct followed by encoded bitstream data. Recommended size for output buffer is sum of size of - NV_ENC_ENCODE_OUT_PARAMS struct and twice the input frame size for lower resolution eg. CIF and 1.5 times the input frame size for higher resolutions. If encoded bitstream size is - greater than the allocated buffer size for encoded bitstream, then the output buffer will have encoded bitstream data equal to buffer size. All CUDA operations on this buffer must use - the default stream. */ - void* completionEvent; /**< [in]: Specifies an event to be signaled on completion of encoding of this Frame [only if operating in Asynchronous mode]. Each output buffer should be associated with a distinct event pointer. */ - NV_ENC_BUFFER_FORMAT bufferFmt; /**< [in]: Specifies the input buffer format. */ - NV_ENC_PIC_STRUCT pictureStruct; /**< [in]: Specifies structure of the input picture. */ - NV_ENC_PIC_TYPE pictureType; /**< [in]: Specifies input picture type. Client required to be set explicitly by the client if the client has not set NV_ENC_INITALIZE_PARAMS::enablePTD to 1 while calling NvInitializeEncoder. */ - NV_ENC_CODEC_PIC_PARAMS codecPicParams; /**< [in]: Specifies the codec specific per-picture encoding parameters. */ - NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE meHintCountsPerBlock[2]; /**< [in]: For H264 and Hevc, specifies the number of hint candidates per block per direction for the current frame. meHintCountsPerBlock[0] is for L0 predictors and meHintCountsPerBlock[1] is for L1 predictors. - The candidate count in NV_ENC_PIC_PARAMS::meHintCountsPerBlock[lx] must never exceed NV_ENC_INITIALIZE_PARAMS::maxMEHintCountsPerBlock[lx] provided during encoder initialization. */ - NVENC_EXTERNAL_ME_HINT *meExternalHints; /**< [in]: For H264 and Hevc, Specifies the pointer to ME external hints for the current frame. The size of ME hint buffer should be equal to number of macroblocks * the total number of candidates per macroblock. - The total number of candidates per MB per direction = 1*meHintCountsPerBlock[Lx].numCandsPerBlk16x16 + 2*meHintCountsPerBlock[Lx].numCandsPerBlk16x8 + 2*meHintCountsPerBlock[Lx].numCandsPerBlk8x8 - + 4*meHintCountsPerBlock[Lx].numCandsPerBlk8x8. For frames using bidirectional ME , the total number of candidates for single macroblock is sum of total number of candidates per MB for each direction (L0 and L1) */ - uint32_t reserved1[6]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[2]; /**< [in]: Reserved and must be set to NULL */ - int8_t *qpDeltaMap; /**< [in]: Specifies the pointer to signed byte array containing value per MB for H264, per CTB for HEVC and per SB for AV1 in raster scan order for the current picture, which will be interpreted depending on NV_ENC_RC_PARAMS::qpMapMode. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DELTA, qpDeltaMap specifies QP modifier per MB for H264, per CTB for HEVC and per SB for AV1. This QP modifier will be applied on top of the QP chosen by rate control. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_EMPHASIS, qpDeltaMap specifies Emphasis Level Map per MB for H264. This level value along with QP chosen by rate control is used to - compute the QP modifier, which in turn is applied on top of QP chosen by rate control. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DISABLED, value in qpDeltaMap will be ignored.*/ - uint32_t qpDeltaMapSize; /**< [in]: Specifies the size in bytes of qpDeltaMap surface allocated by client and pointed to by NV_ENC_PIC_PARAMS::qpDeltaMap. Surface (array) should be picWidthInMbs * picHeightInMbs for H264, picWidthInCtbs * picHeightInCtbs for HEVC and - picWidthInSbs * picHeightInSbs for AV1 */ - uint32_t reservedBitFields; /**< [in]: Reserved bitfields and must be set to 0 */ - uint16_t meHintRefPicDist[2]; /**< [in]: Specifies temporal distance for reference picture (NVENC_EXTERNAL_ME_HINT::refidx = 0) used during external ME with NV_ENC_INITALIZE_PARAMS::enablePTD = 1 . meHintRefPicDist[0] is for L0 hints and meHintRefPicDist[1] is for L1 hints. - If not set, will internally infer distance of 1. Ignored for NV_ENC_INITALIZE_PARAMS::enablePTD = 0 */ - NV_ENC_INPUT_PTR alphaBuffer; /**< [in]: Specifies the input alpha buffer pointer. Client must use a pointer obtained from ::NvEncCreateInputBuffer() or ::NvEncMapInputResource() APIs. - Applicable only when encoding hevc with alpha layer is enabled. */ - NVENC_EXTERNAL_ME_SB_HINT *meExternalSbHints; /**< [in]: For AV1,Specifies the pointer to ME external SB hints for the current frame. The size of ME hint buffer should be equal to meSbHintsCount. */ - uint32_t meSbHintsCount; /**< [in]: For AV1, specifies the total number of external ME SB hint candidates for the frame - NV_ENC_PIC_PARAMS::meSbHintsCount must never exceed the total number of SBs in frame * the max number of candidates per SB provided during encoder initialization. - The max number of candidates per SB is maxMeHintCountsPerBlock[0].numCandsPerSb + maxMeHintCountsPerBlock[1].numCandsPerSb */ - uint32_t stateBufferIdx; /**< [in]: Specifies the buffer index in which the encoder state will be saved for current frame encode. It must be in the - range 0 to NV_ENC_INITIALIZE_PARAMS::numStateBuffers - 1. */ - NV_ENC_OUTPUT_PTR outputReconBuffer; /**< [in]: Specifies the reconstructed frame buffer pointer to output reconstructed frame, if enabled by setting NV_ENC_INITIALIZE_PARAMS::enableReconFrameOutput. - Client must allocate buffers for writing the reconstructed frames and register them with the Nvidia Video Encoder Interface with NV_ENC_REGISTER_RESOURCE::bufferUsage - set to NV_ENC_OUTPUT_RECON. - Client must use the pointer obtained from ::NvEncMapInputResource() API and assign it to NV_ENC_PIC_PARAMS::outputReconBuffer. - Reconstructed output will be in NV_ENC_BUFFER_FORMAT_NV12 format when chromaFormatIDC is set to 1. - chromaFormatIDC = 3 is not supported. */ - uint32_t reserved3[284]; /**< [in]: Reserved and must be set to 0 */ - void* reserved4[57]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_PIC_PARAMS; - -/** Macro for constructing the version field of ::_NV_ENC_PIC_PARAMS */ -#define NV_ENC_PIC_PARAMS_VER (NVENCAPI_STRUCT_VERSION(6) | ( 1u<<31 )) - - -/** - * \struct _NV_ENC_MEONLY_PARAMS - * MEOnly parameters that need to be sent on a per motion estimation basis. - * NV_ENC_MEONLY_PARAMS::meExternalHints is supported for H264 only. - */ -typedef struct _NV_ENC_MEONLY_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to NV_ENC_MEONLY_PARAMS_VER.*/ - uint32_t inputWidth; /**< [in]: Specifies the input frame width */ - uint32_t inputHeight; /**< [in]: Specifies the input frame height */ - NV_ENC_INPUT_PTR inputBuffer; /**< [in]: Specifies the input buffer pointer. Client must use a pointer obtained from NvEncCreateInputBuffer() or NvEncMapInputResource() APIs. */ - NV_ENC_INPUT_PTR referenceFrame; /**< [in]: Specifies the reference frame pointer */ - NV_ENC_OUTPUT_PTR mvBuffer; /**< [in]: Specifies the output buffer pointer. - If NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is set to 0, specifies the pointer to motion vector data buffer allocated by NvEncCreateMVBuffer. - Client must lock mvBuffer using ::NvEncLockBitstream() API to get the motion vector data. - If NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is set to 1, client should allocate buffer in video memory for storing the motion vector data. The size of this buffer must - be equal to total number of macroblocks multiplied by size of NV_ENC_H264_MV_DATA struct. Client should use a pointer obtained from ::NvEncMapInputResource() API, when mapping this - output buffer and assign it to NV_ENC_MEONLY_PARAMS::mvBuffer. All CUDA operations on this buffer must use the default stream. */ - NV_ENC_BUFFER_FORMAT bufferFmt; /**< [in]: Specifies the input buffer format. */ - void* completionEvent; /**< [in]: Specifies an event to be signaled on completion of motion estimation - of this Frame [only if operating in Asynchronous mode]. - Each output buffer should be associated with a distinct event pointer. */ - uint32_t viewID; /**< [in]: Specifies left or right viewID if NV_ENC_CONFIG_H264_MEONLY::bStereoEnable is set. - viewID can be 0,1 if bStereoEnable is set, 0 otherwise. */ - NVENC_EXTERNAL_ME_HINT_COUNTS_PER_BLOCKTYPE - meHintCountsPerBlock[2]; /**< [in]: Specifies the number of hint candidates per block for the current frame. meHintCountsPerBlock[0] is for L0 predictors. - The candidate count in NV_ENC_PIC_PARAMS::meHintCountsPerBlock[lx] must never exceed NV_ENC_INITIALIZE_PARAMS::maxMEHintCountsPerBlock[lx] provided during encoder initialization. */ - NVENC_EXTERNAL_ME_HINT *meExternalHints; /**< [in]: Specifies the pointer to ME external hints for the current frame. The size of ME hint buffer should be equal to number of macroblocks * the total number of candidates per macroblock. - The total number of candidates per MB per direction = 1*meHintCountsPerBlock[Lx].numCandsPerBlk16x16 + 2*meHintCountsPerBlock[Lx].numCandsPerBlk16x8 + 2*meHintCountsPerBlock[Lx].numCandsPerBlk8x8 - + 4*meHintCountsPerBlock[Lx].numCandsPerBlk8x8. For frames using bidirectional ME , the total number of candidates for single macroblock is sum of total number of candidates per MB for each direction (L0 and L1) */ - uint32_t reserved1[243]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[59]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_MEONLY_PARAMS; - -/** NV_ENC_MEONLY_PARAMS struct version*/ -#define NV_ENC_MEONLY_PARAMS_VER NVENCAPI_STRUCT_VERSION(3) - - -/** - * \struct _NV_ENC_LOCK_BITSTREAM - * Bitstream buffer lock parameters. - */ -typedef struct _NV_ENC_LOCK_BITSTREAM -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_LOCK_BITSTREAM_VER. */ - uint32_t doNotWait :1; /**< [in]: If this flag is set, the NvEncodeAPI interface will return buffer pointer even if operation is not completed. If not set, the call will block until operation completes. */ - uint32_t ltrFrame :1; /**< [out]: Flag indicating this frame is marked as LTR frame */ - uint32_t getRCStats :1; /**< [in]: If this flag is set then lockBitstream call will add additional intra-inter MB count and average MVX, MVY */ - uint32_t reservedBitFields :29; /**< [in]: Reserved bit fields and must be set to 0 */ - void* outputBitstream; /**< [in]: Pointer to the bitstream buffer being locked. */ - uint32_t* sliceOffsets; /**< [in, out]: Array which receives the slice (H264/HEVC) or tile (AV1) offsets. This is not supported if NV_ENC_CONFIG_H264::sliceMode is 1 on Kepler GPUs. Array size must be equal to size of frame in MBs. */ - uint32_t frameIdx; /**< [out]: Frame no. for which the bitstream is being retrieved. */ - uint32_t hwEncodeStatus; /**< [out]: The NvEncodeAPI interface status for the locked picture. */ - uint32_t numSlices; /**< [out]: Number of slices (H264/HEVC) or tiles (AV1) in the encoded picture. Will be reported only if NV_ENC_INITIALIZE_PARAMS::reportSliceOffsets set to 1. */ - uint32_t bitstreamSizeInBytes; /**< [out]: Actual number of bytes generated and copied to the memory pointed by bitstreamBufferPtr. - When HEVC alpha layer encoding is enabled, this field reports the total encoded size in bytes i.e it is the encoded size of the base plus the alpha layer. - For AV1 when enablePTD is set, this field reports the total encoded size in bytes of all the encoded frames packed into the current output surface i.e. show frame plus all preceding no-show frames */ - uint64_t outputTimeStamp; /**< [out]: Presentation timestamp associated with the encoded output. */ - uint64_t outputDuration; /**< [out]: Presentation duration associates with the encoded output. */ - void* bitstreamBufferPtr; /**< [out]: Pointer to the generated output bitstream. - For MEOnly mode _NV_ENC_LOCK_BITSTREAM::bitstreamBufferPtr should be typecast to - NV_ENC_H264_MV_DATA/NV_ENC_HEVC_MV_DATA pointer respectively for H264/HEVC */ - NV_ENC_PIC_TYPE pictureType; /**< [out]: Picture type of the encoded picture. */ - NV_ENC_PIC_STRUCT pictureStruct; /**< [out]: Structure of the generated output picture. */ - uint32_t frameAvgQP; /**< [out]: Average QP of the frame. */ - uint32_t frameSatd; /**< [out]: Total SATD cost for whole frame. */ - uint32_t ltrFrameIdx; /**< [out]: Frame index associated with this LTR frame. */ - uint32_t ltrFrameBitmap; /**< [out]: Bitmap of LTR frames indices which were used for encoding this frame. Value of 0 if no LTR frames were used. */ - uint32_t temporalId; /**< [out]: TemporalId value of the frame when using temporalSVC encoding */ - uint32_t intraMBCount; /**< [out]: For H264, Number of Intra MBs in the encoded frame. For HEVC, Number of Intra CTBs in the encoded frame. For AV1, Number of Intra SBs in the encoded show frame. Supported only if _NV_ENC_LOCK_BITSTREAM::getRCStats set to 1. */ - uint32_t interMBCount; /**< [out]: For H264, Number of Inter MBs in the encoded frame, includes skip MBs. For HEVC, Number of Inter CTBs in the encoded frame. For AV1, Number of Inter SBs in the encoded show frame. Supported only if _NV_ENC_LOCK_BITSTREAM::getRCStats set to 1. */ - int32_t averageMVX; /**< [out]: Average Motion Vector in X direction for the encoded frame. Supported only if _NV_ENC_LOCK_BITSTREAM::getRCStats set to 1. */ - int32_t averageMVY; /**< [out]: Average Motion Vector in y direction for the encoded frame. Supported only if _NV_ENC_LOCK_BITSTREAM::getRCStats set to 1. */ - uint32_t alphaLayerSizeInBytes; /**< [out]: Number of bytes generated for the alpha layer in the encoded output. Applicable only when HEVC with alpha encoding is enabled. */ - uint32_t outputStatsPtrSize; /**< [in]: Size of the buffer pointed by NV_ENC_LOCK_BITSTREAM::outputStatsPtr. */ - void* outputStatsPtr; /**< [in, out]: Buffer which receives the encoded frame output stats, if NV_ENC_INITIALIZE_PARAMS::enableOutputStats is set to 1. */ - uint32_t frameIdxDisplay; /**< [out]: Frame index in display order */ - uint32_t reserved1[220]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[63]; /**< [in]: Reserved and must be set to NULL */ - uint32_t reservedInternal[8]; /**< [in]: Reserved and must be set to 0 */ -} NV_ENC_LOCK_BITSTREAM; - -#define NV_ENC_LOCK_BITSTREAM_VER (NVENCAPI_STRUCT_VERSION(1) | ( 1u<<31 )) - - -/** - * \struct _NV_ENC_LOCK_INPUT_BUFFER - * Uncompressed Input Buffer lock parameters. - */ -typedef struct _NV_ENC_LOCK_INPUT_BUFFER -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_LOCK_INPUT_BUFFER_VER. */ - uint32_t doNotWait :1; /**< [in]: Set to 1 to make ::NvEncLockInputBuffer() a unblocking call. If the encoding is not completed, driver will return ::NV_ENC_ERR_ENCODER_BUSY error code. */ - uint32_t reservedBitFields :31; /**< [in]: Reserved bitfields and must be set to 0 */ - NV_ENC_INPUT_PTR inputBuffer; /**< [in]: Pointer to the input buffer to be locked, client should pass the pointer obtained from ::NvEncCreateInputBuffer() or ::NvEncMapInputResource API. */ - void* bufferDataPtr; /**< [out]: Pointed to the locked input buffer data. Client can only access input buffer using the \p bufferDataPtr. */ - uint32_t pitch; /**< [out]: Pitch of the locked input buffer. */ - uint32_t reserved1[251]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_LOCK_INPUT_BUFFER; - -/** Macro for constructing the version field of ::_NV_ENC_LOCK_INPUT_BUFFER */ -#define NV_ENC_LOCK_INPUT_BUFFER_VER NVENCAPI_STRUCT_VERSION(1) - - -/** - * \struct _NV_ENC_MAP_INPUT_RESOURCE - * Map an input resource to a Nvidia Encoder Input Buffer - */ -typedef struct _NV_ENC_MAP_INPUT_RESOURCE -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_MAP_INPUT_RESOURCE_VER. */ - uint32_t subResourceIndex; /**< [in]: Deprecated. Do not use. */ - void* inputResource; /**< [in]: Deprecated. Do not use. */ - NV_ENC_REGISTERED_PTR registeredResource; /**< [in]: The Registered resource handle obtained by calling NvEncRegisterInputResource. */ - NV_ENC_INPUT_PTR mappedResource; /**< [out]: Mapped pointer corresponding to the registeredResource. This pointer must be used in NV_ENC_PIC_PARAMS::inputBuffer parameter in ::NvEncEncodePicture() API. */ - NV_ENC_BUFFER_FORMAT mappedBufferFmt; /**< [out]: Buffer format of the outputResource. This buffer format must be used in NV_ENC_PIC_PARAMS::bufferFmt if client using the above mapped resource pointer. */ - uint32_t reserved1[251]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[63]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_MAP_INPUT_RESOURCE; - -/** Macro for constructing the version field of ::_NV_ENC_MAP_INPUT_RESOURCE */ -#define NV_ENC_MAP_INPUT_RESOURCE_VER NVENCAPI_STRUCT_VERSION(4) - -/** - * \struct _NV_ENC_INPUT_RESOURCE_OPENGL_TEX - * NV_ENC_REGISTER_RESOURCE::resourceToRegister must be a pointer to a variable of this type, - * when NV_ENC_REGISTER_RESOURCE::resourceType is NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEX - */ -typedef struct _NV_ENC_INPUT_RESOURCE_OPENGL_TEX -{ - uint32_t texture; /**< [in]: The name of the texture to be used. */ - uint32_t target; /**< [in]: Accepted values are GL_TEXTURE_RECTANGLE and GL_TEXTURE_2D. */ -} NV_ENC_INPUT_RESOURCE_OPENGL_TEX; - -/** \struct NV_ENC_FENCE_POINT_D3D12 -* Fence and fence value for synchronization. -*/ -typedef struct _NV_ENC_FENCE_POINT_D3D12 -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_FENCE_POINT_D3D12_VER. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0. */ - void* pFence; /**< [in]: Pointer to ID3D12Fence. This fence object is used for synchronization. */ - uint64_t waitValue; /**< [in]: Fence value to reach or exceed before the GPU operation. */ - uint64_t signalValue; /**< [in]: Fence value to set the fence to, after the GPU operation. */ - uint32_t bWait:1; /**< [in]: Wait on 'waitValue' if bWait is set to 1, before starting GPU operation. */ - uint32_t bSignal:1; /**< [in]: Signal on 'signalValue' if bSignal is set to 1, after GPU operation is complete. */ - uint32_t reservedBitField:30; /**< [in]: Reserved and must be set to 0. */ - uint32_t reserved1[7]; /**< [in]: Reserved and must be set to 0. */ -} NV_ENC_FENCE_POINT_D3D12; - -#define NV_ENC_FENCE_POINT_D3D12_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * \struct _NV_ENC_INPUT_RESOURCE_D3D12 - * NV_ENC_PIC_PARAMS::inputBuffer and NV_ENC_PIC_PARAMS::alphaBuffer must be a pointer to a struct of this type, - * when D3D12 interface is used - */ -typedef struct _NV_ENC_INPUT_RESOURCE_D3D12 -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_INPUT_RESOURCE_D3D12_VER. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0. */ - NV_ENC_INPUT_PTR pInputBuffer; /**< [in]: Specifies the input surface pointer. Client must use a pointer obtained from NvEncMapInputResource() in NV_ENC_MAP_INPUT_RESOURCE::mappedResource - when mapping the input surface. */ - NV_ENC_FENCE_POINT_D3D12 inputFencePoint; /**< [in]: Specifies the fence and corresponding fence values to do GPU wait and signal. */ - uint32_t reserved1[16]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[16]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_INPUT_RESOURCE_D3D12; - -#define NV_ENC_INPUT_RESOURCE_D3D12_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * \struct _NV_ENC_OUTPUT_RESOURCE_D3D12 - * NV_ENC_PIC_PARAMS::outputBitstream and NV_ENC_LOCK_BITSTREAM::outputBitstream must be a pointer to a struct of this type, - * when D3D12 interface is used - */ -typedef struct _NV_ENC_OUTPUT_RESOURCE_D3D12 -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_OUTPUT_RESOURCE_D3D12_VER. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0. */ - NV_ENC_INPUT_PTR pOutputBuffer; /**< [in]: Specifies the output buffer pointer. Client must use a pointer obtained from NvEncMapInputResource() in NV_ENC_MAP_INPUT_RESOURCE::mappedResource - when mapping output bitstream buffer */ - NV_ENC_FENCE_POINT_D3D12 outputFencePoint; /**< [in]: Specifies the fence and corresponding fence values to do GPU wait and signal.*/ - uint32_t reserved1[16]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[16]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_OUTPUT_RESOURCE_D3D12; - -#define NV_ENC_OUTPUT_RESOURCE_D3D12_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * \struct _NV_ENC_REGISTER_RESOURCE - * Register a resource for future use with the Nvidia Video Encoder Interface. - */ -typedef struct _NV_ENC_REGISTER_RESOURCE -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_REGISTER_RESOURCE_VER. */ - NV_ENC_INPUT_RESOURCE_TYPE resourceType; /**< [in]: Specifies the type of resource to be registered. - Supported values are - ::NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX, - ::NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR, - ::NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEX */ - uint32_t width; /**< [in]: Input frame width. */ - uint32_t height; /**< [in]: Input frame height. */ - uint32_t pitch; /**< [in]: Input buffer pitch. - For ::NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX resources, set this to 0. - For ::NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR resources, set this to - the pitch as obtained from cuMemAllocPitch(), or to the width in - bytes (if this resource was created by using cuMemAlloc()). This - value must be a multiple of 4. - For ::NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY resources, set this to the - width of the allocation in bytes (i.e. - CUDA_ARRAY3D_DESCRIPTOR::Width * CUDA_ARRAY3D_DESCRIPTOR::NumChannels). - For ::NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEX resources, set this to the - texture width multiplied by the number of components in the texture - format. */ - uint32_t subResourceIndex; /**< [in]: Subresource Index of the DirectX resource to be registered. Should be set to 0 for other interfaces. */ - void* resourceToRegister; /**< [in]: Handle to the resource that is being registered. */ - NV_ENC_REGISTERED_PTR registeredResource; /**< [out]: Registered resource handle. This should be used in future interactions with the Nvidia Video Encoder Interface. */ - NV_ENC_BUFFER_FORMAT bufferFormat; /**< [in]: Buffer format of resource to be registered. */ - NV_ENC_BUFFER_USAGE bufferUsage; /**< [in]: Usage of resource to be registered. */ - NV_ENC_FENCE_POINT_D3D12* pInputFencePoint; /**< [in]: Specifies the input fence and corresponding fence values to do GPU wait and signal. - To be used only when NV_ENC_REGISTER_RESOURCE::resourceToRegister represents D3D12 surface and - NV_ENC_BUFFER_USAGE::bufferUsage is NV_ENC_INPUT_IMAGE. - The fence NV_ENC_FENCE_POINT_D3D12::pFence and NV_ENC_FENCE_POINT_D3D12::waitValue will be used to do GPU wait - before starting GPU operation, if NV_ENC_FENCE_POINT_D3D12::bWait is set. - The fence NV_ENC_FENCE_POINT_D3D12::pFence and NV_ENC_FENCE_POINT_D3D12::signalValue will be used to do GPU signal - when GPU operation finishes, if NV_ENC_FENCE_POINT_D3D12::bSignal is set. */ - uint32_t chromaOffset[2]; /**< [out]: Chroma offset for the reconstructed output buffer when NV_ENC_BUFFER_USAGE::bufferUsage is set - to NV_ENC_OUTPUT_RECON and D3D11 interface is used. - When chroma components are interleaved, 'chromaOffset[0]' will contain chroma offset. - chromaOffset[1] is reserved for future use. */ - uint32_t reserved1[245]; /**< [in]: Reserved and must be set to 0. */ - void* reserved2[61]; /**< [in]: Reserved and must be set to NULL. */ -} NV_ENC_REGISTER_RESOURCE; - -/** Macro for constructing the version field of ::_NV_ENC_REGISTER_RESOURCE */ -#define NV_ENC_REGISTER_RESOURCE_VER NVENCAPI_STRUCT_VERSION(4) - -/** - * \struct _NV_ENC_STAT - * Encode Stats structure. - */ -typedef struct _NV_ENC_STAT -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_STAT_VER. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0 */ - NV_ENC_OUTPUT_PTR outputBitStream; /**< [out]: Specifies the pointer to output bitstream. */ - uint32_t bitStreamSize; /**< [out]: Size of generated bitstream in bytes. */ - uint32_t picType; /**< [out]: Picture type of encoded picture. See ::NV_ENC_PIC_TYPE. */ - uint32_t lastValidByteOffset; /**< [out]: Offset of last valid bytes of completed bitstream */ - uint32_t sliceOffsets[16]; /**< [out]: Offsets of each slice */ - uint32_t picIdx; /**< [out]: Picture number */ - uint32_t frameAvgQP; /**< [out]: Average QP of the frame. */ - uint32_t ltrFrame :1; /**< [out]: Flag indicating this frame is marked as LTR frame */ - uint32_t reservedBitFields :31; /**< [in]: Reserved bit fields and must be set to 0 */ - uint32_t ltrFrameIdx; /**< [out]: Frame index associated with this LTR frame. */ - uint32_t intraMBCount; /**< [out]: For H264, Number of Intra MBs in the encoded frame. For HEVC, Number of Intra CTBs in the encoded frame. */ - uint32_t interMBCount; /**< [out]: For H264, Number of Inter MBs in the encoded frame, includes skip MBs. For HEVC, Number of Inter CTBs in the encoded frame. */ - int32_t averageMVX; /**< [out]: Average Motion Vector in X direction for the encoded frame. */ - int32_t averageMVY; /**< [out]: Average Motion Vector in y direction for the encoded frame. */ - uint32_t reserved1[226]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_STAT; - -/** Macro for constructing the version field of ::_NV_ENC_STAT */ -#define NV_ENC_STAT_VER NVENCAPI_STRUCT_VERSION(1) - - -/** - * \struct _NV_ENC_SEQUENCE_PARAM_PAYLOAD - * Sequence and picture paramaters payload. - */ -typedef struct _NV_ENC_SEQUENCE_PARAM_PAYLOAD -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_INITIALIZE_PARAMS_VER. */ - uint32_t inBufferSize; /**< [in]: Specifies the size of the spsppsBuffer provided by the client */ - uint32_t spsId; /**< [in]: Specifies the SPS id to be used in sequence header. Default value is 0. */ - uint32_t ppsId; /**< [in]: Specifies the PPS id to be used in picture header. Default value is 0. */ - void* spsppsBuffer; /**< [in]: Specifies bitstream header pointer of size NV_ENC_SEQUENCE_PARAM_PAYLOAD::inBufferSize. - It is the client's responsibility to manage this memory. */ - uint32_t* outSPSPPSPayloadSize; /**< [out]: Size of the sequence and picture header in bytes. */ - uint32_t reserved [250]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_SEQUENCE_PARAM_PAYLOAD; - -/** Macro for constructing the version field of ::_NV_ENC_SEQUENCE_PARAM_PAYLOAD */ -#define NV_ENC_SEQUENCE_PARAM_PAYLOAD_VER NVENCAPI_STRUCT_VERSION(1) - - -/** - * Event registration/unregistration parameters. - */ -typedef struct _NV_ENC_EVENT_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_EVENT_PARAMS_VER. */ - uint32_t reserved; /**< [in]: Reserved and must be set to 0 */ - void* completionEvent; /**< [in]: Handle to event to be registered/unregistered with the NvEncodeAPI interface. */ - uint32_t reserved1[253]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_EVENT_PARAMS; - -/** Macro for constructing the version field of ::_NV_ENC_EVENT_PARAMS */ -#define NV_ENC_EVENT_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -/** - * Encoder Session Creation parameters - */ -typedef struct _NV_ENC_OPEN_ENCODE_SESSIONEX_PARAMS -{ - uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER. */ - NV_ENC_DEVICE_TYPE deviceType; /**< [in]: Specified the device Type */ - void* device; /**< [in]: Pointer to client device. */ - void* reserved; /**< [in]: Reserved and must be set to 0. */ - uint32_t apiVersion; /**< [in]: API version. Should be set to NVENCAPI_VERSION. */ - uint32_t reserved1[253]; /**< [in]: Reserved and must be set to 0 */ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS; -/** Macro for constructing the version field of ::_NV_ENC_OPEN_ENCODE_SESSIONEX_PARAMS */ -#define NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER NVENCAPI_STRUCT_VERSION(1) - -/** @} */ /* END ENCODER_STRUCTURE */ - - -/** - * \addtogroup ENCODE_FUNC NvEncodeAPI Functions - * @{ - */ - -// NvEncOpenEncodeSession -/** - * \brief Opens an encoding session. - * - * Deprecated. - * - * \return - * ::NV_ENC_ERR_INVALID_CALL\n - * - */ -NVENCSTATUS NVENCAPI NvEncOpenEncodeSession (void* device, uint32_t deviceType, void** encoder); - -// NvEncGetEncodeGuidCount -/** - * \brief Retrieves the number of supported encode GUIDs. - * - * The function returns the number of codec GUIDs supported by the NvEncodeAPI - * interface. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [out] encodeGUIDCount - * Number of supported encode GUIDs. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeGUIDCount (void* encoder, uint32_t* encodeGUIDCount); - - -// NvEncGetEncodeGUIDs -/** - * \brief Retrieves an array of supported encoder codec GUIDs. - * - * The function returns an array of codec GUIDs supported by the NvEncodeAPI interface. - * The client must allocate an array where the NvEncodeAPI interface can - * fill the supported GUIDs and pass the pointer in \p *GUIDs parameter. - * The size of the array can be determined by using ::NvEncGetEncodeGUIDCount() API. - * The Nvidia Encoding interface returns the number of codec GUIDs it has actually - * filled in the GUID array in the \p GUIDCount parameter. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] guidArraySize - * Number of GUIDs to retrieved. Should be set to the number retrieved using - * ::NvEncGetEncodeGUIDCount. - * \param [out] GUIDs - * Array of supported Encode GUIDs. - * \param [out] GUIDCount - * Number of supported Encode GUIDs. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeGUIDs (void* encoder, GUID* GUIDs, uint32_t guidArraySize, uint32_t* GUIDCount); - - -// NvEncGetEncodeProfileGuidCount -/** - * \brief Retrieves the number of supported profile GUIDs. - * - * The function returns the number of profile GUIDs supported for a given codec. - * The client must first enumerate the codec GUIDs supported by the NvEncodeAPI - * interface. After determining the codec GUID, it can query the NvEncodeAPI - * interface to determine the number of profile GUIDs supported for a particular - * codec GUID. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * The codec GUID for which the profile GUIDs are being enumerated. - * \param [out] encodeProfileGUIDCount - * Number of encode profiles supported for the given encodeGUID. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeProfileGUIDCount (void* encoder, GUID encodeGUID, uint32_t* encodeProfileGUIDCount); - - -// NvEncGetEncodeProfileGUIDs -/** - * \brief Retrieves an array of supported encode profile GUIDs. - * - * The function returns an array of supported profile GUIDs for a particular - * codec GUID. The client must allocate an array where the NvEncodeAPI interface - * can populate the profile GUIDs. The client can determine the array size using - * ::NvEncGetEncodeProfileGUIDCount() API. The client must also validiate that the - * NvEncodeAPI interface supports the GUID the client wants to pass as \p encodeGUID - * parameter. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * The encode GUID whose profile GUIDs are being enumerated. - * \param [in] guidArraySize - * Number of GUIDs to be retrieved. Should be set to the number retrieved using - * ::NvEncGetEncodeProfileGUIDCount. - * \param [out] profileGUIDs - * Array of supported Encode Profile GUIDs - * \param [out] GUIDCount - * Number of valid encode profile GUIDs in \p profileGUIDs array. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeProfileGUIDs (void* encoder, GUID encodeGUID, GUID* profileGUIDs, uint32_t guidArraySize, uint32_t* GUIDCount); - -// NvEncGetInputFormatCount -/** - * \brief Retrieve the number of supported Input formats. - * - * The function returns the number of supported input formats. The client must - * query the NvEncodeAPI interface to determine the supported input formats - * before creating the input surfaces. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the number of supported input formats - * is to be retrieved. - * \param [out] inputFmtCount - * Number of input formats supported for specified Encode GUID. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncGetInputFormatCount (void* encoder, GUID encodeGUID, uint32_t* inputFmtCount); - - -// NvEncGetInputFormats -/** - * \brief Retrieves an array of supported Input formats - * - * Returns an array of supported input formats The client must use the input - * format to create input surface using ::NvEncCreateInputBuffer() API. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the number of supported input formats - * is to be retrieved. - *\param [in] inputFmtArraySize - * Size input format count array passed in \p inputFmts. - *\param [out] inputFmts - * Array of input formats supported for this Encode GUID. - *\param [out] inputFmtCount - * The number of valid input format types returned by the NvEncodeAPI - * interface in \p inputFmts array. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetInputFormats (void* encoder, GUID encodeGUID, NV_ENC_BUFFER_FORMAT* inputFmts, uint32_t inputFmtArraySize, uint32_t* inputFmtCount); - - -// NvEncGetEncodeCaps -/** - * \brief Retrieves the capability value for a specified encoder attribute. - * - * The function returns the capability value for a given encoder attribute. The - * client must validate the encodeGUID using ::NvEncGetEncodeGUIDs() API before - * calling this function. The encoder attribute being queried are enumerated in - * ::NV_ENC_CAPS_PARAM enum. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the capability attribute is to be retrieved. - * \param [in] capsParam - * Used to specify attribute being queried. Refer ::NV_ENC_CAPS_PARAM for more - * details. - * \param [out] capsVal - * The value corresponding to the capability attribute being queried. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeCaps (void* encoder, GUID encodeGUID, NV_ENC_CAPS_PARAM* capsParam, int* capsVal); - - -// NvEncGetEncodePresetCount -/** - * \brief Retrieves the number of supported preset GUIDs. - * - * The function returns the number of preset GUIDs available for a given codec. - * The client must validate the codec GUID using ::NvEncGetEncodeGUIDs() API - * before calling this function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the number of supported presets is to - * be retrieved. - * \param [out] encodePresetGUIDCount - * Receives the number of supported preset GUIDs. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodePresetCount (void* encoder, GUID encodeGUID, uint32_t* encodePresetGUIDCount); - - -// NvEncGetEncodePresetGUIDs -/** - * \brief Receives an array of supported encoder preset GUIDs. - * - * The function returns an array of encode preset GUIDs available for a given codec. - * The client can directly use one of the preset GUIDs based upon the use case - * or target device. The preset GUID chosen can be directly used in - * NV_ENC_INITIALIZE_PARAMS::presetGUID parameter to ::NvEncEncodePicture() API. - * Alternately client can also use the preset GUID to retrieve the encoding config - * parameters being used by NvEncodeAPI interface for that given preset, using - * ::NvEncGetEncodePresetConfig() API. It can then modify preset config parameters - * as per its use case and send it to NvEncodeAPI interface as part of - * NV_ENC_INITIALIZE_PARAMS::encodeConfig parameter for NvEncInitializeEncoder() - * API. - * - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the list of supported presets is to be - * retrieved. - * \param [in] guidArraySize - * Size of array of preset GUIDs passed in \p preset GUIDs - * \param [out] presetGUIDs - * Array of supported Encode preset GUIDs from the NvEncodeAPI interface - * to client. - * \param [out] encodePresetGUIDCount - * Receives the number of preset GUIDs returned by the NvEncodeAPI - * interface. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodePresetGUIDs (void* encoder, GUID encodeGUID, GUID* presetGUIDs, uint32_t guidArraySize, uint32_t* encodePresetGUIDCount); - - -// NvEncGetEncodePresetConfig -/** - * \brief Returns a preset config structure supported for given preset GUID. - * - * The function returns a preset config structure for a given preset GUID. - * NvEncGetEncodePresetConfig() API is not applicable to AV1. - * Before using this function the client must enumerate the preset GUIDs available for - * a given codec. The preset config structure can be modified by the client depending - * upon its use case and can be then used to initialize the encoder using - * ::NvEncInitializeEncoder() API. The client can use this function only if it - * wants to modify the NvEncodeAPI preset configuration, otherwise it can - * directly use the preset GUID. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the list of supported presets is to be - * retrieved. - * \param [in] presetGUID - * Preset GUID, corresponding to which the Encoding configurations is to be - * retrieved. - * \param [out] presetConfig - * The requested Preset Encoder Attribute set. Refer ::_NV_ENC_CONFIG for -* more details. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodePresetConfig (void* encoder, GUID encodeGUID, GUID presetGUID, NV_ENC_PRESET_CONFIG* presetConfig); - -// NvEncGetEncodePresetConfigEx -/** - * \brief Returns a preset config structure supported for given preset GUID. - * - * The function returns a preset config structure for a given preset GUID and tuning info. - * NvEncGetEncodePresetConfigEx() API is not applicable to H264 and HEVC meonly mode. - * Before using this function the client must enumerate the preset GUIDs available for - * a given codec. The preset config structure can be modified by the client depending - * upon its use case and can be then used to initialize the encoder using - * ::NvEncInitializeEncoder() API. The client can use this function only if it - * wants to modify the NvEncodeAPI preset configuration, otherwise it can - * directly use the preset GUID. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encodeGUID - * Encode GUID, corresponding to which the list of supported presets is to be - * retrieved. - * \param [in] presetGUID - * Preset GUID, corresponding to which the Encoding configurations is to be - * retrieved. - * \param [in] tuningInfo - * tuning info, corresponding to which the Encoding configurations is to be - * retrieved. - * \param [out] presetConfig - * The requested Preset Encoder Attribute set. Refer ::_NV_ENC_CONFIG for - * more details. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodePresetConfigEx (void* encoder, GUID encodeGUID, GUID presetGUID, NV_ENC_TUNING_INFO tuningInfo, NV_ENC_PRESET_CONFIG* presetConfig); - -// NvEncInitializeEncoder -/** - * \brief Initialize the encoder. - * - * This API must be used to initialize the encoder. The initialization parameter - * is passed using \p *createEncodeParams The client must send the following - * fields of the _NV_ENC_INITIALIZE_PARAMS structure with a valid value. - * - NV_ENC_INITIALIZE_PARAMS::encodeGUID - * - NV_ENC_INITIALIZE_PARAMS::encodeWidth - * - NV_ENC_INITIALIZE_PARAMS::encodeHeight - * - * The client can pass a preset GUID directly to the NvEncodeAPI interface using - * NV_ENC_INITIALIZE_PARAMS::presetGUID field. If the client doesn't pass - * NV_ENC_INITIALIZE_PARAMS::encodeConfig structure, the codec specific parameters - * will be selected based on the preset GUID. The preset GUID must have been - * validated by the client using ::NvEncGetEncodePresetGUIDs() API. - * If the client passes a custom ::_NV_ENC_CONFIG structure through - * NV_ENC_INITIALIZE_PARAMS::encodeConfig , it will override the codec specific parameters - * based on the preset GUID. It is recommended that even if the client passes a custom config, - * it should also send a preset GUID. In this case, the preset GUID passed by the client - * will not override any of the custom config parameters programmed by the client, - * it is only used as a hint by the NvEncodeAPI interface to determine certain encoder parameters - * which are not exposed to the client. - * - * There are two modes of operation for the encoder namely: - * - Asynchronous mode - * - Synchronous mode - * - * The client can select asynchronous or synchronous mode by setting the \p - * enableEncodeAsync field in ::_NV_ENC_INITIALIZE_PARAMS to 1 or 0 respectively. - *\par Asynchronous mode of operation: - * The Asynchronous mode can be enabled by setting NV_ENC_INITIALIZE_PARAMS::enableEncodeAsync to 1. - * The client operating in asynchronous mode must allocate completion event object - * for each output buffer and pass the completion event object in the - * ::NvEncEncodePicture() API. The client can create another thread and wait on - * the event object to be signaled by NvEncodeAPI interface on completion of the - * encoding process for the output frame. This should unblock the main thread from - * submitting work to the encoder. When the event is signaled the client can call - * NvEncodeAPI interfaces to copy the bitstream data using ::NvEncLockBitstream() - * API. This is the preferred mode of operation. - * - * NOTE: Asynchronous mode is not supported on Linux. - * - *\par Synchronous mode of operation: - * The client can select synchronous mode by setting NV_ENC_INITIALIZE_PARAMS::enableEncodeAsync to 0. - * The client working in synchronous mode can work in a single threaded or multi - * threaded mode. The client need not allocate any event objects. The client can - * only lock the bitstream data after NvEncodeAPI interface has returned - * ::NV_ENC_SUCCESS from encode picture. The NvEncodeAPI interface can return - * ::NV_ENC_ERR_NEED_MORE_INPUT error code from ::NvEncEncodePicture() API. The - * client must not lock the output buffer in such case but should send the next - * frame for encoding. The client must keep on calling ::NvEncEncodePicture() API - * until it returns ::NV_ENC_SUCCESS. \n - * The client must always lock the bitstream data in order in which it has submitted. - * This is true for both asynchronous and synchronous mode. - * - *\par Picture type decision: - * If the client is taking the picture type decision and it must disable the picture - * type decision module in NvEncodeAPI by setting NV_ENC_INITIALIZE_PARAMS::enablePTD - * to 0. In this case the client is required to send the picture in encoding - * order to NvEncodeAPI by doing the re-ordering for B frames. \n - * If the client doesn't want to take the picture type decision it can enable - * picture type decision module in the NvEncodeAPI interface by setting - * NV_ENC_INITIALIZE_PARAMS::enablePTD to 1 and send the input pictures in display - * order. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] createEncodeParams - * Refer ::_NV_ENC_INITIALIZE_PARAMS for details. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncInitializeEncoder (void* encoder, NV_ENC_INITIALIZE_PARAMS* createEncodeParams); - - -// NvEncCreateInputBuffer -/** - * \brief Allocates Input buffer. - * - * This function is used to allocate an input buffer. The client must enumerate - * the input buffer format before allocating the input buffer resources. The - * NV_ENC_INPUT_PTR returned by the NvEncodeAPI interface in the - * NV_ENC_CREATE_INPUT_BUFFER::inputBuffer field can be directly used in - * ::NvEncEncodePicture() API. The number of input buffers to be allocated by the - * client must be at least 4 more than the number of B frames being used for encoding. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] createInputBufferParams - * Pointer to the ::NV_ENC_CREATE_INPUT_BUFFER structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncCreateInputBuffer (void* encoder, NV_ENC_CREATE_INPUT_BUFFER* createInputBufferParams); - - -// NvEncDestroyInputBuffer -/** - * \brief Release an input buffers. - * - * This function is used to free an input buffer. If the client has allocated - * any input buffer using ::NvEncCreateInputBuffer() API, it must free those - * input buffers by calling this function. The client must release the input - * buffers before destroying the encoder using ::NvEncDestroyEncoder() API. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] inputBuffer - * Pointer to the input buffer to be released. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncDestroyInputBuffer (void* encoder, NV_ENC_INPUT_PTR inputBuffer); - -// NvEncSetIOCudaStreams -/** - * \brief Set input and output CUDA stream for specified encoder attribute. - * - * Encoding may involve CUDA pre-processing on the input and post-processing on encoded output. - * This function is used to set input and output CUDA streams to pipeline the CUDA pre-processing - * and post-processing tasks. Clients should call this function before the call to - * NvEncUnlockInputBuffer(). If this function is not called, the default CUDA stream is used for - * input and output processing. After a successful call to this function, the streams specified - * in that call will replace the previously-used streams. - * This API is supported for NVCUVID interface only. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] inputStream - * Pointer to CUstream which is used to process ::NV_ENC_PIC_PARAMS::inputFrame for encode. - * In case of ME-only mode, inputStream is used to process ::NV_ENC_MEONLY_PARAMS::inputBuffer and - * ::NV_ENC_MEONLY_PARAMS::referenceFrame - * \param [in] outputStream - * Pointer to CUstream which is used to process ::NV_ENC_PIC_PARAMS::outputBuffer for encode. - * In case of ME-only mode, outputStream is used to process ::NV_ENC_MEONLY_PARAMS::mvBuffer - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncSetIOCudaStreams (void* encoder, NV_ENC_CUSTREAM_PTR inputStream, NV_ENC_CUSTREAM_PTR outputStream); - - -// NvEncCreateBitstreamBuffer -/** - * \brief Allocates an output bitstream buffer - * - * This function is used to allocate an output bitstream buffer and returns a - * NV_ENC_OUTPUT_PTR to bitstream buffer to the client in the - * NV_ENC_CREATE_BITSTREAM_BUFFER::bitstreamBuffer field. - * The client can only call this function after the encoder session has been - * initialized using ::NvEncInitializeEncoder() API. The minimum number of output - * buffers allocated by the client must be at least 4 more than the number of B - * B frames being used for encoding. The client can only access the output - * bitstream data by locking the \p bitstreamBuffer using the ::NvEncLockBitstream() - * function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] createBitstreamBufferParams - * Pointer ::NV_ENC_CREATE_BITSTREAM_BUFFER for details. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncCreateBitstreamBuffer (void* encoder, NV_ENC_CREATE_BITSTREAM_BUFFER* createBitstreamBufferParams); - - -// NvEncDestroyBitstreamBuffer -/** - * \brief Release a bitstream buffer. - * - * This function is used to release the output bitstream buffer allocated using - * the ::NvEncCreateBitstreamBuffer() function. The client must release the output - * bitstreamBuffer using this function before destroying the encoder session. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] bitstreamBuffer - * Pointer to the bitstream buffer being released. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncDestroyBitstreamBuffer (void* encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer); - -// NvEncEncodePicture -/** - * \brief Submit an input picture for encoding. - * - * This function is used to submit an input picture buffer for encoding. The - * encoding parameters are passed using \p *encodePicParams which is a pointer - * to the ::_NV_ENC_PIC_PARAMS structure. - * - * If the client has set NV_ENC_INITIALIZE_PARAMS::enablePTD to 0, then it must - * send a valid value for the following fields. - * - NV_ENC_PIC_PARAMS::pictureType - * - NV_ENC_PIC_PARAMS_H264::displayPOCSyntax (H264 only) - * - NV_ENC_PIC_PARAMS_H264::frameNumSyntax(H264 only) - * - NV_ENC_PIC_PARAMS_H264::refPicFlag(H264 only) - * - *\par MVC Encoding: - * For MVC encoding the client must call encode picture API for each view separately - * and must pass valid view id in NV_ENC_PIC_PARAMS_MVC::viewID field. Currently - * NvEncodeAPI only support stereo MVC so client must send viewID as 0 for base - * view and view ID as 1 for dependent view. - * - *\par Asynchronous Encoding - * If the client has enabled asynchronous mode of encoding by setting - * NV_ENC_INITIALIZE_PARAMS::enableEncodeAsync to 1 in the ::NvEncInitializeEncoder() - * API ,then the client must send a valid NV_ENC_PIC_PARAMS::completionEvent. - * Incase of asynchronous mode of operation, client can queue the ::NvEncEncodePicture() - * API commands from the main thread and then queue output buffers to be processed - * to a secondary worker thread. Before the locking the output buffers in the - * secondary thread , the client must wait on NV_ENC_PIC_PARAMS::completionEvent - * it has queued in ::NvEncEncodePicture() API call. The client must always process - * completion event and the output buffer in the same order in which they have been - * submitted for encoding. The NvEncodeAPI interface is responsible for any - * re-ordering required for B frames and will always ensure that encoded bitstream - * data is written in the same order in which output buffer is submitted. - * The NvEncodeAPI interface may return ::NV_ENC_ERR_NEED_MORE_INPUT error code for - * some ::NvEncEncodePicture() API calls but the client must not treat it as a fatal error. - * The NvEncodeAPI interface might not be able to submit an input picture buffer for encoding - * immediately due to re-ordering for B frames. - *\code - The below example shows how asynchronous encoding in case of 1 B frames - ------------------------------------------------------------------------ - Suppose the client allocated 4 input buffers(I1,I2..), 4 output buffers(O1,O2..) - and 4 completion events(E1, E2, ...). The NvEncodeAPI interface will need to - keep a copy of the input buffers for re-ordering and it allocates following - internal buffers (NvI1, NvI2...). These internal buffers are managed by NvEncodeAPI - and the client is not responsible for the allocating or freeing the memory of - the internal buffers. - - a) The client main thread will queue the following encode frame calls. - Note the picture type is unknown to the client, the decision is being taken by - NvEncodeAPI interface. The client should pass ::_NV_ENC_PIC_PARAMS parameter - consisting of allocated input buffer, output buffer and output events in successive - ::NvEncEncodePicture() API calls along with other required encode picture params. - For example: - 1st EncodePicture parameters - (I1, O1, E1) - 2nd EncodePicture parameters - (I2, O2, E2) - 3rd EncodePicture parameters - (I3, O3, E3) - - b) NvEncodeAPI SW will receive the following encode Commands from the client. - The left side shows input from client in the form (Input buffer, Output Buffer, - Output Event). The right hand side shows a possible picture type decision take by - the NvEncodeAPI interface. - (I1, O1, E1) ---P1 Frame - (I2, O2, E2) ---B2 Frame - (I3, O3, E3) ---P3 Frame - - c) NvEncodeAPI interface will make a copy of the input buffers to its internal - buffers for re-ordering. These copies are done as part of nvEncEncodePicture - function call from the client and NvEncodeAPI interface is responsible for - synchronization of copy operation with the actual encoding operation. - I1 --> NvI1 - I2 --> NvI2 - I3 --> NvI3 - - d) The NvEncodeAPI encodes I1 as P frame and submits I1 to encoder HW and returns ::NV_ENC_SUCCESS. - The NvEncodeAPI tries to encode I2 as B frame and fails with ::NV_ENC_ERR_NEED_MORE_INPUT error code. - The error is not fatal and it notifies client that I2 is not submitted to encoder immediately. - The NvEncodeAPI encodes I3 as P frame and submits I3 for encoding which will be used as backward - reference frame for I2. The NvEncodeAPI then submits I2 for encoding and returns ::NV_ENC_SUCESS. - Both the submission are part of the same ::NvEncEncodePicture() function call. - - e) After returning from ::NvEncEncodePicture() call , the client must queue the output - bitstream processing work to the secondary thread. The output bitstream processing - for asynchronous mode consist of first waiting on completion event(E1, E2..) - and then locking the output bitstream buffer(O1, O2..) for reading the encoded - data. The work queued to the secondary thread by the client is in the following order - (I1, O1, E1) - (I2, O2, E2) - (I3, O3, E3) - Note they are in the same order in which client calls ::NvEncEncodePicture() API - in \p step a). - - f) NvEncodeAPI interface will do the re-ordering such that Encoder HW will receive - the following encode commands: - (NvI1, O1, E1) ---P1 Frame - (NvI3, O2, E2) ---P3 Frame - (NvI2, O3, E3) ---B2 frame - - g) After the encoding operations are completed, the events will be signaled - by NvEncodeAPI interface in the following order : - (O1, E1) ---P1 Frame ,output bitstream copied to O1 and event E1 signaled. - (O2, E2) ---P3 Frame ,output bitstream copied to O2 and event E2 signaled. - (O3, E3) ---B2 Frame ,output bitstream copied to O3 and event E3 signaled. - - h) The client must lock the bitstream data using ::NvEncLockBitstream() API in - the order O1,O2,O3 to read the encoded data, after waiting for the events - to be signaled in the same order i.e E1, E2 and E3.The output processing is - done in the secondary thread in the following order: - Waits on E1, copies encoded bitstream from O1 - Waits on E2, copies encoded bitstream from O2 - Waits on E3, copies encoded bitstream from O3 - - -Note the client will receive the events signaling and output buffer in the - same order in which they have submitted for encoding. - -Note the LockBitstream will have picture type field which will notify the - output picture type to the clients. - -Note the input, output buffer and the output completion event are free to be - reused once NvEncodeAPI interfaced has signaled the event and the client has - copied the data from the output buffer. - - * \endcode - * - *\par Synchronous Encoding - * The client can enable synchronous mode of encoding by setting - * NV_ENC_INITIALIZE_PARAMS::enableEncodeAsync to 0 in ::NvEncInitializeEncoder() API. - * The NvEncodeAPI interface may return ::NV_ENC_ERR_NEED_MORE_INPUT error code for - * some ::NvEncEncodePicture() API calls when NV_ENC_INITIALIZE_PARAMS::enablePTD - * is set to 1, but the client must not treat it as a fatal error. The NvEncodeAPI - * interface might not be able to submit an input picture buffer for encoding - * immediately due to re-ordering for B frames. The NvEncodeAPI interface cannot - * submit the input picture which is decided to be encoded as B frame as it waits - * for backward reference from temporally subsequent frames. This input picture - * is buffered internally and waits for more input picture to arrive. The client - * must not call ::NvEncLockBitstream() API on the output buffers whose - * ::NvEncEncodePicture() API returns ::NV_ENC_ERR_NEED_MORE_INPUT. The client must - * wait for the NvEncodeAPI interface to return ::NV_ENC_SUCCESS before locking the - * output bitstreams to read the encoded bitstream data. The following example - * explains the scenario with synchronous encoding with 2 B frames. - *\code - The below example shows how synchronous encoding works in case of 1 B frames - ----------------------------------------------------------------------------- - Suppose the client allocated 4 input buffers(I1,I2..), 4 output buffers(O1,O2..) - and 4 completion events(E1, E2, ...). The NvEncodeAPI interface will need to - keep a copy of the input buffers for re-ordering and it allocates following - internal buffers (NvI1, NvI2...). These internal buffers are managed by NvEncodeAPI - and the client is not responsible for the allocating or freeing the memory of - the internal buffers. - - The client calls ::NvEncEncodePicture() API with input buffer I1 and output buffer O1. - The NvEncodeAPI decides to encode I1 as P frame and submits it to encoder - HW and returns ::NV_ENC_SUCCESS. - The client can now read the encoded data by locking the output O1 by calling - NvEncLockBitstream API. - - The client calls ::NvEncEncodePicture() API with input buffer I2 and output buffer O2. - The NvEncodeAPI decides to encode I2 as B frame and buffers I2 by copying it - to internal buffer and returns ::NV_ENC_ERR_NEED_MORE_INPUT. - The error is not fatal and it notifies client that it cannot read the encoded - data by locking the output O2 by calling ::NvEncLockBitstream() API without submitting - more work to the NvEncodeAPI interface. - - The client calls ::NvEncEncodePicture() with input buffer I3 and output buffer O3. - The NvEncodeAPI decides to encode I3 as P frame and it first submits I3 for - encoding which will be used as backward reference frame for I2. - The NvEncodeAPI then submits I2 for encoding and returns ::NV_ENC_SUCESS. Both - the submission are part of the same ::NvEncEncodePicture() function call. - The client can now read the encoded data for both the frames by locking the output - O2 followed by O3 ,by calling ::NvEncLockBitstream() API. - - The client must always lock the output in the same order in which it has submitted - to receive the encoded bitstream in correct encoding order. - - * \endcode - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] encodePicParams - * Pointer to the ::_NV_ENC_PIC_PARAMS structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_ENCODER_BUSY \n - * ::NV_ENC_ERR_NEED_MORE_INPUT \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncEncodePicture (void* encoder, NV_ENC_PIC_PARAMS* encodePicParams); - - -// NvEncLockBitstream -/** - * \brief Lock output bitstream buffer - * - * This function is used to lock the bitstream buffer to read the encoded data. - * The client can only access the encoded data by calling this function. - * The pointer to client accessible encoded data is returned in the - * NV_ENC_LOCK_BITSTREAM::bitstreamBufferPtr field. The size of the encoded data - * in the output buffer is returned in the NV_ENC_LOCK_BITSTREAM::bitstreamSizeInBytes - * The NvEncodeAPI interface also returns the output picture type and picture structure - * of the encoded frame in NV_ENC_LOCK_BITSTREAM::pictureType and - * NV_ENC_LOCK_BITSTREAM::pictureStruct fields respectively. If the client has - * set NV_ENC_LOCK_BITSTREAM::doNotWait to 1, the function might return - * ::NV_ENC_ERR_LOCK_BUSY if client is operating in synchronous mode. This is not - * a fatal failure if NV_ENC_LOCK_BITSTREAM::doNotWait is set to 1. In the above case the client can - * retry the function after few milliseconds. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] lockBitstreamBufferParams - * Pointer to the ::_NV_ENC_LOCK_BITSTREAM structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_LOCK_BUSY \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncLockBitstream (void* encoder, NV_ENC_LOCK_BITSTREAM* lockBitstreamBufferParams); - - -// NvEncUnlockBitstream -/** - * \brief Unlock the output bitstream buffer - * - * This function is used to unlock the output bitstream buffer after the client - * has read the encoded data from output buffer. The client must call this function - * to unlock the output buffer which it has previously locked using ::NvEncLockBitstream() - * function. Using a locked bitstream buffer in ::NvEncEncodePicture() API will cause - * the function to fail. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] bitstreamBuffer - * bitstream buffer pointer being unlocked - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncUnlockBitstream (void* encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer); - -// NvEncRestoreEncoderState -/** - * \brief Restore state of encoder - * - * This function is used to restore the state of encoder with state saved internally in - * state buffer corresponding to index equal to 'NV_ENC_RESTORE_ENCODER_STATE_PARAMS::bfrIndex'. - * Client can specify the state type to be updated by specifying appropriate value in - * 'NV_ENC_RESTORE_ENCODER_STATE_PARAMS::state'. The client must call this - * function after all previous encodes have finished. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] restoreState - * Pointer to the ::_NV_ENC_RESTORE_ENCODER_STATE_PARAMS structure - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncRestoreEncoderState (void* encoder, NV_ENC_RESTORE_ENCODER_STATE_PARAMS* restoreState); - -// NvLockInputBuffer -/** - * \brief Locks an input buffer - * - * This function is used to lock the input buffer to load the uncompressed YUV - * pixel data into input buffer memory. The client must pass the NV_ENC_INPUT_PTR - * it had previously allocated using ::NvEncCreateInputBuffer()in the - * NV_ENC_LOCK_INPUT_BUFFER::inputBuffer field. - * The NvEncodeAPI interface returns pointer to client accessible input buffer - * memory in NV_ENC_LOCK_INPUT_BUFFER::bufferDataPtr field. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] lockInputBufferParams - * Pointer to the ::_NV_ENC_LOCK_INPUT_BUFFER structure - * - * \return - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_LOCK_BUSY \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncLockInputBuffer (void* encoder, NV_ENC_LOCK_INPUT_BUFFER* lockInputBufferParams); - - -// NvUnlockInputBuffer -/** - * \brief Unlocks the input buffer - * - * This function is used to unlock the input buffer memory previously locked for - * uploading YUV pixel data. The input buffer must be unlocked before being used - * again for encoding, otherwise NvEncodeAPI will fail the ::NvEncEncodePicture() - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] inputBuffer - * Pointer to the input buffer that is being unlocked. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - * - */ -NVENCSTATUS NVENCAPI NvEncUnlockInputBuffer (void* encoder, NV_ENC_INPUT_PTR inputBuffer); - - -// NvEncGetEncodeStats -/** - * \brief Get encoding statistics. - * - * This function is used to retrieve the encoding statistics. - * This API is not supported when encode device type is CUDA. - * Note that this API will be removed in future Video Codec SDK release. - * Clients should use NvEncLockBitstream() API to retrieve the encoding statistics. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] encodeStats - * Pointer to the ::_NV_ENC_STAT structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetEncodeStats (void* encoder, NV_ENC_STAT* encodeStats); - - -// NvEncGetSequenceParams -/** - * \brief Get encoded sequence and picture header. - * - * This function can be used to retrieve the sequence and picture header out of - * band. The client must call this function only after the encoder has been - * initialized using ::NvEncInitializeEncoder() function. The client must - * allocate the memory where the NvEncodeAPI interface can copy the bitstream - * header and pass the pointer to the memory in NV_ENC_SEQUENCE_PARAM_PAYLOAD::spsppsBuffer. - * The size of buffer is passed in the field NV_ENC_SEQUENCE_PARAM_PAYLOAD::inBufferSize. - * The NvEncodeAPI interface will copy the bitstream header payload and returns - * the actual size of the bitstream header in the field - * NV_ENC_SEQUENCE_PARAM_PAYLOAD::outSPSPPSPayloadSize. - * The client must call ::NvEncGetSequenceParams() function from the same thread which is - * being used to call ::NvEncEncodePicture() function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] sequenceParamPayload - * Pointer to the ::_NV_ENC_SEQUENCE_PARAM_PAYLOAD structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetSequenceParams (void* encoder, NV_ENC_SEQUENCE_PARAM_PAYLOAD* sequenceParamPayload); - -// NvEncGetSequenceParamEx -/** - * \brief Get sequence and picture header. - * - * This function can be used to retrieve the sequence and picture header out of band, even when - * encoder has not been initialized using ::NvEncInitializeEncoder() function. - * The client must allocate the memory where the NvEncodeAPI interface can copy the bitstream - * header and pass the pointer to the memory in NV_ENC_SEQUENCE_PARAM_PAYLOAD::spsppsBuffer. - * The size of buffer is passed in the field NV_ENC_SEQUENCE_PARAM_PAYLOAD::inBufferSize. - * If encoder has not been initialized using ::NvEncInitializeEncoder() function, client must - * send NV_ENC_INITIALIZE_PARAMS as input. The NV_ENC_INITIALIZE_PARAMS passed must be same as the - * one which will be used for initializing encoder using ::NvEncInitializeEncoder() function later. - * If encoder is already initialized using ::NvEncInitializeEncoder() function, the provided - * NV_ENC_INITIALIZE_PARAMS structure is ignored. The NvEncodeAPI interface will copy the bitstream - * header payload and returns the actual size of the bitstream header in the field - * NV_ENC_SEQUENCE_PARAM_PAYLOAD::outSPSPPSPayloadSize. The client must call ::NvEncGetSequenceParamsEx() - * function from the same thread which is being used to call ::NvEncEncodePicture() function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] encInitParams - * Pointer to the _NV_ENC_INITIALIZE_PARAMS structure. - * \param [in,out] sequenceParamPayload - * Pointer to the ::_NV_ENC_SEQUENCE_PARAM_PAYLOAD structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncGetSequenceParamEx (void* encoder, NV_ENC_INITIALIZE_PARAMS* encInitParams, NV_ENC_SEQUENCE_PARAM_PAYLOAD* sequenceParamPayload); - -// NvEncRegisterAsyncEvent -/** - * \brief Register event for notification to encoding completion. - * - * This function is used to register the completion event with NvEncodeAPI - * interface. The event is required when the client has configured the encoder to - * work in asynchronous mode. In this mode the client needs to send a completion - * event with every output buffer. The NvEncodeAPI interface will signal the - * completion of the encoding process using this event. Only after the event is - * signaled the client can get the encoded data using ::NvEncLockBitstream() function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] eventParams - * Pointer to the ::_NV_ENC_EVENT_PARAMS structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncRegisterAsyncEvent (void* encoder, NV_ENC_EVENT_PARAMS* eventParams); - - -// NvEncUnregisterAsyncEvent -/** - * \brief Unregister completion event. - * - * This function is used to unregister completion event which has been previously - * registered using ::NvEncRegisterAsyncEvent() function. The client must unregister - * all events before destroying the encoder using ::NvEncDestroyEncoder() function. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] eventParams - * Pointer to the ::_NV_ENC_EVENT_PARAMS structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncUnregisterAsyncEvent (void* encoder, NV_ENC_EVENT_PARAMS* eventParams); - - -// NvEncMapInputResource -/** - * \brief Map an externally created input resource pointer for encoding. - * - * Maps an externally allocated input resource [using and returns a NV_ENC_INPUT_PTR - * which can be used for encoding in the ::NvEncEncodePicture() function. The - * mapped resource is returned in the field NV_ENC_MAP_INPUT_RESOURCE::outputResourcePtr. - * The NvEncodeAPI interface also returns the buffer format of the mapped resource - * in the field NV_ENC_MAP_INPUT_RESOURCE::outbufferFmt. - * This function provides synchronization guarantee that any graphics work submitted - * on the input buffer is completed before the buffer is used for encoding. This is - * also true for compute (i.e. CUDA) work, provided that the previous workload using - * the input resource was submitted to the default stream. - * The client should not access any input buffer while they are mapped by the encoder. - * For D3D12 interface type, this function does not provide synchronization guarantee. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] mapInputResParams - * Pointer to the ::_NV_ENC_MAP_INPUT_RESOURCE structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_RESOURCE_NOT_REGISTERED \n - * ::NV_ENC_ERR_MAP_FAILED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncMapInputResource (void* encoder, NV_ENC_MAP_INPUT_RESOURCE* mapInputResParams); - - -// NvEncUnmapInputResource -/** - * \brief UnMaps a NV_ENC_INPUT_PTR which was mapped for encoding - * - * - * UnMaps an input buffer which was previously mapped using ::NvEncMapInputResource() - * API. The mapping created using ::NvEncMapInputResource() should be invalidated - * using this API before the external resource is destroyed by the client. The client - * must unmap the buffer after ::NvEncLockBitstream() API returns successfully for encode - * work submitted using the mapped input buffer. - * - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] mappedInputBuffer - * Pointer to the NV_ENC_INPUT_PTR - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_RESOURCE_NOT_REGISTERED \n - * ::NV_ENC_ERR_RESOURCE_NOT_MAPPED \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncUnmapInputResource (void* encoder, NV_ENC_INPUT_PTR mappedInputBuffer); - -// NvEncDestroyEncoder -/** - * \brief Destroy Encoding Session - * - * Destroys the encoder session previously created using ::NvEncOpenEncodeSession() - * function. The client must flush the encoder before freeing any resources. In order - * to flush the encoder the client must pass a NULL encode picture packet and either - * wait for the ::NvEncEncodePicture() function to return in synchronous mode or wait - * for the flush event to be signaled by the encoder in asynchronous mode. - * The client must free all the input and output resources created using the - * NvEncodeAPI interface before destroying the encoder. If the client is operating - * in asynchronous mode, it must also unregister the completion events previously - * registered. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncDestroyEncoder (void* encoder); - -// NvEncInvalidateRefFrames -/** - * \brief Invalidate reference frames - * - * Invalidates reference frame based on the time stamp provided by the client. - * The encoder marks any reference frames or any frames which have been reconstructed - * using the corrupt frame as invalid for motion estimation and uses older reference - * frames for motion estimation. The encoder forces the current frame to be encoded - * as an intra frame if no reference frames are left after invalidation process. - * This is useful for low latency application for error resiliency. The client - * is recommended to set NV_ENC_CONFIG_H264::maxNumRefFrames to a large value so - * that encoder can keep a backup of older reference frames in the DPB and can use them - * for motion estimation when the newer reference frames have been invalidated. - * This API can be called multiple times. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] invalidRefFrameTimeStamp - * Timestamp of the invalid reference frames which needs to be invalidated. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncInvalidateRefFrames(void* encoder, uint64_t invalidRefFrameTimeStamp); - -// NvEncOpenEncodeSessionEx -/** - * \brief Opens an encoding session. - * - * Opens an encoding session and returns a pointer to the encoder interface in - * the \p **encoder parameter. The client should start encoding process by calling - * this API first. - * The client must pass a pointer to IDirect3DDevice9 device or CUDA context in the \p *device parameter. - * For the OpenGL interface, \p device must be NULL. An OpenGL context must be current when - * calling all NvEncodeAPI functions. - * If the creation of encoder session fails, the client must call ::NvEncDestroyEncoder API - * before exiting. - * - * \param [in] openSessionExParams - * Pointer to a ::NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS structure. - * \param [out] encoder - * Encode Session pointer to the NvEncodeAPI interface. - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_NO_ENCODE_DEVICE \n - * ::NV_ENC_ERR_UNSUPPORTED_DEVICE \n - * ::NV_ENC_ERR_INVALID_DEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncOpenEncodeSessionEx (NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS *openSessionExParams, void** encoder); - -// NvEncRegisterResource -/** - * \brief Registers a resource with the Nvidia Video Encoder Interface. - * - * Registers a resource with the Nvidia Video Encoder Interface for book keeping. - * The client is expected to pass the registered resource handle as well, while calling ::NvEncMapInputResource API. - * - * \param [in] encoder - * Pointer to the NVEncodeAPI interface. - * - * \param [in] registerResParams - * Pointer to a ::_NV_ENC_REGISTER_RESOURCE structure - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_RESOURCE_REGISTER_FAILED \n - * ::NV_ENC_ERR_GENERIC \n - * ::NV_ENC_ERR_UNIMPLEMENTED \n - * - */ -NVENCSTATUS NVENCAPI NvEncRegisterResource (void* encoder, NV_ENC_REGISTER_RESOURCE* registerResParams); - -// NvEncUnregisterResource -/** - * \brief Unregisters a resource previously registered with the Nvidia Video Encoder Interface. - * - * Unregisters a resource previously registered with the Nvidia Video Encoder Interface. - * The client is expected to unregister any resource that it has registered with the - * Nvidia Video Encoder Interface before destroying the resource. - * - * \param [in] encoder - * Pointer to the NVEncodeAPI interface. - * - * \param [in] registeredResource - * The registered resource pointer that was returned in ::NvEncRegisterResource. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_RESOURCE_NOT_REGISTERED \n - * ::NV_ENC_ERR_GENERIC \n - * ::NV_ENC_ERR_UNIMPLEMENTED \n - * - */ -NVENCSTATUS NVENCAPI NvEncUnregisterResource (void* encoder, NV_ENC_REGISTERED_PTR registeredResource); - -// NvEncReconfigureEncoder -/** - * \brief Reconfigure an existing encoding session. - * - * Reconfigure an existing encoding session. - * The client should call this API to change/reconfigure the parameter passed during - * NvEncInitializeEncoder API call. - * Currently Reconfiguration of following are not supported. - * Change in GOP structure. - * Change in sync-Async mode. - * Change in MaxWidth & MaxHeight. - * Change in PTD mode. - * - * Resolution change is possible only if maxEncodeWidth & maxEncodeHeight of NV_ENC_INITIALIZE_PARAMS - * is set while creating encoder session. - * - * \param [in] encoder - * Pointer to the NVEncodeAPI interface. - * - * \param [in] reInitEncodeParams - * Pointer to a ::NV_ENC_RECONFIGURE_PARAMS structure. - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_NO_ENCODE_DEVICE \n - * ::NV_ENC_ERR_UNSUPPORTED_DEVICE \n - * ::NV_ENC_ERR_INVALID_DEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_GENERIC \n - * - */ -NVENCSTATUS NVENCAPI NvEncReconfigureEncoder (void *encoder, NV_ENC_RECONFIGURE_PARAMS* reInitEncodeParams); - - - -// NvEncCreateMVBuffer -/** - * \brief Allocates output MV buffer for ME only mode. - * - * This function is used to allocate an output MV buffer. The size of the mvBuffer is - * dependent on the frame height and width of the last ::NvEncCreateInputBuffer() call. - * The NV_ENC_OUTPUT_PTR returned by the NvEncodeAPI interface in the - * ::NV_ENC_CREATE_MV_BUFFER::mvBuffer field should be used in - * ::NvEncRunMotionEstimationOnly() API. - * Client must lock ::NV_ENC_CREATE_MV_BUFFER::mvBuffer using ::NvEncLockBitstream() API to get the motion vector data. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in,out] createMVBufferParams - * Pointer to the ::NV_ENC_CREATE_MV_BUFFER structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncCreateMVBuffer (void* encoder, NV_ENC_CREATE_MV_BUFFER* createMVBufferParams); - - -// NvEncDestroyMVBuffer -/** - * \brief Release an output MV buffer for ME only mode. - * - * This function is used to release the output MV buffer allocated using - * the ::NvEncCreateMVBuffer() function. The client must release the output - * mvBuffer using this function before destroying the encoder session. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] mvBuffer - * Pointer to the mvBuffer being released. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncDestroyMVBuffer (void* encoder, NV_ENC_OUTPUT_PTR mvBuffer); - - -// NvEncRunMotionEstimationOnly -/** - * \brief Submit an input picture and reference frame for motion estimation in ME only mode. - * - * This function is used to submit the input frame and reference frame for motion - * estimation. The ME parameters are passed using *meOnlyParams which is a pointer - * to ::_NV_ENC_MEONLY_PARAMS structure. - * Client must lock ::NV_ENC_CREATE_MV_BUFFER::mvBuffer using ::NvEncLockBitstream() API to get the motion vector data. - * to get motion vector data. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] meOnlyParams - * Pointer to the ::_NV_ENC_MEONLY_PARAMS structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - * ::NV_ENC_ERR_NEED_MORE_INPUT \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - */ -NVENCSTATUS NVENCAPI NvEncRunMotionEstimationOnly (void* encoder, NV_ENC_MEONLY_PARAMS* meOnlyParams); - -// NvEncodeAPIGetMaxSupportedVersion -/** - * \brief Get the largest NvEncodeAPI version supported by the driver. - * - * This function can be used by clients to determine if the driver supports - * the NvEncodeAPI header the application was compiled with. - * - * \param [out] version - * Pointer to the requested value. The 4 least significant bits in the returned - * indicate the minor version and the rest of the bits indicate the major - * version of the largest supported version. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_ERR_INVALID_PTR \n - */ -NVENCSTATUS NVENCAPI NvEncodeAPIGetMaxSupportedVersion (uint32_t* version); - - -// NvEncGetLastErrorString -/** - * \brief Get the description of the last error reported by the API. - * - * This function returns a null-terminated string that can be used by clients to better understand the reason - * for failure of a previous API call. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * - * \return - * Pointer to buffer containing the details of the last error encountered by the API. - */ -const char * NVENCAPI NvEncGetLastErrorString (void* encoder); - -// NvEncLookaheadPicture -/** - * \brief Submit an input picture for lookahead. - * - * This function can be used by clients to submit input frame for lookahead. Client could call this function - * NV_ENC_INITIALIZE_PARAMS::lookaheadDepth plus one number of frames, before calling NvEncEncodePicture() for the first frame. - * - * \param [in] encoder - * Pointer to the NvEncodeAPI interface. - * \param [in] lookaheadParams - * Pointer to the ::_NV_ENC_LOOKAHEAD_PIC_PARAMS structure. - * - * \return - * ::NV_ENC_SUCCESS \n - * ::NV_ENC_NEED_MORE_INPUT \n should we return this error is lookahead queue is not full? - * ::NV_ENC_ERR_INVALID_PTR \n - * ::NV_ENC_ERR_ENCODER_NOT_INITIALIZED \n - * ::NV_ENC_ERR_GENERIC \n - * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n - * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n - * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n - * ::NV_ENC_ERR_OUT_OF_MEMORY \n - * ::NV_ENC_ERR_INVALID_PARAM \n - * ::NV_ENC_ERR_INVALID_VERSION \n - */ -NVENCSTATUS NVENCAPI NvEncLookaheadPicture (void* encoder, NV_ENC_LOOKAHEAD_PIC_PARAMS *lookaheadParamas); - -/// \cond API PFN -/* - * Defines API function pointers - */ -typedef NVENCSTATUS (NVENCAPI* PNVENCOPENENCODESESSION) (void* device, uint32_t deviceType, void** encoder); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEGUIDCOUNT) (void* encoder, uint32_t* encodeGUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEGUIDS) (void* encoder, GUID* GUIDs, uint32_t guidArraySize, uint32_t* GUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPROFILEGUIDCOUNT) (void* encoder, GUID encodeGUID, uint32_t* encodeProfileGUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPROFILEGUIDS) (void* encoder, GUID encodeGUID, GUID* profileGUIDs, uint32_t guidArraySize, uint32_t* GUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETINPUTFORMATCOUNT) (void* encoder, GUID encodeGUID, uint32_t* inputFmtCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETINPUTFORMATS) (void* encoder, GUID encodeGUID, NV_ENC_BUFFER_FORMAT* inputFmts, uint32_t inputFmtArraySize, uint32_t* inputFmtCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODECAPS) (void* encoder, GUID encodeGUID, NV_ENC_CAPS_PARAM* capsParam, int* capsVal); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPRESETCOUNT) (void* encoder, GUID encodeGUID, uint32_t* encodePresetGUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPRESETGUIDS) (void* encoder, GUID encodeGUID, GUID* presetGUIDs, uint32_t guidArraySize, uint32_t* encodePresetGUIDCount); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPRESETCONFIG) (void* encoder, GUID encodeGUID, GUID presetGUID, NV_ENC_PRESET_CONFIG* presetConfig); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODEPRESETCONFIGEX) (void* encoder, GUID encodeGUID, GUID presetGUID, NV_ENC_TUNING_INFO tuningInfo, NV_ENC_PRESET_CONFIG* presetConfig); -typedef NVENCSTATUS (NVENCAPI* PNVENCINITIALIZEENCODER) (void* encoder, NV_ENC_INITIALIZE_PARAMS* createEncodeParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCCREATEINPUTBUFFER) (void* encoder, NV_ENC_CREATE_INPUT_BUFFER* createInputBufferParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCDESTROYINPUTBUFFER) (void* encoder, NV_ENC_INPUT_PTR inputBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCCREATEBITSTREAMBUFFER) (void* encoder, NV_ENC_CREATE_BITSTREAM_BUFFER* createBitstreamBufferParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCDESTROYBITSTREAMBUFFER) (void* encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCENCODEPICTURE) (void* encoder, NV_ENC_PIC_PARAMS* encodePicParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCLOCKBITSTREAM) (void* encoder, NV_ENC_LOCK_BITSTREAM* lockBitstreamBufferParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCUNLOCKBITSTREAM) (void* encoder, NV_ENC_OUTPUT_PTR bitstreamBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCLOCKINPUTBUFFER) (void* encoder, NV_ENC_LOCK_INPUT_BUFFER* lockInputBufferParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCUNLOCKINPUTBUFFER) (void* encoder, NV_ENC_INPUT_PTR inputBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETENCODESTATS) (void* encoder, NV_ENC_STAT* encodeStats); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETSEQUENCEPARAMS) (void* encoder, NV_ENC_SEQUENCE_PARAM_PAYLOAD* sequenceParamPayload); -typedef NVENCSTATUS (NVENCAPI* PNVENCREGISTERASYNCEVENT) (void* encoder, NV_ENC_EVENT_PARAMS* eventParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCUNREGISTERASYNCEVENT) (void* encoder, NV_ENC_EVENT_PARAMS* eventParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCMAPINPUTRESOURCE) (void* encoder, NV_ENC_MAP_INPUT_RESOURCE* mapInputResParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCUNMAPINPUTRESOURCE) (void* encoder, NV_ENC_INPUT_PTR mappedInputBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCDESTROYENCODER) (void* encoder); -typedef NVENCSTATUS (NVENCAPI* PNVENCINVALIDATEREFFRAMES) (void* encoder, uint64_t invalidRefFrameTimeStamp); -typedef NVENCSTATUS (NVENCAPI* PNVENCOPENENCODESESSIONEX) (NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS *openSessionExParams, void** encoder); -typedef NVENCSTATUS (NVENCAPI* PNVENCREGISTERRESOURCE) (void* encoder, NV_ENC_REGISTER_RESOURCE* registerResParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCUNREGISTERRESOURCE) (void* encoder, NV_ENC_REGISTERED_PTR registeredRes); -typedef NVENCSTATUS (NVENCAPI* PNVENCRECONFIGUREENCODER) (void* encoder, NV_ENC_RECONFIGURE_PARAMS* reInitEncodeParams); - -typedef NVENCSTATUS (NVENCAPI* PNVENCCREATEMVBUFFER) (void* encoder, NV_ENC_CREATE_MV_BUFFER* createMVBufferParams); -typedef NVENCSTATUS (NVENCAPI* PNVENCDESTROYMVBUFFER) (void* encoder, NV_ENC_OUTPUT_PTR mvBuffer); -typedef NVENCSTATUS (NVENCAPI* PNVENCRUNMOTIONESTIMATIONONLY) (void* encoder, NV_ENC_MEONLY_PARAMS* meOnlyParams); -typedef const char * (NVENCAPI* PNVENCGETLASTERROR) (void* encoder); -typedef NVENCSTATUS (NVENCAPI* PNVENCSETIOCUDASTREAMS) (void* encoder, NV_ENC_CUSTREAM_PTR inputStream, NV_ENC_CUSTREAM_PTR outputStream); -typedef NVENCSTATUS (NVENCAPI* PNVENCGETSEQUENCEPARAMEX) (void* encoder, NV_ENC_INITIALIZE_PARAMS* encInitParams, NV_ENC_SEQUENCE_PARAM_PAYLOAD* sequenceParamPayload); -typedef NVENCSTATUS (NVENCAPI* PNVENCRESTOREENCODERSTATE) (void* encoder, NV_ENC_RESTORE_ENCODER_STATE_PARAMS* restoreState); -typedef NVENCSTATUS (NVENCAPI* PNVENCLOOKAHEADPICTURE) (void* encoder, NV_ENC_LOOKAHEAD_PIC_PARAMS* lookaheadParams); - - -/// \endcond - - -/** @} */ /* END ENCODE_FUNC */ - -/** - * \ingroup ENCODER_STRUCTURE - * NV_ENCODE_API_FUNCTION_LIST - */ -typedef struct _NV_ENCODE_API_FUNCTION_LIST -{ - uint32_t version; /**< [in]: Client should pass NV_ENCODE_API_FUNCTION_LIST_VER. */ - uint32_t reserved; /**< [in]: Reserved and should be set to 0. */ - PNVENCOPENENCODESESSION nvEncOpenEncodeSession; /**< [out]: Client should access ::NvEncOpenEncodeSession() API through this pointer. */ - PNVENCGETENCODEGUIDCOUNT nvEncGetEncodeGUIDCount; /**< [out]: Client should access ::NvEncGetEncodeGUIDCount() API through this pointer. */ - PNVENCGETENCODEPRESETCOUNT nvEncGetEncodeProfileGUIDCount; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDCount() API through this pointer.*/ - PNVENCGETENCODEPRESETGUIDS nvEncGetEncodeProfileGUIDs; /**< [out]: Client should access ::NvEncGetEncodeProfileGUIDs() API through this pointer. */ - PNVENCGETENCODEGUIDS nvEncGetEncodeGUIDs; /**< [out]: Client should access ::NvEncGetEncodeGUIDs() API through this pointer. */ - PNVENCGETINPUTFORMATCOUNT nvEncGetInputFormatCount; /**< [out]: Client should access ::NvEncGetInputFormatCount() API through this pointer. */ - PNVENCGETINPUTFORMATS nvEncGetInputFormats; /**< [out]: Client should access ::NvEncGetInputFormats() API through this pointer. */ - PNVENCGETENCODECAPS nvEncGetEncodeCaps; /**< [out]: Client should access ::NvEncGetEncodeCaps() API through this pointer. */ - PNVENCGETENCODEPRESETCOUNT nvEncGetEncodePresetCount; /**< [out]: Client should access ::NvEncGetEncodePresetCount() API through this pointer. */ - PNVENCGETENCODEPRESETGUIDS nvEncGetEncodePresetGUIDs; /**< [out]: Client should access ::NvEncGetEncodePresetGUIDs() API through this pointer. */ - PNVENCGETENCODEPRESETCONFIG nvEncGetEncodePresetConfig; /**< [out]: Client should access ::NvEncGetEncodePresetConfig() API through this pointer. */ - PNVENCINITIALIZEENCODER nvEncInitializeEncoder; /**< [out]: Client should access ::NvEncInitializeEncoder() API through this pointer. */ - PNVENCCREATEINPUTBUFFER nvEncCreateInputBuffer; /**< [out]: Client should access ::NvEncCreateInputBuffer() API through this pointer. */ - PNVENCDESTROYINPUTBUFFER nvEncDestroyInputBuffer; /**< [out]: Client should access ::NvEncDestroyInputBuffer() API through this pointer. */ - PNVENCCREATEBITSTREAMBUFFER nvEncCreateBitstreamBuffer; /**< [out]: Client should access ::NvEncCreateBitstreamBuffer() API through this pointer. */ - PNVENCDESTROYBITSTREAMBUFFER nvEncDestroyBitstreamBuffer; /**< [out]: Client should access ::NvEncDestroyBitstreamBuffer() API through this pointer. */ - PNVENCENCODEPICTURE nvEncEncodePicture; /**< [out]: Client should access ::NvEncEncodePicture() API through this pointer. */ - PNVENCLOCKBITSTREAM nvEncLockBitstream; /**< [out]: Client should access ::NvEncLockBitstream() API through this pointer. */ - PNVENCUNLOCKBITSTREAM nvEncUnlockBitstream; /**< [out]: Client should access ::NvEncUnlockBitstream() API through this pointer. */ - PNVENCLOCKINPUTBUFFER nvEncLockInputBuffer; /**< [out]: Client should access ::NvEncLockInputBuffer() API through this pointer. */ - PNVENCUNLOCKINPUTBUFFER nvEncUnlockInputBuffer; /**< [out]: Client should access ::NvEncUnlockInputBuffer() API through this pointer. */ - PNVENCGETENCODESTATS nvEncGetEncodeStats; /**< [out]: Client should access ::NvEncGetEncodeStats() API through this pointer. */ - PNVENCGETSEQUENCEPARAMS nvEncGetSequenceParams; /**< [out]: Client should access ::NvEncGetSequenceParams() API through this pointer. */ - PNVENCREGISTERASYNCEVENT nvEncRegisterAsyncEvent; /**< [out]: Client should access ::NvEncRegisterAsyncEvent() API through this pointer. */ - PNVENCUNREGISTERASYNCEVENT nvEncUnregisterAsyncEvent; /**< [out]: Client should access ::NvEncUnregisterAsyncEvent() API through this pointer. */ - PNVENCMAPINPUTRESOURCE nvEncMapInputResource; /**< [out]: Client should access ::NvEncMapInputResource() API through this pointer. */ - PNVENCUNMAPINPUTRESOURCE nvEncUnmapInputResource; /**< [out]: Client should access ::NvEncUnmapInputResource() API through this pointer. */ - PNVENCDESTROYENCODER nvEncDestroyEncoder; /**< [out]: Client should access ::NvEncDestroyEncoder() API through this pointer. */ - PNVENCINVALIDATEREFFRAMES nvEncInvalidateRefFrames; /**< [out]: Client should access ::NvEncInvalidateRefFrames() API through this pointer. */ - PNVENCOPENENCODESESSIONEX nvEncOpenEncodeSessionEx; /**< [out]: Client should access ::NvEncOpenEncodeSession() API through this pointer. */ - PNVENCREGISTERRESOURCE nvEncRegisterResource; /**< [out]: Client should access ::NvEncRegisterResource() API through this pointer. */ - PNVENCUNREGISTERRESOURCE nvEncUnregisterResource; /**< [out]: Client should access ::NvEncUnregisterResource() API through this pointer. */ - PNVENCRECONFIGUREENCODER nvEncReconfigureEncoder; /**< [out]: Client should access ::NvEncReconfigureEncoder() API through this pointer. */ - void* reserved1; - PNVENCCREATEMVBUFFER nvEncCreateMVBuffer; /**< [out]: Client should access ::NvEncCreateMVBuffer API through this pointer. */ - PNVENCDESTROYMVBUFFER nvEncDestroyMVBuffer; /**< [out]: Client should access ::NvEncDestroyMVBuffer API through this pointer. */ - PNVENCRUNMOTIONESTIMATIONONLY nvEncRunMotionEstimationOnly; /**< [out]: Client should access ::NvEncRunMotionEstimationOnly API through this pointer. */ - PNVENCGETLASTERROR nvEncGetLastErrorString; /**< [out]: Client should access ::nvEncGetLastErrorString API through this pointer. */ - PNVENCSETIOCUDASTREAMS nvEncSetIOCudaStreams; /**< [out]: Client should access ::nvEncSetIOCudaStreams API through this pointer. */ - PNVENCGETENCODEPRESETCONFIGEX nvEncGetEncodePresetConfigEx; /**< [out]: Client should access ::NvEncGetEncodePresetConfigEx() API through this pointer. */ - PNVENCGETSEQUENCEPARAMEX nvEncGetSequenceParamEx; /**< [out]: Client should access ::NvEncGetSequenceParamEx() API through this pointer. */ - PNVENCRESTOREENCODERSTATE nvEncRestoreEncoderState; /**< [out]: Client should access ::NvEncRestoreEncoderState() API through this pointer. */ - PNVENCLOOKAHEADPICTURE nvEncLookaheadPicture; /**< [out]: Client should access ::NvEncLookaheadPicture() API through this pointer. */ - void* reserved2[275]; /**< [in]: Reserved and must be set to NULL */ -} NV_ENCODE_API_FUNCTION_LIST; - -/** Macro for constructing the version field of ::_NV_ENCODEAPI_FUNCTION_LIST. */ -#define NV_ENCODE_API_FUNCTION_LIST_VER NVENCAPI_STRUCT_VERSION(2) - -// NvEncodeAPICreateInstance -/** - * \ingroup ENCODE_FUNC - * Entry Point to the NvEncodeAPI interface. - * - * Creates an instance of the NvEncodeAPI interface, and populates the - * pFunctionList with function pointers to the API routines implemented by the - * NvEncodeAPI interface. - * - * \param [out] functionList - * - * \return - * ::NV_ENC_SUCCESS - * ::NV_ENC_ERR_INVALID_PTR - */ -NVENCSTATUS NVENCAPI NvEncodeAPICreateInstance(NV_ENCODE_API_FUNCTION_LIST *functionList); - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDA.h b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDA.h deleted file mode 100644 index c26792aa..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDA.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef DDA_H -#define DDA_H - -#include "DDAImpl.h" -#include "Defs.h" - -class DemoApplication { - /// Demo Application Core class -#define returnIfError(x) \ - if (FAILED(x)) { \ - printf(__FUNCTION__ ": Line %d, File %s Returning error 0x%08x\n", \ - __LINE__, __FILE__, x); \ - return x; \ - } - -private: - IDXGIFactory1 *factory1_ = nullptr; - IDXGIAdapter1 *adapter1_ = nullptr; - IDXGIAdapter *adapter_ = nullptr; - /// DDA wrapper object, defined in DDAImpl.h - DDAImpl *pDDAWrapper = nullptr; - /// D3D11 device context used for the operations demonstrated in this - /// application - ID3D11Device *pD3DDev = nullptr; - /// D3D11 device context - ID3D11DeviceContext *pCtx = nullptr; - /// D3D11 RGB Texture2D object that recieves the captured image from DDA - ID3D11Texture2D *pDupTex2D = nullptr; - /// D3D11 YUV420 Texture2D object that sends the image to NVENC for video - /// encoding - ID3D11Texture2D *pEncBuf = nullptr; - ID3D10Multithread *hmt = NULL; - int64_t m_luid = 0; - -private: - /// Initialize DXGI pipeline - HRESULT InitDXGI() { - HRESULT hr = S_OK; - - hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)&factory1_); - if (FAILED(hr)) { - return hr; - } - - UINT i = 0; - while (!FAILED(factory1_->EnumAdapters1(i, &adapter1_))) { - i++; - DXGI_ADAPTER_DESC1 desc = DXGI_ADAPTER_DESC1(); - adapter1_->GetDesc1(&desc); - if ((((int64_t)desc.AdapterLuid.HighPart << 32) | - desc.AdapterLuid.LowPart) == m_luid) { - break; - } - SAFE_RELEASE(adapter1_); - } - if (!adapter1_) { - return S_FALSE; - } - hr = adapter1_->QueryInterface(__uuidof(IDXGIAdapter), (void **)&adapter_); - if (FAILED(hr)) { - return hr; - } - - /// Feature levels supported - D3D_FEATURE_LEVEL FeatureLevels[] = {D3D_FEATURE_LEVEL_11_0}; - UINT NumFeatureLevels = ARRAYSIZE(FeatureLevels); - D3D_FEATURE_LEVEL FeatureLevel = D3D_FEATURE_LEVEL_11_0; - - /// Create device - hr = D3D11CreateDevice(adapter1_, D3D_DRIVER_TYPE_UNKNOWN, nullptr, - D3D11_CREATE_DEVICE_VIDEO_SUPPORT | - D3D11_CREATE_DEVICE_BGRA_SUPPORT, - FeatureLevels, NumFeatureLevels, D3D11_SDK_VERSION, - &pD3DDev, &FeatureLevel, &pCtx); - if (SUCCEEDED(hr)) { - // Device creation succeeded, no need to loop anymore - hr = pCtx->QueryInterface(IID_PPV_ARGS(&hmt)); - if (SUCCEEDED(hr)) { - hr = hmt->SetMultithreadProtected(TRUE); - } - } - return hr; - } - - /// Initialize DDA handler - HRESULT InitDup() { - HRESULT hr = S_OK; - if (!pDDAWrapper) { - pDDAWrapper = new DDAImpl(pD3DDev, pCtx); - hr = pDDAWrapper->Init(); - returnIfError(hr); - } - return hr; - } - -public: - HRESULT Init() { - HRESULT hr = S_OK; - - hr = InitDXGI(); - returnIfError(hr); - - hr = InitDup(); - returnIfError(hr); - - return hr; - } - - ID3D11Device *Device() { return pD3DDev; } - - int width() { return pDDAWrapper->getWidth(); } - - int height() { return pDDAWrapper->getHeight(); } - - /// Capture a frame using DDA - ID3D11Texture2D *Capture(int wait) { - HRESULT hr = pDDAWrapper->GetCapturedFrame(&pDupTex2D, - wait); // Release after preproc - if (FAILED(hr)) { - return NULL; - } - return pDupTex2D; - } - - /// Release all resources - void Cleanup(bool bDelete = true) { - if (pDDAWrapper) { - pDDAWrapper->Cleanup(); - delete pDDAWrapper; - pDDAWrapper = nullptr; - } - - SAFE_RELEASE(pDupTex2D); - if (bDelete) { - SAFE_RELEASE(factory1_); - SAFE_RELEASE(adapter_); - SAFE_RELEASE(adapter1_); - SAFE_RELEASE(pD3DDev); - SAFE_RELEASE(pCtx); - SAFE_RELEASE(hmt) - } - } - DemoApplication(int64_t luid) { m_luid = luid; } - ~DemoApplication() { Cleanup(true); } -}; - -#endif // DDA_H \ No newline at end of file diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.cpp b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.cpp deleted file mode 100644 index 44843624..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "Defs.h" -#include "DDAImpl.h" -#include - -/// Initialize DDA -HRESULT DDAImpl::Init() -{ - IDXGIOutput * pOutput = nullptr; - IDXGIDevice2* pDevice = nullptr; - IDXGIFactory1* pFactory = nullptr; - IDXGIAdapter *pAdapter = nullptr; - IDXGIOutput1* pOut1 = nullptr; - - /// Release all temporary refs before exit -#define CLEAN_RETURN(x) \ - SAFE_RELEASE(pDevice);\ - SAFE_RELEASE(pFactory);\ - SAFE_RELEASE(pOutput);\ - SAFE_RELEASE(pOut1);\ - SAFE_RELEASE(pAdapter);\ - return x; - - HRESULT hr = S_OK; - /// To create a DDA object given a D3D11 device, we must first get to the DXGI Adapter associated with that device - if (FAILED(hr = pD3DDev->QueryInterface(__uuidof(IDXGIDevice2), (void**)&pDevice))) - { - CLEAN_RETURN(hr); - } - - if (FAILED(hr = pDevice->GetParent(__uuidof(IDXGIAdapter), (void**)&pAdapter))) - { - CLEAN_RETURN(hr); - } - /// Once we have the DXGI Adapter, we enumerate the attached display outputs, and select which one we want to capture - /// This sample application always captures the primary display output, enumerated at index 0. - if (FAILED(hr = pAdapter->EnumOutputs(0, &pOutput))) - { - CLEAN_RETURN(hr); - } - - if (FAILED(hr = pOutput->QueryInterface(__uuidof(IDXGIOutput1), (void**)&pOut1))) - { - CLEAN_RETURN(hr); - } - /// Ask DXGI to create an instance of IDXGIOutputDuplication for the selected output. We can now capture this display output - if (FAILED(hr = pOut1->DuplicateOutput(pDevice, &pDup))) - { - CLEAN_RETURN(hr); - } - - DXGI_OUTDUPL_DESC outDesc; - ZeroMemory(&outDesc, sizeof(outDesc)); - pDup->GetDesc(&outDesc); - - height = outDesc.ModeDesc.Height; - width = outDesc.ModeDesc.Width; - CLEAN_RETURN(hr); -} - -/// Acquire a new frame from DDA, and return it as a Texture2D object. -/// 'wait' specifies the time in milliseconds that DDA shoulo wait for a new screen update. -HRESULT DDAImpl::GetCapturedFrame(ID3D11Texture2D **ppTex2D, int wait, bool fail_if_equal) -{ - HRESULT hr = S_OK; - DXGI_OUTDUPL_FRAME_INFO frameInfo; - ZeroMemory(&frameInfo, sizeof(frameInfo)); - int acquired = 0; - - -#define RETURN_ERR(x) {printf(__FUNCTION__": %d : Line %d return 0x%x\n", frameno, __LINE__, x);return x;} - - if (pResource) - { - pDup->ReleaseFrame(); - pResource->Release(); - pResource = nullptr; - } - - hr = pDup->AcquireNextFrame(wait, &frameInfo, &pResource); - if (FAILED(hr)) - { - if (hr == DXGI_ERROR_WAIT_TIMEOUT) - { - // printf(__FUNCTION__": %d : Wait for %d ms timed out\n", frameno, wait); - } - if (hr == DXGI_ERROR_INVALID_CALL) - { - printf(__FUNCTION__": %d : Invalid Call, previous frame not released?\n", frameno); - } - if (hr == DXGI_ERROR_ACCESS_LOST) - { - printf(__FUNCTION__": %d : Access lost, frame needs to be released?\n", frameno); - } - // RETURN_ERR(hr); - return hr; - } - if (fail_if_equal) - { - if (frameInfo.AccumulatedFrames == 0 || frameInfo.LastPresentTime.QuadPart == 0) - { - // No image update, only cursor moved. - RETURN_ERR(DXGI_ERROR_WAIT_TIMEOUT); - } - } - - if (!pResource) - { - printf(__FUNCTION__": %d : Null output resource. Return error.\n", frameno); - return E_UNEXPECTED; - } - - if (FAILED(hr = pResource->QueryInterface(__uuidof(ID3D11Texture2D), (void**)ppTex2D))) - { - return hr; - } - - LARGE_INTEGER pts = frameInfo.LastPresentTime; MICROSEC_TIME(pts, qpcFreq); - LONGLONG interval = pts.QuadPart - lastPTS.QuadPart; - - // printf(__FUNCTION__": %d : Accumulated Frames %u PTS Interval %lld PTS %lld\n", frameno, frameInfo.AccumulatedFrames, interval * 1000, frameInfo.LastPresentTime.QuadPart); - lastPTS = pts; // store microsec value - frameno += frameInfo.AccumulatedFrames; - return hr; -} - -/// Release all resources -int DDAImpl::Cleanup() -{ - if (pResource) - { - pDup->ReleaseFrame(); - SAFE_RELEASE(pResource); - } - - width = height = frameno = 0; - - SAFE_RELEASE(pDup); - SAFE_RELEASE(pCtx); - SAFE_RELEASE(pD3DDev); - - return 0; -} \ No newline at end of file diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.h b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.h deleted file mode 100644 index a6dce4a5..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/DDAImpl.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once -#include -#include -#include -using namespace std; -#include -#include - -class DDAImpl -{ - /// Thin wrapper around IDXGIOutputDuplication interface - /// Manages IDXGIOutputDuplication object lifecycle - /// Interacts with IDXGIOuputDuplication to acquire new frames - -private: - /// The DDA object - IDXGIOutputDuplication* pDup = nullptr; - /// The D3D11 device used by the DDA session - ID3D11Device* pD3DDev = nullptr; - /// The D3D11 Device Context used by the DDA session - ID3D11DeviceContext* pCtx = nullptr; - /// The resource used to acquire a new captured frame from DDA - IDXGIResource *pResource = nullptr; - /// Output width obtained from DXGI_OUTDUPL_DESC - DWORD width = 0; - /// Output height obtained from DXGI_OUTDUPL_DESC - DWORD height = 0; - /// Running count of no. of accumulated desktop updates - int frameno = 0; - /// DXGI_OUTDUPL_FRAME_INFO::latPresentTime from the last Acquired frame - LARGE_INTEGER lastPTS = { 0 }; - /// Clock frequency from QueryPerformaceFrequency() - LARGE_INTEGER qpcFreq = { 0 }; - /// Default constructor - DDAImpl() {} - -public: - /// Initialize DDA - HRESULT Init(); - /// Acquire a new frame from DDA, and return it as a Texture2D object. - /// 'wait' specifies the time in milliseconds that DDA shoulo wait for a new screen update. - HRESULT GetCapturedFrame(ID3D11Texture2D **pTex2D, int wait, bool fail_if_equal = false); - /// Release all resources - int Cleanup(); - /// Return output height to caller - inline DWORD getWidth() { return width; } - /// Return output width to caller - inline DWORD getHeight() { return height; } - -public: - /// Constructor - DDAImpl(ID3D11Device *pDev, ID3D11DeviceContext* pDevCtx) - : pD3DDev(pDev) - , pCtx(pDevCtx) - { - pD3DDev->AddRef(); - pCtx->AddRef(); - QueryPerformanceFrequency(&qpcFreq); - } - /// Destructor. Release all resources before destroying the object - ~DDAImpl() { Cleanup(); } -}; diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Defs.h b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Defs.h deleted file mode 100644 index 129f5146..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Defs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once -#pragma warning(disable:4996) -#pragma warning(disable:4838) - -#if !defined(SAFE_RELEASE) -#define SAFE_RELEASE(X) if(X){X->Release(); X=nullptr;} -#endif - -#if !defined(PRINTERR1) -#define PRINTERR1(x) printf(__FUNCTION__": Error 0x%08x at line %d in file %s\n", x, __LINE__, __FILE__); -#endif - -#if !defined(PRINTERR) -#define PRINTERR(x,y) printf(__FUNCTION__": Error 0x%08x in %s at line %d in file %s\n", x, y, __LINE__, __FILE__); -#endif - - - -#define MICROSEC_TIME(x,f)\ - x.QuadPart *= 1000000;\ - x.QuadPart /= f.QuadPart; diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.cpp b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.cpp deleted file mode 100644 index 08dc0d7c..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "Defs.h" -#include "Preproc.h" - -/// Constructor -RGBToNV12::RGBToNV12(ID3D11Device *pDev, ID3D11DeviceContext *pCtx) - : m_pDev(pDev) - , m_pCtx(pCtx) -{ - m_pDev->AddRef(); - m_pCtx->AddRef(); -} - -/// Initialize Video Context -HRESULT RGBToNV12::Init() -{ - /// Obtain Video device and Video device context - HRESULT hr = m_pDev->QueryInterface(__uuidof(ID3D11VideoDevice), (void**)&m_pVid); - if (FAILED(hr)) - { - PRINTERR(hr, "QAI for ID3D11VideoDevice"); - } - hr = m_pCtx->QueryInterface(__uuidof(ID3D11VideoContext), (void**)&m_pVidCtx); - if (FAILED(hr)) - { - PRINTERR(hr, "QAI for ID3D11VideoContext"); - } - - return hr; -} - -/// Release all Resources -void RGBToNV12::Cleanup() -{ - for (auto& it : viewMap) - { - ID3D11VideoProcessorOutputView* pVPOV = it.second; - pVPOV->Release(); - } - SAFE_RELEASE(m_pVP); - SAFE_RELEASE(m_pVPEnum); - SAFE_RELEASE(m_pVidCtx); - SAFE_RELEASE(m_pVid); - SAFE_RELEASE(m_pCtx); - SAFE_RELEASE(m_pDev); -} - -/// Perform Colorspace conversion -HRESULT RGBToNV12::Convert(ID3D11Texture2D* pRGB, ID3D11Texture2D*pYUV) -{ - HRESULT hr = S_OK; - ID3D11VideoProcessorInputView* pVPIn = nullptr; - - D3D11_TEXTURE2D_DESC inDesc = { 0 }; - D3D11_TEXTURE2D_DESC outDesc = { 0 }; - pRGB->GetDesc(&inDesc); - pYUV->GetDesc(&outDesc); - - /// Check if VideoProcessor needs to be reconfigured - /// Reconfiguration is required if input/output dimensions have changed - if (m_pVP) - { - if (m_inDesc.Width != inDesc.Width || - m_inDesc.Height != inDesc.Height || - m_outDesc.Width != outDesc.Width || - m_outDesc.Height != outDesc.Height) - { - SAFE_RELEASE(m_pVPEnum); - SAFE_RELEASE(m_pVP); - } - } - - if (!m_pVP) - { - /// Initialize Video Processor - m_inDesc = inDesc; - m_outDesc = outDesc; - D3D11_VIDEO_PROCESSOR_CONTENT_DESC contentDesc = - { - D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE, - { 1, 1 }, inDesc.Width, inDesc.Height, - { 1, 1 }, outDesc.Width, outDesc.Height, - D3D11_VIDEO_USAGE_PLAYBACK_NORMAL - }; - hr = m_pVid->CreateVideoProcessorEnumerator(&contentDesc, &m_pVPEnum);; - if (FAILED(hr)) - { - PRINTERR(hr, "CreateVideoProcessorEnumerator"); - } - hr = m_pVid->CreateVideoProcessor(m_pVPEnum, 0, &m_pVP);; - if (FAILED(hr)) - { - PRINTERR(hr, "CreateVideoProcessor"); - } - } - - /// Obtain Video Processor Input view from input texture - D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC inputVD = { 0, D3D11_VPIV_DIMENSION_TEXTURE2D,{ 0,0 } }; - hr = m_pVid->CreateVideoProcessorInputView(pRGB, m_pVPEnum, &inputVD, &pVPIn); - if (FAILED(hr)) - { - PRINTERR(hr, "CreateVideoProcessInputView"); - return hr; - } - - /// Obtain Video Processor Output view from output texture - ID3D11VideoProcessorOutputView* pVPOV = nullptr; - auto it = viewMap.find(pYUV); - /// Optimization: Check if we already created a video processor output view for this texture - if (it == viewMap.end()) - { - /// We don't have a video processor output view for this texture, create one now. - D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC ovD = { D3D11_VPOV_DIMENSION_TEXTURE2D }; - hr = m_pVid->CreateVideoProcessorOutputView(pYUV, m_pVPEnum, &ovD, &pVPOV); - if (FAILED(hr)) - { - SAFE_RELEASE(pVPIn); - PRINTERR(hr, "CreateVideoProcessorOutputView"); - return hr; - } - viewMap.insert({ pYUV, pVPOV }); - } - else - { - pVPOV = it->second; - } - - /// Create a Video Processor Stream to run the operation - D3D11_VIDEO_PROCESSOR_STREAM stream = { TRUE, 0, 0, 0, 0, nullptr, pVPIn, nullptr }; - - /// Perform the Colorspace conversion - hr = m_pVidCtx->VideoProcessorBlt(m_pVP, pVPOV, 0, 1, &stream); - if (FAILED(hr)) - { - SAFE_RELEASE(pVPIn); - PRINTERR(hr, "VideoProcessorBlt"); - return hr; - } - SAFE_RELEASE(pVPIn); - return hr; -} - diff --git a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.h b/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.h deleted file mode 100644 index 901dffc9..00000000 --- a/libs/hwcodec/externals/nvEncDXGIOutputDuplicationSample/Preproc.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once -#include -#include -#include -using namespace std; - -class RGBToNV12 -{ - /// Simple Preprocessor class - /// Uses DXVAHD VideoProcessBlt to perform colorspace conversion -private: - /// D3D11 device to be used for Processing - ID3D11Device *m_pDev = nullptr; - /// D3D11 device context to be used for Processing - ID3D11DeviceContext* m_pCtx = nullptr; - /// D3D11 video device to be used for Processing, obtained from d3d11 device - ID3D11VideoDevice* m_pVid = nullptr; - /// D3D11 video device context to be used for Processing, obtained from d3d11 device - ID3D11VideoContext* m_pVidCtx = nullptr; - /// DXVAHD video processor configured for processing. - /// Needs to be reconfigured based on input and output textures for each Convert() call - ID3D11VideoProcessor* m_pVP = nullptr; - /// DXVAHD VpBlt output target. Obtained from the output texture passed to Convert() - ID3D11VideoProcessorOutputView* m_pVPOut = nullptr; - /// D3D11 video processor enumerator. Required to configure Video processor streams - ID3D11VideoProcessorEnumerator* m_pVPEnum = nullptr; - /// Mapping of Texture2D handle and corresponding Video Processor output view handle - /// Optimization to avoid having to create video processor output views in each Convert() call - std::unordered_map viewMap; - /// Input and Output Texture2D properties. - /// Required to optimize Video Processor stream usage - D3D11_TEXTURE2D_DESC m_inDesc = { 0 }; - D3D11_TEXTURE2D_DESC m_outDesc = { 0 }; -private: - /// Default Constructor - RGBToNV12() - { - } - -public: - /// Initialize Video Context - HRESULT Init(); - /// Perform Colorspace conversion - HRESULT Convert(ID3D11Texture2D* pRGB, ID3D11Texture2D*pYUV); - /// Release all resources - void Cleanup(); - -public: - /// Constructor - RGBToNV12(ID3D11Device *pDev, ID3D11DeviceContext *pCtx); - /// Destructor. Release all resources before destroying object - ~RGBToNV12() - { - Cleanup(); - } - -}; - - diff --git a/libs/hwcodec/src/android.rs b/libs/hwcodec/src/android.rs deleted file mode 100644 index 04ccc561..00000000 --- a/libs/hwcodec/src/android.rs +++ /dev/null @@ -1,18 +0,0 @@ -use core::ffi::{c_int, c_void}; - -#[link(name = "avcodec")] -extern "C" { - fn av_jni_set_java_vm( - vm: *mut c_void, - ctx: *mut c_void, - ) -> c_int; -} - -pub fn ffmpeg_set_java_vm(vm: *mut c_void) { - unsafe { - av_jni_set_java_vm( - vm as _, - std::ptr::null_mut() as _, - ); - } -} diff --git a/libs/hwcodec/src/common.rs b/libs/hwcodec/src/common.rs index 06998d6e..3d6d8b4c 100644 --- a/libs/hwcodec/src/common.rs +++ b/libs/hwcodec/src/common.rs @@ -5,9 +5,6 @@ use serde_derive::{Deserialize, Serialize}; include!(concat!(env!("OUT_DIR"), "/common_ffi.rs")); -pub(crate) const DATA_H264_720P: &[u8] = include_bytes!("res/720p.h264"); -pub(crate) const DATA_H265_720P: &[u8] = include_bytes!("res/720p.h265"); - #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum Driver { NV, @@ -31,14 +28,8 @@ pub(crate) fn supported_gpu(_encode: bool) -> (bool, bool, bool) { unsafe { #[cfg(windows)] { - #[cfg(feature = "vram")] - return ( - _encode && crate::vram::nv::nv_encode_driver_support() == 0 - || !_encode && crate::vram::nv::nv_decode_driver_support() == 0, - crate::vram::amf::amf_driver_support() == 0, - crate::vram::mfx::mfx_driver_support() == 0, - ); - #[cfg(not(feature = "vram"))] + // Without VRAM feature, assume all GPU types might be available + // FFmpeg will handle the actual detection return (true, true, true); } @@ -53,55 +44,21 @@ pub(crate) fn supported_gpu(_encode: bool) -> (bool, bool, bool) { } } -#[cfg(target_os = "macos")] -pub(crate) fn get_video_toolbox_codec_support() -> (bool, bool, bool, bool) { - use std::ffi::c_void; - - extern "C" { - fn checkVideoToolboxSupport( - h264_encode: *mut i32, - h265_encode: *mut i32, - h264_decode: *mut i32, - h265_decode: *mut i32, - ) -> c_void; - } - - let mut h264_encode = 0; - let mut h265_encode = 0; - let mut h264_decode = 0; - let mut h265_decode = 0; - unsafe { - checkVideoToolboxSupport( - &mut h264_encode as *mut _, - &mut h265_encode as *mut _, - &mut h264_decode as *mut _, - &mut h265_decode as *mut _, - ); - } - ( - h264_encode == 1, - h265_encode == 1, - h264_decode == 1, - h265_decode == 1, - ) -} - pub fn get_gpu_signature() -> u64 { - #[cfg(any(windows, target_os = "macos"))] + #[cfg(windows)] { extern "C" { pub fn GetHwcodecGpuSignature() -> u64; } unsafe { GetHwcodecGpuSignature() } } - #[cfg(not(any(windows, target_os = "macos")))] + #[cfg(not(windows))] { 0 } } -// called by child process -#[cfg(any(target_os = "linux", target_os = "macos"))] +#[cfg(target_os = "linux")] pub fn setup_parent_death_signal() { use std::sync::Once; @@ -123,7 +80,6 @@ pub fn setup_parent_death_signal() { }); } -// called by parent process #[cfg(windows)] pub fn child_exit_when_parent_exit(child_process_id: u32) -> bool { unsafe { @@ -133,4 +89,4 @@ pub fn child_exit_when_parent_exit(child_process_id: u32) -> bool { let result = add_process_to_new_job(child_process_id); result == 0 } -} \ No newline at end of file +} diff --git a/libs/hwcodec/src/ffmpeg_ram/decode.rs b/libs/hwcodec/src/ffmpeg_ram/decode.rs index 6a0c8c07..c06efada 100644 --- a/libs/hwcodec/src/ffmpeg_ram/decode.rs +++ b/libs/hwcodec/src/ffmpeg_ram/decode.rs @@ -1,6 +1,3 @@ -#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))] -use super::Priority; -use crate::common::TEST_TIMEOUT_MS; use crate::ffmpeg::{init_av_log, AVHWDeviceType::*}; use crate::{ @@ -8,7 +5,7 @@ use crate::{ ffmpeg::{AVHWDeviceType, AVPixelFormat}, ffmpeg_ram::{ ffmpeg_ram_decode, ffmpeg_ram_free_decoder, ffmpeg_ram_new_decoder, CodecInfo, - AV_NUM_DATA_POINTERS, + AV_NUM_DATA_POINTERS, Priority, }, }; use log::error; @@ -16,7 +13,6 @@ use std::{ ffi::{c_void, CString}, os::raw::c_int, slice::from_raw_parts, - time::Instant, vec, }; @@ -179,188 +175,19 @@ impl Decoder { } } + /// Returns available decoders for IP-KVM scenario. + /// Only MJPEG software decoder is supported as IP-KVM captures from video capture cards + /// that output MJPEG streams. pub fn available_decoders() -> Vec { - use log::debug; - - #[allow(unused_mut)] - let mut codecs: Vec = vec![]; - // windows disable nvdec to avoid gpu stuck - #[cfg(target_os = "linux")] - { - let (nv, _, _) = crate::common::supported_gpu(false); - debug!("Linux GPU support detected - NV: {}", nv); - if nv { - codecs.push(CodecInfo { - name: "h264".to_owned(), - format: H264, - hwdevice: AV_HWDEVICE_TYPE_CUDA, - priority: Priority::Good as _, - ..Default::default() - }); - codecs.push(CodecInfo { - name: "hevc".to_owned(), - format: H265, - hwdevice: AV_HWDEVICE_TYPE_CUDA, - priority: Priority::Good as _, - ..Default::default() - }); - } - } - - #[cfg(target_os = "windows")] - { - codecs.append(&mut vec![ - CodecInfo { - name: "h264".to_owned(), - format: H264, - hwdevice: AV_HWDEVICE_TYPE_D3D11VA, - priority: Priority::Best as _, - ..Default::default() - }, - CodecInfo { - name: "hevc".to_owned(), - format: H265, - hwdevice: AV_HWDEVICE_TYPE_D3D11VA, - priority: Priority::Best as _, - ..Default::default() - }, - ]); - } - - #[cfg(target_os = "linux")] - { - codecs.append(&mut vec![ - CodecInfo { - name: "h264".to_owned(), - format: H264, - hwdevice: AV_HWDEVICE_TYPE_VAAPI, - priority: Priority::Good as _, - ..Default::default() - }, - CodecInfo { - name: "hevc".to_owned(), - format: H265, - hwdevice: AV_HWDEVICE_TYPE_VAAPI, - priority: Priority::Good as _, - ..Default::default() - }, - CodecInfo { - name: "mjpeg".to_owned(), - format: MJPEG, - hwdevice: AV_HWDEVICE_TYPE_VAAPI, - priority: Priority::Good as _, - ..Default::default() - }, - ]); - } - - #[cfg(target_os = "macos")] - { - let (_, _, h264, h265) = crate::common::get_video_toolbox_codec_support(); - debug!( - "VideoToolbox decode support - H264: {}, H265: {}", - h264, h265 - ); - if h264 { - codecs.push(CodecInfo { - name: "h264".to_owned(), - format: H264, - hwdevice: AV_HWDEVICE_TYPE_VIDEOTOOLBOX, - priority: Priority::Best as _, - ..Default::default() - }); - } - if h265 { - codecs.push(CodecInfo { - name: "hevc".to_owned(), - format: H265, - hwdevice: AV_HWDEVICE_TYPE_VIDEOTOOLBOX, - priority: Priority::Best as _, - ..Default::default() - }); - } - } - - let mut res = Vec::::new(); - let buf264 = &crate::common::DATA_H264_720P[..]; - let buf265 = &crate::common::DATA_H265_720P[..]; - - for codec in codecs { - // Skip if this format already exists in results - if res - .iter() - .any(|existing: &CodecInfo| existing.format == codec.format) - { - continue; - } - - debug!( - "Testing decoder: {} (hwdevice: {:?})", - codec.name, codec.hwdevice - ); - - let c = DecodeContext { - name: codec.name.clone(), - device_type: codec.hwdevice, - thread_count: 4, - }; - - match Decoder::new(c) { - Ok(mut decoder) => { - debug!("Decoder {} created successfully", codec.name); - - // MJPEG decoder doesn't need test data - just verify it can be created - if codec.format == MJPEG { - debug!("MJPEG decoder {} test passed (creation only)", codec.name); - res.push(codec); - continue; - } - - let data = match codec.format { - H264 => buf264, - H265 => buf265, - _ => { - log::error!("Unsupported format: {:?}, skipping", codec.format); - continue; - } - }; - - let start = Instant::now(); - - match decoder.decode(data) { - Ok(_) => { - let elapsed = start.elapsed().as_millis(); - - if elapsed < TEST_TIMEOUT_MS as _ { - debug!("Decoder {} test passed", codec.name); - res.push(codec); - } else { - debug!( - "Decoder {} test failed - timeout: {}ms", - codec.name, elapsed - ); - } - } - Err(err) => { - debug!("Decoder {} test failed with error: {}", codec.name, err); - } - } - } - Err(_) => { - debug!("Failed to create decoder {}", codec.name); - } - } - } - - let soft = CodecInfo::soft(); - if let Some(c) = soft.h264 { - res.push(c); - } - if let Some(c) = soft.h265 { - res.push(c); - } - - res + // IP-KVM scenario only needs MJPEG decoding + // MJPEG comes from video capture cards, software decoding is sufficient + vec![CodecInfo { + name: "mjpeg".to_owned(), + format: MJPEG, + hwdevice: AV_HWDEVICE_TYPE_NONE, + priority: Priority::Best as _, + ..Default::default() + }] } } diff --git a/libs/hwcodec/src/ffmpeg_ram/encode.rs b/libs/hwcodec/src/ffmpeg_ram/encode.rs index 1bf8c139..065d9bda 100644 --- a/libs/hwcodec/src/ffmpeg_ram/encode.rs +++ b/libs/hwcodec/src/ffmpeg_ram/encode.rs @@ -1,8 +1,5 @@ use crate::{ - common::{ - DataFormat::{self, *}, - Quality, RateControl, TEST_TIMEOUT_MS, - }, + common::DataFormat::{self, *}, ffmpeg::{init_av_log, AVPixelFormat}, ffmpeg_ram::{ ffmpeg_linesize_offset_length, ffmpeg_ram_encode, ffmpeg_ram_free_encoder, @@ -21,6 +18,9 @@ use super::Priority; #[cfg(any(windows, target_os = "linux"))] use crate::common::Driver; +/// Timeout for encoder test in milliseconds +const TEST_TIMEOUT_MS: u64 = 3000; + #[derive(Debug, Clone, PartialEq)] pub struct EncodeContext { pub name: String, @@ -31,8 +31,8 @@ pub struct EncodeContext { pub align: i32, pub fps: i32, pub gop: i32, - pub rc: RateControl, - pub quality: Quality, + pub rc: crate::common::RateControl, + pub quality: crate::common::Quality, pub kbs: i32, pub q: i32, pub thread_count: i32, @@ -175,25 +175,15 @@ impl Encoder { pub fn available_encoders(ctx: EncodeContext, _sdk: Option) -> Vec { use log::debug; - if !(cfg!(windows) || cfg!(target_os = "linux") || cfg!(target_os = "macos")) { + if !(cfg!(windows) || cfg!(target_os = "linux")) { return vec![]; } let mut codecs: Vec = vec![]; #[cfg(any(windows, target_os = "linux"))] { let contains = |_vendor: Driver, _format: DataFormat| { - #[cfg(all(windows, feature = "vram"))] - { - if let Some(_sdk) = _sdk.as_ref() { - if !_sdk.is_empty() { - if let Ok(available) = - crate::vram::Available::deserialize(_sdk.as_str()) - { - return available.contains(true, _vendor, _format); - } - } - } - } + // Without VRAM feature, we can't check SDK availability + // Just return true and let FFmpeg handle the actual detection true }; let (_nv, amf, _intel) = crate::common::supported_gpu(true); @@ -245,7 +235,6 @@ impl Encoder { }); } if amf { - // sdk not use h265 codecs.push(CodecInfo { name: "hevc_amf".to_owned(), format: H265, @@ -322,28 +311,6 @@ impl Encoder { } } - #[cfg(target_os = "macos")] - { - let (_h264, h265, _, _) = crate::common::get_video_toolbox_codec_support(); - // h264 encode failed too often, not AV_CODEC_CAP_HARDWARE - // if h264 { - // codecs.push(CodecInfo { - // name: "h264_videotoolbox".to_owned(), - // format: H264, - // priority: Priority::Best as _, - // ..Default::default() - // }); - // } - if h265 { - codecs.push(CodecInfo { - name: "hevc_videotoolbox".to_owned(), - format: H265, - priority: Priority::Best as _, - ..Default::default() - }); - } - } - // qsv doesn't support yuv420p codecs.retain(|c| { let ctx = ctx.clone(); @@ -379,11 +346,7 @@ impl Encoder { let mut passed = false; let mut last_err: Option = None; - let max_attempts = if cfg!(all(target_os = "macos", target_arch = "x86_64")) { - 3 - } else { - 1 - }; + let max_attempts = 1; for attempt in 0..max_attempts { let pts = (attempt as i64) * 33; // 33ms is an approximation for 30 FPS (1000 / 30) let start = std::time::Instant::now(); diff --git a/libs/hwcodec/src/lib.rs b/libs/hwcodec/src/lib.rs index 08e9ecc3..33054dd8 100644 --- a/libs/hwcodec/src/lib.rs +++ b/libs/hwcodec/src/lib.rs @@ -1,11 +1,6 @@ pub mod common; pub mod ffmpeg; pub mod ffmpeg_ram; -pub mod mux; -#[cfg(all(windows, feature = "vram"))] -pub mod vram; -#[cfg(target_os = "android")] -pub mod android; #[no_mangle] pub extern "C" fn hwcodec_log(level: i32, message: *const std::os::raw::c_char) { diff --git a/libs/hwcodec/src/mux.rs b/libs/hwcodec/src/mux.rs deleted file mode 100644 index 7ecac876..00000000 --- a/libs/hwcodec/src/mux.rs +++ /dev/null @@ -1,98 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -include!(concat!(env!("OUT_DIR"), "/mux_ffi.rs")); - -use log::{error, trace}; - -use crate::ffmpeg::{av_log_get_level, AV_LOG_ERROR}; -use std::{ - ffi::{c_void, CString}, - time::Instant, -}; - -#[derive(Debug, Clone, PartialEq)] -pub struct MuxContext { - pub filename: String, - pub width: usize, - pub height: usize, - pub is265: bool, - pub framerate: usize, -} - -pub struct Muxer { - inner: *mut c_void, - pub ctx: MuxContext, - start: Instant, -} - -unsafe impl Send for Muxer {} -unsafe impl Sync for Muxer {} - -impl Muxer { - pub fn new(ctx: MuxContext) -> Result { - unsafe { - let inner = hwcodec_new_muxer( - CString::new(ctx.filename.as_str()) - .map_err(|_| ())? - .as_ptr(), - ctx.width as _, - ctx.height as _, - if ctx.is265 { 1 } else { 0 }, - ctx.framerate as _, - ); - if inner.is_null() { - return Err(()); - } - - Ok(Muxer { - inner, - ctx, - start: Instant::now(), - }) - } - } - - pub fn write_video(&mut self, data: &[u8], key: bool) -> Result<(), i32> { - unsafe { - let result = hwcodec_write_video_frame( - self.inner, - (*data).as_ptr(), - data.len() as _, - self.start.elapsed().as_millis() as _, - if key { 1 } else { 0 }, - ); - if result != 0 { - if av_log_get_level() >= AV_LOG_ERROR as _ { - error!("Error write_video: {}", result); - } - return Err(result); - } - Ok(()) - } - } - - pub fn write_tail(&mut self) -> Result<(), i32> { - unsafe { - let result = hwcodec_write_tail(self.inner); - if result != 0 { - if av_log_get_level() >= AV_LOG_ERROR as _ { - error!("Error write_tail: {}", result); - } - return Err(result); - } - Ok(()) - } - } -} - -impl Drop for Muxer { - fn drop(&mut self) { - unsafe { - hwcodec_free_muxer(self.inner); - self.inner = std::ptr::null_mut(); - trace!("Muxer dropped"); - } - } -} diff --git a/libs/hwcodec/src/res/720p.h264 b/libs/hwcodec/src/res/720p.h264 deleted file mode 100644 index 61b3bb27..00000000 Binary files a/libs/hwcodec/src/res/720p.h264 and /dev/null differ diff --git a/libs/hwcodec/src/res/720p.h265 b/libs/hwcodec/src/res/720p.h265 deleted file mode 100644 index 8e72d441..00000000 Binary files a/libs/hwcodec/src/res/720p.h265 and /dev/null differ diff --git a/libs/hwcodec/src/vram/amf.rs b/libs/hwcodec/src/vram/amf.rs deleted file mode 100644 index cb43a28b..00000000 --- a/libs/hwcodec/src/vram/amf.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(unused)] -include!(concat!(env!("OUT_DIR"), "/amf_ffi.rs")); - -use crate::{ - common::DataFormat::*, - vram::inner::{DecodeCalls, EncodeCalls, InnerDecodeContext, InnerEncodeContext}, -}; - -pub fn encode_calls() -> EncodeCalls { - EncodeCalls { - new: amf_new_encoder, - encode: amf_encode, - destroy: amf_destroy_encoder, - test: amf_test_encode, - set_bitrate: amf_set_bitrate, - set_framerate: amf_set_framerate, - } -} - -pub fn decode_calls() -> DecodeCalls { - DecodeCalls { - new: amf_new_decoder, - decode: amf_decode, - destroy: amf_destroy_decoder, - test: amf_test_decode, - } -} - -// to-do: hardware ability -pub fn possible_support_encoders() -> Vec { - if unsafe { amf_driver_support() } != 0 { - return vec![]; - } - let codecs = vec![H264, H265]; - - let mut v = vec![]; - for codec in codecs.iter() { - v.push(InnerEncodeContext { - format: codec.clone(), - }); - } - v -} - -pub fn possible_support_decoders() -> Vec { - if unsafe { amf_driver_support() } != 0 { - return vec![]; - } - // https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/432#issuecomment-1873141122 - let codecs = vec![H264]; - - let mut v = vec![]; - for codec in codecs.iter() { - v.push(InnerDecodeContext { - data_format: codec.clone(), - }); - } - v -} diff --git a/libs/hwcodec/src/vram/decode.rs b/libs/hwcodec/src/vram/decode.rs deleted file mode 100644 index aa43ad74..00000000 --- a/libs/hwcodec/src/vram/decode.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::{ - common::{DataFormat::*, Driver::*}, - ffmpeg::init_av_log, - vram::{amf, ffmpeg, inner::DecodeCalls, mfx, nv, DecodeContext}, -}; -use log::trace; -use std::ffi::c_void; - -pub struct Decoder { - calls: DecodeCalls, - codec: *mut c_void, - frames: *mut Vec, - pub ctx: DecodeContext, -} - -unsafe impl Send for Decoder {} -unsafe impl Sync for Decoder {} - -extern "C" { - fn hwcodec_get_d3d11_texture_width_height( - texture: *mut c_void, - width: *mut i32, - height: *mut i32, - ); -} - -impl Decoder { - pub fn new(ctx: DecodeContext) -> Result { - init_av_log(); - let calls = match ctx.driver { - NV => nv::decode_calls(), - AMF => amf::decode_calls(), - MFX => mfx::decode_calls(), - FFMPEG => ffmpeg::decode_calls(), - }; - unsafe { - let codec = (calls.new)( - ctx.device.unwrap_or(std::ptr::null_mut()), - ctx.luid, - ctx.data_format as i32, - ); - if codec.is_null() { - return Err(()); - } - Ok(Self { - calls, - codec, - frames: Box::into_raw(Box::new(Vec::::new())), - ctx, - }) - } - } - - pub fn decode(&mut self, packet: &[u8]) -> Result<&mut Vec, i32> { - unsafe { - (&mut *self.frames).clear(); - let ret = (self.calls.decode)( - self.codec, - packet.as_ptr() as _, - packet.len() as _, - Some(Self::callback), - self.frames as *mut _ as *mut c_void, - ); - - if ret != 0 { - Err(ret) - } else { - Ok(&mut *self.frames) - } - } - } - - unsafe extern "C" fn callback(texture: *mut c_void, obj: *const c_void) { - let frames = &mut *(obj as *mut Vec); - let mut width = 0; - let mut height = 0; - hwcodec_get_d3d11_texture_width_height(texture, &mut width, &mut height); - - let frame = DecodeFrame { - texture, - width, - height, - }; - frames.push(frame); - } -} - -impl Drop for Decoder { - fn drop(&mut self) { - unsafe { - (self.calls.destroy)(self.codec); - self.codec = std::ptr::null_mut(); - let _ = Box::from_raw(self.frames); - trace!("Decoder dropped"); - } - } -} - -pub struct DecodeFrame { - pub texture: *mut c_void, - pub width: i32, - pub height: i32, -} - -pub fn available() -> Vec { - use log::debug; - - let mut codecs: Vec<_> = vec![]; - // disable nv sdk decode - // codecs.append( - // &mut nv::possible_support_decoders() - // .drain(..) - // .map(|n| (NV, n)) - // .collect(), - // ); - codecs.append( - &mut ffmpeg::possible_support_decoders() - .drain(..) - .map(|n| (FFMPEG, n)) - .collect(), - ); - codecs.append( - &mut amf::possible_support_decoders() - .drain(..) - .map(|n| (AMF, n)) - .collect(), - ); - codecs.append( - &mut mfx::possible_support_decoders() - .drain(..) - .map(|n| (MFX, n)) - .collect(), - ); - - let inputs: Vec = codecs - .drain(..) - .map(|(driver, n)| DecodeContext { - device: None, - driver: driver.clone(), - vendor: driver, // Initially set vendor same as driver, will be updated by test results - data_format: n.data_format, - luid: 0, - }) - .collect(); - - let mut outputs = Vec::::new(); - let mut exclude_luid_formats = Vec::<(i64, i32)>::new(); - let buf264 = &crate::common::DATA_H264_720P[..]; - let buf265 = &crate::common::DATA_H265_720P[..]; - - for input in inputs { - debug!( - "Testing vram decoder: driver={:?}, format={:?}", - input.driver, input.data_format - ); - - let test = match input.driver { - NV => nv::decode_calls().test, - AMF => amf::decode_calls().test, - MFX => mfx::decode_calls().test, - FFMPEG => ffmpeg::decode_calls().test, - }; - - let mut luids: Vec = vec![0; crate::vram::MAX_ADATERS]; - let mut vendors: Vec = vec![0; crate::vram::MAX_ADATERS]; - let mut desc_count: i32 = 0; - - let data = match input.data_format { - H264 => buf264, - H265 => buf265, - _ => { - debug!("Unsupported data format: {:?}, skipping", input.data_format); - continue; - } - }; - - let (excluded_luids, exclude_formats): (Vec, Vec) = exclude_luid_formats - .iter() - .map(|(luid, format)| (*luid, *format)) - .unzip(); - - let result = unsafe { - test( - luids.as_mut_ptr(), - vendors.as_mut_ptr(), - luids.len() as _, - &mut desc_count, - input.data_format as i32, - data.as_ptr() as *mut u8, - data.len() as _, - excluded_luids.as_ptr(), - exclude_formats.as_ptr(), - exclude_luid_formats.len() as i32, - ) - }; - - if result == 0 { - if desc_count as usize <= luids.len() { - debug!( - "vram decoder test passed: driver={:?}, adapters={}", - input.driver, desc_count - ); - for i in 0..desc_count as usize { - let mut input = input.clone(); - input.luid = luids[i]; - input.vendor = match vendors[i] { - 0 => NV, - 1 => AMF, - 2 => MFX, - _ => { - log::error!( - "Unexpected vendor value encountered: {}. Skipping.", - vendors[i] - ); - continue; - }, }; - exclude_luid_formats.push((luids[i], input.data_format as i32)); - outputs.push(input); - } - } - } else { - debug!( - "vram decoder test failed: driver={:?}, error={}", - input.driver, result - ); - } - } - - outputs -} diff --git a/libs/hwcodec/src/vram/encode.rs b/libs/hwcodec/src/vram/encode.rs deleted file mode 100644 index 928fbe08..00000000 --- a/libs/hwcodec/src/vram/encode.rs +++ /dev/null @@ -1,248 +0,0 @@ -use crate::{ - common::Driver::*, - ffmpeg::init_av_log, - vram::{ - amf, ffmpeg, inner::EncodeCalls, mfx, nv, DynamicContext, EncodeContext, FeatureContext, - }, -}; -use log::trace; -use std::{ - fmt::Display, os::raw::{c_int, c_void}, slice::from_raw_parts -}; - -pub struct Encoder { - calls: EncodeCalls, - codec: *mut c_void, - frames: *mut Vec, - pub ctx: EncodeContext, -} - -unsafe impl Send for Encoder {} -unsafe impl Sync for Encoder {} - -impl Encoder { - pub fn new(ctx: EncodeContext) -> Result { - init_av_log(); - if ctx.d.width % 2 == 1 || ctx.d.height % 2 == 1 { - return Err(()); - } - let calls = match ctx.f.driver { - NV => nv::encode_calls(), - AMF => amf::encode_calls(), - MFX => mfx::encode_calls(), - FFMPEG => ffmpeg::encode_calls(), - }; - unsafe { - let codec = (calls.new)( - ctx.d.device.unwrap_or(std::ptr::null_mut()), - ctx.f.luid, - ctx.f.data_format as i32, - ctx.d.width, - ctx.d.height, - ctx.d.kbitrate, - ctx.d.framerate, - ctx.d.gop, - ); - if codec.is_null() { - return Err(()); - } - Ok(Self { - calls, - codec, - frames: Box::into_raw(Box::new(Vec::::new())), - ctx, - }) - } - } - - pub fn encode(&mut self, tex: *mut c_void, ms: i64) -> Result<&mut Vec, i32> { - unsafe { - (&mut *self.frames).clear(); - let result = (self.calls.encode)( - self.codec, - tex, - Some(Self::callback), - self.frames as *mut _ as *mut c_void, - ms, - ); - if result != 0 { - Err(result) - } else { - Ok(&mut *self.frames) - } - } - } - - extern "C" fn callback(data: *const u8, size: c_int, key: i32, obj: *const c_void, pts: i64) { - unsafe { - let frames = &mut *(obj as *mut Vec); - frames.push(EncodeFrame { - data: from_raw_parts(data, size as usize).to_vec(), - pts, - key, - }); - } - } - - pub fn set_bitrate(&mut self, kbs: i32) -> Result<(), i32> { - unsafe { - match (self.calls.set_bitrate)(self.codec, kbs) { - 0 => Ok(()), - err => Err(err), - } - } - } - - pub fn set_framerate(&mut self, framerate: i32) -> Result<(), i32> { - unsafe { - match (self.calls.set_framerate)(self.codec, framerate) { - 0 => Ok(()), - err => Err(err), - } - } - } -} - -impl Drop for Encoder { - fn drop(&mut self) { - unsafe { - (self.calls.destroy)(self.codec); - self.codec = std::ptr::null_mut(); - let _ = Box::from_raw(self.frames); - trace!("Encoder dropped"); - } - } -} - -pub struct EncodeFrame { - pub data: Vec, - pub pts: i64, - pub key: i32, -} - -impl Display for EncodeFrame { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "encode len:{}, key:{}", self.data.len(), self.key) - } -} - -pub fn available(d: DynamicContext) -> Vec { - use log::debug; - - let mut natives: Vec<_> = vec![]; - natives.append( - &mut ffmpeg::possible_support_encoders() - .drain(..) - .map(|n| (FFMPEG, n)) - .collect(), - ); - natives.append( - &mut nv::possible_support_encoders() - .drain(..) - .map(|n| (NV, n)) - .collect(), - ); - natives.append( - &mut amf::possible_support_encoders() - .drain(..) - .map(|n| (AMF, n)) - .collect(), - ); - natives.append( - &mut mfx::possible_support_encoders() - .drain(..) - .map(|n| (MFX, n)) - .collect(), - ); - let inputs: Vec = natives - .drain(..) - .map(|(driver, n)| EncodeContext { - f: FeatureContext { - driver: driver.clone(), - vendor: driver, // Initially set vendor same as driver, will be updated by test results - data_format: n.format, - luid: 0, - }, - d, - }) - .collect(); - - let mut outputs = Vec::::new(); - let mut exclude_luid_formats = Vec::<(i64, i32)>::new(); - - for input in inputs { - debug!( - "Testing vram encoder: driver={:?}, format={:?}", - input.f.driver, input.f.data_format - ); - - let test = match input.f.driver { - NV => nv::encode_calls().test, - AMF => amf::encode_calls().test, - MFX => mfx::encode_calls().test, - FFMPEG => ffmpeg::encode_calls().test, - }; - - let mut luids: Vec = vec![0; crate::vram::MAX_ADATERS]; - let mut vendors: Vec = vec![0; crate::vram::MAX_ADATERS]; - let mut desc_count: i32 = 0; - - let (excluded_luids, exclude_formats): (Vec, Vec) = exclude_luid_formats - .iter() - .map(|(luid, format)| (*luid, *format)) - .unzip(); - - let result = unsafe { - test( - luids.as_mut_ptr(), - vendors.as_mut_ptr(), - luids.len() as _, - &mut desc_count, - input.f.data_format as i32, - input.d.width, - input.d.height, - input.d.kbitrate, - input.d.framerate, - input.d.gop, - excluded_luids.as_ptr(), - exclude_formats.as_ptr(), - exclude_luid_formats.len() as i32, - ) - }; - - if result == 0 { - if desc_count as usize <= luids.len() { - debug!( - "vram encoder test passed: driver={:?}, adapters={}", - input.f.driver, desc_count - ); - for i in 0..desc_count as usize { - let mut input = input.clone(); - input.f.luid = luids[i]; - input.f.vendor = match vendors[i] { - 0 => NV, - 1 => AMF, - 2 => MFX, - _ => { - log::error!( - "Unexpected vendor value encountered: {}. Skipping.", - vendors[i] - ); - continue; - }, - }; - exclude_luid_formats.push((luids[i], input.f.data_format as i32)); - outputs.push(input); - } - } - } else { - debug!( - "vram encoder test failed: driver={:?}, error={}", - input.f.driver, result - ); - } - } - - let result: Vec<_> = outputs.drain(..).map(|e| e.f).collect(); - result -} diff --git a/libs/hwcodec/src/vram/ffmpeg.rs b/libs/hwcodec/src/vram/ffmpeg.rs deleted file mode 100644 index c4813cfc..00000000 --- a/libs/hwcodec/src/vram/ffmpeg.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(unused)] -include!(concat!(env!("OUT_DIR"), "/ffmpeg_vram_ffi.rs")); - -use crate::{ - common::DataFormat::*, - vram::inner::{DecodeCalls, EncodeCalls, InnerDecodeContext, InnerEncodeContext}, -}; - -pub fn encode_calls() -> EncodeCalls { - EncodeCalls { - new: ffmpeg_vram_new_encoder, - encode: ffmpeg_vram_encode, - destroy: ffmpeg_vram_destroy_encoder, - test: ffmpeg_vram_test_encode, - set_bitrate: ffmpeg_vram_set_bitrate, - set_framerate: ffmpeg_vram_set_framerate, - } -} - -pub fn decode_calls() -> DecodeCalls { - DecodeCalls { - new: ffmpeg_vram_new_decoder, - decode: ffmpeg_vram_decode, - destroy: ffmpeg_vram_destroy_decoder, - test: ffmpeg_vram_test_decode, - } -} - -pub fn possible_support_encoders() -> Vec { - let dataFormats = vec![H264, H265]; - let mut v = vec![]; - for dataFormat in dataFormats.iter() { - v.push(InnerEncodeContext { - format: dataFormat.clone(), - }); - } - v -} - -pub fn possible_support_decoders() -> Vec { - let codecs = vec![H264, H265]; - let mut v = vec![]; - for codec in codecs.iter() { - v.push(InnerDecodeContext { - data_format: codec.clone(), - }); - } - v -} diff --git a/libs/hwcodec/src/vram/inner.rs b/libs/hwcodec/src/vram/inner.rs deleted file mode 100644 index fbb8962d..00000000 --- a/libs/hwcodec/src/vram/inner.rs +++ /dev/null @@ -1,88 +0,0 @@ -use crate::common::{DataFormat, DecodeCallback, EncodeCallback}; -use std::os::raw::{c_int, c_void}; - -pub type NewEncoderCall = unsafe extern "C" fn( - hdl: *mut c_void, - luid: i64, - codecID: i32, - width: i32, - height: i32, - bitrate: i32, - framerate: i32, - gop: i32, -) -> *mut c_void; - -pub type EncodeCall = unsafe extern "C" fn( - encoder: *mut c_void, - tex: *mut c_void, - callback: EncodeCallback, - obj: *mut c_void, - ms: i64, -) -> c_int; - -pub type NewDecoderCall = - unsafe extern "C" fn(device: *mut c_void, luid: i64, dataFormat: i32) -> *mut c_void; - -pub type DecodeCall = unsafe extern "C" fn( - decoder: *mut c_void, - data: *mut u8, - length: i32, - callback: DecodeCallback, - obj: *mut c_void, -) -> c_int; - -pub type TestEncodeCall = unsafe extern "C" fn( - outLuids: *mut i64, - outVendors: *mut i32, - maxDescNum: i32, - outDescNum: *mut i32, - dataFormat: i32, - width: i32, - height: i32, - kbs: i32, - framerate: i32, - gop: i32, - excludedLuids: *const i64, - excludeFormats: *const i32, - excludeCount: i32, -) -> c_int; - -pub type TestDecodeCall = unsafe extern "C" fn( - outLuids: *mut i64, - outVendors: *mut i32, - maxDescNum: i32, - outDescNum: *mut i32, - dataFormat: i32, - data: *mut u8, - length: i32, - excludedLuids: *const i64, - excludeFormats: *const i32, - excludeCount: i32, -) -> c_int; - -pub type IVCall = unsafe extern "C" fn(v: *mut c_void) -> c_int; - -pub type IVICall = unsafe extern "C" fn(v: *mut c_void, i: i32) -> c_int; - -pub struct EncodeCalls { - pub new: NewEncoderCall, - pub encode: EncodeCall, - pub destroy: IVCall, - pub test: TestEncodeCall, - pub set_bitrate: IVICall, - pub set_framerate: IVICall, -} -pub struct DecodeCalls { - pub new: NewDecoderCall, - pub decode: DecodeCall, - pub destroy: IVCall, - pub test: TestDecodeCall, -} - -pub struct InnerEncodeContext { - pub format: DataFormat, -} - -pub struct InnerDecodeContext { - pub data_format: DataFormat, -} diff --git a/libs/hwcodec/src/vram/mfx.rs b/libs/hwcodec/src/vram/mfx.rs deleted file mode 100644 index 68753c1b..00000000 --- a/libs/hwcodec/src/vram/mfx.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(unused)] -include!(concat!(env!("OUT_DIR"), "/mfx_ffi.rs")); - -use crate::{ - common::DataFormat::*, - vram::inner::{DecodeCalls, EncodeCalls, InnerDecodeContext, InnerEncodeContext}, -}; - -pub fn encode_calls() -> EncodeCalls { - EncodeCalls { - new: mfx_new_encoder, - encode: mfx_encode, - destroy: mfx_destroy_encoder, - test: mfx_test_encode, - set_bitrate: mfx_set_bitrate, - set_framerate: mfx_set_framerate, - } -} - -pub fn decode_calls() -> DecodeCalls { - DecodeCalls { - new: mfx_new_decoder, - decode: mfx_decode, - destroy: mfx_destroy_decoder, - test: mfx_test_decode, - } -} - -pub fn possible_support_encoders() -> Vec { - if unsafe { mfx_driver_support() } != 0 { - return vec![]; - } - let dataFormats = vec![H264, H265]; - let mut v = vec![]; - for dataFormat in dataFormats.iter() { - v.push(InnerEncodeContext { - format: dataFormat.clone(), - }); - } - v -} - -pub fn possible_support_decoders() -> Vec { - if unsafe { mfx_driver_support() } != 0 { - return vec![]; - } - let dataFormats = vec![H264, H265]; - let mut v = vec![]; - for dataFormat in dataFormats.iter() { - v.push(InnerDecodeContext { - data_format: dataFormat.clone(), - }); - } - v -} diff --git a/libs/hwcodec/src/vram/mod.rs b/libs/hwcodec/src/vram/mod.rs deleted file mode 100644 index a4ca2a07..00000000 --- a/libs/hwcodec/src/vram/mod.rs +++ /dev/null @@ -1,90 +0,0 @@ -pub(crate) mod amf; -pub mod decode; -pub mod encode; -pub(crate) mod ffmpeg; -mod inner; -pub(crate) mod mfx; -pub(crate) mod nv; - -pub(crate) const MAX_ADATERS: usize = 16; - -use crate::common::{DataFormat, Driver}; -pub use serde; -pub use serde_derive; -use serde_derive::{Deserialize, Serialize}; -use std::ffi::c_void; - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -pub struct FeatureContext { - pub driver: Driver, - pub vendor: Driver, - pub luid: i64, - pub data_format: DataFormat, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)] -pub struct DynamicContext { - #[serde(skip)] - pub device: Option<*mut c_void>, - pub width: i32, - pub height: i32, - pub kbitrate: i32, - pub framerate: i32, - pub gop: i32, -} - -unsafe impl Send for DynamicContext {} -unsafe impl Sync for DynamicContext {} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -pub struct EncodeContext { - pub f: FeatureContext, - pub d: DynamicContext, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -pub struct DecodeContext { - #[serde(skip)] - pub device: Option<*mut c_void>, - pub driver: Driver, - pub vendor: Driver, - pub luid: i64, - pub data_format: DataFormat, -} - -unsafe impl Send for DecodeContext {} -unsafe impl Sync for DecodeContext {} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -pub struct Available { - pub e: Vec, - pub d: Vec, -} - -impl Available { - pub fn serialize(&self) -> Result { - match serde_json::to_string_pretty(self) { - Ok(s) => Ok(s), - Err(_) => Err(()), - } - } - - pub fn deserialize(s: &str) -> Result { - match serde_json::from_str(s) { - Ok(c) => Ok(c), - Err(_) => Err(()), - } - } - - pub fn contains(&self, encode: bool, vendor: Driver, data_format: DataFormat) -> bool { - if encode { - self.e - .iter() - .any(|f| f.vendor == vendor && f.data_format == data_format) - } else { - self.d - .iter() - .any(|d| d.vendor == vendor && d.data_format == data_format) - } - } -} diff --git a/libs/hwcodec/src/vram/nv.rs b/libs/hwcodec/src/vram/nv.rs deleted file mode 100644 index a78b9dfd..00000000 --- a/libs/hwcodec/src/vram/nv.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(unused)] -include!(concat!(env!("OUT_DIR"), "/nv_ffi.rs")); - -use crate::{ - common::DataFormat::*, - vram::inner::{DecodeCalls, EncodeCalls, InnerDecodeContext, InnerEncodeContext}, -}; - -pub fn encode_calls() -> EncodeCalls { - EncodeCalls { - new: nv_new_encoder, - encode: nv_encode, - destroy: nv_destroy_encoder, - test: nv_test_encode, - set_bitrate: nv_set_bitrate, - set_framerate: nv_set_framerate, - } -} - -pub fn decode_calls() -> DecodeCalls { - DecodeCalls { - new: nv_new_decoder, - decode: nv_decode, - destroy: nv_destroy_decoder, - test: nv_test_decode, - } -} - -pub fn possible_support_encoders() -> Vec { - if unsafe { nv_encode_driver_support() } != 0 { - return vec![]; - } - let dataFormats = vec![H264, H265]; - let mut v = vec![]; - for dataFormat in dataFormats.iter() { - v.push(InnerEncodeContext { - format: dataFormat.clone(), - }); - } - v -} - -pub fn possible_support_decoders() -> Vec { - if unsafe { nv_encode_driver_support() } != 0 { - return vec![]; - } - let dataFormats = vec![H264, H265]; - let mut v = vec![]; - for dataFormat in dataFormats.iter() { - v.push(InnerDecodeContext { - data_format: dataFormat.clone(), - }); - } - v -}