summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/CameraSource.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-06-03 17:21:16 -0700
committerJames Dong <jdong@google.com>2011-06-03 17:21:16 -0700
commit98cfde007490a5903b729a4718c0dada755ae8f8 (patch)
tree18fa8669249822af188837d7bcec18a80ae55cd2 /media/libstagefright/CameraSource.cpp
parent158b194da537c18a6ad1d7ef3cd63c87b2310269 (diff)
downloadframeworks_av-98cfde007490a5903b729a4718c0dada755ae8f8.zip
frameworks_av-98cfde007490a5903b729a4718c0dada755ae8f8.tar.gz
frameworks_av-98cfde007490a5903b729a4718c0dada755ae8f8.tar.bz2
Add timestamp and data pointer checks in CameraSource
Change-Id: I99e188f631df2257813aa7ec657d6ecfc8859d9e
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rw-r--r--media/libstagefright/CameraSource.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index a1f04d3..61bb2a8 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -701,12 +701,11 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs,
return;
}
- if (mNumFramesReceived > 0 &&
- timestampUs - mLastFrameTimestampUs > mGlitchDurationThresholdUs) {
- if (mNumGlitches % 10 == 0) { // Don't spam the log
- LOGV("Long delay detected in video recording");
+ if (mNumFramesReceived > 0) {
+ CHECK(timestampUs > mLastFrameTimestampUs);
+ if (timestampUs - mLastFrameTimestampUs > mGlitchDurationThresholdUs) {
+ ++mNumGlitches;
}
- ++mNumGlitches;
}
// May need to skip frame or modify timestamp. Currently implemented
@@ -732,6 +731,7 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs,
}
++mNumFramesReceived;
+ CHECK(data != NULL && data->size() > 0);
mFramesReceived.push_back(data);
int64_t timeUs = mStartTimeUs + (timestampUs - mFirstFrameTimeUs);
mFrameTimes.push_back(timeUs);