Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
34b57399
提交
34b57399
authored
11月 14, 2018
作者:
Seven Du
提交者:
Andrey Volk
1月 02, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11521: [mod_av] WIP add test code and add png
上级
c3f80bb7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
112 行增加
和
1 行删除
+112
-1
av.conf.xml
conf/vanilla/autoload_configs/av.conf.xml
+1
-0
Makefile.am
src/mod/applications/mod_av/test/Makefile.am
+1
-1
cluecon.png
src/mod/applications/mod_av/test/cluecon.png
+0
-0
test_avformat.c
src/mod/applications/mod_av/test/test_avformat.c
+110
-0
没有找到文件。
conf/vanilla/autoload_configs/av.conf.xml
浏览文件 @
34b57399
...
...
@@ -141,5 +141,6 @@ enum AVColorRange {
<configuration
name=
"avformat.conf"
description=
"AVFormat Config"
>
<settings>
<param
name=
"colorspace"
value=
"1"
/>
</settings>
</configuration>
src/mod/applications/mod_av/test/Makefile.am
浏览文件 @
34b57399
bin_PROGRAMS
=
test_mod_av
bin_PROGRAMS
=
test_mod_av
test_avformat
AM_CFLAGS
=
$(SWITCH_AM_CFLAGS)
-I
../
$(AVFORMAT_CFLAGS)
$(AVCODEC_CFLAGS)
$(SWSCALE_CFLAGS)
$(AVUTIL_CFLAGS)
$(AVRESAMPLE_CFALGS)
AM_LDFLAGS
=
$(switch_builddir)
/libfreeswitch.la
$(AVFORMAT_LIBS)
$(AVCODEC_LIBS)
$(SWSCALE_LIBS)
$(AVUTIL_LIBS)
$(AVRESAMPLE_LIBS)
-avoid-version
-no-undefined
$(SWITCH_AM_LDFLAGS)
../mod_av.la
TESTS
=
$(bin_PROGRAMS)
src/mod/applications/mod_av/test/cluecon.png
0 → 100644
浏览文件 @
34b57399
208.7 KB
src/mod/applications/mod_av/test/test_avformat.c
0 → 100644
浏览文件 @
34b57399
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2018, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Seven Du <seven@signalwire.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* test_avformat -- avformat tests
*
*/
#include <test/switch_test.h>
#define SAMPLES 160
FST_CORE_BEGIN
(
"conf"
)
{
FST_MODULE_BEGIN
(
mod_av
,
mod_av_test
)
{
FST_SETUP_BEGIN
()
{
fst_requires_module
(
"mod_av"
);
}
FST_SETUP_END
()
FST_TEST_BEGIN
(
avformat_test
)
{
switch_status_t
status
;
switch_image_t
*
img
=
switch_img_alloc
(
NULL
,
SWITCH_IMG_FMT_I420
,
1280
,
720
,
1
);
switch_file_handle_t
fh
=
{
0
};
uint8_t
data
[
SAMPLES
*
2
]
=
{
0
};
switch_frame_t
frame
=
{
0
};
switch_size_t
len
=
SAMPLES
;
uint32_t
flags
=
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
|
SWITCH_FILE_FLAG_VIDEO
;
fst_requires
(
img
);
status
=
switch_core_file_open
(
&
fh
,
"./test.mp4"
,
1
,
8000
,
flags
,
fst_pool
);
fst_requires
(
status
==
SWITCH_STATUS_SUCCESS
);
fst_requires
(
switch_test_flag
(
&
fh
,
SWITCH_FILE_OPEN
));
status
=
switch_core_file_write
(
&
fh
,
data
,
&
len
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"status: %d len: %d
\n
"
,
status
,
len
);
fst_check
(
status
==
SWITCH_STATUS_SUCCESS
);
// fst_requires(len == SAMPLES);
frame
.
img
=
img
;
status
=
switch_core_file_write_video
(
&
fh
,
&
frame
);
fst_check
(
status
==
SWITCH_STATUS_SUCCESS
);
switch_image_t
*
ccimg
=
switch_img_read_png
(
"./cluecon.png"
,
SWITCH_IMG_FMT_ARGB
);
fst_requires
(
ccimg
);
switch_rgb_color_t
color
=
{
0
};
color
.
a
=
255
;
for
(
int
i
=
0
;
i
<
30
;
i
++
)
{
len
=
SAMPLES
;
if
(
i
==
10
)
{
color
.
r
=
255
;
}
else
if
(
i
==
20
)
{
color
.
r
=
0
;
color
.
b
=
255
;
}
switch_img_fill
(
img
,
0
,
0
,
img
->
d_w
,
img
->
d_h
,
&
color
);
switch_img_patch
(
img
,
ccimg
,
i
*
10
,
i
*
10
);
status
=
switch_core_file_write
(
&
fh
,
data
,
&
len
);
status
=
switch_core_file_write_video
(
&
fh
,
&
frame
);
switch_yield
(
100000
);
}
switch_core_file_close
(
&
fh
);
switch_img_free
(
&
img
);
switch_img_free
(
&
ccimg
);
}
FST_TEST_END
()
FST_TEARDOWN_BEGIN
()
{
const
char
*
err
=
NULL
;
switch_sleep
(
1000000
);
fst_check
(
switch_loadable_module_unload_module
(
SWITCH_GLOBAL_dirs
.
mod_dir
,
(
char
*
)
"mod_av"
,
SWITCH_TRUE
,
&
err
)
==
SWITCH_STATUS_SUCCESS
);
}
FST_TEARDOWN_END
()
}
FST_MODULE_END
()
}
FST_CORE_END
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论