Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
46abb230
提交
46abb230
authored
2月 11, 2015
作者:
Seven Du
提交者:
Anthony Minessale
5月 27, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7500 FS-7513: add and use switch_img_fill
上级
04968772
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
35 行增加
和
13 行删除
+35
-13
switch_core_video.h
src/include/switch_core_video.h
+3
-1
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+10
-11
switch_core_video.c
src/switch_core_video.c
+22
-1
没有找到文件。
src/include/switch_core_video.h
浏览文件 @
46abb230
...
@@ -189,7 +189,9 @@ SWITCH_DECLARE(void) switch_img_add_text(void *buffer, int w, int x, int y, char
...
@@ -189,7 +189,9 @@ SWITCH_DECLARE(void) switch_img_add_text(void *buffer, int w, int x, int y, char
SWITCH_DECLARE
(
switch_image_t
*
)
switch_img_copy_rect
(
switch_image_t
*
img
,
int
x
,
int
y
,
int
w
,
int
h
);
SWITCH_DECLARE
(
switch_image_t
*
)
switch_img_copy_rect
(
switch_image_t
*
img
,
int
x
,
int
y
,
int
w
,
int
h
);
SWITCH_DECLARE
(
void
)
switch_image_draw_pixel
(
switch_image_t
*
img
,
int
x
,
int
y
,
switch_yuv_color_t
color
);
SWITCH_DECLARE
(
void
)
switch_img_fill
(
switch_image_t
*
img
,
int
x
,
int
y
,
int
w
,
int
h
,
switch_yuv_color_t
color
);
SWITCH_DECLARE
(
void
)
switch_img_draw_pixel
(
switch_image_t
*
img
,
int
x
,
int
y
,
switch_yuv_color_t
color
);
SWITCH_DECLARE
(
void
)
switch_color_set
(
switch_yuv_color_t
*
color
,
char
*
color_str
);
SWITCH_DECLARE
(
void
)
switch_color_set
(
switch_yuv_color_t
*
color
,
char
*
color_str
);
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
46abb230
...
@@ -754,7 +754,7 @@ static void draw_bitmap(switch_image_t *img, FT_Bitmap* bitmap, FT_Int x, FT_Int
...
@@ -754,7 +754,7 @@ static void draw_bitmap(switch_image_t *img, FT_Bitmap* bitmap, FT_Int x, FT_Int
if
(
i
<
0
||
j
<
0
||
i
>=
img
->
d_w
||
j
>=
img
->
d_h
)
continue
;
if
(
i
<
0
||
j
<
0
||
i
>=
img
->
d_w
||
j
>=
img
->
d_h
)
continue
;
if
(
bitmap
->
buffer
[
q
*
bitmap
->
width
+
p
]
>
128
)
{
if
(
bitmap
->
buffer
[
q
*
bitmap
->
width
+
p
]
>
128
)
{
switch_im
age
_draw_pixel
(
img
,
i
,
j
,
color
);
switch_im
g
_draw_pixel
(
img
,
i
,
j
,
color
);
}
}
}
}
}
}
...
@@ -1013,16 +1013,7 @@ static int mcu_canvas_wake(mcu_canvas_t *mcu_canvas)
...
@@ -1013,16 +1013,7 @@ static int mcu_canvas_wake(mcu_canvas_t *mcu_canvas)
static
void
reset_image
(
switch_image_t
*
img
,
switch_yuv_color_t
*
color
)
static
void
reset_image
(
switch_image_t
*
img
,
switch_yuv_color_t
*
color
)
{
{
int
i
;
switch_img_fill
(
img
,
0
,
0
,
img
->
w
,
img
->
h
,
*
color
);
for
(
i
=
0
;
i
<
img
->
h
;
i
++
)
{
memset
(
img
->
planes
[
SWITCH_PLANE_Y
]
+
img
->
stride
[
SWITCH_PLANE_Y
]
*
i
,
color
->
y
,
img
->
d_w
);
}
for
(
i
=
0
;
i
<
img
->
h
/
2
;
i
++
)
{
memset
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
i
,
color
->
u
,
img
->
d_w
/
2
);
memset
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
i
,
color
->
v
,
img
->
d_w
/
2
);
}
}
}
#define SCALE_FACTOR 360.0f
#define SCALE_FACTOR 360.0f
...
@@ -1126,6 +1117,10 @@ static void scale_and_patch(conference_obj_t *conference, mcu_layer_t *layer)
...
@@ -1126,6 +1117,10 @@ static void scale_and_patch(conference_obj_t *conference, mcu_layer_t *layer)
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Scaling Error: ret: %d
\n
"
,
ret
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Scaling Error: ret: %d
\n
"
,
ret
);
}
else
{
}
else
{
if
(
layer
->
img
->
d_h
>
20
)
{
// reserv the bottom room for text, e.g. caller id
// switch_img_set_rect(layer->img, 0, 0, layer->img->d_w, layer->img->d_h - 20);
}
switch_img_patch
(
IMG
,
layer
->
img
,
x
,
y
);
switch_img_patch
(
IMG
,
layer
->
img
,
x
,
y
);
}
}
}
else
{
}
else
{
...
@@ -1583,6 +1578,10 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
...
@@ -1583,6 +1578,10 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
80
,
color
,
24
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
80
,
color
,
24
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
160
,
color
,
36
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
160
,
color
,
36
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
300
,
color
,
72
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
10
,
300
,
color
,
72
,
"AVA 123 你好 FreeSWITCH
\n
FreeSWITCH Rocks!"
);
switch_img_fill
(
conference
->
canvas
->
img
,
300
,
10
,
400
,
40
,
color
);
switch_color_set
(
&
color
,
"#FF0000"
);
switch_img_draw_text
(
conference
->
canvas
->
img
,
300
,
10
,
color
,
32
,
"FreeSWITCH"
);
}
}
if
(
used
)
{
if
(
used
)
{
...
...
src/switch_core_video.c
浏览文件 @
46abb230
...
@@ -161,7 +161,7 @@ SWITCH_DECLARE(switch_image_t *) switch_img_copy_rect(switch_image_t *img, int x
...
@@ -161,7 +161,7 @@ SWITCH_DECLARE(switch_image_t *) switch_img_copy_rect(switch_image_t *img, int x
return
new_img
;
return
new_img
;
}
}
SWITCH_DECLARE
(
void
)
switch_im
age
_draw_pixel
(
switch_image_t
*
img
,
int
x
,
int
y
,
switch_yuv_color_t
color
)
SWITCH_DECLARE
(
void
)
switch_im
g
_draw_pixel
(
switch_image_t
*
img
,
int
x
,
int
y
,
switch_yuv_color_t
color
)
{
{
if
(
x
<
0
||
y
<
0
||
x
>=
img
->
d_w
||
y
>=
img
->
d_h
)
return
;
if
(
x
<
0
||
y
<
0
||
x
>=
img
->
d_w
||
y
>=
img
->
d_h
)
return
;
...
@@ -173,6 +173,27 @@ SWITCH_DECLARE(void) switch_image_draw_pixel(switch_image_t *img, int x, int y,
...
@@ -173,6 +173,27 @@ SWITCH_DECLARE(void) switch_image_draw_pixel(switch_image_t *img, int x, int y,
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_img_fill
(
switch_image_t
*
img
,
int
x
,
int
y
,
int
w
,
int
h
,
switch_yuv_color_t
color
)
{
int
len
,
i
;
if
(
x
<
0
||
y
<
0
||
x
>=
img
->
d_w
||
y
>=
img
->
d_h
)
return
;
len
=
MIN
(
w
,
img
->
d_w
-
x
);
if
(
len
<=
0
)
return
;
for
(
i
=
y
;
i
<
(
y
+
h
)
&&
i
<
img
->
d_h
;
i
++
)
{
memset
(
img
->
planes
[
SWITCH_PLANE_Y
]
+
img
->
stride
[
SWITCH_PLANE_Y
]
*
i
+
x
,
color
.
y
,
len
);
}
len
/=
2
;
for
(
i
=
y
;
i
<
(
y
+
h
)
&&
i
<
img
->
d_h
;
i
+=
2
)
{
memset
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
x
/
2
,
color
.
u
,
len
);
memset
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
x
/
2
,
color
.
v
,
len
);
}
}
static
uint8_t
scv_art
[
14
][
16
]
=
{
static
uint8_t
scv_art
[
14
][
16
]
=
{
{
0x00
,
0x7E
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x7E
,
0x00
},
{
0x00
,
0x7E
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x42
,
0x7E
,
0x00
},
{
0x00
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x00
},
{
0x00
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x02
,
0x00
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论