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

Commit 08c97b55 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6041582 from 3717431b to rvc-release

Change-Id: I04c1494bb9223a539ea158badbf62b7879a7c6f1
parents 80fb0494 3717431b
Loading
Loading
Loading
Loading
+3 −38
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <mediadrm/DrmSessionClientInterface.h>
#include <mediadrm/DrmSessionManager.h>
#include <mediadrm/IDrmMetricsConsumer.h>
#include <mediadrm/DrmUtils.h>

#include <vector>

@@ -388,44 +389,8 @@ void DrmHal::cleanup() {
    mPluginV1_2.clear();
}

Vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
    Vector<sp<IDrmFactory>> factories;

    auto manager = hardware::defaultServiceManager1_2();

    if (manager != NULL) {
        manager->listManifestByInterface(drm::V1_0::IDrmFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_0::IDrmFactory::getService(instance);
                        if (factory != NULL) {
                            factories.push_back(factory);
                        }
                    }
                }
            );
        manager->listManifestByInterface(drm::V1_1::IDrmFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_1::IDrmFactory::getService(instance);
                        if (factory != NULL) {
                            factories.push_back(factory);
                        }
                    }
                }
            );
        manager->listManifestByInterface(drm::V1_2::IDrmFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_2::IDrmFactory::getService(instance);
                        if (factory != NULL) {
                            factories.push_back(factory);
                        }
                    }
                }
            );
    }

std::vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
    std::vector<sp<IDrmFactory>> factories(DrmUtils::MakeDrmFactories());
    if (factories.size() == 0) {
        // must be in passthrough mode, load the default passthrough service
        auto passthrough = IDrmFactory::getService();
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void MakeHidlFactories(const uint8_t uuid[16], V &factories) {
            auto factory = Hal::getService(instance);
            if (factory != nullptr) {
                ALOGI("found %s %s", Hal::descriptor, instance.c_str());
                if (factory->isCryptoSchemeSupported(uuid)) {
                if (!uuid || factory->isCryptoSchemeSupported(uuid)) {
                    factories.push_back(factory);
                }
            }
+2 −2
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ private:
    mutable Mutex mEventLock;
    mutable Mutex mNotifyLock;

    const Vector<sp<IDrmFactory>> mFactories;
    const std::vector<sp<IDrmFactory>> mFactories;
    sp<IDrmPlugin> mPlugin;
    sp<drm::V1_1::IDrmPlugin> mPluginV1_1;
    sp<drm::V1_2::IDrmPlugin> mPluginV1_2;
@@ -219,7 +219,7 @@ private:
     */
    status_t mInitCheck;

    Vector<sp<IDrmFactory>> makeDrmFactories();
    std::vector<sp<IDrmFactory>> makeDrmFactories();
    sp<IDrmPlugin> makeDrmPlugin(const sp<IDrmFactory>& factory,
            const uint8_t uuid[16], const String8& appPackageName);

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ void WriteKeysChange(
    obj.writeInt32(hasNewUsableKey);
}

std::vector<sp<::V1_0::IDrmFactory>> MakeDrmFactories(const uint8_t uuid[16]);
std::vector<sp<::V1_0::IDrmFactory>> MakeDrmFactories(const uint8_t uuid[16] = nullptr);

std::vector<sp<::V1_0::IDrmPlugin>> MakeDrmPlugins(const uint8_t uuid[16],
                                                   const char *appPackageName);
+3 −1
Original line number Diff line number Diff line
@@ -1524,8 +1524,10 @@ void CCodec::flush() {

    {
        Mutexed<State>::Locked state(mState);
        if (state->get() == FLUSHING) {
            state->set(FLUSHED);
        }
    }
    mCallback->onFlushCompleted();
}

Loading