提交 20b7ecfa 编写于 作者: Z z_apperception

<zhaochen69@huawei.com>

Signed-off-by: Nz_apperception <zhaochen69@huawei.com>
上级 07ce031c
......@@ -15,11 +15,19 @@ import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaRecorderTest") {
suite_name = "acts"
sources = [ "src/testcase/ActsMediaRecorderNDKTest.cpp" ]
sources = [ "src/ActsMediaRecorderTest.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 = [
......
/*
* 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_0100
* @tc.name : Set Video Source 01
* @tc.number : SUB_MEDIA_REC_TEST_1200
* @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_0110
* @tc.name : Set Video Source 02
* @tc.number : SUB_MEDIA_REC_TEST_1800
* @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_0200
* @tc.name : Set Video Source 03
* @tc.number : SUB_MEDIA_REC_TEST_1900
* @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_0300
* @tc.name : Set Video Source 04
* @tc.number : SUB_MEDIA_REC_TEST_2000
* @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_0400
* @tc.name : Set Video Source 05
* @tc.number : SUB_MEDIA_REC_TEST_2100
* @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_recorderSourceMaxCount);
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_0500
* @tc.name : Set Video Encoder 01
* @tc.number : SUB_MEDIA_REC_TEST_2200
* @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_0600
* @tc.name : Set Video Encoder 02
* @tc.number : SUB_MEDIA_REC_TEST_2300
* @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_0700
* @tc.name : Set Video Encoder 03
* @tc.number : SUB_MEDIA_REC_TEST_2400
* @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_0800
* @tc.name : Set Video Encoder 04
* @tc.number : SUB_MEDIA_REC_TEST_2500
* @tc.name : Set Video Encoder with H264
* @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_0900
* @tc.name : Set Video Encoder 05
* @tc.number : SUB_MEDIA_REC_TEST_2600
* @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_1000
* @tc.name : Set Video Size 01
* @tc.number : SUB_MEDIA_REC_TEST_2700
* @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_1100
* @tc.name : Set Video Size 02
* @tc.number : SUB_MEDIA_REC_TEST_2800
* @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_1200
* @tc.name : Set Video Size 03
* @tc.number : SUB_MEDIA_REC_TEST_2900
* @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_1300
* @tc.name : Set Video Size 04
* @tc.number : SUB_MEDIA_REC_TEST_3000
* @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_1400
* @tc.name : Set Video Size 05
* @tc.number : SUB_MEDIA_REC_TEST_3100
* @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_1500
* @tc.name : Set Video Frame Rate 01
* @tc.number : SUB_MEDIA_REC_TEST_3200
* @tc.name : Set Video FrameRate 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_1600
* @tc.name : Set Video Frame Rate 02
* @tc.number : SUB_MEDIA_REC_TEST_3300
* @tc.name : Set Video FrameRate 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_1700
* @tc.name : Set Video Frame Rate 03
* @tc.number : SUB_MEDIA_REC_TEST_3400
* @tc.name : Set Video FrameRate 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_1800
* @tc.name : Set Video Encoding BitRate 01
* @tc.number : SUB_MEDIA_REC_TEST_3500
* @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_1900
* @tc.name : Set Video Encoding BitRate 02
* @tc.number : SUB_MEDIA_REC_TEST_3600
* @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_2000
* @tc.name : Set Video Encoding BitRate 03
* @tc.number : SUB_MEDIA_REC_TEST_3700
* @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_2100
* @tc.name : Set Capture Rate 01
* @tc.number : SUB_MEDIA_REC_TEST_3800
* @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_2200
* @tc.name : Set Capture Rate 02
* @tc.number : SUB_MEDIA_REC_TEST_3900
* @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_2300
* @tc.name : Set Capture Rate 03
* @tc.number : SUB_MEDIA_REC_TEST_4000
* @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_2400
* @tc.name : Set Audio Source 01
* @tc.number : SUB_MEDIA_REC_TEST_4100
* @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_2500
* @tc.name : Set Audio Source 02
* @tc.number : SUB_MEDIA_REC_TEST_4200
* @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_2600
* @tc.name : Set Audio Source 03
* @tc.number : SUB_MEDIA_REC_TEST_4300
* @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_2700
* @tc.name : Set Audio Encoder 01
* @tc.number : SUB_MEDIA_REC_TEST_4400
* @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_2800
* @tc.name : Set Audio Encoder 02
* @tc.number : SUB_MEDIA_REC_TEST_4500
* @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_2900
* @tc.name : Set Audio Encoder 03
* @tc.number : SUB_MEDIA_REC_TEST_4600
* @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_3000
* @tc.name : Set Audio Encoder 04
* @tc.number : SUB_MEDIA_REC_TEST_4700
* @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_3100
* @tc.name : Set Audio Encoder 05
* @tc.number : SUB_MEDIA_REC_TEST_4800
* @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_3200
* @tc.name : Set Audio Encoder 06
* @tc.number : SUB_MEDIA_REC_TEST_4900
* @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_3300
* @tc.name : Set Audio Encoder 07
* @tc.number : SUB_MEDIA_REC_TEST_5000
* @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_3400
* @tc.name : Set Audio Sample Rate 01
* @tc.number : SUB_MEDIA_REC_TEST_5100
* @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_3500
* @tc.name : Set Audio Sample Rate 02
* @tc.number : SUB_MEDIA_REC_TEST_5200
* @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_3600
* @tc.name : Set Audio Sample Rate 03
* @tc.number : SUB_MEDIA_REC_TEST_5300
* @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_3700
* @tc.name : Set Audio Channels 01
* @tc.number : SUB_MEDIA_REC_TEST_5400
* @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_3800
* @tc.name : Set Audio Channels 02
* @tc.number : SUB_MEDIA_REC_TEST_5900
* @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_3900
* @tc.name : Set Audio Channels 03
* @tc.number : SUB_MEDIA_REC_TEST_6000
* @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_4000
* @tc.name : Set Audio Channels 04
* @tc.number : SUB_MEDIA_REC_TEST_6100
* @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_4100
* @tc.name : Set Audio Channels 05
* @tc.number : SUB_MEDIA_REC_TEST_6300
* @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_4200
* @tc.name : Set Audio Encoding BitRate 01
* @tc.number : SUB_MEDIA_REC_TEST_6500
* @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_4400
* @tc.name : Set Audio Encoding BitRate 03
* @tc.number : SUB_MEDIA_REC_TEST_7100
* @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_4600
* @tc.name : Test Recorder GetSurface 01
* @tc.number : SUB_MEDIA_REC_TEST_7800
* @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_4700
* @tc.name : Test Recorder GetSurface 02
* @tc.number : SUB_MEDIA_REC_TEST_7900
* @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_4800
* @tc.name : Test Recorder SetMaxDuration 01
* @tc.number : SUB_MEDIA_REC_TEST_8000
* @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_4900
* @tc.name : Test Recorder SetMaxDuration 02
* @tc.number : SUB_MEDIA_REC_TEST_8100
* @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_5000
* @tc.name : Test Recorder SetMaxDuration 03
* @tc.number : SUB_MEDIA_REC_TEST_8200
* @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_5100
* @tc.name : Test Recorder SetMaxDuration 04
* @tc.number : SUB_MEDIA_REC_TEST_8300
* @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_5200
* @tc.name : Test Recorder SetMaxFileSize 01
* @tc.number : SUB_MEDIA_REC_TEST_8400
* @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_5300
* @tc.name : Test Recorder SetMaxFileSize 02
* @tc.number : SUB_MEDIA_REC_TEST_8500
* @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_5400
* @tc.name : Test Recorder SetOutputFile 01
* @tc.number : SUB_MEDIA_REC_TEST_8600
* @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_5500
* @tc.name : Test Recorder SetNextOutputFile 01
* @tc.number : SUB_MEDIA_REC_TEST_8700
* @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_5600
* @tc.name : Test Recorder SetOutputPath 01
* @tc.number : SUB_MEDIA_REC_TEST_8800
* @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_5700
* @tc.name : Test Recorder SetOutputFormat 01
* @tc.number : SUB_MEDIA_REC_TEST_8900
* @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_5800
* @tc.name : Test Recorder SetOutputFormat 02
* @tc.number : SUB_MEDIA_REC_TEST_9000
* @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_5900
* @tc.name : Test Recorder SetOutputFormat 03
* @tc.number : SUB_MEDIA_REC_TEST_9100
* @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
/*
* 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
/*
* 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.
先完成此消息的编辑!
想要评论请 注册