Add EventFlag for effect HAL thread processing
Bug: 261129656
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ieb81cef8785ea986bc2fc27fd142fd868e8bd103
diff --git a/media/libaudiohal/impl/EffectConversionHelperAidl.h b/media/libaudiohal/impl/EffectConversionHelperAidl.h
index 1200264..0c682ff 100644
--- a/media/libaudiohal/impl/EffectConversionHelperAidl.h
+++ b/media/libaudiohal/impl/EffectConversionHelperAidl.h
@@ -40,6 +40,7 @@
std::shared_ptr<StatusMQ> getStatusMQ() { return mStatusQ; }
std::shared_ptr<DataMQ> getInputMQ() { return mInputQ; }
std::shared_ptr<DataMQ> getOutputMQ() { return mOutputQ; }
+ std::shared_ptr<android::hardware::EventFlag> getEventFlagGroup() { return mEfGroup; }
protected:
const int32_t mSessionId;
@@ -85,6 +86,17 @@
std::shared_ptr<StatusMQ> mStatusQ = nullptr;
std::shared_ptr<DataMQ> mInputQ = nullptr, mOutputQ = nullptr;
+
+ struct EventFlagDeleter {
+ void operator()(::android::hardware::EventFlag* flag) const {
+ if (flag) {
+ ::android::hardware::EventFlag::deleteEventFlag(&flag);
+ }
+ }
+ };
+ std::shared_ptr<android::hardware::EventFlag> mEfGroup = nullptr;
+ status_t updateEventFlags();
+
status_t handleInit(uint32_t cmdSize, const void* pCmdData, uint32_t* replySize,
void* pReplyData);
status_t handleSetConfig(uint32_t cmdSize, const void* pCmdData, uint32_t* replySize,
@@ -121,6 +133,7 @@
virtual status_t visualizerMeasure(uint32_t* replySize __unused, void* pReplyData __unused) {
return BAD_VALUE;
}
+
};
} // namespace effect