Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efd0374e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I630138a1,I545e9890,I20223fa1,I9e966951,I9fe167dd

* changes:
  codec2: add util method to fill Traits from C2ComponentInterface
  CCodec: handle color-transfer-request
  codec2: integrate filter plugin with codec2 hidl utils
  codec2: add filter plugin interface & wrapper implementation
  codec2: allow multiple components to get block pool from ID
parents 51f482db c6046709
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ cc_library {
        "libbase",
        "libcodec2",
        "libcodec2_vndk",
        "libcodec2_hidl_plugin_stub",
        "libcutils",
        "libhidlbase",
        "liblog",
@@ -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",
            ],
        },
    },
+11 −0
Original line number Diff line number Diff line
@@ -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>

@@ -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;
    }
+25 −1
Original line number Diff line number Diff line
@@ -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 {
@@ -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,
@@ -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) {
@@ -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);
    }
@@ -458,7 +483,6 @@ Return<void> ComponentStore::debug(
    return Void();
}


}  // namespace utils
}  // namespace V1_0
}  // namespace c2
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@
#include <vector>

namespace android {
class FilterWrapper;

namespace hardware {
namespace media {
namespace c2 {
@@ -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,
+9 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ cc_library {
        "libbase",
        "libcodec2",
        "libcodec2_hidl@1.0",
        "libcodec2_hidl_plugin_stub",
        "libcodec2_vndk",
        "libcutils",
        "libhidlbase",
@@ -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