diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/DataSource.h | 8 | ||||
-rw-r--r-- | include/media/stagefright/FileSource.h | 15 | ||||
-rw-r--r-- | include/media/stagefright/MediaErrors.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/MediaExtractor.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/MetaData.h | 2 |
5 files changed, 33 insertions, 0 deletions
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index a3da3ed..d0b9fcd 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -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() {} diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h index 8a215ea..4307263 100644 --- a/include/media/stagefright/FileSource.h +++ b/include/media/stagefright/FileSource.h @@ -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 &); }; diff --git a/include/media/stagefright/MediaErrors.h b/include/media/stagefright/MediaErrors.h index e44122d..6df4d86 100644 --- a/include/media/stagefright/MediaErrors.h +++ b/include/media/stagefright/MediaErrors.h @@ -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 diff --git a/include/media/stagefright/MediaExtractor.h b/include/media/stagefright/MediaExtractor.h index 16b0a4c..a82106e 100644 --- a/include/media/stagefright/MediaExtractor.h +++ b/include/media/stagefright/MediaExtractor.h @@ -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() {} diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index cffcef2..b1a775a 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -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 |