summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-06-22 11:07:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-22 11:07:52 -0700
commit032897470aa5df2400996ffa5d26a937803ea446 (patch)
treed4ef843f8de4be7b4f553aa53466a953aa4c52dd /media
parent0f5d8441ef3ee88855df71b15d81f4c14f12d63d (diff)
parent839ba2c1834d125a27bbc8d9a85bcaa735894094 (diff)
downloadframeworks_base-032897470aa5df2400996ffa5d26a937803ea446.zip
frameworks_base-032897470aa5df2400996ffa5d26a937803ea446.tar.gz
frameworks_base-032897470aa5df2400996ffa5d26a937803ea446.tar.bz2
Merge "Add some error log messages to indicate the failure of a recording session"
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MPEG4Writer.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index ea9911c..f075699 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -205,6 +205,8 @@ private:
// Duration is time scale based
void addOneSttsTableEntry(size_t sampleCount, int32_t timescaledDur);
void addOneCttsTableEntry(size_t sampleCount, int32_t timescaledDur);
+
+ bool isTrackMalFormed() const;
void sendTrackSummary(bool hasMultipleTracks);
// Write the boxes
@@ -1975,7 +1977,6 @@ status_t MPEG4Writer::Track::threadEntry() {
}
CHECK(timestampUs >= 0);
-
LOGV("%s media time stamp: %lld and previous paused duration %lld",
mIsAudio? "Audio": "Video", timestampUs, previousPausedDurationUs);
if (timestampUs > mTrackDurationUs) {
@@ -2082,11 +2083,10 @@ status_t MPEG4Writer::Track::threadEntry() {
}
- if (mSampleSizes.empty() || // no samples written
- (!mIsAudio && mNumStssTableEntries == 0) || // no sync frames for video
- (OK != checkCodecSpecificData())) { // no codec specific data
+ if (isTrackMalFormed()) {
err = ERROR_MALFORMED;
}
+
mOwner->trackProgressStatus(mTrackId, -1, err);
// Last chunk
@@ -2136,6 +2136,24 @@ status_t MPEG4Writer::Track::threadEntry() {
return err;
}
+bool MPEG4Writer::Track::isTrackMalFormed() const {
+ if (mSampleSizes.empty()) { // no samples written
+ LOGE("The number of recorded samples is 0");
+ return true;
+ }
+
+ if (!mIsAudio && mNumStssTableEntries == 0) { // no sync frames for video
+ LOGE("There are no sync frames for video track");
+ return true;
+ }
+
+ if (OK != checkCodecSpecificData()) { // no codec specific data
+ return true;
+ }
+
+ return false;
+}
+
void MPEG4Writer::Track::sendTrackSummary(bool hasMultipleTracks) {
// Send track summary only if test mode is enabled.