Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d7127764
提交
d7127764
authored
2月 11, 2015
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7506 FS-7513: banner update
上级
0697db4f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
562 行删除
+26
-562
Makefile.am
src/mod/applications/mod_conference/Makefile.am
+2
-2
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+24
-12
utf8.c
src/mod/applications/mod_conference/utf8.c
+0
-477
utf8.h
src/mod/applications/mod_conference/utf8.h
+0
-71
没有找到文件。
src/mod/applications/mod_conference/Makefile.am
浏览文件 @
d7127764
...
...
@@ -2,8 +2,8 @@ include $(top_srcdir)/build/modmake.rulesam
MODNAME
=
mod_conference
mod_LTLIBRARIES
=
mod_conference.la
mod_conference_la_SOURCES
=
mod_conference.c
utf8.c
mod_conference_la_CFLAGS
=
$(AM_CFLAGS)
-I
.
-I
/usr/include/freetype2
mod_conference_la_SOURCES
=
mod_conference.c
mod_conference_la_CFLAGS
=
$(AM_CFLAGS)
-I
.
mod_conference_la_LIBADD
=
$(switch_builddir)
/libfreeswitch.la
mod_conference_la_LDFLAGS
=
-avoid-version
-module
-no-undefined
-shared
-lyuv
-lfreetype
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
d7127764
...
...
@@ -929,25 +929,26 @@ static void scale_and_patch(conference_obj_t *conference, mcu_layer_t *layer)
if (layer->geometry.scale) {
int img_w = 0, img_h = 0;
double screen_aspect = 0, img_aspect = 0;
int x_pos = layer->x_pos;
int y_pos = layer->y_pos;
img_w = layer->screen_w = IMG->d_w * layer->geometry.scale / SCALE_FACTOR;
img_h = layer->screen_h = IMG->d_h * layer->geometry.scale / SCALE_FACTOR;
layer->x_pos = IMG->d_w * layer->geometry.x / SCALE_FACTOR;
layer->y_pos = IMG->d_h * layer->geometry.y / SCALE_FACTOR;
screen_aspect = (double) layer->screen_w / layer->screen_h;
img_aspect = (double) img->d_w / img->d_h;
if (screen_aspect > img_aspect) {
img_w = img_aspect * layer->screen_h;
layer->
x_pos += (layer->screen_w - img_w) / 2;
x_pos += (layer->screen_w - img_w) / 2;
} else if (screen_aspect < img_aspect) {
img_h = layer->screen_w / img_aspect;
layer->
y_pos += (layer->screen_h - img_h) / 2;
y_pos += (layer->screen_h - img_h) / 2;
}
/*int I420Scale(const uint8* src_y, int src_stride_y,
const uint8* src_u, int src_stride_u,
const uint8* src_v, int src_stride_v,
...
...
@@ -989,7 +990,7 @@ static void scale_and_patch(conference_obj_t *conference, mcu_layer_t *layer)
// 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,
layer->x_pos, layer->
y_pos);
switch_img_patch(IMG, layer->img,
x_pos,
y_pos);
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "insert at %d,%d\n", 0, 0);
...
...
@@ -1048,10 +1049,11 @@ static void detach_video_layer(conference_member_t *member)
switch_mutex_unlock(member->conference->canvas->mutex);
}
static void layer_set_banner(mcu_layer_t *layer, const char *text)
static void layer_set_banner(mcu_
canvas_t *canvas, mcu_
layer_t *layer, const char *text)
{
switch_yuv_color_t fgcolor, bgcolor;
int font_size = 24;
int font_scale = 4;
int font_size = 0;
const char *fg = "#cccccc";
const char *bg = "#142e55";
char *parsed = NULL;
...
...
@@ -1080,14 +1082,18 @@ static void layer_set_banner(mcu_layer_t *layer, const char *text)
font_face = var;
}
if ((var = switch_event_get_header(params, "font_s
iz
e"))) {
if ((var = switch_event_get_header(params, "font_s
cal
e"))) {
int tmp = atoi(var);
if (tmp >= 5 && tmp <= 50) {
font_s
iz
e = tmp;
font_s
cal
e = tmp;
}
}
}
font_size = (double)(font_scale / 100.0f) * layer->screen_h;
switch_color_set(&fgcolor, fg);
switch_color_set(&bgcolor, bg);
...
...
@@ -1115,6 +1121,7 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
const char *res_id = NULL;
switch_status_t status = SWITCH_STATUS_SUCCESS;
const char *banner = NULL;
switch_yuv_color_t color;
if (!member->session) abort();
...
...
@@ -1144,7 +1151,7 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
}
if ((banner = switch_channel_get_variable_dup(channel, "video_banner_text", SWITCH_FALSE, -1))) {
layer_set_banner(layer, banner);
layer_set_banner(
member->conference->canvas,
layer, banner);
}
layer->member_id = member->id;
...
...
@@ -1155,6 +1162,11 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
if (layer->geometry.audio_position) {
conf_api_sub_position(member, NULL, layer->geometry.audio_position);
}
switch_color_set(&color, "#000000");
switch_img_fill(member->conference->canvas->img, layer->x_pos, layer->y_pos, layer->screen_w, layer->screen_h, color);
end:
...
...
src/mod/applications/mod_conference/utf8.c
deleted
100644 → 0
浏览文件 @
0697db4f
差异被折叠。
点击展开。
src/mod/applications/mod_conference/utf8.h
deleted
100644 → 0
浏览文件 @
0697db4f
#include <stdarg.h>
/* is c the start of a utf8 sequence? */
#define isutf(c) (((c)&0xC0)!=0x80)
/* convert UTF-8 data to wide character */
int
u8_toucs
(
uint32_t
*
dest
,
int
sz
,
char
*
src
,
int
srcsz
);
/* the opposite conversion */
int
u8_toutf8
(
char
*
dest
,
int
sz
,
uint32_t
*
src
,
int
srcsz
);
/* single character to UTF-8 */
int
u8_wc_toutf8
(
char
*
dest
,
uint32_t
ch
);
/* character number to byte offset */
int
u8_offset
(
char
*
str
,
int
charnum
);
/* byte offset to character number */
int
u8_charnum
(
char
*
s
,
int
offset
);
/* return next character, updating an index variable */
uint32_t
u8_nextchar
(
char
*
s
,
int
*
i
);
/* move to next character */
void
u8_inc
(
char
*
s
,
int
*
i
);
/* move to previous character */
void
u8_dec
(
char
*
s
,
int
*
i
);
/* returns length of next utf-8 sequence */
int
u8_seqlen
(
char
*
s
);
/* assuming src points to the character after a backslash, read an
escape sequence, storing the result in dest and returning the number of
input characters processed */
int
u8_read_escape_sequence
(
char
*
src
,
uint32_t
*
dest
);
/* given a wide character, convert it to an ASCII escape sequence stored in
buf, where buf is "sz" bytes. returns the number of characters output.*/
int
u8_escape_wchar
(
char
*
buf
,
int
sz
,
uint32_t
ch
);
/* convert a string "src" containing escape sequences to UTF-8 */
int
u8_unescape
(
char
*
buf
,
int
sz
,
char
*
src
);
/* convert UTF-8 "src" to ASCII with escape sequences.
if escape_quotes is nonzero, quote characters will be preceded by
backslashes as well. */
int
u8_escape
(
char
*
buf
,
int
sz
,
char
*
src
,
int
escape_quotes
);
/* utility predicates used by the above */
int
octal_digit
(
char
c
);
int
hex_digit
(
char
c
);
/* return a pointer to the first occurrence of ch in s, or NULL if not
found. character index of found character returned in *charn. */
char
*
u8_strchr
(
char
*
s
,
uint32_t
ch
,
int
*
charn
);
/* same as the above, but searches a buffer of a given size instead of
a NUL-terminated string. */
char
*
u8_memchr
(
char
*
s
,
uint32_t
ch
,
size_t
sz
,
int
*
charn
);
/* count the number of characters in a UTF-8 string */
int
u8_strlen
(
char
*
s
);
int
u8_is_locale_utf8
(
char
*
locale
);
/* printf where the format string and arguments may be in UTF-8.
you can avoid this function and just use ordinary printf() if the current
locale is UTF-8. */
int
u8_vprintf
(
char
*
fmt
,
va_list
ap
);
int
u8_printf
(
char
*
fmt
,
...);
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论