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

Commit 5895e970 authored by Gloria Wang's avatar Gloria Wang Committed by Android (Google) Code Review
Browse files

Merge "- Retrieve is_drm in MediaMetadataRetriever. - Add one more column in...

Merge "- Retrieve is_drm in MediaMetadataRetriever. - Add one more column in MediaStore to indicate whether a   media file is drm-protected. - Remove old DRM code from Ringtone - Use the new DRM code in RingtoneManager"
parents d26edf94 0d0edfb0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ enum {
    METADATA_KEY_VIDEO_HEIGHT    = 19,
    METADATA_KEY_BITRATE         = 20,
    METADATA_KEY_TIMED_TEXT_LANGUAGES      = 21,
    METADATA_KEY_IS_DRM          = 22,

    // Add more here...
};
+8 −1
Original line number Diff line number Diff line
@@ -56,7 +56,12 @@ public:
    virtual uint32_t flags() const;

    // for DRM
    virtual void setDrmFlag(bool flag) {};
    virtual void setDrmFlag(bool flag) {
        mIsDrm = flag;
    };
    virtual bool getDrmFlag() {
        return mIsDrm;
    }
    virtual char* getDrmTrackInfo(size_t trackID, int *len) {
        return NULL;
    }
@@ -66,6 +71,8 @@ protected:
    virtual ~MediaExtractor() {}

private:
    bool mIsDrm;

    MediaExtractor(const MediaExtractor &);
    MediaExtractor &operator=(const MediaExtractor &);
};
+0 −4
Original line number Diff line number Diff line
@@ -387,10 +387,6 @@ status_t MPEG4Extractor::readMetaData() {
    return mInitCheck;
}

void MPEG4Extractor::setDrmFlag(bool flag) {
    mIsDrm = flag;
}

char* MPEG4Extractor::getDrmTrackInfo(size_t trackID, int *len) {
    if (mFirstSINF == NULL) {
        return NULL;
+7 −2
Original line number Diff line number Diff line
@@ -116,8 +116,13 @@ sp<MediaExtractor> MediaExtractor::Create(
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC_ADTS)) {
        ret = new AACExtractor(source);
    }
    if (ret != NULL && isDrm) {
        ret->getMetaData()->setInt32(kKeyIsDRM, 1);

    if (ret != NULL) {
       if (isDrm) {
           ret->setDrmFlag(true);
       } else {
           ret->setDrmFlag(false);
       }
    }

    return ret;
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ status_t StagefrightMediaScanner::processFile(
                { "duration", METADATA_KEY_DURATION },
                { "writer", METADATA_KEY_WRITER },
                { "compilation", METADATA_KEY_COMPILATION },
                { "isdrm", METADATA_KEY_IS_DRM },
            };
            static const size_t kNumEntries = sizeof(kKeyMap) / sizeof(kKeyMap[0]);

Loading