Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
93dd3cec
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,发现更多精彩内容 >>
提交
93dd3cec
编写于
11月 22, 2013
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
made the getframe function a bit more safe and modified a few names for clarity
上级
d8b49034
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
16 deletion
+52
-16
libobs/obs-source.c
libobs/obs-source.c
+8
-1
libobs/obs.c
libobs/obs.c
+22
-5
libobs/obs.h
libobs/obs.h
+22
-10
未找到文件。
libobs/obs-source.c
浏览文件 @
93dd3cec
...
...
@@ -850,10 +850,17 @@ struct source_frame *obs_source_getframe(obs_source_t source)
unlock:
pthread_mutex_unlock
(
&
source
->
video_mutex
);
if
(
frame
!=
NULL
)
obs_source_addref
(
source
);
return
frame
;
}
void
obs_source_releaseframe
(
obs_source_t
source
,
struct
source_frame
*
frame
)
{
source_frame_destroy
(
frame
);
if
(
frame
)
{
source_frame_destroy
(
frame
);
obs_source_release
(
source
);
}
}
libobs/obs.c
浏览文件 @
93dd3cec
...
...
@@ -291,7 +291,7 @@ bool obs_reset_audio(struct audio_info *ai)
return
true
;
}
bool
obs_enum_inputs
(
size_t
idx
,
const
char
**
name
)
bool
obs_enum_input
_type
s
(
size_t
idx
,
const
char
**
name
)
{
if
(
idx
>=
obs
->
input_types
.
num
)
return
false
;
...
...
@@ -299,7 +299,7 @@ bool obs_enum_inputs(size_t idx, const char **name)
return
true
;
}
bool
obs_enum_filters
(
size_t
idx
,
const
char
**
name
)
bool
obs_enum_filter
_type
s
(
size_t
idx
,
const
char
**
name
)
{
if
(
idx
>=
obs
->
filter_types
.
num
)
return
false
;
...
...
@@ -307,7 +307,7 @@ bool obs_enum_filters(size_t idx, const char **name)
return
true
;
}
bool
obs_enum_transitions
(
size_t
idx
,
const
char
**
name
)
bool
obs_enum_transition
_type
s
(
size_t
idx
,
const
char
**
name
)
{
if
(
idx
>=
obs
->
transition_types
.
num
)
return
false
;
...
...
@@ -315,7 +315,7 @@ bool obs_enum_transitions(size_t idx, const char **name)
return
true
;
}
bool
obs_enum_outputs
(
size_t
idx
,
const
char
**
name
)
bool
obs_enum_output
_type
s
(
size_t
idx
,
const
char
**
name
)
{
if
(
idx
>=
obs
->
output_types
.
num
)
return
false
;
...
...
@@ -345,8 +345,12 @@ bool obs_add_source(obs_source_t source)
obs_source_t
obs_get_output_source
(
uint32_t
channel
)
{
struct
obs_source
*
source
;
assert
(
channel
<
MAX_CHANNELS
);
return
obs
->
data
.
channels
[
channel
];
source
=
obs
->
data
.
channels
[
channel
];
obs_source_addref
(
source
);
return
source
;
}
void
obs_set_output_source
(
uint32_t
channel
,
obs_source_t
source
)
...
...
@@ -362,3 +366,16 @@ void obs_set_output_source(uint32_t channel, obs_source_t source)
if
(
prev_source
)
obs_source_release
(
prev_source
);
}
void
obs_enum_sources
(
ENUM_SOURCES_PROC
enum_proc
,
void
*
param
)
{
struct
obs_data
*
data
=
&
obs
->
data
;
size_t
i
;
pthread_mutex_lock
(
&
data
->
sources_mutex
);
for
(
i
=
0
;
i
<
data
->
sources
.
num
;
i
++
)
enum_proc
(
data
->
sources
.
array
[
i
],
param
);
pthread_mutex_unlock
(
&
data
->
sources_mutex
);
}
libobs/obs.h
浏览文件 @
93dd3cec
...
...
@@ -127,6 +127,9 @@ typedef struct obs_scene_item *obs_sceneitem_t;
typedef
struct
obs_output
*
obs_output_t
;
typedef
struct
obs_service
*
obs_service_t
;
/* typedefs */
typedef
void
(
*
ENUM_SOURCES_PROC
)(
obs_source_t
source
,
void
*
param
);
/* ------------------------------------------------------------------------- */
/* OBS context */
...
...
@@ -162,36 +165,36 @@ EXPORT bool obs_reset_audio(struct audio_info *ai);
EXPORT
int
obs_load_module
(
const
char
*
path
);
/**
* Enumerates all available inputs.
* Enumerates all available inputs
source types
.
*
* Inputs are general source inputs (such as capture sources, device sources,
* etc).
*/
EXPORT
bool
obs_enum_inputs
(
size_t
idx
,
const
char
**
name
);
EXPORT
bool
obs_enum_input
_type
s
(
size_t
idx
,
const
char
**
name
);
/**
* Enumerates all available filters.
* Enumerates all available filter
source type
s.
*
* Filters are sources that are used to modify the video/audio output of
* other sources.
*/
EXPORT
bool
obs_enum_filters
(
size_t
idx
,
const
char
**
name
);
EXPORT
bool
obs_enum_filter
_type
s
(
size_t
idx
,
const
char
**
name
);
/**
* Enumerates all available transitions.
* Enumerates all available transition
source type
s.
*
* Transitions are sources used to transition between two or more other
* sources.
*/
EXPORT
bool
obs_enum_transitions
(
size_t
idx
,
const
char
**
name
);
EXPORT
bool
obs_enum_transition
_type
s
(
size_t
idx
,
const
char
**
name
);
/**
* Enumerates all available ouputs.
* Enumerates all available ouput
type
s.
*
* Outputs handle color space conversion, encoding, and output to file or
* streams.
*/
EXPORT
bool
obs_enum_outputs
(
size_t
idx
,
const
char
**
name
);
EXPORT
bool
obs_enum_output
_type
s
(
size_t
idx
,
const
char
**
name
);
/** Gets the graphics context for this OBS context */
EXPORT
graphics_t
obs_graphics
(
void
);
...
...
@@ -200,7 +203,8 @@ EXPORT graphics_t obs_graphics(void);
EXPORT
media_t
obs_media
(
void
);
/**
* Adds a source to the user source list.
* Adds a source to the user source list and increments the reference counter
* for that source.
*
* The user source list is the list of sources that are accessible by a user.
* Typically when a transition is active, it is not meant to be accessible by
...
...
@@ -208,10 +212,18 @@ EXPORT media_t obs_media(void);
*/
EXPORT
bool
obs_add_source
(
obs_source_t
source
);
/** Sets
/gets
the primary output source for a channel. */
/** Sets the primary output source for a channel. */
EXPORT
void
obs_set_output_source
(
uint32_t
channel
,
obs_source_t
source
);
/**
* Gets the primary output source for a channel and increments the reference
* counter for that source. Use obs_source_release to release.
*/
EXPORT
obs_source_t
obs_get_output_source
(
uint32_t
channel
);
/** Enumerates user sources */
EXPORT
void
obs_enum_sources
(
ENUM_SOURCES_PROC
enum_proc
,
void
*
param
);
/**
* Returns the location of a plugin data file.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录