Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b53d1cae
提交
b53d1cae
authored
10月 15, 2018
作者:
Seven Du
提交者:
Chris Rienzo
12月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11461: [mod_av] Add test code, improve tests on Windows.
上级
2ae3b857
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
3206 行增加
和
2790 行删除
+3206
-2790
Freeswitch.2017.sln
Freeswitch.2017.sln
+2802
-2789
configure.ac
configure.ac
+1
-0
switch_test.h
src/include/test/switch_test.h
+9
-1
Makefile.am
src/mod/applications/mod_av/Makefile.am
+2
-0
Makefile.am
src/mod/applications/mod_av/test/Makefile.am
+4
-0
freeswitch.xml
src/mod/applications/mod_av/test/conf/freeswitch.xml
+40
-0
test_mod_av.2017.vcxproj
src/mod/applications/mod_av/test/test_mod_av.2017.vcxproj
+203
-0
test_mod_av.c
src/mod/applications/mod_av/test/test_mod_av.c
+145
-0
没有找到文件。
Freeswitch.2017.sln
浏览文件 @
b53d1cae
差异被折叠。
点击展开。
configure.ac
浏览文件 @
b53d1cae
...
@@ -1983,6 +1983,7 @@ AC_CONFIG_FILES([Makefile
...
@@ -1983,6 +1983,7 @@ AC_CONFIG_FILES([Makefile
src/mod/xml_int/mod_xml_rpc/Makefile
src/mod/xml_int/mod_xml_rpc/Makefile
src/mod/xml_int/mod_xml_scgi/Makefile
src/mod/xml_int/mod_xml_scgi/Makefile
src/mod/applications/mod_av/Makefile
src/mod/applications/mod_av/Makefile
src/mod/applications/mod_av/test/Makefile
src/mod/applications/mod_video_filter/Makefile
src/mod/applications/mod_video_filter/Makefile
src/include/switch_am_config.h
src/include/switch_am_config.h
build/getsounds.sh
build/getsounds.sh
...
...
src/include/test/switch_test.h
浏览文件 @
b53d1cae
...
@@ -81,7 +81,15 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir,
...
@@ -81,7 +81,15 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir,
// Allow test to define the runtime dir
// Allow test to define the runtime dir
if
(
!
zstr
(
confdir
))
{
if
(
!
zstr
(
confdir
))
{
SWITCH_GLOBAL_dirs
.
conf_dir
=
strdup
(
confdir
);
#ifdef SWITCH_TEST_BASE_DIR_FOR_CONF
SWITCH_GLOBAL_dirs
.
conf_dir
=
switch_mprintf
(
"%s%s%s"
,
SWITCH_TEST_BASE_DIR_FOR_CONF
,
SWITCH_PATH_SEPARATOR
,
confdir
);
#else
if
(
confdir
[
0
]
!=
'/'
)
{
SWITCH_GLOBAL_dirs
.
conf_dir
=
switch_mprintf
(
".%s%s"
,
SWITCH_PATH_SEPARATOR
,
confdir
);
}
else
{
SWITCH_GLOBAL_dirs
.
conf_dir
=
strdup
(
confdir
);
}
#endif
}
else
{
}
else
{
SWITCH_GLOBAL_dirs
.
conf_dir
=
switch_mprintf
(
"%s%sconf"
,
basedir
,
SWITCH_PATH_SEPARATOR
);
SWITCH_GLOBAL_dirs
.
conf_dir
=
switch_mprintf
(
"%s%sconf"
,
basedir
,
SWITCH_PATH_SEPARATOR
);
}
}
...
...
src/mod/applications/mod_av/Makefile.am
浏览文件 @
b53d1cae
...
@@ -9,6 +9,8 @@ mod_av_la_CFLAGS = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE
...
@@ -9,6 +9,8 @@ mod_av_la_CFLAGS = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE
mod_av_la_LIBADD
=
$(switch_builddir)
/libfreeswitch.la
$(AVFORMAT_LIBS)
$(AVCODEC_LIBS)
$(SWSCALE_LIBS)
$(AVUTIL_LIBS)
$(AVRESAMPLE_LIBS)
mod_av_la_LIBADD
=
$(switch_builddir)
/libfreeswitch.la
$(AVFORMAT_LIBS)
$(AVCODEC_LIBS)
$(SWSCALE_LIBS)
$(AVUTIL_LIBS)
$(AVRESAMPLE_LIBS)
mod_av_la_LDFLAGS
=
-avoid-version
-module
-no-undefined
-shared
-lm
-lz
mod_av_la_LDFLAGS
=
-avoid-version
-module
-no-undefined
-shared
-lm
-lz
SUBDIRS
=
.
test
else
else
install
:
error
install
:
error
all
:
error
all
:
error
...
...
src/mod/applications/mod_av/test/Makefile.am
0 → 100644
浏览文件 @
b53d1cae
bin_PROGRAMS
=
test_mod_av
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/conf/freeswitch.xml
0 → 100644
浏览文件 @
b53d1cae
<?xml version="1.0"?>
<document
type=
"freeswitch/xml"
>
<section
name=
"configuration"
description=
"Various Configuration"
>
<configuration
name=
"modules.conf"
description=
"Modules"
>
<modules>
<load
module=
"mod_console"
/>
</modules>
</configuration>
<configuration
name=
"console.conf"
description=
"Console Logger"
>
<mappings>
<map
name=
"all"
value=
"console,debug,info,notice,warning,err,crit,alert"
/>
</mappings>
<settings>
<param
name=
"colorize"
value=
"true"
/>
<param
name=
"loglevel"
value=
"debug"
/>
</settings>
</configuration>
<configuration
name=
"timezones.conf"
description=
"Timezones"
>
<timezones>
<zone
name=
"GMT"
value=
"GMT0"
/>
</timezones>
</configuration>
<X-PRE-PROCESS
cmd=
"include"
data=
"./vpx.conf.xml"
/>
<X-PRE-PROCESS
cmd=
"include"
data=
"./av.conf.xml"
/>
</section>
<section
name=
"dialplan"
description=
"Regex/XML Dialplan"
>
<context
name=
"default"
>
<extension
name=
"sample"
>
<condition>
<action
application=
"info"
/>
</condition>
</extension>
</context>
</section>
</document>
src/mod/applications/mod_av/test/test_mod_av.2017.vcxproj
0 → 100644
浏览文件 @
b53d1cae
差异被折叠。
点击展开。
src/mod/applications/mod_av/test/test_mod_av.c
0 → 100644
浏览文件 @
b53d1cae
/*
* 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 <dujinfang@gmail.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* mod_av_test -- avcodec tests
*
*/
#include <test/switch_test.h>
int
loop
=
0
;
/* Add our command line options. */
static
fctcl_init_t
my_cl_options
[]
=
{
{
"--disable-hw"
,
/* long_opt */
NULL
,
/* short_opt (optional) */
FCTCL_STORE_TRUE
,
/* action */
"disable hardware encoder"
/* help */
},
{
"--loop"
,
/* long_opt */
NULL
,
/* short_opt (optional) */
FCTCL_STORE_VALUE
,
/* action */
"loops to encode a picture"
/* help */
},
FCTCL_INIT_NULL
/* Sentinel */
};
FST_CORE_BEGIN
(
"conf"
)
{
fctcl_install
(
my_cl_options
);
const
char
*
loop_
=
fctcl_val
(
"--loop"
);
if
(
loop_
)
loop
=
atoi
(
loop_
);
FST_MODULE_BEGIN
(
mod_av
,
mod_av_test
)
{
FST_SETUP_BEGIN
()
{
// fst_requires_module("mod_av");
}
FST_SETUP_END
()
FST_TEST_BEGIN
(
encoder_test
)
{
switch_status_t
status
;
switch_codec_t
codec
=
{
0
};
switch_codec_settings_t
codec_settings
=
{
0
};
// switch_set_string(codec_settings.video.config_profile_name, "conference");
if
(
!
fctcl_is
(
"--disable-hw"
))
{
codec_settings
.
video
.
try_hardware_encoder
=
1
;
}
status
=
switch_core_codec_init
(
&
codec
,
"H264"
,
NULL
,
NULL
,
0
,
0
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
&
codec_settings
,
fst_pool
);
fst_check
(
status
==
SWITCH_STATUS_SUCCESS
);
switch_image_t
*
img
=
switch_img_alloc
(
NULL
,
SWITCH_IMG_FMT_I420
,
1280
,
720
,
1
);
fst_requires
(
img
);
uint8_t
buf
[
SWITCH_DEFAULT_VIDEO_SIZE
+
12
];
switch_frame_t
frame
=
{
0
};
frame
.
packet
=
buf
;
frame
.
packetlen
=
SWITCH_DEFAULT_VIDEO_SIZE
+
12
;
frame
.
data
=
buf
+
12
;
frame
.
datalen
=
SWITCH_DEFAULT_VIDEO_SIZE
;
frame
.
payload
=
96
;
frame
.
m
=
0
;
frame
.
seq
=
0
;
frame
.
timestamp
=
0
;
frame
.
img
=
img
;
int
packets
=
0
;
switch_status_t
encode_status
;
do
{
frame
.
datalen
=
SWITCH_DEFAULT_VIDEO_SIZE
;
encode_status
=
switch_core_codec_encode_video
(
&
codec
,
&
frame
);
if
(
encode_status
==
SWITCH_STATUS_SUCCESS
||
encode_status
==
SWITCH_STATUS_MORE_DATA
)
{
fst_requires
((
encode_status
==
SWITCH_STATUS_SUCCESS
&&
frame
.
m
)
||
!
frame
.
m
);
if
(
frame
.
flags
&
SFF_PICTURE_RESET
)
{
frame
.
flags
&=
~
SFF_PICTURE_RESET
;
fst_check
(
0
);
}
if
(
frame
.
datalen
==
0
)
break
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"[%d]: %02x %02x | m=%d | %d
\n
"
,
loop
,
buf
[
12
],
buf
[
13
],
frame
.
m
,
frame
.
datalen
);
packets
++
;
}
}
while
(
encode_status
==
SWITCH_STATUS_MORE_DATA
||
loop
--
>
1
);
fst_check
(
frame
.
m
==
1
);
fst_check
(
packets
>
0
);
switch_core_codec_destroy
(
&
codec
);
}
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论