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

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

Merge "resolved conflicts for merge of 9084631d to gingerbread-plus-aosp" into...

Merge "resolved conflicts for merge of 9084631d to gingerbread-plus-aosp" into gingerbread-plus-aosp
parents 96bdc500 b8791479
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <utils/List.h>
#include <utils/RefBase.h>
#include <utils/threads.h>
#include <drm/DrmManagerClient.h>

namespace android {

@@ -73,6 +74,13 @@ public:
    static void RegisterSniffer(SnifferFunc func);
    static void RegisterDefaultSniffers();

    // for DRM
    virtual DecryptHandle* DrmInitialization(DrmManagerClient *client) {
        return NULL;
    }
    virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client) {};


protected:
    virtual ~DataSource() {}

+15 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaErrors.h>
#include <utils/threads.h>
#include <drm/DrmManagerClient.h>

namespace android {

@@ -37,15 +38,29 @@ public:

    virtual status_t getSize(off_t *size);

    virtual DecryptHandle* DrmInitialization(DrmManagerClient *client);

    virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client);

protected:
    virtual ~FileSource();

private:
    FILE *mFile;
    int mFd;
    int64_t mOffset;
    int64_t mLength;
    Mutex mLock;

    /*for DRM*/
    DecryptHandle *mDecryptHandle;
    DrmManagerClient *mDrmManagerClient;
    int64_t mDrmBufOffset;
    int64_t mDrmBufSize;
    unsigned char *mDrmBuf;

    ssize_t readAtDRM(off_t offset, void *data, size_t size);

    FileSource(const FileSource &);
    FileSource &operator=(const FileSource &);
};
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ enum {
    // Not technically an error.
    INFO_FORMAT_CHANGED    = MEDIA_ERROR_BASE - 12,
    INFO_DISCONTINUITY     = MEDIA_ERROR_BASE - 13,

    ERROR_NO_LICENSE       = MEDIA_ERROR_BASE - 14,
};

}  // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ public:
    // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE
    virtual uint32_t flags() const;

    // for DRM
    virtual void setDrmFlag(bool flag) {};
    virtual char* getDrmTrackInfo(size_t trackID, int *len) {
        return NULL;
    }

protected:
    MediaExtractor() {}
    virtual ~MediaExtractor() {}
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ enum {
    kKeyBufferID          = 'bfID',
    kKeyMaxInputSize      = 'inpS',
    kKeyThumbnailTime     = 'thbT',  // int64_t (usecs)
    kKeyTrackID           = 'trID',
    kKeyIsDRM             = 'idrm',  // int32_t (bool)

    kKeyAlbum             = 'albu',  // cstring
    kKeyArtist            = 'arti',  // cstring
Loading