diff options
Diffstat (limited to 'media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp')
-rw-r--r-- | media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp index 7240964e..4c68219b 100644 --- a/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp +++ b/media/omx/1.0/vts/functional/audio/media_audio_hidl_test_common.cpp | |||
@@ -46,47 +46,6 @@ using ::android::sp; | |||
46 | #include <media_hidl_test_common.h> | 46 | #include <media_hidl_test_common.h> |
47 | #include <memory> | 47 | #include <memory> |
48 | 48 | ||
49 | Return<android::hardware::media::omx::V1_0::Status> setAudioPortFormat( | ||
50 | sp<IOmxNode> omxNode, OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE eEncoding) { | ||
51 | OMX_U32 index = 0; | ||
52 | OMX_AUDIO_PARAM_PORTFORMATTYPE portFormat; | ||
53 | std::vector<OMX_AUDIO_CODINGTYPE> arrEncoding; | ||
54 | android::hardware::media::omx::V1_0::Status status; | ||
55 | |||
56 | while (1) { | ||
57 | portFormat.nIndex = index; | ||
58 | status = getPortParam(omxNode, OMX_IndexParamAudioPortFormat, portIndex, | ||
59 | &portFormat); | ||
60 | if (status != ::android::hardware::media::omx::V1_0::Status::OK) break; | ||
61 | arrEncoding.push_back(portFormat.eEncoding); | ||
62 | index++; | ||
63 | if (index == 512) { | ||
64 | // enumerated way too many formats, highly unusual for this to | ||
65 | // happen. | ||
66 | EXPECT_LE(index, 512U) | ||
67 | << "Expecting OMX_ErrorNoMore but not received"; | ||
68 | break; | ||
69 | } | ||
70 | } | ||
71 | if (!index) return status; | ||
72 | for (index = 0; index < arrEncoding.size(); index++) { | ||
73 | if (arrEncoding[index] == eEncoding) { | ||
74 | portFormat.eEncoding = arrEncoding[index]; | ||
75 | break; | ||
76 | } | ||
77 | } | ||
78 | if (index == arrEncoding.size()) { | ||
79 | ALOGE("setting default Port format %x", (int)arrEncoding[0]); | ||
80 | portFormat.eEncoding = arrEncoding[0]; | ||
81 | } | ||
82 | // In setParam call nIndex shall be ignored as per omx-il specification. | ||
83 | // see how this holds up by corrupting nIndex | ||
84 | portFormat.nIndex = RANDOM_INDEX; | ||
85 | status = setPortParam(omxNode, OMX_IndexParamAudioPortFormat, portIndex, | ||
86 | &portFormat); | ||
87 | return status; | ||
88 | } | ||
89 | |||
90 | void enumerateProfile(sp<IOmxNode> omxNode, OMX_U32 portIndex, | 49 | void enumerateProfile(sp<IOmxNode> omxNode, OMX_U32 portIndex, |
91 | std::vector<int32_t>* arrProfile) { | 50 | std::vector<int32_t>* arrProfile) { |
92 | android::hardware::media::omx::V1_0::Status status; | 51 | android::hardware::media::omx::V1_0::Status status; |