Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
0d222b6b
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0d222b6b
编写于
11月 10, 2020
作者:
V
Vadim Zhukov
提交者:
Jim
11月 14, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add OpenBSD support
上级
fc6d5376
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
96 addition
and
4 deletion
+96
-4
UI/obs-app.cpp
UI/obs-app.cpp
+2
-0
libobs/obs-nix.c
libobs/obs-nix.c
+20
-2
libobs/util/platform-nix.c
libobs/util/platform-nix.c
+61
-1
libobs/util/profiler.c
libobs/util/profiler.c
+4
-0
plugins/obs-outputs/librtmp/rtmp.c
plugins/obs-outputs/librtmp/rtmp.c
+9
-1
未找到文件。
UI/obs-app.cpp
浏览文件 @
0d222b6b
...
...
@@ -1440,6 +1440,8 @@ string OBSApp::GetVersionString() const
ver
<<
"windows)"
;
#elif __APPLE__
ver
<<
"mac)"
;
#elif __OpenBSD__
ver
<<
"openbsd)"
;
#elif __FreeBSD__
ver
<<
"freebsd)"
;
#else
/* assume linux for the time being */
...
...
libobs/obs-nix.c
浏览文件 @
0d222b6b
...
...
@@ -23,10 +23,12 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#if defined(__FreeBSD__)
#if defined(__FreeBSD__)
|| defined(__OpenBSD__)
#include <sys/sysctl.h>
#endif
#if !defined(__OpenBSD__)
#include <sys/sysinfo.h>
#endif
#include <sys/utsname.h>
#include <xcb/xcb.h>
#if USE_XINPUT
...
...
@@ -155,9 +157,10 @@ static void log_processor_info(void)
dstr_free
(
&
proc_speed
);
free
(
line
);
}
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
|| defined(__OpenBSD__)
static
void
log_processor_speed
(
void
)
{
#ifndef __OpenBSD__
char
*
line
=
NULL
;
size_t
linecap
=
0
;
FILE
*
fp
;
...
...
@@ -187,6 +190,7 @@ static void log_processor_speed(void)
fclose
(
fp
);
dstr_free
(
&
proc_speed
);
free
(
line
);
#endif
}
static
void
log_processor_name
(
void
)
...
...
@@ -218,6 +222,19 @@ static void log_processor_info(void)
static
void
log_memory_info
(
void
)
{
#if defined(__OpenBSD__)
int
mib
[
2
];
size_t
len
;
int64_t
mem
;
mib
[
0
]
=
CTL_HW
;
mib
[
1
]
=
HW_PHYSMEM64
;
len
=
sizeof
(
mem
);
if
(
sysctl
(
mib
,
2
,
&
mem
,
&
len
,
NULL
,
0
)
>=
0
)
blog
(
LOG_INFO
,
"Physical Memory: %"
PRIi64
"MB Total"
,
mem
/
1024
/
1024
);
#else
struct
sysinfo
info
;
if
(
sysinfo
(
&
info
)
<
0
)
return
;
...
...
@@ -227,6 +244,7 @@ static void log_memory_info(void)
(
uint64_t
)
info
.
totalram
*
info
.
mem_unit
/
1024
/
1024
,
((
uint64_t
)
info
.
freeram
+
(
uint64_t
)
info
.
bufferram
)
*
info
.
mem_unit
/
1024
/
1024
);
#endif
}
static
void
log_kernel_version
(
void
)
...
...
libobs/util/platform-nix.c
浏览文件 @
0d222b6b
...
...
@@ -34,14 +34,16 @@
#include <sys/times.h>
#include <sys/wait.h>
#include <libgen.h>
#if
def __FreeBSD__
#if
defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <unistd.h>
#if defined(__FreeBSD__)
#include <libprocstat.h>
#endif
#else
#include <sys/resource.h>
#endif
...
...
@@ -272,6 +274,62 @@ char *os_get_program_data_path_ptr(const char *name)
return
str
;
}
#if defined(__OpenBSD__)
// a bit modified version of https://stackoverflow.com/a/31495527
ssize_t
os_openbsd_get_executable_path
(
char
*
epath
)
{
int
mib
[
4
];
char
**
argv
;
size_t
len
;
const
char
*
comm
;
int
ok
=
0
;
mib
[
0
]
=
CTL_KERN
;
mib
[
1
]
=
KERN_PROC_ARGS
;
mib
[
2
]
=
getpid
();
mib
[
3
]
=
KERN_PROC_ARGV
;
if
(
sysctl
(
mib
,
4
,
NULL
,
&
len
,
NULL
,
0
)
<
0
)
abort
();
if
(
!
(
argv
=
malloc
(
len
)))
abort
();
if
(
sysctl
(
mib
,
4
,
argv
,
&
len
,
NULL
,
0
)
<
0
)
abort
();
comm
=
argv
[
0
];
if
(
*
comm
==
'/'
||
*
comm
==
'.'
)
{
if
(
realpath
(
comm
,
epath
))
ok
=
1
;
}
else
{
char
*
sp
;
char
*
xpath
=
strdup
(
getenv
(
"PATH"
));
char
*
path
=
strtok_r
(
xpath
,
":"
,
&
sp
);
struct
stat
st
;
if
(
!
xpath
)
abort
();
while
(
path
)
{
snprintf
(
epath
,
PATH_MAX
,
"%s/%s"
,
path
,
comm
);
if
(
!
stat
(
epath
,
&
st
)
&&
(
st
.
st_mode
&
S_IXUSR
))
{
ok
=
1
;
break
;
}
path
=
strtok_r
(
NULL
,
":"
,
&
sp
);
}
free
(
xpath
);
}
free
(
argv
);
return
ok
?
(
ssize_t
)
strlen
(
epath
)
:
-
1
;
}
#endif
char
*
os_get_executable_path_ptr
(
const
char
*
name
)
{
char
exe
[
PATH_MAX
];
...
...
@@ -286,6 +344,8 @@ char *os_get_executable_path_ptr(const char *name)
return
NULL
;
}
count
=
pathlen
;
#elif defined(__OpenBSD__)
ssize_t
count
=
os_openbsd_get_executable_path
(
exe
);
#else
ssize_t
count
=
readlink
(
"/proc/self/exe"
,
exe
,
PATH_MAX
-
1
);
if
(
count
>=
0
)
{
...
...
libobs/util/profiler.c
浏览文件 @
0d222b6b
...
...
@@ -1058,7 +1058,11 @@ bool profiler_snapshot_dump_csv_gz(const profiler_snapshot_t *snap,
profiler_snapshot_dump
(
snap
,
dump_csv_gzwrite
,
gz
);
#ifdef _WIN32
gzclose_w
(
gz
);
#else
gzclose
(
gz
);
#endif
return
true
;
}
...
...
plugins/obs-outputs/librtmp/rtmp.c
浏览文件 @
0d222b6b
...
...
@@ -348,6 +348,12 @@ RTMP_TLS_LoadCerts(RTMP *r) {
"/etc/ssl/certs"
);
goto
error
;
}
#elif defined(__OpenBSD__)
if
(
mbedtls_x509_crt_parse_file
(
chain
,
"/etc/ssl/cert.pem"
)
<
0
)
{
RTMP_Log
(
RTMP_LOGERROR
,
"mbedtls_x509_crt_parse_file: Couldn't parse "
"/etc/ssl/cert.pem"
);
goto
error
;
}
#endif
mbedtls_ssl_conf_ca_chain
(
&
r
->
RTMP_TLS_ctx
->
conf
,
chain
,
NULL
);
...
...
@@ -814,8 +820,10 @@ add_addr_info(struct sockaddr_storage *service, socklen_t *addrlen, AVal *host,
*
socket_error
=
WSANO_DATA
;
#elif __FreeBSD__
*
socket_error
=
ENOATTR
;
#el
se
#el
if defined(ENODATA)
*
socket_error
=
ENODATA
;
#else
*
socket_error
=
EAFNOSUPPORT
;
#endif
RTMP_Log
(
RTMP_LOGERROR
,
"Could not resolve server '%s': no valid address found"
,
hostname
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录