Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
20b7ecfa
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
20b7ecfa
编写于
10月 14, 2021
作者:
Z
z_apperception
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<zhaochen69@huawei.com>
Signed-off-by:
N
z_apperception
<
zhaochen69@huawei.com
>
上级
07ce031c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
1888 addition
and
190 deletion
+1888
-190
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
+10
-2
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.cpp
..._lite_posix/recorder_native/src/ActsMediaRecorderTest.cpp
+1830
-0
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
...ia_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
+48
-0
multimedia_lite/media_lite_posix/recorder_native/src/include/ActsMediaRecorderTest.h
...posix/recorder_native/src/include/ActsMediaRecorderTest.h
+0
-188
未找到文件。
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
浏览文件 @
20b7ecfa
...
...
@@ -15,11 +15,19 @@ import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaRecorderTest") {
suite_name = "acts"
sources = [ "src/
testcase/ActsMediaRecorderNDK
Test.cpp" ]
sources = [ "src/
ActsMediaRecorder
Test.cpp" ]
include_dirs = [
"src
/include
",
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//third_party/bounds_checking_function/include",
"//drivers/peripheral/codec/interfaces/include",
"//foundation/multimedia/utils/lite/hals",
"//foundation/multimedia/media_lite/test/unittest/recorder_lite",
"//foundation/multimedia/media_lite/interfaces/kits/recorder_lite",
"//foundation/multimedia/media_lite/frameworks/recorder_lite",
"//foundation/multimedia/media_lite/frameworks/recorder_lite/recoder_sink/include",
"//foundation/multimedia/media_lite/frameworks/recorder_lite/recoder_source/include",
]
deps = [
...
...
multimedia_lite/media_lite_posix/recorder_native/src/
testcase/ActsMediaRecorderNDK
Test.cpp
→
multimedia_lite/media_lite_posix/recorder_native/src/
ActsMediaRecorder
Test.cpp
100755 → 100644
浏览文件 @
20b7ecfa
/*
* Copyright (
c
) 2021 Huawei Device Co., Ltd.
* Copyright (
C
) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -12,174 +12,648 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ActsMediaRecorderTest.h"
#include
<unistd.h>
#include "
camera_kit
.h"
#include
"media_info.h"
#include "
media_errors
.h"
#include "recorder.h"
#include "gtest/gtest.h"
#include "ActsTestMediaUtils.h"
static
int32_t
g_recoderSourceMaxCount
=
4
;
// max recorder source setting
#include <iostream>
using
namespace
std
;
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
testing
::
ext
;
namespace
OHOS
{
const
int32_t
RET_OK
=
0
;
const
int32_t
RET_NOK
=
-
1
;
static
int32_t
g_recorderSourceMaxCount
=
4
;
// max recorder source setting
void
RecoderLiteTest
::
SetUpTestCase
(
void
)
{}
void
RecoderLiteTest
::
TearDownTestCase
(
void
)
{}
void
RecoderLiteTest
::
SetUp
()
{}
void
RecoderLiteTest
::
TearDown
()
{}
void
RecoderLiteTest
::
OnError
(
const
int32_t
errorType
,
const
int32_t
errorCode
)
{
cout
<<
"RecoderLiteTest::OnError ..."
<<
endl
;
}
void
RecoderLiteTest
::
OnInfo
(
const
int32_t
type
,
const
int32_t
extra
)
{
cout
<<
"RecoderLiteTest::OnInfo ..."
<<
endl
;
}
namespace
Media
{
void
TestVideoRecorderCallback
::
OnError
(
int32_t
errorType
,
int32_t
errorCode
)
{
cout
<<
"TestVideoRecorderCallback::OnError ..."
<<
endl
;
}
void
TestVideoRecorderCallback
::
OnInfo
(
int32_t
type
,
int32_t
extra
)
{
cout
<<
"TestVideoRecorderCallback::OnInfo ..."
<<
endl
;
}
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0100
* @tc.name : Start recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Start_test_001
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0200
* @tc.name : Start recorder without recorder sink prepare
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Start_test_002
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_NE
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0300
* @tc.name : Pasue recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Pause_test_001
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* Media Recorder test
* @tc.number : SUB_MEDIA_REC_TEST_0400
* @tc.name : Pause recorder - pause multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
class
ActsMediaRecorderNDKTest
:
public
testing
::
Test
{
protected:
/* *
* @tc.setup:This is before test class
*/
static
void
SetUpTestCase
(
void
);
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Pause_test_002
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_NE
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is after test class
*/
static
void
TearDownTestCase
(
void
);
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0500
* @tc.name : Resume recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Resume_test_001
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Resume
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is before test case
*/
virtual
void
SetUp
(
void
);
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0600
* @tc.name : Resume recorder - resume multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Resume_test_002
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Resume
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Resume
();
EXPECT_NE
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is after test case
*/
virtual
void
TearDown
(
void
);
};
/* *
* @tc.number : SUB_MEDIA_REC_TEST_0700
* @tc.name : Stop recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Stop_test_001
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Stop
(
true
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is before test class
* @tc.number : SUB_MEDIA_REC_TEST_0800
* @tc.name : Stop recorder - stop multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
void
ActsMediaRecorderNDKTest
::
SetUpTestCase
(
void
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Stop_test_002
,
Level1
)
{
cout
<<
"SetUpTestCase"
<<
endl
;
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Stop
(
true
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Stop
(
true
);
EXPECT_NE
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is after test class
* @tc.number : SUB_MEDIA_REC_TEST_0900
* @tc.name : Reset recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
void
ActsMediaRecorderNDKTest
::
TearDownTestCase
(
void
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Reset_test_001
,
Level1
)
{
cout
<<
"TearDownTestCase"
<<
endl
;
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Reset
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is before test case
* @tc.number : SUB_MEDIA_REC_TEST_1000
* @tc.name : Reset recorder - Reset multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
void
ActsMediaRecorderNDKTest
::
SetUp
(
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Reset_test_002
,
Level1
)
{
cout
<<
"SetUp"
<<
endl
;
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Reset
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Reset
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.setup:This is after test case
* @tc.number : SUB_MEDIA_REC_TEST_1100
* @tc.name : Release recorder
* @tc.desc : [C- SOFTWARE -0200]
*/
void
ActsMediaRecorderNDKTest
::
TearDown
(
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Release_test_001
,
Level1
)
{
sleep
(
1
);
cout
<<
"TearDown"
<<
endl
;
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_01
00
* @tc.name :
Set Video Source 01
* @tc.number : SUB_MEDIA_REC_
TEST_12
00
* @tc.name :
Reset recorder - Reset multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSource01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Release_test_002
,
Level1
)
{
cout
<<
"Test_SetVideoSource01 starting..."
<<
endl
;
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
EXPECT_NE
(
RET_OK
,
retStatus
);
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_1300
* @tc.name : SetFileSplitDuration POST recording
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetFileSplitDuration_test_001
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
FileSplitType
type
=
FILE_SPLIT_POST
;
int64_t
timestamp
=
-
1
;
uint32_t
duration
=
5
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetFileSplitDuration
(
type
,
timestamp
,
duration
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_1400
* @tc.name : SetFileSplitDuration PRE recording
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetFileSplitDuration_test_002
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
FileSplitType
type
=
FILE_SPLIT_PRE
;
int64_t
timestamp
=
-
1
;
uint32_t
duration
=
5
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetFileSplitDuration
(
type
,
timestamp
,
duration
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_1500
* @tc.name : SetFileSplitDuration NORMAL recording
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetFileSplitDuration_test_003
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
FileSplitType
type
=
FILE_SPLIT_NORMAL
;
int64_t
timestamp
=
-
1
;
uint32_t
duration
=
5
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetFileSplitDuration
(
type
,
timestamp
,
duration
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_1600
* @tc.name : SetFileSplitDuration NORMAL recording in PAUSE state
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetFileSplitDuration_test_004
,
Level1
)
{
int32_t
retStatus
=
0
;
int32_t
sourceId
=
0
;
int32_t
audioSourceId
=
0
;
FileSplitType
type
=
FILE_SPLIT_NORMAL
;
int64_t
timestamp
=
-
1
;
uint32_t
duration
=
5
;
Recorder
*
recInstance
=
new
Recorder
();
shared_ptr
<
TestVideoRecorderCallback
>
cb
=
std
::
make_shared
<
TestVideoRecorderCallback
>
();
retStatus
=
recInstance
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Prepare
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetRecorderCallback
(
cb
);
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Start
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Pause
();
EXPECT_EQ
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
SetFileSplitDuration
(
type
,
timestamp
,
duration
);
EXPECT_NE
(
RET_OK
,
retStatus
);
retStatus
=
recInstance
->
Release
();
delete
recInstance
;
recInstance
=
nullptr
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_1700
* @tc.name : Set Video Source ES
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSource_test_001
,
Level1
)
{
cout
<<
"medialite_recorder_SetVideoSource01 starting..."
<<
endl
;
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
cout
<<
"
Test
_SetVideoSource01 ending..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 ending..."
<<
endl
;
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_011
0
* @tc.name : Set Video Source
02
* @tc.number : SUB_MEDIA_REC_
TEST_180
0
* @tc.name : Set Video Source
YUV
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSource02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSource_test_002
,
Level1
)
{
cout
<<
"
Test
_SetVideoSource01 starting..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 starting..."
<<
endl
;
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_YUV
,
sourceId
);
EXPECT_EQ
(
SUCCESS
,
ret
);
cout
<<
"
Test
_SetVideoSource01 ending..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 ending..."
<<
endl
;
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_02
00
* @tc.name : Set Video Source
03
* @tc.number : SUB_MEDIA_REC_
TEST_19
00
* @tc.name : Set Video Source
RGB
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSource03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSource_test_003
,
Level1
)
{
cout
<<
"
Test
_SetVideoSource03 starting..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource03 starting..."
<<
endl
;
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_RGB
,
sourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
cout
<<
"
Test
_SetVideoSource03 ending..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource03 ending..."
<<
endl
;
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_03
00
* @tc.name : Set Video Source
04
* @tc.number : SUB_MEDIA_REC_
TEST_20
00
* @tc.name : Set Video Source
invalid
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSource04
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSource_test_004
,
Level1
)
{
cout
<<
"
Test
_SetVideoSource01 starting..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 starting..."
<<
endl
;
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_BUTT
,
sourceId
);
EXPECT_EQ
(
ERR_INVALID_PARAM
,
ret
);
cout
<<
"
Test
_SetVideoSource01 ending..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 ending..."
<<
endl
;
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_04
00
* @tc.name : Set Video Source
05
* @tc.number : SUB_MEDIA_REC_
TEST_21
00
* @tc.name : Set Video Source
Max count 4
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSource05
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSource_test_005
,
Level1
)
{
cout
<<
"
Test
_SetVideoSource01 starting..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 starting..."
<<
endl
;
Recorder
*
recorder
=
new
Recorder
();
for
(
int32_t
i
=
0
;
i
<
g_recoderSourceMaxCount
;
i
++
)
{
int32_t
temp
=
i
;
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
temp
);
for
(
int32_t
i
=
0
;
i
<
g_recorderSourceMaxCount
;
i
++
)
{
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
i
);
EXPECT_EQ
(
RET_OK
,
ret
);
}
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
g_recoderSourceMaxCount
);
int32_t
ret
=
recorder
->
SetVideoSource
(
VIDEO_SOURCE_SURFACE_ES
,
g_reco
r
derSourceMaxCount
);
EXPECT_EQ
(
ERR_NOFREE_CHANNEL
,
ret
);
cout
<<
"
Test
_SetVideoSource01 ending..."
<<
endl
;
cout
<<
"
medialite_recorder
_SetVideoSource01 ending..."
<<
endl
;
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_05
00
* @tc.name : Set Video Encoder
01
* @tc.number : SUB_MEDIA_REC_
TEST_22
00
* @tc.name : Set Video Encoder
with video surface
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncoder01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncoder_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -192,11 +666,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncoder01, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_06
00
* @tc.name : Set Video Encoder
02
* @tc.number : SUB_MEDIA_REC_
TEST_23
00
* @tc.name : Set Video Encoder
without video surface
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncoder02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncoder_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -207,11 +681,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncoder02, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_07
00
* @tc.name : Set Video Encoder
03
* @tc.number : SUB_MEDIA_REC_
TEST_24
00
* @tc.name : Set Video Encoder
with VIDEO_DEFAULT
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncoder03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncoder_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -224,11 +698,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncoder03, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_08
00
* @tc.name : Set Video Encoder
0
4
* @tc.number : SUB_MEDIA_REC_
TEST_25
00
* @tc.name : Set Video Encoder
with H26
4
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncoder04
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncoder_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -241,11 +715,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncoder04, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_09
00
* @tc.name : Set Video Encoder
05
* @tc.number : SUB_MEDIA_REC_
TEST_26
00
* @tc.name : Set Video Encoder
with invalid video source
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncoder05
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncoder_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -258,11 +732,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncoder05, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_10
00
* @tc.name : Set Video Size
01
* @tc.number : SUB_MEDIA_REC_
TEST_27
00
* @tc.name : Set Video Size
valid resolution
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSize01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSize_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -277,11 +751,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoSize01, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_11
00
* @tc.name : Set Video Size
02
* @tc.number : SUB_MEDIA_REC_
TEST_28
00
* @tc.name : Set Video Size
invalid resolution
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSize02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSize_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -296,11 +770,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoSize02, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_12
00
* @tc.name : Set Video Size
03
* @tc.number : SUB_MEDIA_REC_
TEST_29
00
* @tc.name : Set Video Size
valid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSize03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSize_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -313,11 +787,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoSize03, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_13
00
* @tc.name : Set Video Size
04
* @tc.number : SUB_MEDIA_REC_
TEST_30
00
* @tc.name : Set Video Size
unsupported resolution
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSize04
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSize_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -330,11 +804,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoSize04, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_14
00
* @tc.name : Set Video Size
05
* @tc.number : SUB_MEDIA_REC_
TEST_31
00
* @tc.name : Set Video Size
invalid resolution
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoSize05
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoSize_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -347,11 +821,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoSize05, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_15
00
* @tc.name : Set Video Frame
Rate 01
* @tc.number : SUB_MEDIA_REC_
TEST_32
00
* @tc.name : Set Video Frame
Rate with valid value
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoFrameRate01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoFrameRate_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -365,11 +839,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoFrameRate01, Function | MediumTe
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_16
00
* @tc.name : Set Video Frame
Rate 02
* @tc.number : SUB_MEDIA_REC_
TEST_33
00
* @tc.name : Set Video Frame
Rate with invalid value
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoFrameRate02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoFrameRate_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -383,11 +857,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoFrameRate02, Function | MediumTe
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_17
00
* @tc.name : Set Video Frame
Rate 03
* @tc.number : SUB_MEDIA_REC_
TEST_34
00
* @tc.name : Set Video Frame
Rate with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoFrameRate03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoFrameRate_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -399,11 +873,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoFrameRate03, Function | MediumTe
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_18
00
* @tc.name : Set Video Encoding BitRate
01
* @tc.number : SUB_MEDIA_REC_
TEST_35
00
* @tc.name : Set Video Encoding BitRate
with valid info
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncodingBitRate01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncodingBitRate_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -417,11 +891,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncodingBitRate01, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_19
00
* @tc.name : Set Video Encoding BitRate
02
* @tc.number : SUB_MEDIA_REC_
TEST_36
00
* @tc.name : Set Video Encoding BitRate
with invalid rate
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncodingBitRate02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncodingBitRate_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -435,11 +909,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncodingBitRate02, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_20
00
* @tc.name : Set Video Encoding BitRate
03
* @tc.number : SUB_MEDIA_REC_
TEST_37
00
* @tc.name : Set Video Encoding BitRate
with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetVideoEncodingBitRate03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetVideoEncodingBitRate_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -451,11 +925,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetVideoEncodingBitRate03, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_21
00
* @tc.name : Set Capture Rate
01
* @tc.number : SUB_MEDIA_REC_
TEST_38
00
* @tc.name : Set Capture Rate
with valid info
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetCaptureRate01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetCaptureRate_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -469,11 +943,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetCaptureRate01, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_22
00
* @tc.name : Set Capture Rate
02
* @tc.number : SUB_MEDIA_REC_
TEST_39
00
* @tc.name : Set Capture Rate
with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetCaptureRate02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetCaptureRate_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -485,11 +959,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetCaptureRate02, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_23
00
* @tc.name : Set Capture Rate
03
* @tc.number : SUB_MEDIA_REC_
TEST_40
00
* @tc.name : Set Capture Rate
with invalid fps
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetCaptureRate03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetCaptureRate_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -503,11 +977,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetCaptureRate03, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_24
00
* @tc.name : Set Audio Source
01
* @tc.number : SUB_MEDIA_REC_
TEST_41
00
* @tc.name : Set Audio Source
with valid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSource01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSource_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -518,11 +992,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioSource01, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_25
00
* @tc.name : Set Audio Source
02
* @tc.number : SUB_MEDIA_REC_
TEST_42
00
* @tc.name : Set Audio Source
with invalid source
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSource02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSource_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -533,31 +1007,32 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioSource02, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_26
00
* @tc.name : Set Audio Source
03
* @tc.number : SUB_MEDIA_REC_
TEST_43
00
* @tc.name : Set Audio Source
multiple times
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSource03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSource_test_003
,
Level1
)
{
int32_t
sourceId
;
int32_t
ret
;
Recorder
*
recorder
=
new
Recorder
();
for
(
int32_t
i
=
0
;
i
<
g_recoderSourceMaxCount
;
i
++
)
{
int32_t
tempSourceId
=
i
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
tempSourceId
);
for
(
int32_t
i
=
0
;
i
<
g_recorderSourceMaxCount
;
i
++
)
{
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
sourceId
);
cout
<<
i
<<
endl
;
EXPECT_EQ
(
RET_OK
,
ret
);
}
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
g_recoderSourceMaxCount
)
;
EXPECT_EQ
(
ERR_NOFREE_CHANNEL
,
ret
)
;
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
sourceId
)
;
EXPECT_EQ
(
ERR_NOFREE_CHANNEL
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_27
00
* @tc.name : Set Audio Encoder
01
* @tc.number : SUB_MEDIA_REC_
TEST_44
00
* @tc.name : Set Audio Encoder
with AAC_LC
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -570,11 +1045,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder01, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_28
00
* @tc.name : Set Audio Encoder
02
* @tc.number : SUB_MEDIA_REC_
TEST_45
00
* @tc.name : Set Audio Encoder
with AUDIO_DEFAULT
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -587,11 +1062,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder02, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_29
00
* @tc.name : Set Audio Encoder
03
* @tc.number : SUB_MEDIA_REC_
TEST_46
00
* @tc.name : Set Audio Encoder
with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
10000
;
...
...
@@ -602,11 +1077,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder03, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_30
00
* @tc.name : Set Audio Encoder
04
* @tc.number : SUB_MEDIA_REC_
TEST_47
00
* @tc.name : Set Audio Encoder
with valid data AAC_HE_V1
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder04
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -619,11 +1094,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder04, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_31
00
* @tc.name : Set Audio Encoder
05
* @tc.number : SUB_MEDIA_REC_
TEST_48
00
* @tc.name : Set Audio Encoder
with valid data AAC_HE_V2
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder05
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -636,11 +1111,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder05, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_32
00
* @tc.name : Set Audio Encoder
06
* @tc.number : SUB_MEDIA_REC_
TEST_49
00
* @tc.name : Set Audio Encoder
with valid data AAC_LD
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder06
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_006
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -653,11 +1128,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder06, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_33
00
* @tc.name : Set Audio Encoder
07
* @tc.number : SUB_MEDIA_REC_
TEST_50
00
* @tc.name : Set Audio Encoder
with valid data AAC_ELD
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncoder07
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncoder_test_007
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -670,11 +1145,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncoder07, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_34
00
* @tc.name : Set Audio Sample Rate
01
* @tc.number : SUB_MEDIA_REC_
TEST_51
00
* @tc.name : Set Audio Sample Rate
with valid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSampleRate01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -688,11 +1163,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioSampleRate01, Function | MediumT
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_35
00
* @tc.name : Set Audio Sample Rate
02
* @tc.number : SUB_MEDIA_REC_
TEST_52
00
* @tc.name : Set Audio Sample Rate
with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSamplingRate02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
10000
;
...
...
@@ -704,11 +1179,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioSamplingRate02, Function | Mediu
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_36
00
* @tc.name : Set Audio Sample Rate
03
* @tc.number : SUB_MEDIA_REC_
TEST_53
00
* @tc.name : Set Audio Sample Rate
with invalid sample rate
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioSampleRate03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -722,11 +1197,83 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioSampleRate03, Function | MediumT
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_37
00
* @tc.name : Set Audio
Channels 01
* @tc.number : SUB_MEDIA_REC_
TEST_54
00
* @tc.name : Set Audio
Sample Rate with 44.1Khz
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioChannels01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
sampleRate
=
44100
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioSampleRate
(
audioSourceId
,
sampleRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_5500
* @tc.name : Set Audio Sample Rate with 8Khz
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
sampleRate
=
8000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioSampleRate
(
audioSourceId
,
sampleRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_5600
* @tc.name : Set Audio Sample Rate with 16Khz
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_006
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
sampleRate
=
16000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioSampleRate
(
audioSourceId
,
sampleRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_5700
* @tc.name : Set Audio Sample Rate with 32Khz
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioSampleRate_test_007
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
sampleRate
=
32000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioSampleRate
(
audioSourceId
,
sampleRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_5800
* @tc.name : Set Audio Channels with valid one channel count
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -740,11 +1287,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioChannels01, Function | MediumTes
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_38
00
* @tc.name : Set Audio Channels
02
* @tc.number : SUB_MEDIA_REC_
TEST_59
00
* @tc.name : Set Audio Channels
with valid two channel count
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioChannels02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -758,11 +1305,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioChannels02, Function | MediumTes
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_39
00
* @tc.name : Set Audio Channels
03
* @tc.number : SUB_MEDIA_REC_
TEST_60
00
* @tc.name : Set Audio Channels
with invalid channel count
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioChannels03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -776,16 +1323,34 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioChannels03, Function | MediumTes
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_40
00
* @tc.name : Set Audio Channels
04
* @tc.number : SUB_MEDIA_REC_
TEST_61
00
* @tc.name : Set Audio Channels
with valid one channel count and AUDIO_VOICE_CALL as source
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioChannels04
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
channelCount
=
1000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
int32_t
channelCount
=
2
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioChannels
(
audioSourceId
,
channelCount
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_6200
* @tc.name : Set Audio Channels with valid two channel count and AUDIO_VOICE_CALL as source
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
channelCount
=
1
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioChannels
(
audioSourceId
,
channelCount
);
EXPECT_EQ
(
RET_OK
,
ret
);
...
...
@@ -794,11 +1359,29 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioChannels04, Function | MediumTes
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_41
00
* @tc.name : Set Audio Channels
05
* @tc.number : SUB_MEDIA_REC_
TEST_63
00
* @tc.name : Set Audio Channels
with invalid channel count and AUDIO_VOICE_CALL as source
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioChannels05
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_006
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
channelCount
=
0
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioChannels
(
audioSourceId
,
channelCount
);
EXPECT_EQ
(
ERR_INVALID_PARAM
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_6400
* @tc.name : Set Audio Channels with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioChannels_test_007
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
100000
;
...
...
@@ -810,11 +1393,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioChannels05, Function | MediumTes
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_42
00
* @tc.name : Set Audio Encoding BitRate
01
* @tc.number : SUB_MEDIA_REC_
TEST_65
00
* @tc.name : Set Audio Encoding BitRate
with valid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncodingBitRate01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -828,11 +1411,83 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncodingBitRate01, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_PARAM_4300
* @tc.name : Set Audio Encoding BitRate 02
* @tc.number : SUB_MEDIA_REC_TEST_6600
* @tc.name : Set Audio Encoding BitRate with 44000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
44000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_6700
* @tc.name : Set Audio Encoding BitRate with 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
8000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_6800
* @tc.name : Set Audio Encoding BitRate with 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
16000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_6900
* @tc.name : Set Audio Encoding BitRate with 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_005
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
32000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7000
* @tc.name : Set Audio Encoding BitRate with invalid bitrate
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncodingBitRate02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_006
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
...
...
@@ -846,11 +1501,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncodingBitRate02, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_44
00
* @tc.name : Set Audio Encoding BitRate
03
* @tc.number : SUB_MEDIA_REC_
TEST_71
00
* @tc.name : Set Audio Encoding BitRate
with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetAudioEncodingBitRate03
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_007
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
10000
;
...
...
@@ -862,11 +1517,101 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetAudioEncodingBitRate03, Function | Me
}
/* *
* @tc.number : SUB_MEDIA_REC_PARAM_4500
* @tc.name : Test Recorder Prepare 01
* @tc.number : SUB_MEDIA_REC_TEST_7200
* @tc.name : Set Audio Encoding BitRate with valid data and source AUDIO_VOICE_CALL
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_008
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
48000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7300
* @tc.name : Set Audio Encoding BitRate with 44000 and source AUDIO_VOICE_CALL
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_Prepare01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_009
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
44000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7400
* @tc.name : Set Audio Encoding BitRate with 8000 and source AUDIO_VOICE_CALL
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_010
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
8000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7500
* @tc.name : Set Audio Encoding BitRate with 16000 and source AUDIO_VOICE_CALL
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_011
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
16000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7600
* @tc.name : Set Audio Encoding BitRate with 32000 and source AUDIO_VOICE_CALL
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetAudioEncodingBitRate_test_012
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
audioSourceId
=
0
;
int32_t
audioEncodingBitRate
=
32000
;
int32_t
ret
=
recorder
->
SetAudioSource
(
AUDIO_VOICE_CALL
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
SetAudioEncodingBitRate
(
audioSourceId
,
audioEncodingBitRate
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_TEST_7700
* @tc.name : Prepare recorder with valid info
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_Prepare_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -876,17 +1621,17 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_Prepare01, Function | MediumTest | Level
ret
=
recorder
->
SetAudioSource
(
AUDIO_MIC
,
audioSourceId
);
EXPECT_EQ
(
RET_OK
,
ret
);
ret
=
recorder
->
Prepare
();
EXPECT_
NE
(
RET_OK
,
ret
);
EXPECT_
EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_46
00
* @tc.name :
Test Recorder GetSurface 01
* @tc.number : SUB_MEDIA_REC_
TEST_78
00
* @tc.name :
GetSurface with valid info
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_GetSurface01
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_GetSurface_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
0
;
...
...
@@ -900,11 +1645,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_GetSurface01, Function | MediumTest | Le
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_47
00
* @tc.name :
Test Recorder GetSurface 02
* @tc.number : SUB_MEDIA_REC_
TEST_79
00
* @tc.name :
GetSurface with invalid source ID
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_GetSurface02
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_GetSurface_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
sourceId
=
10000
;
...
...
@@ -915,11 +1660,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_GetSurface02, Function | MediumTest | Le
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_48
00
* @tc.name :
Test Recorder SetMaxDuration 01
* @tc.number : SUB_MEDIA_REC_
TEST_80
00
* @tc.name :
Set Max Duration with valid value
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxDuration
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxDuration_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxDuration
(
1000
);
...
...
@@ -929,11 +1674,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxDuration, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_49
00
* @tc.name :
Test Recorder SetMaxDuration 02
* @tc.number : SUB_MEDIA_REC_
TEST_81
00
* @tc.name :
Set Max Duration with zero value
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxDuration2
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxDuration_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxDuration
(
0
);
...
...
@@ -943,11 +1688,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxDuration2, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_50
00
* @tc.name :
Test Recorder SetMaxDuration 03
* @tc.number : SUB_MEDIA_REC_
TEST_82
00
* @tc.name :
Set Max Duration with invalid value
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxDuration3
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxDuration_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxDuration
(
-
1
);
...
...
@@ -957,11 +1702,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxDuration3, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_51
00
* @tc.name :
Test Recorder SetMaxDuration 04
* @tc.number : SUB_MEDIA_REC_
TEST_83
00
* @tc.name :
Set Max Duration with invalid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxDuration4
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxDuration_test_004
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxDuration
(
4294967295
);
...
...
@@ -971,11 +1716,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxDuration4, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_52
00
* @tc.name :
Test Recorder SetMaxFileSize 01
* @tc.number : SUB_MEDIA_REC_
TEST_84
00
* @tc.name :
Set Max File Size with invalid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxFileSize1
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxFileSize_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxFileSize
(
0
);
...
...
@@ -985,11 +1730,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxFileSize1, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_53
00
* @tc.name :
Test Recorder SetMaxFileSize 02
* @tc.number : SUB_MEDIA_REC_
TEST_85
00
* @tc.name :
Set Max File Size with valid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetMaxFileSize2
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetMaxFileSize_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetMaxFileSize
(
2000
);
...
...
@@ -999,39 +1744,39 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetMaxFileSize2, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_54
00
* @tc.name :
Test Recorder SetOutputFile 01
* @tc.number : SUB_MEDIA_REC_
TEST_86
00
* @tc.name :
Set Output File with invalid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetOutputFile1
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetOutputFile_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetOutputFile
(
-
1
);
EXPECT_EQ
(
-
5
,
ret
);
EXPECT_EQ
(
ERR_INVALID_PARAM
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_55
00
* @tc.name :
Test Recorder SetNextOutputFile 01
* @tc.number : SUB_MEDIA_REC_
TEST_87
00
* @tc.name :
Set Next Output File with invalid data
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetNextOutputFile1
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetNextOutputFile_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetNextOutputFile
(
-
1
);
EXPECT_EQ
(
-
5
,
ret
);
EXPECT_EQ
(
ERR_INVALID_PARAM
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_56
00
* @tc.name :
Test Recorder SetOutputPath 01
* @tc.number : SUB_MEDIA_REC_
TEST_88
00
* @tc.name :
Set Output Path with empty path
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetOutputPath1
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetOutputPath_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
const
string
path
=
""
;
...
...
@@ -1042,11 +1787,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputPath1, Function | MediumTest |
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_57
00
* @tc.name :
Test Recorder SetOutputFormat 01
* @tc.number : SUB_MEDIA_REC_
TEST_89
00
* @tc.name :
Set Output Path with FORMAT_DEFAULT
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetOutputFormat1
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetOutputFormat_test_001
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetOutputFormat
(
FORMAT_DEFAULT
);
...
...
@@ -1056,11 +1801,11 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFormat1, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_58
00
* @tc.name :
Test Recorder SetOutputFormat 02
* @tc.number : SUB_MEDIA_REC_
TEST_90
00
* @tc.name :
Set Output Path with FORMAT_MPEG_4
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetOutputFormat2
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetOutputFormat_test_002
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetOutputFormat
(
FORMAT_MPEG_4
);
...
...
@@ -1070,15 +1815,16 @@ HWTEST_F(ActsMediaRecorderNDKTest, Test_SetOutputFormat2, Function | MediumTest
}
/* *
* @tc.number : SUB_MEDIA_REC_
PARAM_59
00
* @tc.name :
Test Recorder SetOutputFormat 03
* @tc.number : SUB_MEDIA_REC_
TEST_91
00
* @tc.name :
Set Output Path with FORMAT_TS
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaRecorderNDKTest
,
Test_SetOutputFormat3
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
RecoderLiteTest
,
medialite_recorder_SetOutputFormat_test_003
,
Level1
)
{
Recorder
*
recorder
=
new
Recorder
();
int32_t
ret
=
recorder
->
SetOutputFormat
(
FORMAT_TS
);
EXPECT_EQ
(
RET_OK
,
ret
);
delete
recorder
;
recorder
=
NULL
;
}
\ No newline at end of file
}
}
// namespace OHOS
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
0 → 100644
浏览文件 @
20b7ecfa
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RECORDER_LITE_TEST_H
#define RECORDER_LITE_TEST_H
#include "gtest/gtest.h"
#include "recorder.h"
using
OHOS
::
Media
::
RecorderCallback
;
namespace
OHOS
{
class
RecoderLiteTest
:
public
testing
::
Test
{
public:
// SetUpTestCase: before all testcasee
static
void
SetUpTestCase
(
void
);
// TearDownTestCase: after all testcase
static
void
TearDownTestCase
(
void
);
// SetUp
void
SetUp
(
void
);
// TearDown
void
TearDown
(
void
);
void
OnError
(
const
int32_t
errorType
,
const
int32_t
errorCode
);
void
OnInfo
(
const
int32_t
type
,
const
int32_t
extra
);
};
namespace
Media
{
class
TestVideoRecorderCallback
:
public
RecorderCallback
{
public:
void
OnError
(
int32_t
errorType
,
int32_t
errorCode
);
void
OnInfo
(
int32_t
type
,
int32_t
extra
);
};
}
}
#endif // RECORDER_LITE_TEST_H
multimedia_lite/media_lite_posix/recorder_native/src/include/ActsMediaRecorderTest.h
已删除
100755 → 0
浏览文件 @
07ce031c
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ACTS_MEDIA_RECODER_TEST_H
#define ACTS_MEDIA_RECODER_TEST_H
#include <unistd.h>
#include "recorder.h"
#include "gtest/gtest.h"
#include "camera_kit.h"
#include "TestCaseParse.h"
#include "ActsTestMediaUtils.h"
#define TESTCASECOUNT 38
const
string
g_testPath
;
const
string
g_recordFilePath
;
static
int32_t
g_fdNull
=
-
1
;
// fd is null
static
int32_t
g_sleepTime
=
1
;
using
namespace
std
;
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
testing
::
ext
;
/* *
* creat camera device callback
*/
class
SampleCameraDeviceCallback
:
public
CameraDeviceCallback
{
public:
SampleCameraDeviceCallback
()
{
cout
<<
"camera device call back created"
<<
endl
;
}
~
SampleCameraDeviceCallback
()
{
cout
<<
"camera device call back destroyed"
<<
endl
;
}
/* *
* camera statu changed
*/
void
OnCameraStatus
(
std
::
string
cameraId
,
int32_t
status
)
override
;
};
/* *
* create FrameStateCallback
*/
class
SampleFrameStateCallback
:
public
FrameStateCallback
{
void
OnFrameFinished
(
Camera
&
camera
,
FrameConfig
&
fc
,
FrameResult
&
result
)
override
;
void
OnFrameError
(
Camera
&
camera
,
FrameConfig
&
frameConfig
,
int32_t
errorCode
,
FrameResult
&
frameResult
)
override
;
};
/* *
* create CameraStateCallback
*/
class
SampleCameraStateMng
:
public
CameraStateCallback
{
public:
SampleCameraStateMng
()
=
delete
;
SampleCameraStateMng
(
EventHandler
&
eventHandler
)
:
eventHandler
(
eventHandler
)
{}
~
SampleCameraStateMng
()
{
CloseRecorder
();
if
(
cam_
!=
nullptr
)
{
cam_
->
Release
();
}
}
// close Recorder
void
CloseRecorder
();
// 相机创建成功
void
OnCreated
(
Camera
&
c
)
override
;
// 相机创建失败
void
OnCreateFailed
(
const
std
::
string
cameraId
,
int32_t
errorCode
)
override
{
cout
<<
"CameraStateCallback OnCreateFailed
\n
"
<<
endl
;
}
void
OnReleased
(
Camera
&
c
)
override
{
cout
<<
"CameraStateCallback OnReleased
\n
"
<<
endl
;
}
void
OnConfigured
(
Camera
&
c
)
override
{
cout
<<
"CameraStateCallback OnConfigured
\n
"
<<
endl
;
}
void
OnConfigureFailed
(
const
std
::
string
cameraId
,
int32_t
errorCode
)
override
{
cout
<<
"CameraStateCallback OnConfigureFailed
\n
"
<<
endl
;
}
// 创建Reorder
int32_t
SampleCreateRecorder
(
TestCase
&
ft
);
// 准备录像
int32_t
PrepareRecorder
();
// 开始录像
int32_t
StartRecord
();
/* *
* 开始预览
*/
int32_t
StartPreview
();
/* *
* 拍照,并保存文件
*/
int32_t
Capture
();
/* *
* 停止录像
*/
int32_t
Stop
();
private:
enum
State
:
int32_t
{
STATE_IDLE
,
STATE_RUNNING
,
STATE_BUTT
};
State
previewState_
=
STATE_IDLE
;
State
recordState_
=
STATE_IDLE
;
EventHandler
&
eventHandler
;
Recorder
*
recorder_
=
nullptr
;
Camera
*
cam_
=
nullptr
;
int32_t
recordFd_
=
g_fdNull
;
SampleFrameStateCallback
fsCb_
;
};
/* *
* Media Recorder test
*/
class
ActsMediaRecorderTest
:
public
testing
::
Test
{
public:
/* *
* @tc.setup:This is before test class
*/
static
void
SetUpTestCase
(
void
);
/* *
* @tc.setup:This is after test class
*/
static
void
TearDownTestCase
(
void
);
/* *
* @tc.setup:This is before test case
*/
virtual
void
SetUp
(
void
);
/* *
* @tc.setup:This is after test case
*/
virtual
void
TearDown
(
void
);
/* *
* Create CameraKit
*/
virtual
void
CreateCameraKit
(
void
);
/* *
* release Camera
*/
virtual
void
ReleaseCameraKit
(
void
);
CameraKit
*
cameraKit_
;
string
camId
;
};
#endif // ACTS_MEDIA_RECODER_TEST_H
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录