界面与品牌 - 默认 UI 语言固定为英文,不再跟随系统区域设置自动切换(frontend/OBSApp.cpp),用户仍可在设置中手动切换 - 程序图标更换为 CAIIC logo:exe 图标 obs-studio.ico 及界面/托盘/About 图标 obs.png - About 窗口精简为 logo + 名称 + 版本号,移除项目介绍、赞助名单、Authors/License 标签页 - 版本号定为 1.0.0(构建参数 OBS_VERSION_OVERRIDE=1.0.0) 分辨率支持 - 移除首次启动将画布强制限制为 1920x1080 的逻辑,默认使用显示器原生分辨率 - 设置-视频 与自动配置向导新增 3840x2160 / 2560x1440 预设 - 自动配置向导性能测试上限放宽至 4K60(软硬件编码数据率上限及起始分辨率钳制) 插件 - 集成 obs-shaderfilter 2.6.0(绿幕抠图/自定义着色器滤镜),并适配新版 libobs 的 gs_image_file_ex API - 补齐缺失的源码:obs-browser、obs-websocket、libdshowcapture(含 external/capture-device-support) 工程 - 新增 .gitignore,排除 deploy/ 发布目录与构建日志
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#include "drm-format.hpp"
|
|
|
|
#include <util/util.hpp>
|
|
|
|
#ifdef ENABLE_BROWSER_SHARED_TEXTURE
|
|
|
|
static const struct obs_cef_video_format supported_formats[] = {
|
|
{
|
|
CEF_COLOR_TYPE_RGBA_8888,
|
|
DRM_FORMAT_ABGR8888,
|
|
GS_RGBA_UNORM,
|
|
"RGBA_8888",
|
|
},
|
|
{
|
|
CEF_COLOR_TYPE_BGRA_8888,
|
|
DRM_FORMAT_ARGB8888,
|
|
GS_BGRA_UNORM,
|
|
"BGRA_8888",
|
|
},
|
|
};
|
|
|
|
constexpr size_t N_SUPPORTED_FORMATS = sizeof(supported_formats) / sizeof(supported_formats[0]);
|
|
|
|
bool obs_cef_all_drm_formats_supported(void)
|
|
{
|
|
size_t n_supported = 0;
|
|
size_t n_formats = 0;
|
|
enum gs_dmabuf_flags dmabuf_flags;
|
|
BPtr<uint32_t> drm_formats;
|
|
|
|
if (!gs_query_dmabuf_capabilities(&dmabuf_flags, &drm_formats, &n_formats))
|
|
return false;
|
|
|
|
for (size_t i = 0; i < n_formats; i++) {
|
|
for (size_t j = 0; j < N_SUPPORTED_FORMATS; j++) {
|
|
if (drm_formats[i] != supported_formats[j].drm_format)
|
|
continue;
|
|
|
|
blog(LOG_DEBUG, "[obs-browser]: CEF color type %s supported", supported_formats[j].pretty_name);
|
|
n_supported++;
|
|
}
|
|
}
|
|
|
|
return n_supported == N_SUPPORTED_FORMATS;
|
|
}
|
|
|
|
struct obs_cef_video_format obs_cef_format_from_cef_type(cef_color_type_t cef_type)
|
|
{
|
|
for (size_t i = 0; i < N_SUPPORTED_FORMATS; i++) {
|
|
if (supported_formats[i].cef_type == cef_type)
|
|
return supported_formats[i];
|
|
}
|
|
|
|
blog(LOG_ERROR, "[obs-browser]: Unsupported CEF color format (%d)", cef_type);
|
|
|
|
return {cef_type, DRM_FORMAT_INVALID, GS_UNKNOWN, NULL};
|
|
}
|
|
|
|
#endif
|