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

Commit a8723484 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Remove kKeyIsDRM metadata key

It was only ever set by DRMExtractor, which was removed in Oreo.

Test: build, CTS
Change-Id: Id90fddb0f10df2061427bc8803c456cf18edadea
parent 309fbe09
Loading
Loading
Loading
Loading
+86 −115
Original line number Diff line number Diff line
@@ -5316,14 +5316,7 @@ status_t MPEG4Source::read(
        // Whole NAL units are returned but each fragment is prefixed by
        // the start code (0x00 00 00 01).
        ssize_t num_bytes_read = 0;
        int32_t drm = 0;
        bool usesDRM = (mFormat.findInt32(kKeyIsDRM, &drm) && drm != 0);
        if (usesDRM) {
            num_bytes_read =
                mDataSource->readAt(offset, (uint8_t*)mBuffer->data(), size);
        } else {
        num_bytes_read = mDataSource->readAt(offset, mSrcBuffer, size);
        }

        if (num_bytes_read < (ssize_t)size) {
            mBuffer->release();
@@ -5332,11 +5325,6 @@ status_t MPEG4Source::read(
            return ERROR_IO;
        }

        if (usesDRM) {
            CHECK(mBuffer != NULL);
            mBuffer->set_range(0, size);

        } else {
        uint8_t *dstData = (uint8_t *)mBuffer->data();
        size_t srcOffset = 0;
        size_t dstOffset = 0;
@@ -5382,7 +5370,6 @@ status_t MPEG4Source::read(
        CHECK_EQ(srcOffset, size);
        CHECK(mBuffer != NULL);
        mBuffer->set_range(0, dstOffset);
        }

        mBuffer->meta_data().clear();
        mBuffer->meta_data().setInt64(
@@ -5669,17 +5656,8 @@ status_t MPEG4Source::fragmentedRead(
        // Whole NAL units are returned but each fragment is prefixed by
        // the start code (0x00 00 00 01).
        ssize_t num_bytes_read = 0;
        int32_t drm = 0;
        bool usesDRM = (mFormat.findInt32(kKeyIsDRM, &drm) && drm != 0);
        void *data = NULL;
        bool isMalFormed = false;
        if (usesDRM) {
            if (mBuffer == NULL || !isInRange((size_t)0u, mBuffer->size(), size)) {
                isMalFormed = true;
            } else {
                data = mBuffer->data();
            }
        } else {
        int32_t max_size;
        if (!mFormat.findInt32(kKeyMaxInputSize, &max_size)
                || !isInRange((size_t)0u, (size_t)max_size, size)) {
@@ -5687,7 +5665,6 @@ status_t MPEG4Source::fragmentedRead(
        } else {
            data = mSrcBuffer;
        }
        }

        if (isMalFormed || data == NULL) {
            ALOGE("isMalFormed size %zu", size);
@@ -5707,11 +5684,6 @@ status_t MPEG4Source::fragmentedRead(
            return ERROR_IO;
        }

        if (usesDRM) {
            CHECK(mBuffer != NULL);
            mBuffer->set_range(0, size);

        } else {
        uint8_t *dstData = (uint8_t *)mBuffer->data();
        size_t srcOffset = 0;
        size_t dstOffset = 0;
@@ -5759,7 +5731,6 @@ status_t MPEG4Source::fragmentedRead(
        CHECK_EQ(srcOffset, size);
        CHECK(mBuffer != NULL);
        mBuffer->set_range(0, dstOffset);
        }

        mBuffer->meta_data().setInt64(
                kKeyTime, ((int64_t)cts * 1000000) / mTimescale);
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ enum {
    kKeyMaxHeight         = 'maxH',
    kKeyThumbnailTime     = 'thbT',  // int64_t (usecs)
    kKeyTrackID           = 'trID',
    kKeyIsDRM             = 'idrm',  // int32_t (bool)
    kKeyEncoderDelay      = 'encd',  // int32_t (frames)
    kKeyEncoderPadding    = 'encp',  // int32_t (frames)

+0 −6
Original line number Diff line number Diff line
@@ -276,12 +276,6 @@ status_t StagefrightMetadataRetriever::getFrameInternal(
        return NO_INIT;
    }

    int32_t drm = 0;
    if (fileMeta->findInt32(kKeyIsDRM, &drm) && drm != 0) {
        ALOGE("frame grab not allowed.");
        return ERROR_DRM_UNKNOWN;
    }

    size_t n = mExtractor->countTracks();
    size_t i;
    for (i = 0; i < n; ++i) {