mirror of
https://gitee.com/openharmony/xts_hats
synced 2025-01-09 18:01:44 +00:00
refactor: modify the enum type name of auido moudle
Signed-off-by: zhang_haodong <zhanghaodong12@huawei.com>
This commit is contained in:
parent
806a35eeec
commit
e820c546a8
@ -47,7 +47,7 @@ const int BUFFER_SIZE = 2048;
|
|||||||
|
|
||||||
int32_t InitAttrs(struct AudioSampleAttributes &attrs)
|
int32_t InitAttrs(struct AudioSampleAttributes &attrs)
|
||||||
{
|
{
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
attrs.channelCount = CHANNELCOUNT;
|
attrs.channelCount = CHANNELCOUNT;
|
||||||
attrs.sampleRate = SAMPLERATE;
|
attrs.sampleRate = SAMPLERATE;
|
||||||
attrs.interleaved = 0;
|
attrs.interleaved = 0;
|
||||||
@ -151,13 +151,13 @@ int32_t SwitchAdapter(struct AudioAdapterDescriptor *descs, const std::string &a
|
|||||||
uint32_t PcmFormatToBits(int format)
|
uint32_t PcmFormatToBits(int format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case AUDIO_FORMAT_PCM_8_BIT:
|
case AUDIO_FORMAT_TYPE_PCM_8_BIT:
|
||||||
return PCM_8_BIT;
|
return PCM_8_BIT;
|
||||||
case AUDIO_FORMAT_PCM_16_BIT:
|
case AUDIO_FORMAT_TYPE_PCM_16_BIT:
|
||||||
return PCM_16_BIT;
|
return PCM_16_BIT;
|
||||||
case AUDIO_FORMAT_PCM_24_BIT:
|
case AUDIO_FORMAT_TYPE_PCM_24_BIT:
|
||||||
return PCM_24_BIT;
|
return PCM_24_BIT;
|
||||||
case AUDIO_FORMAT_PCM_32_BIT:
|
case AUDIO_FORMAT_TYPE_PCM_32_BIT:
|
||||||
return PCM_32_BIT;
|
return PCM_32_BIT;
|
||||||
default:
|
default:
|
||||||
return PCM_16_BIT;
|
return PCM_16_BIT;
|
||||||
@ -198,19 +198,19 @@ int32_t WavHeadAnalysis(struct AudioHeadInfo &wavHeadInfo, FILE *file, struct Au
|
|||||||
attrs.sampleRate = wavHeadInfo.audioSampleRate;
|
attrs.sampleRate = wavHeadInfo.audioSampleRate;
|
||||||
switch (wavHeadInfo.audioBitsPerSample) {
|
switch (wavHeadInfo.audioBitsPerSample) {
|
||||||
case PCM_8_BIT: {
|
case PCM_8_BIT: {
|
||||||
attrs.format = AUDIO_FORMAT_PCM_8_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_8_BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PCM_16_BIT: {
|
case PCM_16_BIT: {
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PCM_24_BIT: {
|
case PCM_24_BIT: {
|
||||||
attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PCM_32_BIT: {
|
case PCM_32_BIT: {
|
||||||
attrs.format = AUDIO_FORMAT_PCM_32_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_32_BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -112,7 +112,7 @@ int32_t AudioHdiCaptureAttrTest::AudioCaptureStart(const string path, struct Aud
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0001
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0001
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 8000;
|
* attrs.sampleRate = 8000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -127,7 +127,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 8000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -137,7 +137,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
uint32_t ret2 = 8000;
|
uint32_t ret2 = 8000;
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -149,7 +149,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0002
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0002
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 11025;
|
* attrs.sampleRate = 11025;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -166,12 +166,12 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 11025);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 11025);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0003
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0003
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 22050;
|
* attrs.sampleRate = 22050;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -198,7 +198,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 22050);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 22050);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -208,7 +208,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
uint32_t ret2 = 22050;
|
uint32_t ret2 = 22050;
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -221,7 +221,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0004
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0004
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 32000;
|
* attrs.sampleRate = 32000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -238,12 +238,12 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 32000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0005
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0005
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 44100;
|
* attrs.sampleRate = 44100;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -270,7 +270,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 44100);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -280,7 +280,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
uint32_t ret2 = 44100;
|
uint32_t ret2 = 44100;
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -293,7 +293,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0006
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0006
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_COMMUNICATION;
|
* attrs.type = AUDIO_IN_COMMUNICATION;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 48000;
|
* attrs.sampleRate = 48000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -310,12 +310,12 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 48000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 8000);
|
||||||
|
|
||||||
ret = capture->attr.SetSampleAttributes(captureNull, &attrs);
|
ret = capture->attr.SetSampleAttributes(captureNull, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
||||||
@ -353,7 +353,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0008
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0008
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 12000;
|
* attrs.sampleRate = 12000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -368,7 +368,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 12000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 12000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -379,7 +379,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -392,7 +392,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0009
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0009
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 16000;
|
* attrs.sampleRate = 16000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -407,7 +407,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 16000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 16000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -418,7 +418,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -431,7 +431,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0010
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0010
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 24000;
|
* attrs.sampleRate = 24000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -448,13 +448,13 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 24000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 24000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0011
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0011
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 64000;
|
* attrs.sampleRate = 64000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -481,7 +481,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 64000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 64000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -492,7 +492,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -504,7 +504,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0012
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0012
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 96000;
|
* attrs.sampleRate = 96000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -519,7 +519,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 96000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 96000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -530,7 +530,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -557,7 +557,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 0xFFFFFFFFu);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 0xFFFFFFFFu);
|
||||||
|
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_NOT_SUPPORT, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_NOT_SUPPORT, ret);
|
||||||
@ -587,18 +587,18 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_PCM_8_BIT, 1, 8000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_PCM_8_BIT, 1, 8000);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_PCM_32_BIT, 2, 11025);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_PCM_32_BIT, 2, 11025);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
||||||
#ifdef ALSA_LIB_MODE
|
#ifdef ALSA_LIB_MODE
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
#endif
|
#endif
|
||||||
InitAttrsUpdate(attrs3, AUDIO_FORMAT_AAC_MAIN, 1, 22050);
|
InitAttrsUpdate(attrs3, AUDIO_FORMAT_TYPE_AAC_MAIN, 1, 22050);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs3);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs3);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0015
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0015
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_AAC_LC/LD/ELD;
|
* attrs.format = AUDIO_FORMAT_TYPE_AAC_LC/LD/ELD;
|
||||||
* attrs.sampleRate = 32000/44100/48000;
|
* attrs.sampleRate = 32000/44100/48000;
|
||||||
* attrs.channelCount = 1/2;
|
* attrs.channelCount = 1/2;
|
||||||
*/
|
*/
|
||||||
@ -627,15 +627,15 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_AAC_LC, 2, 32000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_AAC_LC, 2, 32000);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_AAC_LD, 1, 44100);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_AAC_LD, 1, 44100);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs3, AUDIO_FORMAT_AAC_ELD, 2, 48000);
|
InitAttrsUpdate(attrs3, AUDIO_FORMAT_TYPE_AAC_ELD, 2, 48000);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs3);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs3);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0016
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0016
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_AAC_HE_V1/V2
|
* attrs.format = AUDIO_FORMAT_TYPE_AAC_HE_V1/V2
|
||||||
* attrs.sampleRate = 8000/44100;
|
* attrs.sampleRate = 8000/44100;
|
||||||
* attrs.channelCount = 1/2;
|
* attrs.channelCount = 1/2;
|
||||||
*/
|
*/
|
||||||
@ -663,11 +663,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_AAC_HE_V1, 1, 8000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_AAC_HE_V1, 1, 8000);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_AAC_HE_V2, 2, 44100);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_AAC_HE_V2, 2, 44100);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs2);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -679,7 +679,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0017
|
* @tc.number SUB_Audio_HDI_AudioCaptureSetSampleAttributes_0017
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
* attrs.sampleRate = 8000;
|
* attrs.sampleRate = 8000;
|
||||||
* attrs.channelCount = 5;
|
* attrs.channelCount = 5;
|
||||||
*/
|
*/
|
||||||
@ -694,7 +694,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 5, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 5, 8000);
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -706,7 +706,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureSetSampleAttributes_
|
|||||||
* @tc.number SUB_Audio_HDI_AudioCaptureGetSampleAttributes_0001
|
* @tc.number SUB_Audio_HDI_AudioCaptureGetSampleAttributes_0001
|
||||||
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
* @tc.desc Test AudioCaptureSetSampleAttributes with the following parameter settings
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 8000;
|
* attrs.sampleRate = 8000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -723,7 +723,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureGetSampleAttributes_
|
|||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 32000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -733,7 +733,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureGetSampleAttributes_
|
|||||||
uint32_t ret2 = 1;
|
uint32_t ret2 = 1;
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -757,7 +757,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_AudioCaptureGetSampleAttributes_
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = capture->attr.GetSampleAttributes(captureNull, &attrs);
|
ret = capture->attr.GetSampleAttributes(captureNull, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
||||||
@ -853,11 +853,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameSize_0004, Functi
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 48000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -888,11 +888,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameSize_0005, Functi
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -923,11 +923,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameSize_0006, Functi
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 44100);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -958,11 +958,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameSize_0007, Functi
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1089,11 +1089,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameCount_0005, Funct
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 8000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1127,11 +1127,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameCount_0006, Funct
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 8000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1166,11 +1166,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameCount_0007, Funct
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 44100);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1204,11 +1204,11 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_hdi_CaptureGetFrameCount_0008, Funct
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 32000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1269,7 +1269,7 @@ HWTEST_F(AudioHdiCaptureAttrTest, SUB_Audio_HDI_CaptureGetCurrentChannelId_0002,
|
|||||||
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
ret = AudioCreateCapture(manager, PIN_IN_MIC, ADAPTER_NAME, &adapter, &capture);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
ret = AudioCaptureSetGetSampleAttributes(attrs, attrsValue, capture);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
@ -558,9 +558,9 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0008,
|
|||||||
manager->UnloadAdapter(manager, adapter);
|
manager->UnloadAdapter(manager, adapter);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @tc.name Test GetCapturePosition API via define format to AUDIO_FORMAT_PCM_16_BIT
|
* @tc.name Test GetCapturePosition API via define format to AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
* @tc.number SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009
|
* @tc.number SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009
|
||||||
* @tc.desc Test GetCapturePosition interface,return 0 if get framesize define format to AUDIO_FORMAT_PCM_16_BIT
|
* @tc.desc Test GetCapturePosition interface,return 0 if get framesize define format to AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
*/
|
*/
|
||||||
HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009, Function | MediumTest | Level1)
|
HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009, Function | MediumTest | Level1)
|
||||||
{
|
{
|
||||||
@ -581,7 +581,7 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009,
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 2;
|
attrs.channelCount = 2;
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
@ -589,7 +589,7 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009,
|
|||||||
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
ret = AudioCaptureStartAndOneFrame(capture);
|
ret = AudioCaptureStartAndOneFrame(capture);
|
||||||
@ -604,9 +604,9 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0009,
|
|||||||
manager->UnloadAdapter(manager, adapter);
|
manager->UnloadAdapter(manager, adapter);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @tc.name Test GetCapturePosition API via define format to AUDIO_FORMAT_PCM_24_BIT
|
* @tc.name Test GetCapturePosition API via define format to AUDIO_FORMAT_TYPE_PCM_24_BIT
|
||||||
* @tc.number SUB_Audio_HDI_AudioCaptureGetCapturePosition_0010
|
* @tc.number SUB_Audio_HDI_AudioCaptureGetCapturePosition_0010
|
||||||
* @tc.desc Test GetCapturePosition interface,return 0 if get framesize define format to AUDIO_FORMAT_PCM_24_BIT
|
* @tc.desc Test GetCapturePosition interface,return 0 if get framesize define format to AUDIO_FORMAT_TYPE_PCM_24_BIT
|
||||||
*/
|
*/
|
||||||
HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0010, Function | MediumTest | Level1)
|
HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0010, Function | MediumTest | Level1)
|
||||||
{
|
{
|
||||||
@ -627,14 +627,14 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0010,
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 2;
|
attrs.channelCount = 2;
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
|
|
||||||
@ -674,14 +674,14 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0011,
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 1;
|
attrs.channelCount = 1;
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0012,
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 1;
|
attrs.channelCount = 1;
|
||||||
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
ret = capture->attr.SetSampleAttributes(capture, &attrs);
|
||||||
@ -728,7 +728,7 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_AudioCaptureGetCapturePosition_0012,
|
|||||||
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
ret = capture->attr.GetSampleAttributes(capture, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
|
|
||||||
ret = AudioCaptureStartAndOneFrame(capture);
|
ret = AudioCaptureStartAndOneFrame(capture);
|
||||||
@ -1074,7 +1074,7 @@ HWTEST_F(AudioHdiCaptureTest, SUB_Audio_HDI_CaptureGetMmapPosition_0002, Functio
|
|||||||
ASSERT_EQ(nullptr, audiopara.capture);
|
ASSERT_EQ(nullptr, audiopara.capture);
|
||||||
}
|
}
|
||||||
InitAttrs(audiopara.attrs);
|
InitAttrs(audiopara.attrs);
|
||||||
audiopara.attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
audiopara.attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
audiopara.attrs.channelCount = 1;
|
audiopara.attrs.channelCount = 1;
|
||||||
ret = audiopara.capture->attr.SetSampleAttributes(audiopara.capture, &(audiopara.attrs));
|
ret = audiopara.capture->attr.SetSampleAttributes(audiopara.capture, &(audiopara.attrs));
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
@ -90,7 +90,7 @@ void AudioHdiRenderAttrTest::TearDown(void) {}
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0001
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0001
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = AUDIO_SAMPLE_RATE_MASK_8000;
|
* attrs.sampleRate = AUDIO_SAMPLE_RATE_MASK_8000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -104,7 +104,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 8000);
|
||||||
|
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -118,7 +118,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -131,7 +131,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0002
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0002
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 11025;
|
* attrs.sampleRate = 11025;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -148,13 +148,13 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 11025);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 11025);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0003
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0003
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 22050;
|
* attrs.sampleRate = 22050;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -183,13 +183,13 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 22050);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 22050);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0004
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0004
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 32000;
|
* attrs.sampleRate = 32000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -218,13 +218,13 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 32000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0005
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0005
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 44100;
|
* attrs.sampleRate = 44100;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -251,7 +251,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 44100);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -262,7 +262,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -273,7 +273,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.name Test AudioRenderSetSampleAttributes API via legal input.
|
* @tc.name Test AudioRenderSetSampleAttributes API via legal input.
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_COMMUNICATION;
|
* attrs.type = AUDIO_IN_COMMUNICATION;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 48000;
|
* attrs.sampleRate = 48000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -290,13 +290,13 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 48000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 8000);
|
||||||
|
|
||||||
ret = render->attr.SetSampleAttributes(renderNull, &attrs);
|
ret = render->attr.SetSampleAttributes(renderNull, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
||||||
@ -334,7 +334,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0008
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0008
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 12000;
|
* attrs.sampleRate = 12000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -349,7 +349,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 12000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 12000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -360,7 +360,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -372,7 +372,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0009
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0009
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 16000;
|
* attrs.sampleRate = 16000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -387,7 +387,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 16000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 16000);
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
@ -397,7 +397,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -410,7 +410,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0010
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0010
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 24000;
|
* attrs.sampleRate = 24000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -428,12 +428,12 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 24000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 24000);
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0011
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0011
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 64000;
|
* attrs.sampleRate = 64000;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -462,13 +462,13 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 64000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 64000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0012
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0012
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
* attrs.sampleRate = 96000;
|
* attrs.sampleRate = 96000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -496,7 +496,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 96000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 96000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
@ -507,7 +507,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
EXPECT_EQ(ret2, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret1, attrsValue.channelCount);
|
EXPECT_EQ(ret1, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -519,7 +519,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0013
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0013
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 0xFFFFFFFFu;
|
* attrs.sampleRate = 0xFFFFFFFFu;
|
||||||
* attrs.channelCount = 2;
|
* attrs.channelCount = 2;
|
||||||
*/
|
*/
|
||||||
@ -533,7 +533,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 0xFFFFFFFFu);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 0xFFFFFFFFu);
|
||||||
|
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_NOT_SUPPORT, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_NOT_SUPPORT, ret);
|
||||||
@ -564,18 +564,18 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_PCM_8_BIT, 1, 8000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_PCM_8_BIT, 1, 8000);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_PCM_32_BIT, 2, 11025);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_PCM_32_BIT, 2, 11025);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
||||||
#ifdef ALSA_LIB_MODE
|
#ifdef ALSA_LIB_MODE
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
#endif
|
#endif
|
||||||
InitAttrsUpdate(attrs3, AUDIO_FORMAT_AAC_MAIN, 1, 22050);
|
InitAttrsUpdate(attrs3, AUDIO_FORMAT_TYPE_AAC_MAIN, 1, 22050);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs3);
|
ret = render->attr.SetSampleAttributes(render, &attrs3);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0015
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0015
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_AAC_LC/LD/ELD;
|
* attrs.format = AUDIO_FORMAT_TYPE_AAC_LC/LD/ELD;
|
||||||
* attrs.sampleRate = 32000/44100/48000;
|
* attrs.sampleRate = 32000/44100/48000;
|
||||||
* attrs.channelCount = 1/2;
|
* attrs.channelCount = 1/2;
|
||||||
*/
|
*/
|
||||||
@ -604,15 +604,15 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
|
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_AAC_LC, 2, 32000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_AAC_LC, 2, 32000);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_AAC_LD, 1, 44100);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_AAC_LD, 1, 44100);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs3, AUDIO_FORMAT_AAC_ELD, 2, 48000);
|
InitAttrsUpdate(attrs3, AUDIO_FORMAT_TYPE_AAC_ELD, 2, 48000);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs3);
|
ret = render->attr.SetSampleAttributes(render, &attrs3);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0016
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0016
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_AAC_HE_V1/V2
|
* attrs.format = AUDIO_FORMAT_TYPE_AAC_HE_V1/V2
|
||||||
* attrs.sampleRate = 8000/44100;
|
* attrs.sampleRate = 8000/44100;
|
||||||
* attrs.channelCount = 1/2;
|
* attrs.channelCount = 1/2;
|
||||||
*/
|
*/
|
||||||
@ -640,11 +640,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs1, AUDIO_FORMAT_AAC_HE_V1, 1, 8000);
|
InitAttrsUpdate(attrs1, AUDIO_FORMAT_TYPE_AAC_HE_V1, 1, 8000);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
ret = render->attr.SetSampleAttributes(render, &attrs1);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs2, AUDIO_FORMAT_AAC_HE_V2, 2, 44100);
|
InitAttrsUpdate(attrs2, AUDIO_FORMAT_TYPE_AAC_HE_V2, 2, 44100);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
ret = render->attr.SetSampleAttributes(render, &attrs2);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -656,7 +656,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0017
|
* @tc.number SUB_Audio_HDI_AudioRenderSetSampleAttributes_0017
|
||||||
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderSetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
* attrs.sampleRate = 8000;
|
* attrs.sampleRate = 8000;
|
||||||
* attrs.channelCount = 5;
|
* attrs.channelCount = 5;
|
||||||
*/
|
*/
|
||||||
@ -671,7 +671,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 5, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 5, 8000);
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
|
|
||||||
@ -683,7 +683,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderSetSampleAttributes_00
|
|||||||
* @tc.number SUB_Audio_HDI_AudioRenderGetSampleAttributes_0001
|
* @tc.number SUB_Audio_HDI_AudioRenderGetSampleAttributes_0001
|
||||||
* @tc.desc Test AudioRenderGetSampleAttributes ,the setting parameters are as follows.
|
* @tc.desc Test AudioRenderGetSampleAttributes ,the setting parameters are as follows.
|
||||||
* attrs.type = AUDIO_IN_MEDIA;
|
* attrs.type = AUDIO_IN_MEDIA;
|
||||||
* attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
* attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
* attrs.sampleRate = 8000;
|
* attrs.sampleRate = 8000;
|
||||||
* attrs.channelCount = 1;
|
* attrs.channelCount = 1;
|
||||||
*/
|
*/
|
||||||
@ -699,7 +699,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderGetSampleAttributes_00
|
|||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 8000);
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
#ifdef PRODUCT_RK3568
|
#ifdef PRODUCT_RK3568
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
@ -709,7 +709,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderGetSampleAttributes_00
|
|||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
|
||||||
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
EXPECT_EQ(AUDIO_IN_MEDIA, attrsValue.type);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
EXPECT_EQ(ret1, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(ret2, attrsValue.channelCount);
|
EXPECT_EQ(ret2, attrsValue.channelCount);
|
||||||
#endif
|
#endif
|
||||||
@ -733,7 +733,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_AudioRenderGetSampleAttributes_00
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 44100);
|
||||||
|
|
||||||
ret = render->attr.GetSampleAttributes(renderNull, &attrs);
|
ret = render->attr.GetSampleAttributes(renderNull, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INVALID_PARAM, ret);
|
||||||
@ -831,11 +831,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameSize_0004, Function
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 48000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -866,11 +866,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameSize_0005, Function
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -901,11 +901,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameSize_0006, Function
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 44100);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -936,11 +936,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameSize_0007, Function
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 48000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 48000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1046,11 +1046,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameCount_0004, Functio
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 2, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 2, 8000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1084,11 +1084,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameCount_0005, Functio
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 2, 8000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 2, 8000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1123,11 +1123,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameCount_0006, Functio
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 44100);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 44100);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1160,11 +1160,11 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetFrameCount_0007, Functio
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_16_BIT, 1, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_16_BIT, 1, 32000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
|
|
||||||
@ -1223,7 +1223,7 @@ HWTEST_F(AudioHdiRenderAttrTest, SUB_Audio_HDI_RenderGetCurrentChannelId_0002, F
|
|||||||
TestAudioManager* manager = GetAudioManager();
|
TestAudioManager* manager = GetAudioManager();
|
||||||
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
ret = AudioCreateRender(manager, PIN_OUT_SPEAKER, ADAPTER_NAME, &adapter, &render);
|
||||||
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
ASSERT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
InitAttrsUpdate(attrs, AUDIO_FORMAT_PCM_24_BIT, 1, 32000);
|
InitAttrsUpdate(attrs, AUDIO_FORMAT_TYPE_PCM_24_BIT, 1, 32000);
|
||||||
|
|
||||||
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
ret = AudioRenderSetGetSampleAttributes(attrs, attrsValue, render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
@ -620,7 +620,7 @@ HWTEST_F(AudioHdiRenderControlTest, SUB_Audio_HDI_CreateRender_0004, Function |
|
|||||||
|
|
||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
InitDevDesc(devDesc, renderPort->portId, PIN_OUT_SPEAKER);
|
InitDevDesc(devDesc, renderPort->portId, PIN_OUT_SPEAKER);
|
||||||
attrs.format = AUDIO_FORMAT_AAC_MAIN;
|
attrs.format = AUDIO_FORMAT_TYPE_AAC_MAIN;
|
||||||
ret = adapter->CreateRender(adapter, &devDesc, &attrs, &render);
|
ret = adapter->CreateRender(adapter, &devDesc, &attrs, &render);
|
||||||
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
EXPECT_EQ(AUDIO_HAL_ERR_INTERNAL, ret);
|
||||||
attrs.channelCount = channelCountErr;
|
attrs.channelCount = channelCountErr;
|
||||||
|
@ -949,9 +949,9 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0008, Fu
|
|||||||
manager->UnloadAdapter(manager, adapter);
|
manager->UnloadAdapter(manager, adapter);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @tc.name Test GetRenderPosition API via define format to AUDIO_FORMAT_PCM_16_BIT
|
* @tc.name Test GetRenderPosition API via define format to AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
* @tc.number SUB_Audio_HDI_AudioRenderGetRenderPosition_0009
|
* @tc.number SUB_Audio_HDI_AudioRenderGetRenderPosition_0009
|
||||||
* @tc.desc Test GetRenderPosition interface,return 0 if get framesize define format to AUDIO_FORMAT_PCM_16_BIT
|
* @tc.desc Test GetRenderPosition interface,return 0 if get framesize define format to AUDIO_FORMAT_TYPE_PCM_16_BIT
|
||||||
*/
|
*/
|
||||||
HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0009, Function | MediumTest | Level1)
|
HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0009, Function | MediumTest | Level1)
|
||||||
{
|
{
|
||||||
@ -972,14 +972,14 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0009, Fu
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 2;
|
attrs.channelCount = 2;
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
ret = AudioRenderStartAndOneFrame(render);
|
ret = AudioRenderStartAndOneFrame(render);
|
||||||
@ -994,9 +994,9 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0009, Fu
|
|||||||
}
|
}
|
||||||
#ifndef ALSA_LIB_MODE
|
#ifndef ALSA_LIB_MODE
|
||||||
/**
|
/**
|
||||||
* @tc.name Test GetRenderPosition API via define format to AUDIO_FORMAT_PCM_24_BIT
|
* @tc.name Test GetRenderPosition API via define format to AUDIO_FORMAT_TYPE_PCM_24_BIT
|
||||||
* @tc.number SUB_Audio_HDI_AudioRenderGetRenderPosition_0010
|
* @tc.number SUB_Audio_HDI_AudioRenderGetRenderPosition_0010
|
||||||
* @tc.desc Test GetRenderPosition interface,return 0 if get framesize define format to AUDIO_FORMAT_PCM_24_BIT
|
* @tc.desc Test GetRenderPosition interface,return 0 if get framesize define format to AUDIO_FORMAT_TYPE_PCM_24_BIT
|
||||||
*/
|
*/
|
||||||
HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0010, Function | MediumTest | Level1)
|
HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0010, Function | MediumTest | Level1)
|
||||||
{
|
{
|
||||||
@ -1017,14 +1017,14 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0010, Fu
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 2;
|
attrs.channelCount = 2;
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
ret = AudioRenderStartAndOneFrame(render);
|
ret = AudioRenderStartAndOneFrame(render);
|
||||||
@ -1063,7 +1063,7 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0011, Fu
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_16_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_16_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 1;
|
attrs.channelCount = 1;
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
@ -1071,7 +1071,7 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0011, Fu
|
|||||||
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_16_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_16_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
ret = AudioRenderStartAndOneFrame(render);
|
ret = AudioRenderStartAndOneFrame(render);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
@ -1107,14 +1107,14 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_AudioRenderGetRenderPosition_0012, Fu
|
|||||||
InitAttrs(attrs);
|
InitAttrs(attrs);
|
||||||
attrs.type = AUDIO_IN_MEDIA;
|
attrs.type = AUDIO_IN_MEDIA;
|
||||||
attrs.interleaved = false;
|
attrs.interleaved = false;
|
||||||
attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
attrs.sampleRate = 48000;
|
attrs.sampleRate = 48000;
|
||||||
attrs.channelCount = 1;
|
attrs.channelCount = 1;
|
||||||
ret = render->attr.SetSampleAttributes(render, &attrs);
|
ret = render->attr.SetSampleAttributes(render, &attrs);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
ret = render->attr.GetSampleAttributes(render, &attrsValue);
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
EXPECT_EQ(AUDIO_FORMAT_PCM_24_BIT, attrsValue.format);
|
EXPECT_EQ(AUDIO_FORMAT_TYPE_PCM_24_BIT, attrsValue.format);
|
||||||
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
EXPECT_EQ(sampleRateExp, attrsValue.sampleRate);
|
||||||
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
EXPECT_EQ(channelCountExp, attrsValue.channelCount);
|
||||||
ret = AudioRenderStartAndOneFrame(render);
|
ret = AudioRenderStartAndOneFrame(render);
|
||||||
@ -1475,7 +1475,7 @@ HWTEST_F(AudioHdiRenderTest, SUB_Audio_HDI_RenderGetMmapPosition_0002, Function
|
|||||||
ASSERT_EQ(nullptr, audiopara.render);
|
ASSERT_EQ(nullptr, audiopara.render);
|
||||||
}
|
}
|
||||||
InitAttrs(audiopara.attrs);
|
InitAttrs(audiopara.attrs);
|
||||||
audiopara.attrs.format = AUDIO_FORMAT_PCM_24_BIT;
|
audiopara.attrs.format = AUDIO_FORMAT_TYPE_PCM_24_BIT;
|
||||||
audiopara.attrs.channelCount = 1;
|
audiopara.attrs.channelCount = 1;
|
||||||
ret = audiopara.render->attr.SetSampleAttributes(audiopara.render, &(audiopara.attrs));
|
ret = audiopara.render->attr.SetSampleAttributes(audiopara.render, &(audiopara.attrs));
|
||||||
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
EXPECT_EQ(AUDIO_HAL_SUCCESS, ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user