Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
d069302b
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d069302b
编写于
2月 26, 2016
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libobs: Add function to get obs object type
上级
826d5c08
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
31 addition
and
10 deletion
+31
-10
libobs/obs-encoder.c
libobs/obs-encoder.c
+2
-2
libobs/obs-internal.h
libobs/obs-internal.h
+2
-0
libobs/obs-output.c
libobs/obs-output.c
+2
-2
libobs/obs-service.c
libobs/obs-service.c
+2
-2
libobs/obs-source.c
libobs/obs-source.c
+2
-2
libobs/obs.c
libobs/obs.c
+11
-2
libobs/obs.h
libobs/obs.h
+10
-0
未找到文件。
libobs/obs-encoder.c
浏览文件 @
d069302b
...
...
@@ -54,8 +54,8 @@ static bool init_encoder(struct obs_encoder *encoder, const char *name,
return
false
;
if
(
pthread_mutexattr_settype
(
&
attr
,
PTHREAD_MUTEX_RECURSIVE
)
!=
0
)
return
false
;
if
(
!
obs_context_data_init
(
&
encoder
->
context
,
settings
,
name
,
hotkey_data
,
false
))
if
(
!
obs_context_data_init
(
&
encoder
->
context
,
OBS_OBJ_TYPE_ENCODER
,
settings
,
name
,
hotkey_data
,
false
))
return
false
;
if
(
pthread_mutex_init
(
&
encoder
->
init_mutex
,
&
attr
)
!=
0
)
return
false
;
...
...
libobs/obs-internal.h
浏览文件 @
d069302b
...
...
@@ -385,6 +385,7 @@ struct obs_context_data {
obs_data_t
*
settings
;
signal_handler_t
*
signals
;
proc_handler_t
*
procs
;
enum
obs_obj_type
type
;
DARRAY
(
obs_hotkey_id
)
hotkeys
;
DARRAY
(
obs_hotkey_pair_id
)
hotkey_pairs
;
...
...
@@ -402,6 +403,7 @@ struct obs_context_data {
extern
bool
obs_context_data_init
(
struct
obs_context_data
*
context
,
enum
obs_obj_type
type
,
obs_data_t
*
settings
,
const
char
*
name
,
obs_data_t
*
hotkey_data
,
...
...
libobs/obs-output.c
浏览文件 @
d069302b
...
...
@@ -53,8 +53,8 @@ static const char *output_signals[] = {
static
bool
init_output_handlers
(
struct
obs_output
*
output
,
const
char
*
name
,
obs_data_t
*
settings
,
obs_data_t
*
hotkey_data
)
{
if
(
!
obs_context_data_init
(
&
output
->
context
,
settings
,
name
,
hotkey_data
,
false
))
if
(
!
obs_context_data_init
(
&
output
->
context
,
OBS_OBJ_TYPE_OUTPUT
,
settings
,
name
,
hotkey_data
,
false
))
return
false
;
signal_handler_add_array
(
output
->
context
.
signals
,
output_signals
);
...
...
libobs/obs-service.c
浏览文件 @
d069302b
...
...
@@ -46,8 +46,8 @@ obs_service_t *obs_service_create(const char *id, const char *name,
service
=
bzalloc
(
sizeof
(
struct
obs_service
));
if
(
!
obs_context_data_init
(
&
service
->
context
,
settings
,
name
,
hotkey_data
,
false
))
{
if
(
!
obs_context_data_init
(
&
service
->
context
,
OBS_OBJ_TYPE_SERVICE
,
settings
,
name
,
hotkey_data
,
false
))
{
bfree
(
service
);
return
NULL
;
}
...
...
libobs/obs-source.c
浏览文件 @
d069302b
...
...
@@ -79,8 +79,8 @@ bool obs_source_init_context(struct obs_source *source,
obs_data_t
*
settings
,
const
char
*
name
,
obs_data_t
*
hotkey_data
,
bool
private
)
{
if
(
!
obs_context_data_init
(
&
source
->
context
,
settings
,
name
,
hotkey_data
,
private
))
if
(
!
obs_context_data_init
(
&
source
->
context
,
OBS_OBJ_TYPE_SOURCE
,
settings
,
name
,
hotkey_data
,
private
))
return
false
;
return
signal_handler_add_array
(
source
->
context
.
signals
,
...
...
libobs/obs.c
浏览文件 @
d069302b
...
...
@@ -1650,6 +1650,7 @@ static inline char *dup_name(const char *name, bool private)
static
inline
bool
obs_context_data_init_wrap
(
struct
obs_context_data
*
context
,
enum
obs_obj_type
type
,
obs_data_t
*
settings
,
const
char
*
name
,
obs_data_t
*
hotkey_data
,
...
...
@@ -1658,6 +1659,7 @@ static inline bool obs_context_data_init_wrap(
assert
(
context
);
memset
(
context
,
0
,
sizeof
(
*
context
));
context
->
private
=
private
;
context
->
type
=
type
;
pthread_mutex_init_value
(
&
context
->
rename_cache_mutex
);
if
(
pthread_mutex_init
(
&
context
->
rename_cache_mutex
,
NULL
)
<
0
)
...
...
@@ -1679,13 +1681,14 @@ static inline bool obs_context_data_init_wrap(
bool
obs_context_data_init
(
struct
obs_context_data
*
context
,
enum
obs_obj_type
type
,
obs_data_t
*
settings
,
const
char
*
name
,
obs_data_t
*
hotkey_data
,
bool
private
)
{
if
(
obs_context_data_init_wrap
(
context
,
settings
,
name
,
hotkey_data
,
private
))
{
if
(
obs_context_data_init_wrap
(
context
,
type
,
settings
,
name
,
hotkey_data
,
private
))
{
return
true
;
}
else
{
obs_context_data_free
(
context
);
...
...
@@ -1768,3 +1771,9 @@ uint64_t obs_get_video_frame_time(void)
{
return
obs
?
obs
->
video
.
video_time
:
0
;
}
enum
obs_obj_type
obs_obj_get_type
(
void
*
obj
)
{
struct
obs_context_data
*
context
=
obj
;
return
context
?
context
->
type
:
OBS_OBJ_TYPE_INVALID
;
}
libobs/obs.h
浏览文件 @
d069302b
...
...
@@ -560,6 +560,16 @@ typedef bool (*obs_save_source_filter_cb)(void *data, obs_source_t *source);
EXPORT
obs_data_array_t
*
obs_save_sources_filtered
(
obs_save_source_filter_cb
cb
,
void
*
data
);
enum
obs_obj_type
{
OBS_OBJ_TYPE_INVALID
,
OBS_OBJ_TYPE_SOURCE
,
OBS_OBJ_TYPE_OUTPUT
,
OBS_OBJ_TYPE_ENCODER
,
OBS_OBJ_TYPE_SERVICE
};
EXPORT
enum
obs_obj_type
obs_obj_get_type
(
void
*
obj
);
/* ------------------------------------------------------------------------- */
/* View context */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录