Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
40687ccb
提交
40687ccb
authored
3月 04, 2017
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10050: [core] chromakey
上级
a73d2ca7
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
3 行删除
+20
-3
switch_core_video.h
src/include/switch_core_video.h
+2
-0
mod_video_filter.c
src/mod/applications/mod_video_filter/mod_video_filter.c
+1
-0
switch_core_video.c
src/switch_core_video.c
+17
-3
没有找到文件。
src/include/switch_core_video.h
浏览文件 @
40687ccb
...
@@ -223,6 +223,8 @@ SWITCH_DECLARE(int) switch_img_set_rect(switch_image_t *img,
...
@@ -223,6 +223,8 @@ SWITCH_DECLARE(int) switch_img_set_rect(switch_image_t *img,
*/
*/
SWITCH_DECLARE
(
void
)
switch_img_patch
(
switch_image_t
*
IMG
,
switch_image_t
*
img
,
int
x
,
int
y
);
SWITCH_DECLARE
(
void
)
switch_img_patch
(
switch_image_t
*
IMG
,
switch_image_t
*
img
,
int
x
,
int
y
);
SWITCH_DECLARE
(
void
)
switch_img_attenuate
(
switch_image_t
*
img
);
/*!\brief patch a small img to a big IMG at position x,y
/*!\brief patch a small img to a big IMG at position x,y
*
*
* Both IMG and img must be non-NULL
* Both IMG and img must be non-NULL
...
...
src/mod/applications/mod_video_filter/mod_video_filter.c
浏览文件 @
40687ccb
...
@@ -253,6 +253,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
...
@@ -253,6 +253,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
switch_img_to_raw
(
frame
->
img
,
context
->
data
,
frame
->
img
->
d_w
*
4
,
SWITCH_IMG_FMT_ARGB
);
switch_img_to_raw
(
frame
->
img
,
context
->
data
,
frame
->
img
->
d_w
*
4
,
SWITCH_IMG_FMT_ARGB
);
img
=
switch_img_wrap
(
NULL
,
SWITCH_IMG_FMT_ARGB
,
frame
->
img
->
d_w
,
frame
->
img
->
d_h
,
1
,
context
->
data
);
img
=
switch_img_wrap
(
NULL
,
SWITCH_IMG_FMT_ARGB
,
frame
->
img
->
d_w
,
frame
->
img
->
d_h
,
1
,
context
->
data
);
switch_assert
(
img
);
switch_assert
(
img
);
switch_chromakey_process
(
context
->
ck
,
img
);
switch_chromakey_process
(
context
->
ck
,
img
);
...
...
src/switch_core_video.c
浏览文件 @
40687ccb
...
@@ -286,8 +286,10 @@ SWITCH_DECLARE(void) switch_img_free(switch_image_t **img)
...
@@ -286,8 +286,10 @@ SWITCH_DECLARE(void) switch_img_free(switch_image_t **img)
gdImageDestroy
((
gdImagePtr
)(
*
img
)
->
user_priv
);
gdImageDestroy
((
gdImagePtr
)(
*
img
)
->
user_priv
);
#endif
#endif
}
else
{
}
else
{
if
((
int
)(
intptr_t
)(
*
img
)
->
user_priv
!=
1
)
{
switch_safe_free
((
*
img
)
->
user_priv
);
switch_safe_free
((
*
img
)
->
user_priv
);
}
}
}
vpx_img_free
((
vpx_image_t
*
)
*
img
);
vpx_img_free
((
vpx_image_t
*
)
*
img
);
*
img
=
NULL
;
*
img
=
NULL
;
}
}
...
@@ -338,6 +340,16 @@ static void switch_img_patch_rgb_noalpha(switch_image_t *IMG, switch_image_t *im
...
@@ -338,6 +340,16 @@ static void switch_img_patch_rgb_noalpha(switch_image_t *IMG, switch_image_t *im
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_img_attenuate
(
switch_image_t
*
img
)
{
if
(
img
->
fmt
!=
SWITCH_IMG_FMT_ARGB
)
{
return
;
}
ARGBAttenuate
(
img
->
planes
[
SWITCH_PLANE_PACKED
],
img
->
stride
[
SWITCH_PLANE_PACKED
],
img
->
planes
[
SWITCH_PLANE_PACKED
],
img
->
stride
[
SWITCH_PLANE_PACKED
],
img
->
d_w
,
img
->
d_h
);
}
SWITCH_DECLARE
(
void
)
switch_img_patch_rgb
(
switch_image_t
*
IMG
,
switch_image_t
*
img
,
int
x
,
int
y
,
switch_bool_t
noalpha
)
SWITCH_DECLARE
(
void
)
switch_img_patch_rgb
(
switch_image_t
*
IMG
,
switch_image_t
*
img
,
int
x
,
int
y
,
switch_bool_t
noalpha
)
{
{
int
i
;
int
i
;
...
@@ -358,7 +370,10 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
...
@@ -358,7 +370,10 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
int
height
=
MIN
(
img
->
d_h
,
IMG
->
d_h
-
abs
(
y
));
int
height
=
MIN
(
img
->
d_h
,
IMG
->
d_h
-
abs
(
y
));
void
(
*
ARGBBlendRow
)(
const
uint8
*
src_argb
,
const
uint8
*
src_argb1
,
uint8
*
dst_argb
,
int
width
)
=
GetARGBBlend
();
void
(
*
ARGBBlendRow
)(
const
uint8
*
src_argb
,
const
uint8
*
src_argb1
,
uint8
*
dst_argb
,
int
width
)
=
GetARGBBlend
();
if
(
!
img
->
user_priv
)
{
img
->
user_priv
=
(
void
*
)(
intptr_t
)
1
;
ARGBAttenuate
(
src_argb0
,
src_stride_argb0
,
src_argb0
,
src_stride_argb0
,
img
->
d_w
,
img
->
d_h
);
ARGBAttenuate
(
src_argb0
,
src_stride_argb0
,
src_argb0
,
src_stride_argb0
,
img
->
d_w
,
img
->
d_h
);
}
// Coalesce rows. we have same size images, treat as a single row
// Coalesce rows. we have same size images, treat as a single row
if
(
src_stride_argb0
==
width
*
4
&&
if
(
src_stride_argb0
==
width
*
4
&&
...
@@ -384,7 +399,6 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
...
@@ -384,7 +399,6 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
src_argb1
+=
src_stride_argb1
;
src_argb1
+=
src_stride_argb1
;
dst_argb
+=
dst_stride_argb
;
dst_argb
+=
dst_stride_argb
;
}
}
ARGBUnattenuate
(
img
->
planes
[
SWITCH_PLANE_PACKED
],
src_stride_argb0
,
img
->
planes
[
SWITCH_PLANE_PACKED
],
src_stride_argb0
,
img
->
d_w
,
img
->
d_h
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论