提交 1c02e162 编写于 作者: L limeng151

fix multimedia testcase

Signed-off-by: Nlimeng151 <limeng151@huawei.com>
Change-Id: Ia178cf9215157fed1c7e273597ee26bf47e7a168
上级 a2683855
......@@ -61,7 +61,8 @@ lite_component("acts_component") {
"//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest",
"//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest",
#"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
"//test/xts/acts/multimedia_lite/media_lite_posix/audio_native:ActsMediaAudioTest",
"//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest",
#"//test/xts/acts/distributedschedule_lite/distributed_schedule_posix:ActsDMSTest",
......
# 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.
#
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaAudioTest") {
suite_name = "acts"
sources = [ "src/ActsMediaAudioTest.cpp" ]
ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ]
if (ohos_kernel_type == "linux") {
ldflags += [ "-lpthread" ]
}
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
include_dirs = [
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//foundation/multimedia/audio_lite/frameworks/audio_encoder/include",
"//foundation/multimedia/audio_lite/frameworks/audio_source/include",
"//foundation/multimedia/audio_lite/interfaces/kits",
"//foundation/multimedia/utils/lite/include",
"//drivers/peripheral/audio/interfaces/include",
"//drivers/peripheral/codec/interfaces/include",
"//drivers/peripheral/format/interfaces/include",
"//foundation/multimedia/audio_lite/test/unittest",
]
deps = [
"//foundation/multimedia/audio_lite/frameworks:audio_capturer_lite",
"//foundation/multimedia/utils/lite:media_common",
"//third_party/bounds_checking_function:libsec_shared",
]
cflags = [ "-Wno-error" ]
}
{
"description": "Config for hcpptest demo test cases",
"environment": [
{
"type": "device",
"label": "ipcamera"
}
],
"kits": [
{
"type": "MountKit",
"server": "NfsServer",
"mount": [
{
"source": "testcases/multimedia",
"target": "/test_root/multimedia"
}
]
}
],
"driver": {
"type": "CppTestLite",
"execute": "/test_root/multimedia/ActsMediaAudioTest.bin"
}
}
\ No newline at end of file
/*
* Copyright (C) 2020-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.
*/
#include "ActsMediaAudioTest.h"
#include "codec_type.h"
#include "media_errors.h"
using namespace std;
using namespace OHOS::Audio;
using namespace testing::ext;
namespace OHOS {
const int32_t BUFFER_SIZE = 1024;
const int32_t SAMPLE_RATE = 24000;
const int32_t BIT_RATE = 1024;
const int32_t CHANNEL_COUNT = 2;
void AudioliteTest::SetUpTestCase(void) {}
void AudioliteTest::TearDownTestCase(void) {}
void AudioliteTest::SetUp()
{
audioCapInfo.channelCount = CHANNEL_COUNT;
audioCapInfo.sampleRate = SAMPLE_RATE;
audioCapInfo.bitRate = BIT_RATE;
audioCapInfo.inputSource = AUDIO_SOURCE_DEFAULT;
audioCapInfo.bitWidth = BIT_WIDTH_16;
}
void AudioliteTest::TearDown() {}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0100
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_buffer_001, TestSize.Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0200
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_buffer_002, TestSize.Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0300
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audioCapturer_003, TestSize.Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0400
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audioCapturer_004, TestSize.Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0500
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audioCapturer_005, TestSize.Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0600
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_006, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0700
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_007, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0800
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_008, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_0900
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_009, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1000
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_010, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1100
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_011, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1200
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_012, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1300
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_013, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1400
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_014, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1500
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 2; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_015, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1600
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_016, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1700
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_017, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1800
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_018, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_1900
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_019, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2000
* @tc.name : Audio Capture Test-Format DEFAULT; Channel 1; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_020, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AUDIO_DEFAULT;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2100
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_021, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2200
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_022, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2300
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_023, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2400
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_024, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2500
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_025, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2600
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_026, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2700
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_027, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2800
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_028, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_2900
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_029, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3000
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_030, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3100
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_031, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3200
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_032, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3300
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_033, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3400
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_034, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3500
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 2; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_035, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3600
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_036, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3700
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_037, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3800
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_038, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_3900
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_039, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4000
* @tc.name : Audio Capture Test-Format AAC_LC; Channel 1; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_040, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LC;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4100
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_041, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4200
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_042, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4300
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_043, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4400
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_044, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4500
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_045, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4600
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_046, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4700
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_047, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4800
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_048, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_4900
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_049, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5000
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_050, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5100
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_051, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5200
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_052, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5300
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_053, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5400
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_054, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 24000;
info.channelCount = 2;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5500
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 2; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_055, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 48000;
info.channelCount = 2;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5600
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_056, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5700
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_057, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5800
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_058, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_5900
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 8; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_059, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6000
* @tc.name : Audio Capture Test-Format AAC_HE_V1; Channel 1; Bit_width 8; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_060, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_HE_V1;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6100
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 16; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_061, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6200
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 16; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_062, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6300
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 16; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_063, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6400
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 16; Sample Rate 24000; Bit Rate 24000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_064, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 24000;
info.channelCount = 1;
info.bitRate = 24000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6500
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 16; Sample Rate 48000; Bit Rate 48000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_065, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 48000;
info.channelCount = 1;
info.bitRate = 48000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6600
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 24; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_066, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6700
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 24; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_067, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6800
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 24; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_068, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_6900
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 24; Sample Rate 64000; Bit Rate 64000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_069, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 64000;
info.channelCount = 2;
info.bitRate = 64000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7000
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 16; Sample Rate 96000; Bit Rate 96000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_070, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 96000;
info.channelCount = 2;
info.bitRate = 96000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_16;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7100
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 8; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_071, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 8000;
info.channelCount = 2;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7200
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 8; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_072, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 16000;
info.channelCount = 2;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7300
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 8; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_073, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 32000;
info.channelCount = 2;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7400
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 8; Sample Rate 64000; Bit Rate 64000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_074, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 64000;
info.channelCount = 2;
info.bitRate = 64000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7500
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 2; Bit_width 8; Sample Rate 96000; Bit Rate 96000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_075, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 96000;
info.channelCount = 2;
info.bitRate = 96000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_8;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7600
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 24; Sample Rate 8000; Bit Rate 8000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_076, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 8000;
info.channelCount = 1;
info.bitRate = 8000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7700
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 24; Sample Rate 16000; Bit Rate 16000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_077, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 16000;
info.channelCount = 1;
info.bitRate = 16000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7800
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 24; Sample Rate 32000; Bit Rate 32000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_078, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 32000;
info.channelCount = 1;
info.bitRate = 32000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_7900
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 24; Sample Rate 64000; Bit Rate 64000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_079, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 64000;
info.channelCount = 1;
info.bitRate = 64000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_TEST_8000
* @tc.name : Audio Capture Test-Format AAC_LD; Channel 1; Bit_width 24; Sample Rate 96000; Bit Rate 96000
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(AudioliteTest, audio_lite_audioCapturer_test_080, Level1)
{
AudioCapturer *audioCapturer = new AudioCapturer();
AudioCapturerInfo info;
info.inputSource = AUDIO_MIC;
info.audioFormat = AAC_LD;
info.sampleRate = 96000;
info.channelCount = 1;
info.bitRate = 96000;
info.streamType = TYPE_MEDIA;
info.bitWidth = BIT_WIDTH_24;
uint64_t frameCnt = audioCapturer->GetFrameCount();
uint32_t framesize = static_cast<uint32_t>((frameCnt * info.channelCount * info.bitWidth) / sizeof(uint8_t));
uint8_t *buffer;
audioCapturer->SetCapturerInfo(info);
audioCapturer->Start();
audioCapturer->Read(buffer, framesize, false);
EXPECT_TRUE(sizeof(buffer) > 0);
audioCapturer->Release();
delete audioCapturer;
}
} // 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 AUDIOLITETEST_H
#define AUDIOLITETEST_H
#include <sys/time.h>
#include "gtest/gtest.h"
#include "audio_capturer.h"
namespace OHOS {
const int RET_SUCCESS = 0;
const int RET_FAILURE = -1;
struct OHOS::Audio::AudioCapturerInfo audioCapInfo;
class AudioliteTest : 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);
};
} // namespace OHOS
#endif // AUDIOLITETEST_H
......@@ -11,27 +11,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/lite/config/subsystem/aafwk/config.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaPlayerTest") {
suite_name = "acts"
sources = [ "src/ActsAudioPlayerTest.cpp" ]
if (ohos_kernel_type == "liteos_a" &&
enable_ohos_appexecfwk_feature_ability == true) {
sources += [ "src/ActsVideoPlayerTest.cpp" ]
}
include_dirs = [ "src" ]
sources = [ "src/ActsMediaPlayerTest.cpp" ]
ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ]
if (ohos_kernel_type == "linux") {
ldflags += [ "-lpthread" ]
}
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
include_dirs = [
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//third_party/bounds_checking_function/include",
"//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/base",
"//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/async",
"//foundation/multimedia/media_lite/interfaces/kits/player_lite",
"//foundation/multimedia/utils/lite/include",
"//foundation/multimedia/media_lite/test/unittest/player_lite",
]
deps = [
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
#"//foundation/multimedia/camera_lite/frameworks:camera_lite",
#"//foundation/multimedia/media_lite/frameworks/recorder_lite:recorder_lite",
"//foundation/multimedia/utils/lite:media_common",
"//third_party/bounds_checking_function:libsec_shared",
]
cflags = [ "-Wno-error" ]
......
......@@ -14,9 +14,6 @@
{
"source": "testcases/multimedia",
"target": "/test_root/multimedia"
},{
"source": "resource/multimedia",
"target": "/test_root/multimedia"
}
]
}
......
/*
* 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.
*/
#include "ActsMediaPlayerTest.h"
#include <unistd.h>
#include <fcntl.h>
#include "securec.h"
#include <fstream>
#include <iostream>
#include <climits>
namespace OHOS {
const string g_avFileName = "1080P_25fps.mp4";
const string g_audioFileName = "Audiochannel_002.m4a";
const int32_t HI_SUCCESS = 0;
const int32_t HI_FAILURE = -1;
using OHOS::Media::Player;
using OHOS::Media::PlayerSeekMode;
using OHOS::Media::Source;
using OHOS::Media::Format;
using OHOS::Media::StreamSource;
static void InitSurface()
{
OHOS::g_surface->SetUserData("region_position_x", "0");
OHOS::g_surface->SetUserData("region_position_y", "0");
OHOS::g_surface->SetUserData("region_width", "720");
OHOS::g_surface->SetUserData("region_height", "540");
}
class PlayerliteTest : public testing::Test {
protected:
// SetUpTestCase:The preset action of the test suite is executed before the first TestCase
static void SetUpTestCase(void)
{
}
// TearDownTestCase:The test suite cleanup action is executed after the last TestCase
static void TearDownTestCase(void)
{
}
// SetUp:Execute before each test case
virtual void SetUp()
{
g_tagTestSample.adaptr = std::make_shared<Player>();
InitSurface();
}
// TearDown:Execute after each test case
virtual void TearDown()
{
}
};
class PlayerliteCallback : public Media::PlayerCallback {
public:
PlayerliteCallback() = default;
virtual ~PlayerliteCallback() = default;
void OnPlaybackComplete() override;
void OnError(int32_t errorType, int32_t errorCode) override;
void OnInfo(int type, int extra) override;
void OnVideoSizeChanged(int width, int height) override;
void OnRewindToComplete() override;
};
void PlayerliteCallback::OnPlaybackComplete()
{
cout << "PlayerTest::OnPlaybackComplete ..." << endl;
}
void PlayerliteCallback::OnError(int32_t errorType, int32_t errorCode)
{
cout << "PlayerTest::OnError ..." << endl;
}
void PlayerliteCallback::OnInfo(int32_t type, int32_t extra)
{
cout << "PlayerTest::OnInfo ..." << endl;
}
void PlayerliteCallback::OnVideoSizeChanged(int width, int height)
{
cout << "PlayerTest::OnVideoSizeChanged ..." << endl;
}
void PlayerliteCallback::OnRewindToComplete()
{
cout << "PlayerTest::OnRewindToComplete ..." << endl;
}
static int32_t FileCheck(const string &argv)
{
if (sizeof(argv.c_str()) < sizeof(g_tagTestSample.filePath) &&
realpath(argv.c_str(), g_tagTestSample.filePath) == nullptr) {
printf("realpath input file failed, errno: %d!\n", errno);
return -1;
}
return 0;
}
static int32_t CreateAndSetSource()
{
std::string uri(g_tagTestSample.filePath);
Source source(uri);
int32_t ret = g_tagTestSample.adaptr->SetSource(source);
string ret1 = source.GetSourceUri();
return ret;
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0100
* @tc.name : Video Prepare
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Prepare_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::string uri(g_tagTestSample.filePath);
Source source(uri);
ret = g_tagTestSample.adaptr->SetSource(source);
string ret1 = source.GetSourceUri();
source.GetSourceType();
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(true, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0200
* @tc.name : Video Prepare
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Prepare_test_002, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0300
* @tc.name : Video Play Playback Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Play_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
sleep(1);
EXPECT_EQ(HI_SUCCESS, ret);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(true, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0400
* @tc.name : Video Stop Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Stop_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerCallback> cb;
g_tagTestSample.adaptr->SetPlayerCallback(cb);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(false, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0500
* @tc.name : Video Stop Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Stop_test_002, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0600
* @tc.name : Video Pause Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Pause_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_SUCCESS, ret);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(false, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0700
* @tc.name : Video Pause Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Pause_test_002, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_FAILURE, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0800
* @tc.name : Video GetCurrentTime Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_GetCurrentTime_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(1);
int64_t currentPosition;
ret = g_tagTestSample.adaptr->GetCurrentTime(currentPosition);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0900
* @tc.name : Video GetCurrentTime Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_GetCurrentTime_test_002, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
int64_t currentPosition;
ret = g_tagTestSample.adaptr->GetCurrentTime(currentPosition);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(1);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(true, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1000
* @tc.name : Video GetDuration Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_GetDuration_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Rewind(1, PLAYER_SEEK_NEXT_SYNC);
EXPECT_EQ(HI_SUCCESS, ret);
int64_t currentPosition;
ret = g_tagTestSample.adaptr->GetCurrentTime(currentPosition);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1100
* @tc.name : Video GetDuration Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_GetDuration_test_002, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
int64_t duration;
ret = g_tagTestSample.adaptr->GetDuration(duration);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1200
* @tc.name : Video GetVideoSurfaceSize Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_GetVideoSurfaceSize_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
int32_t videoWidth;
ret = g_tagTestSample.adaptr->GetVideoWidth(videoWidth);
EXPECT_EQ(HI_SUCCESS, ret);
int32_t videoHeight;
ret = g_tagTestSample.adaptr->GetVideoHeight(videoHeight);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1300
* @tc.name : Video Reset Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Reset_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
ret = g_tagTestSample.adaptr->Reset();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1400
* @tc.name : Video Release Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Release_test_001, Level1)
{
int32_t ret = FileCheck(g_avFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVideoSurface(g_surface);
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
ret = g_tagTestSample.adaptr->Release();
EXPECT_EQ(HI_SUCCESS, ret);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1500
* @tc.name : Audio SetSource Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_AudioSetSource_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(2);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1600
* @tc.name : Audio Format Play->Pause->Play->Stop Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_AudioPlay_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1700
* @tc.name : Audio Format Play Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_Play_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_FAILURE, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1800
* @tc.name : Audio Format Prepare Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioPrepare_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1900
* @tc.name : Audio Format Prepare Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioPrepare_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2000
* @tc.name : Audio Format Stop Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioStop_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2100
* @tc.name : Audio Format Stop Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioStop_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Stop();
EXPECT_EQ(HI_SUCCESS, ret);
bool flag = g_tagTestSample.adaptr->IsPlaying();
EXPECT_EQ(false, flag);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2200
* @tc.name : Audio Format Pause Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioPause_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Pause();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2300
* @tc.name : Audio Format SetVolume Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_SetVolume_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVolume(40, 40);
sleep(10);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2400
* @tc.name : Audio Format SetVolume Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_SetVolume_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVolume(0, 0);
sleep(10);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2500
* @tc.name : Audio Format SetVolume Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_SetVolume_test_003, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVolume(-1, -1);
sleep(10);
EXPECT_EQ(HI_FAILURE, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2600
* @tc.name : Audio Format SetVolume Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_SetVolume_test_004, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVolume(300, 300);
sleep(10);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2700
* @tc.name : Audio Format SetVolume Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_SetVolume_test_005, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->SetVolume(300, 301);
sleep(10);
EXPECT_EQ(HI_FAILURE, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2800
* @tc.name : Audio Format GetCurrentTime Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioGetCurrentTime_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
sleep(3);
int64_t currentPosition;
ret = g_tagTestSample.adaptr->GetCurrentTime(currentPosition);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2900
* @tc.name : Audio Format GetCurrentTime Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioGetCurrentTime_test_002, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Play();
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Pause();
ret = g_tagTestSample.adaptr->Rewind(0, PLAYER_SEEK_NEXT_SYNC);
EXPECT_EQ(HI_SUCCESS, ret);
int64_t currentPosition;
ret = g_tagTestSample.adaptr->GetCurrentTime(currentPosition);
EXPECT_EQ(HI_SUCCESS, ret);
g_tagTestSample.adaptr->Release();
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_3000
* @tc.name : Audio Format Duration Test
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F(PlayerliteTest, medialite_player_audioGetDuration_test_001, Level1)
{
int32_t ret = FileCheck(g_audioFileName);
EXPECT_EQ(HI_SUCCESS, ret);
std::shared_ptr<PlayerliteCallback> callBack;
callBack = std::make_shared<PlayerliteCallback>();
g_tagTestSample.adaptr->SetPlayerCallback(callBack);
ret = CreateAndSetSource();
EXPECT_EQ(HI_SUCCESS, ret);
ret = g_tagTestSample.adaptr->Prepare();
EXPECT_EQ(HI_SUCCESS, ret);
int64_t duration;
ret = g_tagTestSample.adaptr->GetDuration(duration);
EXPECT_EQ(HI_SUCCESS, ret);
}
} // OHOS
\ No newline at end of file
/*
* 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 PLAYER_LITE_TEST_H
#define PLAYER_LITE_TEST_H
#include "gtest/gtest.h"
#include "player.h"
namespace OHOS {
using OHOS::Media::Player;
using OHOS::Media::PlayerSeekMode;
using OHOS::Media::Source;
using OHOS::Media::Format;
using OHOS::Media::StreamSource;
using OHOS::Media::StreamCallback;
using OHOS::Media::SourceType;
using OHOS::Media::PlayerCallback;
using namespace std;
using namespace OHOS::Media;
using namespace testing::ext;
const int FILE_PATH_LEN = 2048;
using TestSample = struct TagTestSample {
std::shared_ptr<Player> adaptr;
char filePath[FILE_PATH_LEN];
};
static TagTestSample g_tagTestSample;
static Surface *g_surface = Surface::CreateSurface();
} // namespace OHOS
#endif // PLAYER_LITE_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.
先完成此消息的编辑!
想要评论请 注册