Loading media/codec2/hidl/1.0/utils/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ cc_library { "libbase", "libcodec2", "libcodec2_vndk", "libcodec2_hidl_plugin_stub", "libcutils", "libhidlbase", "liblog", Loading @@ -102,9 +103,17 @@ cc_library { vendor: { exclude_shared_libs: [ "libstagefright_bufferqueue_helper_novndk", "libcodec2_hidl_plugin_stub", ], shared_libs: [ "libstagefright_bufferqueue_helper", "libcodec2_hidl_plugin", ], }, apex: { exclude_shared_libs: [ "libcodec2_hidl_plugin", "libcodec2_hidl_plugin_stub", ], }, }, Loading media/codec2/hidl/1.0/utils/Component.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,10 @@ #include <codec2/hidl/1.0/ComponentStore.h> #include <codec2/hidl/1.0/InputBufferManager.h> #ifndef __ANDROID_APEX__ #include <FilterWrapper.h> #endif #include <hidl/HidlBinderSupport.h> #include <utils/Timers.h> Loading Loading @@ -390,10 +394,17 @@ Return<void> Component::createBlockPool( uint32_t allocatorId, createBlockPool_cb _hidl_cb) { std::shared_ptr<C2BlockPool> blockPool; #ifdef __ANDROID_APEX__ c2_status_t status = CreateCodec2BlockPool( static_cast<C2PlatformAllocatorStore::id_t>(allocatorId), mComponent, &blockPool); #else c2_status_t status = ComponentStore::GetFilterWrapper()->createBlockPool( static_cast<C2PlatformAllocatorStore::id_t>(allocatorId), mComponent, &blockPool); #endif if (status != C2_OK) { blockPool = nullptr; } Loading media/codec2/hidl/1.0/utils/ComponentStore.cpp +25 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,14 @@ #include <ostream> #include <sstream> #ifndef __ANDROID_APEX__ #include <codec2/hidl/plugin/FilterPlugin.h> #include <dlfcn.h> #include <C2Config.h> #include <DefaultFilterPlugin.h> #include <FilterWrapper.h> #endif namespace android { namespace hardware { namespace media { Loading Loading @@ -176,6 +184,16 @@ std::shared_ptr<ParameterCache> ComponentStore::getParameterCache() const { return mParameterCache; } #ifndef __ANDROID_APEX__ // static std::shared_ptr<FilterWrapper> ComponentStore::GetFilterWrapper() { constexpr const char kPluginPath[] = "libc2filterplugin.so"; static std::shared_ptr<FilterWrapper> wrapper = FilterWrapper::Create( std::make_unique<DefaultFilterPlugin>(kPluginPath)); return wrapper; } #endif // Methods from ::android::hardware::media::c2::V1_0::IComponentStore Return<void> ComponentStore::createComponent( const hidl_string& name, Loading @@ -189,6 +207,9 @@ Return<void> ComponentStore::createComponent( mStore->createComponent(name, &c2component)); if (status == Status::OK) { #ifndef __ANDROID_APEX__ c2component = GetFilterWrapper()->maybeWrapComponent(c2component); #endif onInterfaceLoaded(c2component->intf()); component = new Component(c2component, listener, this, pool); if (!component) { Loading @@ -214,8 +235,12 @@ Return<void> ComponentStore::createInterface( createInterface_cb _hidl_cb) { std::shared_ptr<C2ComponentInterface> c2interface; c2_status_t res = mStore->createInterface(name, &c2interface); sp<IComponentInterface> interface; if (res == C2_OK) { #ifndef __ANDROID_APEX__ c2interface = GetFilterWrapper()->maybeWrapInterface(c2interface); #endif onInterfaceLoaded(c2interface); interface = new ComponentInterface(c2interface, mParameterCache); } Loading Loading @@ -458,7 +483,6 @@ Return<void> ComponentStore::debug( return Void(); } } // namespace utils } // namespace V1_0 } // namespace c2 Loading media/codec2/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #include <vector> namespace android { class FilterWrapper; namespace hardware { namespace media { namespace c2 { Loading Loading @@ -74,6 +76,8 @@ struct ComponentStore : public IComponentStore { */ std::shared_ptr<ParameterCache> getParameterCache() const; static std::shared_ptr<FilterWrapper> GetFilterWrapper(); // Methods from ::android::hardware::media::c2::V1_0::IComponentStore. virtual Return<void> createComponent( const hidl_string& name, Loading media/codec2/hidl/1.1/utils/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ cc_library { "libbase", "libcodec2", "libcodec2_hidl@1.0", "libcodec2_hidl_plugin_stub", "libcodec2_vndk", "libcutils", "libhidlbase", Loading @@ -114,9 +115,17 @@ cc_library { vendor: { exclude_shared_libs: [ "libstagefright_bufferqueue_helper_novndk", "libcodec2_hidl_plugin_stub", ], shared_libs: [ "libstagefright_bufferqueue_helper", "libcodec2_hidl_plugin", ], }, apex: { exclude_shared_libs: [ "libcodec2_hidl_plugin_stub", "libcodec2_hidl_plugin", ], }, }, Loading Loading
media/codec2/hidl/1.0/utils/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ cc_library { "libbase", "libcodec2", "libcodec2_vndk", "libcodec2_hidl_plugin_stub", "libcutils", "libhidlbase", "liblog", Loading @@ -102,9 +103,17 @@ cc_library { vendor: { exclude_shared_libs: [ "libstagefright_bufferqueue_helper_novndk", "libcodec2_hidl_plugin_stub", ], shared_libs: [ "libstagefright_bufferqueue_helper", "libcodec2_hidl_plugin", ], }, apex: { exclude_shared_libs: [ "libcodec2_hidl_plugin", "libcodec2_hidl_plugin_stub", ], }, }, Loading
media/codec2/hidl/1.0/utils/Component.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,10 @@ #include <codec2/hidl/1.0/ComponentStore.h> #include <codec2/hidl/1.0/InputBufferManager.h> #ifndef __ANDROID_APEX__ #include <FilterWrapper.h> #endif #include <hidl/HidlBinderSupport.h> #include <utils/Timers.h> Loading Loading @@ -390,10 +394,17 @@ Return<void> Component::createBlockPool( uint32_t allocatorId, createBlockPool_cb _hidl_cb) { std::shared_ptr<C2BlockPool> blockPool; #ifdef __ANDROID_APEX__ c2_status_t status = CreateCodec2BlockPool( static_cast<C2PlatformAllocatorStore::id_t>(allocatorId), mComponent, &blockPool); #else c2_status_t status = ComponentStore::GetFilterWrapper()->createBlockPool( static_cast<C2PlatformAllocatorStore::id_t>(allocatorId), mComponent, &blockPool); #endif if (status != C2_OK) { blockPool = nullptr; } Loading
media/codec2/hidl/1.0/utils/ComponentStore.cpp +25 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,14 @@ #include <ostream> #include <sstream> #ifndef __ANDROID_APEX__ #include <codec2/hidl/plugin/FilterPlugin.h> #include <dlfcn.h> #include <C2Config.h> #include <DefaultFilterPlugin.h> #include <FilterWrapper.h> #endif namespace android { namespace hardware { namespace media { Loading Loading @@ -176,6 +184,16 @@ std::shared_ptr<ParameterCache> ComponentStore::getParameterCache() const { return mParameterCache; } #ifndef __ANDROID_APEX__ // static std::shared_ptr<FilterWrapper> ComponentStore::GetFilterWrapper() { constexpr const char kPluginPath[] = "libc2filterplugin.so"; static std::shared_ptr<FilterWrapper> wrapper = FilterWrapper::Create( std::make_unique<DefaultFilterPlugin>(kPluginPath)); return wrapper; } #endif // Methods from ::android::hardware::media::c2::V1_0::IComponentStore Return<void> ComponentStore::createComponent( const hidl_string& name, Loading @@ -189,6 +207,9 @@ Return<void> ComponentStore::createComponent( mStore->createComponent(name, &c2component)); if (status == Status::OK) { #ifndef __ANDROID_APEX__ c2component = GetFilterWrapper()->maybeWrapComponent(c2component); #endif onInterfaceLoaded(c2component->intf()); component = new Component(c2component, listener, this, pool); if (!component) { Loading @@ -214,8 +235,12 @@ Return<void> ComponentStore::createInterface( createInterface_cb _hidl_cb) { std::shared_ptr<C2ComponentInterface> c2interface; c2_status_t res = mStore->createInterface(name, &c2interface); sp<IComponentInterface> interface; if (res == C2_OK) { #ifndef __ANDROID_APEX__ c2interface = GetFilterWrapper()->maybeWrapInterface(c2interface); #endif onInterfaceLoaded(c2interface); interface = new ComponentInterface(c2interface, mParameterCache); } Loading Loading @@ -458,7 +483,6 @@ Return<void> ComponentStore::debug( return Void(); } } // namespace utils } // namespace V1_0 } // namespace c2 Loading
media/codec2/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #include <vector> namespace android { class FilterWrapper; namespace hardware { namespace media { namespace c2 { Loading Loading @@ -74,6 +76,8 @@ struct ComponentStore : public IComponentStore { */ std::shared_ptr<ParameterCache> getParameterCache() const; static std::shared_ptr<FilterWrapper> GetFilterWrapper(); // Methods from ::android::hardware::media::c2::V1_0::IComponentStore. virtual Return<void> createComponent( const hidl_string& name, Loading
media/codec2/hidl/1.1/utils/Android.bp +9 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ cc_library { "libbase", "libcodec2", "libcodec2_hidl@1.0", "libcodec2_hidl_plugin_stub", "libcodec2_vndk", "libcutils", "libhidlbase", Loading @@ -114,9 +115,17 @@ cc_library { vendor: { exclude_shared_libs: [ "libstagefright_bufferqueue_helper_novndk", "libcodec2_hidl_plugin_stub", ], shared_libs: [ "libstagefright_bufferqueue_helper", "libcodec2_hidl_plugin", ], }, apex: { exclude_shared_libs: [ "libcodec2_hidl_plugin_stub", "libcodec2_hidl_plugin", ], }, }, Loading