Loading media/libstagefright/MPEG4Writer.cpp +0 −41 Original line number Diff line number Diff line Loading @@ -2436,47 +2436,6 @@ status_t MPEG4Writer::setNextFd(int fd) { return OK; } bool MPEG4Writer::isSampleMetadataValid(size_t trackIndex, int64_t timeUs) { // Track Index starts from zero, so it should be at least 1 less than size. if (trackIndex >= mTracks.size()) { ALOGE("Incorrect trackIndex %zu, mTracks->size() %zu", trackIndex, mTracks.size()); return false; } List<Track *>::iterator it = mTracks.begin(); // (*it) is already pointing to trackIndex 0. for (int i = 1; i <= trackIndex; i++) { it++; } return (*it)->isTimestampValid(timeUs); } bool MPEG4Writer::Track::isTimestampValid(int64_t timeUs) { // No timescale if HEIF if (mIsHeif) { return true; } // Make sure abs(timeUs) does not overflow if (timeUs == INT64_MIN) { return false; } // Ensure that the timeUs value does not have extremely low or high values // that would cause an underflow or overflow, like in the calculation - // mdhdDuration = (trakDurationUs * mTimeScale + 5E5) / 1E6 if (abs(timeUs) >= (INT64_MAX - 5E5) / mTimeScale) { return false; } // Limit check for calculations in ctts box if (abs(timeUs) + kMaxCttsOffsetTimeUs >= INT64_MAX / mTimeScale) { return false; } return true; } bool MPEG4Writer::Track::isExifData( MediaBufferBase *buffer, uint32_t *tiffHdrOffset) const { if (!mIsHeif) { Loading media/libstagefright/include/media/stagefright/MPEG4Writer.h +0 −3 Original line number Diff line number Diff line Loading @@ -77,9 +77,6 @@ public: virtual void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } virtual int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } virtual status_t setNextFd(int fd); // Returns true if the timestamp is valid which is compatible with the Mpeg4. // Note that this overloads that method in the base class. bool isSampleMetadataValid(size_t trackIndex, int64_t timeUs) override; protected: virtual ~MPEG4Writer(); Loading Loading
media/libstagefright/MPEG4Writer.cpp +0 −41 Original line number Diff line number Diff line Loading @@ -2436,47 +2436,6 @@ status_t MPEG4Writer::setNextFd(int fd) { return OK; } bool MPEG4Writer::isSampleMetadataValid(size_t trackIndex, int64_t timeUs) { // Track Index starts from zero, so it should be at least 1 less than size. if (trackIndex >= mTracks.size()) { ALOGE("Incorrect trackIndex %zu, mTracks->size() %zu", trackIndex, mTracks.size()); return false; } List<Track *>::iterator it = mTracks.begin(); // (*it) is already pointing to trackIndex 0. for (int i = 1; i <= trackIndex; i++) { it++; } return (*it)->isTimestampValid(timeUs); } bool MPEG4Writer::Track::isTimestampValid(int64_t timeUs) { // No timescale if HEIF if (mIsHeif) { return true; } // Make sure abs(timeUs) does not overflow if (timeUs == INT64_MIN) { return false; } // Ensure that the timeUs value does not have extremely low or high values // that would cause an underflow or overflow, like in the calculation - // mdhdDuration = (trakDurationUs * mTimeScale + 5E5) / 1E6 if (abs(timeUs) >= (INT64_MAX - 5E5) / mTimeScale) { return false; } // Limit check for calculations in ctts box if (abs(timeUs) + kMaxCttsOffsetTimeUs >= INT64_MAX / mTimeScale) { return false; } return true; } bool MPEG4Writer::Track::isExifData( MediaBufferBase *buffer, uint32_t *tiffHdrOffset) const { if (!mIsHeif) { Loading
media/libstagefright/include/media/stagefright/MPEG4Writer.h +0 −3 Original line number Diff line number Diff line Loading @@ -77,9 +77,6 @@ public: virtual void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } virtual int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } virtual status_t setNextFd(int fd); // Returns true if the timestamp is valid which is compatible with the Mpeg4. // Note that this overloads that method in the base class. bool isSampleMetadataValid(size_t trackIndex, int64_t timeUs) override; protected: virtual ~MPEG4Writer(); Loading