Update
Some checks failed
build / build (arm64-v8a) (push) Failing after 33s
build / build (armeabi-v7a) (push) Failing after 37s
build / build (x86) (push) Failing after 2m49s
build / build (x86_64) (push) Failing after 39s
build / package (push) Has been skipped

This commit is contained in:
Iscle 2025-04-03 00:23:29 +02:00
parent 5e5012120b
commit 9f76039bf9
2 changed files with 26 additions and 34 deletions

View File

@ -15,18 +15,10 @@ void *native_handle_create;
void *native_handle_delete;
void *native_handle_close;
void logError() {
ALOGD("_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE called");
}
void createEventFlag() {
ALOGD("_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ called");
}
// libfmq
void *_ZN7android8hardware7details5checkEbPKc;
void *_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE = (void *) (logError); // ndk
void *_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ = (void *) (createEventFlag); // ndk
void *_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE; // ndk
void *_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_; // ndk
void *_ZN7android8hardware9EventFlag15deleteEventFlagEPPS1_;
static void init_libcutils() {
@ -90,18 +82,18 @@ static void init_libfmq() {
}
// ndk variant, real symbol: _ZN7android8hardware7details8logErrorERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE
// _ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE = dlsym(libfmq, "_ZN7android8hardware7details8logErrorERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE");
// if (_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE == nullptr) {
// ALOGE("Failed to load symbol _ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE from libfmq.so");
// goto exit;
// }
_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE = dlsym(libfmq, "_ZN7android8hardware7details8logErrorERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE");
if (_ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE == nullptr) {
ALOGE("Failed to load symbol _ZN7android8hardware7details8logErrorERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE from libfmq.so");
goto exit;
}
// ndk variant, real symbol: _ZN7android8hardware9EventFlag15createEventFlagEPNSt3__16atomicIjEEPPS1_
// _ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ = dlsym(libfmq, "_ZN7android8hardware9EventFlag15createEventFlagEPNSt3__16atomicIjEEPPS1_");
// if (_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ == nullptr) {
// ALOGE("Failed to load symbol _ZN7android8hardware9EventFlag15createEventFlagEPNSt3__16atomicIjEEPPS1_ from libfmq.so");
// goto exit;
// }
_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ = dlsym(libfmq, "_ZN7android8hardware9EventFlag15createEventFlagEPNSt3__16atomicIjEEPPS1_");
if (_ZN7android8hardware9EventFlag15createEventFlagEPNSt6__ndk16atomicIjEEPPS1_ == nullptr) {
ALOGE("Failed to load symbol _ZN7android8hardware9EventFlag15createEventFlagEPNSt3__16atomicIjEEPPS1_ from libfmq.so");
goto exit;
}
_ZN7android8hardware9EventFlag15deleteEventFlagEPPS1_ = dlsym(libfmq, "_ZN7android8hardware9EventFlag15deleteEventFlagEPPS1_");
if (_ZN7android8hardware9EventFlag15deleteEventFlagEPPS1_ == nullptr) {

View File

@ -7,31 +7,31 @@
#include <fmq/AidlMessageQueue.h>
#include "aidl/EffectThread.h"
using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
using aidl::android::hardware::audio::effect::BnEffect;
using aidl::android::hardware::audio::effect::CommandId;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::EffectThread;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::State;
class ViPER4AndroidAIDL : public BnEffect, public EffectThread {
public:
// BnEffect
::ndk::ScopedAStatus open(const ::aidl::android::hardware::audio::effect::Parameter::Common &common, const std::optional< ::aidl::android::hardware::audio::effect::Parameter::Specific> &specific, ::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn *ret) override;
::ndk::ScopedAStatus close() override;
::ndk::ScopedAStatus getDescriptor(::aidl::android::hardware::audio::effect::Descriptor *_aidl_return) override;
::ndk::ScopedAStatus command(::aidl::android::hardware::audio::effect::CommandId id) override;
::ndk::ScopedAStatus getState(::aidl::android::hardware::audio::effect::State *_aidl_return) override;
::ndk::ScopedAStatus setParameter(const ::aidl::android::hardware::audio::effect::Parameter &in_param) override;
::ndk::ScopedAStatus getParameter(const ::aidl::android::hardware::audio::effect::Parameter::Id &in_paramId, ::aidl::android::hardware::audio::effect::Parameter *_aidl_return) override;
::ndk::ScopedAStatus reopen(::aidl::android::hardware::audio::effect::IEffect::OpenEffectReturn *_aidl_return) override;
ndk::ScopedAStatus open(const Parameter::Common &common, const std::optional<Parameter::Specific> &specific, IEffect::OpenEffectReturn *ret) override;
ndk::ScopedAStatus close() override;
ndk::ScopedAStatus getDescriptor(Descriptor *_aidl_return) override;
ndk::ScopedAStatus command(CommandId id) override;
ndk::ScopedAStatus getState(State *_aidl_return) override;
ndk::ScopedAStatus setParameter(const Parameter &in_param) override;
ndk::ScopedAStatus getParameter(const Parameter::Id &in_paramId, Parameter *_aidl_return) override;
ndk::ScopedAStatus reopen(IEffect::OpenEffectReturn *_aidl_return) override;
// EffectThread
void process() override;
private:
typedef ::android::AidlMessageQueue<
IEffect::Status, ::aidl::android::hardware::common::fmq::SynchronizedReadWrite>
StatusMQ;
typedef ::android::AidlMessageQueue<
float, ::aidl::android::hardware::common::fmq::SynchronizedReadWrite>
DataMQ;
typedef android::AidlMessageQueue<IEffect::Status, SynchronizedReadWrite> StatusMQ;
typedef android::AidlMessageQueue<float, SynchronizedReadWrite> DataMQ;
std::mutex mImplMutex;
State mState = State::INIT;