Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
310f390e
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,发现更多精彩内容 >>
提交
310f390e
编写于
5月 22, 2015
作者:
J
John Bradley
提交者:
jp9000
3月 21, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libobs: Allow filters to specify technique
上级
9e15e3d8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
6 deletion
+43
-6
libobs/obs-source.c
libobs/obs-source.c
+32
-6
libobs/obs.h
libobs/obs.h
+11
-0
未找到文件。
libobs/obs-source.c
浏览文件 @
310f390e
...
...
@@ -2592,9 +2592,9 @@ const char *obs_source_get_id(const obs_source_t *source)
}
static
inline
void
render_filter_bypass
(
obs_source_t
*
target
,
gs_effect_t
*
effect
)
gs_effect_t
*
effect
,
const
char
*
tech_name
)
{
gs_technique_t
*
tech
=
gs_effect_get_technique
(
effect
,
"Draw"
);
gs_technique_t
*
tech
=
gs_effect_get_technique
(
effect
,
tech_name
);
size_t
passes
,
i
;
passes
=
gs_technique_begin
(
tech
);
...
...
@@ -2607,9 +2607,9 @@ static inline void render_filter_bypass(obs_source_t *target,
}
static
inline
void
render_filter_tex
(
gs_texture_t
*
tex
,
gs_effect_t
*
effect
,
uint32_t
width
,
uint32_t
height
)
uint32_t
width
,
uint32_t
height
,
const
char
*
tech_name
)
{
gs_technique_t
*
tech
=
gs_effect_get_technique
(
effect
,
"Draw"
);
gs_technique_t
*
tech
=
gs_effect_get_technique
(
effect
,
tech_name
);
gs_eparam_t
*
image
=
gs_effect_get_param_by_name
(
effect
,
"image"
);
size_t
passes
,
i
;
...
...
@@ -2694,6 +2694,31 @@ void obs_source_process_filter_begin(obs_source_t *filter,
gs_blend_state_pop
();
}
void
obs_source_process_filter_tech_end
(
obs_source_t
*
filter
,
gs_effect_t
*
effect
,
uint32_t
width
,
uint32_t
height
,
const
char
*
tech_name
)
{
obs_source_t
*
target
,
*
parent
;
gs_texture_t
*
texture
;
uint32_t
target_flags
,
parent_flags
;
if
(
!
filter
)
return
;
target
=
obs_filter_get_target
(
filter
);
parent
=
obs_filter_get_parent
(
filter
);
target_flags
=
target
->
info
.
output_flags
;
parent_flags
=
parent
->
info
.
output_flags
;
const
char
*
tech
=
tech_name
?
tech_name
:
"Draw"
;
if
(
can_bypass
(
target
,
parent
,
parent_flags
,
filter
->
allow_direct
))
{
render_filter_bypass
(
target
,
effect
,
tech
);
}
else
{
texture
=
gs_texrender_get_texture
(
filter
->
filter_texrender
);
render_filter_tex
(
texture
,
effect
,
width
,
height
,
tech
);
}
}
void
obs_source_process_filter_end
(
obs_source_t
*
filter
,
gs_effect_t
*
effect
,
uint32_t
width
,
uint32_t
height
)
{
...
...
@@ -2710,11 +2735,12 @@ void obs_source_process_filter_end(obs_source_t *filter, gs_effect_t *effect,
parent_flags
=
parent
->
info
.
output_flags
;
if
(
can_bypass
(
target
,
parent
,
parent_flags
,
filter
->
allow_direct
))
{
render_filter_bypass
(
target
,
effect
);
render_filter_bypass
(
target
,
effect
,
"Draw"
);
}
else
{
texture
=
gs_texrender_get_texture
(
filter
->
filter_texrender
);
if
(
texture
)
render_filter_tex
(
texture
,
effect
,
width
,
height
);
render_filter_tex
(
texture
,
effect
,
width
,
height
,
"Draw"
);
}
}
...
...
libobs/obs.h
浏览文件 @
310f390e
...
...
@@ -954,6 +954,17 @@ EXPORT void obs_source_process_filter_begin(obs_source_t *filter,
EXPORT
void
obs_source_process_filter_end
(
obs_source_t
*
filter
,
gs_effect_t
*
effect
,
uint32_t
width
,
uint32_t
height
);
/**
* Draws the filter with a specific technique.
*
* Before calling this function, first call obs_source_process_filter_begin and
* then set the effect parameters, and then call this function to finalize the
* filter.
*/
EXPORT
void
obs_source_process_filter_tech_end
(
obs_source_t
*
filter
,
gs_effect_t
*
effect
,
uint32_t
width
,
uint32_t
height
,
const
char
*
tech_name
);
/** Skips the filter if the filter is invalid and cannot be rendered */
EXPORT
void
obs_source_skip_video_filter
(
obs_source_t
*
filter
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录