diff options
author | James Dong <jdong@google.com> | 2010-11-16 14:04:54 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-11-18 14:12:24 -0800 |
commit | b1262a8b1dd23abad64465f9ffd25c44facdf4d2 (patch) | |
tree | cd19da06f0cc2c92ec35e1086d126c3546cc5584 /include | |
parent | 83ed1ae073556f4971bf8f3a5cbcd2d37e1dd2bb (diff) | |
download | frameworks_base-b1262a8b1dd23abad64465f9ffd25c44facdf4d2.zip frameworks_base-b1262a8b1dd23abad64465f9ffd25c44facdf4d2.tar.gz frameworks_base-b1262a8b1dd23abad64465f9ffd25c44facdf4d2.tar.bz2 |
64-bit file size/offset support for media framework
Change-Id: I3452bc2c0f1d990cc67285df2fce1f9f86ff8e10
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/AMRWriter.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/DataSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/FileSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/JPEGSource.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/MPEG4Writer.h | 15 |
5 files changed, 17 insertions, 15 deletions
diff --git a/include/media/stagefright/AMRWriter.h b/include/media/stagefright/AMRWriter.h index aa965e1..d8410a9 100644 --- a/include/media/stagefright/AMRWriter.h +++ b/include/media/stagefright/AMRWriter.h @@ -45,6 +45,7 @@ protected: private: FILE *mFile; + int mFd; status_t mInitCheck; sp<MediaSource> mSource; bool mStarted; diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 27f33fb..d4f1733 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -48,13 +48,13 @@ public: virtual status_t initCheck() const = 0; - virtual ssize_t readAt(off_t offset, void *data, size_t size) = 0; + virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; // Convenience methods: - bool getUInt16(off_t offset, uint16_t *x); + bool getUInt16(off64_t offset, uint16_t *x); // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off_t *size); + virtual status_t getSize(off64_t *size); virtual uint32_t flags() { return 0; diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h index 4307263..a7f7181 100644 --- a/include/media/stagefright/FileSource.h +++ b/include/media/stagefright/FileSource.h @@ -34,9 +34,9 @@ public: virtual status_t initCheck() const; - virtual ssize_t readAt(off_t offset, void *data, size_t size); + virtual ssize_t readAt(off64_t offset, void *data, size_t size); - virtual status_t getSize(off_t *size); + virtual status_t getSize(off64_t *size); virtual DecryptHandle* DrmInitialization(DrmManagerClient *client); @@ -59,7 +59,7 @@ private: int64_t mDrmBufSize; unsigned char *mDrmBuf; - ssize_t readAtDRM(off_t offset, void *data, size_t size); + ssize_t readAtDRM(off64_t offset, void *data, size_t size); FileSource(const FileSource &); FileSource &operator=(const FileSource &); diff --git a/include/media/stagefright/JPEGSource.h b/include/media/stagefright/JPEGSource.h index 9d0a700..1b7e91b 100644 --- a/include/media/stagefright/JPEGSource.h +++ b/include/media/stagefright/JPEGSource.h @@ -42,9 +42,9 @@ private: sp<DataSource> mSource; MediaBufferGroup *mGroup; bool mStarted; - off_t mSize; + off64_t mSize; int32_t mWidth, mHeight; - off_t mOffset; + off64_t mOffset; status_t parseJPEG(); diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h index 7bf07eb..e6d8a26 100644 --- a/include/media/stagefright/MPEG4Writer.h +++ b/include/media/stagefright/MPEG4Writer.h @@ -62,19 +62,20 @@ private: class Track; FILE *mFile; + int mFd; bool mUse4ByteNalLength; bool mUse32BitOffset; bool mIsFileSizeLimitExplicitlyRequested; bool mPaused; bool mStarted; - off_t mOffset; + off64_t mOffset; off_t mMdatOffset; uint8_t *mMoovBoxBuffer; - off_t mMoovBoxBufferOffset; + off64_t mMoovBoxBufferOffset; bool mWriteMoovBoxToMemory; - off_t mFreeBoxOffset; + off64_t mFreeBoxOffset; bool mStreamableFile; - off_t mEstimatedMoovBoxSize; + off64_t mEstimatedMoovBoxSize; uint32_t mInterleaveDurationUs; int32_t mTimeScale; int64_t mStartTimestampUs; @@ -83,7 +84,7 @@ private: List<Track *> mTracks; - List<off_t> mBoxes; + List<off64_t> mBoxes; void setStartTimestampUs(int64_t timeUs); int64_t getStartTimestampUs(); // Not const @@ -145,8 +146,8 @@ private: void unlock(); // Acquire lock before calling these methods - off_t addSample_l(MediaBuffer *buffer); - off_t addLengthPrefixedSample_l(MediaBuffer *buffer); + off64_t addSample_l(MediaBuffer *buffer); + off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); inline size_t write(const void *ptr, size_t size, size_t nmemb, FILE* stream); bool exceedsFileSizeLimit(); |