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

Commit c856d729 authored by Hassan Shojania's avatar Hassan Shojania Committed by android-build-merger
Browse files

Merge "Modular DRM for MediaPlayer/Removing mimes report" into oc-dev am: a28ec4a3

am: d241b656

Change-Id: I606b89d57a83128c096b3800eeed2b7ba8172812
parents b05dfdff d241b656
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1954,12 +1954,12 @@ status_t NuPlayer::GenericSource::checkDrmInfo()
    size_t psshsize;

    if (!mFileMeta->findData(kKeyPssh, &type, &pssh, &psshsize)) {
        ALOGE("checkDrmInfo: No PSSH");
        ALOGV("checkDrmInfo: No PSSH");
        return OK; // source without DRM info
    }

    Parcel parcel;
    NuPlayerDrm::retrieveDrmInfo(pssh, psshsize, mMimes, &parcel);
    NuPlayerDrm::retrieveDrmInfo(pssh, psshsize, &parcel);
    ALOGV("checkDrmInfo: MEDIA_DRM_INFO PSSH size: %d  Parcel size: %d  objects#: %d",
          (int)psshsize, (int)parcel.dataSize(), (int)parcel.objectsCount());

+1 −31
Original line number Diff line number Diff line
@@ -205,26 +205,8 @@ sp<ICrypto> NuPlayerDrm::createCryptoAndPlugin(const uint8_t uuid[16],
}

// Parcel has only private copy constructor so passing it in rather than returning
void NuPlayerDrm::retrieveDrmInfo(const void *pssh, size_t psshsize,
        const Vector<String8> &mimes_in, Parcel *parcel)
void NuPlayerDrm::retrieveDrmInfo(const void *pssh, size_t psshsize, Parcel *parcel)
{
    // 0) Make mimes a vector of unique items while keeping the original order; video first
    Vector<String8> mimes;
    for (size_t j = 0; j < mimes_in.size(); j++) {
        String8 mime = mimes_in[j];
        bool exists = false;
        for (size_t i = 0; i < mimes.size() && !exists; i++) {
            if (mimes[i] == mime) {
                exists = true;
            }
        } // for i

        if (!exists) {
            mimes.add(mime);
        }
    } // for j


    // 1) PSSH bytes
    parcel->writeUint32(psshsize);
    parcel->writeByteArray(psshsize, (const uint8_t*)pssh);
@@ -242,18 +224,6 @@ void NuPlayerDrm::retrieveDrmInfo(const void *pssh, size_t psshsize,
        ALOGV("retrieveDrmInfo: MEDIA_DRM_INFO  supportedScheme[%zu] %s", i,
                uuid.toHexString().string());
    }

    // TODO: remove mimes after it's removed from Java DrmInfo
    // 3) mimes
    parcel->writeUint32(mimes.size());
    for (size_t i = 0; i < mimes.size(); i++) {
        // writing as String16 so the Java framework side can unpack it to Java String
        String16 mime(mimes[i]);
        parcel->writeString16(mime);

        ALOGV("retrieveDrmInfo: MEDIA_DRM_INFO  MIME[%zu] %s",
                i, mimes[i].string());
    }
}

////////////////////////////////////////////////////////////////////////////////////////////
+1 −2
Original line number Diff line number Diff line
@@ -84,8 +84,7 @@ namespace android {
        static sp<ICrypto> createCryptoAndPlugin(const uint8_t uuid[16],
                const Vector<uint8_t> &drmSessionId, status_t &status);
        // Parcel has only private copy constructor so passing it in rather than returning
        static void retrieveDrmInfo(const void *pssh, size_t psshsize,
                const Vector<String8> &mimes_in, Parcel *parcel);
        static void retrieveDrmInfo(const void *pssh, size_t psshsize, Parcel *parcel);

        ////////////////////////////////////////////////////////////////////////////////////////////
        /// Helpers for NuPlayerDecoder