codec2: Allow all component names in VTS
Test: VtsHidlC2V1_0TargetVideoDecTest -I default -C c2.qti.avc.decoder -P /sdcard/res/
Test: VtsHidlC2V1_0TargetVideoEncTest -I default -C c2.qti.avc.encoder -P /sdcard/res/
Bug: 131905215
Change-Id: I8bbdff7b53778ed4e21e7c598363591b07eb5f60
diff --git a/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioDecTest.cpp b/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioDecTest.cpp
index 89947d4..6469735 100644
--- a/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioDecTest.cpp
+++ b/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioDecTest.cpp
@@ -117,17 +117,10 @@
const size_t kNumStringToName =
sizeof(kStringToName) / sizeof(kStringToName[0]);
- std::string substring;
- std::string comp;
- substring = std::string(gEnv->getComponent());
- /* TODO: better approach to find the component */
- /* "c2.android." => 11th position */
- size_t pos = 11;
- size_t len = substring.find(".decoder", pos);
- comp = substring.substr(pos, len - pos);
-
+ // Find the component type
+ std::string comp = std::string(gEnv->getComponent());
for (size_t i = 0; i < kNumStringToName; ++i) {
- if (!strcasecmp(comp.c_str(), kStringToName[i].Name)) {
+ if (strcasestr(comp.c_str(), kStringToName[i].Name)) {
mCompName = kStringToName[i].CompName;
break;
}
diff --git a/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioEncTest.cpp b/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioEncTest.cpp
index 0946fa6..01baf7e 100644
--- a/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioEncTest.cpp
+++ b/media/codec2/hidl/1.0/vts/functional/audio/VtsHidlC2V1_0TargetAudioEncTest.cpp
@@ -103,17 +103,10 @@
const size_t kNumStringToName =
sizeof(kStringToName) / sizeof(kStringToName[0]);
- std::string substring;
- std::string comp;
- substring = std::string(gEnv->getComponent());
- /* TODO: better approach to find the component */
- /* "c2.android." => 11th position */
- size_t pos = 11;
- size_t len = substring.find(".encoder", pos);
- comp = substring.substr(pos, len - pos);
-
+ // Find the component type
+ std::string comp = std::string(gEnv->getComponent());
for (size_t i = 0; i < kNumStringToName; ++i) {
- if (!strcasecmp(comp.c_str(), kStringToName[i].Name)) {
+ if (strcasestr(comp.c_str(), kStringToName[i].Name)) {
mCompName = kStringToName[i].CompName;
break;
}
diff --git a/media/codec2/hidl/1.0/vts/functional/common/README.md b/media/codec2/hidl/1.0/vts/functional/common/README.md
index da569a8..3deab10 100644
--- a/media/codec2/hidl/1.0/vts/functional/common/README.md
+++ b/media/codec2/hidl/1.0/vts/functional/common/README.md
@@ -1,22 +1,31 @@
-## Codec2 Hal @ 1.0 tests ##
+## Codec2 VTS Hal @ 1.0 tests ##
---
#### master :
Functionality of master is to enumerate all the Codec2 components available in C2 media service.
-usage: MtsHidlC2V1\_0TargetMasterTest -I software
+usage: VtsHidlC2V1\_0TargetMasterTest -I default
#### component :
-Functionality of component is to test common functionality across all the Codec2 components available in C2 media service. For a standard C2 component, these tests are expected to pass.
+Functionality of component test is to validate common functionality across all the Codec2 components available in C2 media service. For a standard C2 component, these tests are expected to pass.
-usage: MtsHidlC2V1\_0TargetComponentTest -I software -C <comp name>
+usage: VtsHidlC2V1\_0TargetComponentTest -I software -C <comp name>
+example: VtsHidlC2V1\_0TargetComponentTest -I software -C c2.android.vorbis.decoder
#### audio :
-Functionality of audio test is to validate audio specific functionality Codec2 components. The resource files for this test are taken from hardware/interfaces/media/res. The path to these files on the device is required to be given for bitstream tests.
+Functionality of audio test is to validate audio specific functionality Codec2 components. The resource files for this test are taken from media/codec2/hidl/1.0/vts/functional/res. The path to these files on the device is required to be given for bitstream tests.
-usage: MtsHidlC2V1\_0TargetAudioDecTest -I software -C <comp name> -P /sdcard/media
+usage: VtsHidlC2V1\_0TargetAudioDecTest -I default -C <comp name> -P /sdcard/res/
+usage: VtsHidlC2V1\_0TargetAudioEncTest -I software -C <comp name> -P /sdcard/res/
+
+example: VtsHidlC2V1\_0TargetAudioDecTest -I software -C c2.android.flac.decoder -P /sdcard/res/
+example: VtsHidlC2V1\_0TargetAudioEncTest -I software -C c2.android.opus.encoder -P /sdcard/res/
#### video :
-Functionality of video test is to validate video specific functionality Codec2 components. The resource files for this test are taken from hardware/interfaces/media/res. The path to these files on the device is required to be given for bitstream tests.
+Functionality of video test is to validate video specific functionality Codec2 components. The resource files for this test are taken from media/codec2/hidl/1.0/vts/functional/res. The path to these files on the device is required to be given for bitstream tests.
-usage: MtsHidlC2V1\_0TargetVideoDecTest -I software -C <comp name> -P /sdcard/media
+usage: VtsHidlC2V1\_0TargetVideoDecTest -I default -C <comp name> -P /sdcard/res/
+usage: VtsHidlC2V1\_0TargetVideoEncTest -I software -C <comp name> -P /sdcard/res/
+
+example: VtsHidlC2V1\_0TargetVideoDecTest -I software -C c2.android.avc.decoder -P /sdcard/res/
+example: VtsHidlC2V1\_0TargetVideoEncTest -I software -C c2.android.vp9.encoder -P /sdcard/res/
diff --git a/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoDecTest.cpp b/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoDecTest.cpp
index 9bfcdd5..33fa848 100644
--- a/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoDecTest.cpp
+++ b/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoDecTest.cpp
@@ -107,17 +107,10 @@
const size_t kNumStringToName =
sizeof(kStringToName) / sizeof(kStringToName[0]);
- std::string substring;
- std::string comp;
- substring = std::string(gEnv->getComponent());
- /* TODO: better approach to find the component */
- /* "c2.android." => 11th position */
- size_t pos = 11;
- size_t len = substring.find(".decoder", pos);
- comp = substring.substr(pos, len - pos);
-
+ // Find the component type
+ std::string comp = std::string(gEnv->getComponent());
for (size_t i = 0; i < kNumStringToName; ++i) {
- if (!strcasecmp(comp.c_str(), kStringToName[i].Name)) {
+ if (strcasestr(comp.c_str(), kStringToName[i].Name)) {
mCompName = kStringToName[i].CompName;
break;
}
diff --git a/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoEncTest.cpp b/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoEncTest.cpp
index 3c9e96c..6bcf840 100644
--- a/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoEncTest.cpp
+++ b/media/codec2/hidl/1.0/vts/functional/video/VtsHidlC2V1_0TargetVideoEncTest.cpp
@@ -101,17 +101,10 @@
const size_t kNumStringToName =
sizeof(kStringToName) / sizeof(kStringToName[0]);
- std::string substring;
- std::string comp;
- substring = std::string(gEnv->getComponent());
- /* TODO: better approach to find the component */
- /* "c2.android." => 11th position */
- size_t pos = 11;
- size_t len = substring.find(".encoder", pos);
- comp = substring.substr(pos, len - pos);
-
+ // Find the component type
+ std::string comp = std::string(gEnv->getComponent());
for (size_t i = 0; i < kNumStringToName; ++i) {
- if (!strcasecmp(comp.c_str(), kStringToName[i].Name)) {
+ if (strcasestr(comp.c_str(), kStringToName[i].Name)) {
mCompName = kStringToName[i].CompName;
break;
}