Loading media/libaudiohal/impl/EffectsFactoryHalHidl.cpp +17 −2 Original line number Original line Diff line number Diff line Loading @@ -105,12 +105,26 @@ status_t EffectsFactoryHalHidl::getDescriptor( status_t EffectsFactoryHalHidl::createEffect( status_t EffectsFactoryHalHidl::createEffect( const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, sp<EffectHalInterface> *effect) { int32_t deviceId __unused, sp<EffectHalInterface> *effect) { if (mEffectsFactory == 0) return NO_INIT; if (mEffectsFactory == 0) return NO_INIT; Uuid hidlUuid; Uuid hidlUuid; HidlUtils::uuidFromHal(*pEffectUuid, &hidlUuid); HidlUtils::uuidFromHal(*pEffectUuid, &hidlUuid); Result retval = Result::NOT_INITIALIZED; Result retval = Result::NOT_INITIALIZED; Return<void> ret = mEffectsFactory->createEffect( Return<void> ret; #if MAJOR_VERSION >= 6 ret = mEffectsFactory->createEffect( hidlUuid, sessionId, ioId, deviceId, [&](Result r, const sp<IEffect>& result, uint64_t effectId) { retval = r; if (retval == Result::OK) { *effect = new EffectHalHidl(result, effectId); } }); #else if (sessionId == AUDIO_SESSION_DEVICE && ioId == AUDIO_IO_HANDLE_NONE) { return INVALID_OPERATION; } ret = mEffectsFactory->createEffect( hidlUuid, sessionId, ioId, hidlUuid, sessionId, ioId, [&](Result r, const sp<IEffect>& result, uint64_t effectId) { [&](Result r, const sp<IEffect>& result, uint64_t effectId) { retval = r; retval = r; Loading @@ -118,6 +132,7 @@ status_t EffectsFactoryHalHidl::createEffect( *effect = new EffectHalHidl(result, effectId); *effect = new EffectHalHidl(result, effectId); } } }); }); #endif if (ret.isOk()) { if (ret.isOk()) { if (retval == Result::OK) return OK; if (retval == Result::OK) return OK; else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND; else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND; Loading media/libaudiohal/impl/EffectsFactoryHalHidl.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,7 @@ class EffectsFactoryHalHidl : public EffectsFactoryHalInterface, public Conversi // To release the effect engine, it is necessary to release references // To release the effect engine, it is necessary to release references // to the returned effect object. // to the returned effect object. virtual status_t createEffect(const effect_uuid_t *pEffectUuid, virtual status_t createEffect(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, int32_t sessionId, int32_t ioId, int32_t deviceId, sp<EffectHalInterface> *effect); sp<EffectHalInterface> *effect); virtual status_t dumpEffects(int fd); virtual status_t dumpEffects(int fd); Loading media/libaudiohal/include/media/audiohal/EffectsFactoryHalInterface.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ class EffectsFactoryHalInterface : public RefBase // To release the effect engine, it is necessary to release references // To release the effect engine, it is necessary to release references // to the returned effect object. // to the returned effect object. virtual status_t createEffect(const effect_uuid_t *pEffectUuid, virtual status_t createEffect(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, int32_t sessionId, int32_t ioId, int32_t deviceId, sp<EffectHalInterface> *effect) = 0; sp<EffectHalInterface> *effect) = 0; virtual status_t dumpEffects(int fd) = 0; virtual status_t dumpEffects(int fd) = 0; Loading media/libaudioprocessing/BufferProviders.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -164,6 +164,7 @@ DownmixerBufferProvider::DownmixerBufferProvider( if (mEffectsFactory->createEffect(&sDwnmFxDesc.uuid, if (mEffectsFactory->createEffect(&sDwnmFxDesc.uuid, sessionId, sessionId, SESSION_ID_INVALID_AND_IGNORED, SESSION_ID_INVALID_AND_IGNORED, AUDIO_PORT_HANDLE_NONE, &mDownmixInterface) != 0) { &mDownmixInterface) != 0) { ALOGE("DownmixerBufferProvider() error creating downmixer effect"); ALOGE("DownmixerBufferProvider() error creating downmixer effect"); mDownmixInterface.clear(); mDownmixInterface.clear(); Loading media/libeffects/factory/EffectsFactory.c +30 −7 Original line number Original line Diff line number Diff line Loading @@ -254,7 +254,8 @@ int EffectGetDescriptor(const effect_uuid_t *uuid, effect_descriptor_t *pDescrip return ret; return ret; } } int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle) int doEffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, int32_t deviceId, effect_handle_t *pHandle) { { list_elem_t *e = gLibraryList; list_elem_t *e = gLibraryList; lib_entry_t *l = NULL; lib_entry_t *l = NULL; Loading Loading @@ -292,7 +293,19 @@ int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, eff } } // create effect in library // create effect in library if (sessionId == AUDIO_SESSION_DEVICE) { if (l->desc->version >= EFFECT_LIBRARY_API_VERSION_3_1) { ALOGI("EffectCreate() create_effect_3_1"); ret = l->desc->create_effect_3_1(uuid, sessionId, ioId, deviceId, &itfe); } else { ALOGE("EffectCreate() cannot create device effect on library with API version < 3.1"); ret = -ENOSYS; } } else { ALOGI("EffectCreate() create_effect"); ret = l->desc->create_effect(uuid, sessionId, ioId, &itfe); ret = l->desc->create_effect(uuid, sessionId, ioId, &itfe); } if (ret != 0) { if (ret != 0) { ALOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret); ALOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret); goto exit; goto exit; Loading Loading @@ -324,6 +337,16 @@ exit: return ret; return ret; } } int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle) { return doEffectCreate(uuid, sessionId, ioId, AUDIO_PORT_HANDLE_NONE, pHandle); } int EffectCreateOnDevice(const effect_uuid_t *uuid, int32_t deviceId, int32_t ioId, effect_handle_t *pHandle) { return doEffectCreate(uuid, AUDIO_SESSION_DEVICE, ioId, deviceId, pHandle); } int EffectRelease(effect_handle_t handle) int EffectRelease(effect_handle_t handle) { { effect_entry_t *fx; effect_entry_t *fx; Loading Loading
media/libaudiohal/impl/EffectsFactoryHalHidl.cpp +17 −2 Original line number Original line Diff line number Diff line Loading @@ -105,12 +105,26 @@ status_t EffectsFactoryHalHidl::getDescriptor( status_t EffectsFactoryHalHidl::createEffect( status_t EffectsFactoryHalHidl::createEffect( const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, sp<EffectHalInterface> *effect) { int32_t deviceId __unused, sp<EffectHalInterface> *effect) { if (mEffectsFactory == 0) return NO_INIT; if (mEffectsFactory == 0) return NO_INIT; Uuid hidlUuid; Uuid hidlUuid; HidlUtils::uuidFromHal(*pEffectUuid, &hidlUuid); HidlUtils::uuidFromHal(*pEffectUuid, &hidlUuid); Result retval = Result::NOT_INITIALIZED; Result retval = Result::NOT_INITIALIZED; Return<void> ret = mEffectsFactory->createEffect( Return<void> ret; #if MAJOR_VERSION >= 6 ret = mEffectsFactory->createEffect( hidlUuid, sessionId, ioId, deviceId, [&](Result r, const sp<IEffect>& result, uint64_t effectId) { retval = r; if (retval == Result::OK) { *effect = new EffectHalHidl(result, effectId); } }); #else if (sessionId == AUDIO_SESSION_DEVICE && ioId == AUDIO_IO_HANDLE_NONE) { return INVALID_OPERATION; } ret = mEffectsFactory->createEffect( hidlUuid, sessionId, ioId, hidlUuid, sessionId, ioId, [&](Result r, const sp<IEffect>& result, uint64_t effectId) { [&](Result r, const sp<IEffect>& result, uint64_t effectId) { retval = r; retval = r; Loading @@ -118,6 +132,7 @@ status_t EffectsFactoryHalHidl::createEffect( *effect = new EffectHalHidl(result, effectId); *effect = new EffectHalHidl(result, effectId); } } }); }); #endif if (ret.isOk()) { if (ret.isOk()) { if (retval == Result::OK) return OK; if (retval == Result::OK) return OK; else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND; else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND; Loading
media/libaudiohal/impl/EffectsFactoryHalHidl.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,7 @@ class EffectsFactoryHalHidl : public EffectsFactoryHalInterface, public Conversi // To release the effect engine, it is necessary to release references // To release the effect engine, it is necessary to release references // to the returned effect object. // to the returned effect object. virtual status_t createEffect(const effect_uuid_t *pEffectUuid, virtual status_t createEffect(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, int32_t sessionId, int32_t ioId, int32_t deviceId, sp<EffectHalInterface> *effect); sp<EffectHalInterface> *effect); virtual status_t dumpEffects(int fd); virtual status_t dumpEffects(int fd); Loading
media/libaudiohal/include/media/audiohal/EffectsFactoryHalInterface.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ class EffectsFactoryHalInterface : public RefBase // To release the effect engine, it is necessary to release references // To release the effect engine, it is necessary to release references // to the returned effect object. // to the returned effect object. virtual status_t createEffect(const effect_uuid_t *pEffectUuid, virtual status_t createEffect(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, int32_t sessionId, int32_t ioId, int32_t deviceId, sp<EffectHalInterface> *effect) = 0; sp<EffectHalInterface> *effect) = 0; virtual status_t dumpEffects(int fd) = 0; virtual status_t dumpEffects(int fd) = 0; Loading
media/libaudioprocessing/BufferProviders.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -164,6 +164,7 @@ DownmixerBufferProvider::DownmixerBufferProvider( if (mEffectsFactory->createEffect(&sDwnmFxDesc.uuid, if (mEffectsFactory->createEffect(&sDwnmFxDesc.uuid, sessionId, sessionId, SESSION_ID_INVALID_AND_IGNORED, SESSION_ID_INVALID_AND_IGNORED, AUDIO_PORT_HANDLE_NONE, &mDownmixInterface) != 0) { &mDownmixInterface) != 0) { ALOGE("DownmixerBufferProvider() error creating downmixer effect"); ALOGE("DownmixerBufferProvider() error creating downmixer effect"); mDownmixInterface.clear(); mDownmixInterface.clear(); Loading
media/libeffects/factory/EffectsFactory.c +30 −7 Original line number Original line Diff line number Diff line Loading @@ -254,7 +254,8 @@ int EffectGetDescriptor(const effect_uuid_t *uuid, effect_descriptor_t *pDescrip return ret; return ret; } } int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle) int doEffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, int32_t deviceId, effect_handle_t *pHandle) { { list_elem_t *e = gLibraryList; list_elem_t *e = gLibraryList; lib_entry_t *l = NULL; lib_entry_t *l = NULL; Loading Loading @@ -292,7 +293,19 @@ int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, eff } } // create effect in library // create effect in library if (sessionId == AUDIO_SESSION_DEVICE) { if (l->desc->version >= EFFECT_LIBRARY_API_VERSION_3_1) { ALOGI("EffectCreate() create_effect_3_1"); ret = l->desc->create_effect_3_1(uuid, sessionId, ioId, deviceId, &itfe); } else { ALOGE("EffectCreate() cannot create device effect on library with API version < 3.1"); ret = -ENOSYS; } } else { ALOGI("EffectCreate() create_effect"); ret = l->desc->create_effect(uuid, sessionId, ioId, &itfe); ret = l->desc->create_effect(uuid, sessionId, ioId, &itfe); } if (ret != 0) { if (ret != 0) { ALOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret); ALOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret); goto exit; goto exit; Loading Loading @@ -324,6 +337,16 @@ exit: return ret; return ret; } } int EffectCreate(const effect_uuid_t *uuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle) { return doEffectCreate(uuid, sessionId, ioId, AUDIO_PORT_HANDLE_NONE, pHandle); } int EffectCreateOnDevice(const effect_uuid_t *uuid, int32_t deviceId, int32_t ioId, effect_handle_t *pHandle) { return doEffectCreate(uuid, AUDIO_SESSION_DEVICE, ioId, deviceId, pHandle); } int EffectRelease(effect_handle_t handle) int EffectRelease(effect_handle_t handle) { { effect_entry_t *fx; effect_entry_t *fx; Loading