Loading media/libstagefright/CameraSource.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ CameraSource::CameraSource( mNumFramesReceived(0), mLastFrameTimestampUs(0), mStarted(false), mEos(false), mNumFramesEncoded(0), mTimeBetweenFrameCaptureUs(0), mFirstFrameTimeUs(0), Loading Loading @@ -880,6 +881,7 @@ status_t CameraSource::reset() { { Mutex::Autolock autoLock(mLock); mStarted = false; mEos = false; mStopSystemTimeUs = -1; mFrameAvailableCondition.signal(); Loading Loading @@ -1075,7 +1077,7 @@ status_t CameraSource::read( { Mutex::Autolock autoLock(mLock); while (mStarted && mFramesReceived.empty()) { while (mStarted && !mEos && mFramesReceived.empty()) { if (NO_ERROR != mFrameAvailableCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { Loading @@ -1091,6 +1093,9 @@ status_t CameraSource::read( if (!mStarted) { return OK; } if (mFramesReceived.empty()) { return ERROR_END_OF_STREAM; } frame = *mFramesReceived.begin(); mFramesReceived.erase(mFramesReceived.begin()); Loading Loading @@ -1129,6 +1134,8 @@ bool CameraSource::shouldSkipFrameLocked(int64_t timestampUs) { if (mStopSystemTimeUs != -1 && timestampUs >= mStopSystemTimeUs) { ALOGV("Drop Camera frame at %lld stop time: %lld us", (long long)timestampUs, (long long)mStopSystemTimeUs); mEos = true; mFrameAvailableCondition.signal(); return true; } Loading media/libstagefright/include/media/stagefright/CameraSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ protected: int32_t mNumFramesReceived; int64_t mLastFrameTimestampUs; bool mStarted; bool mEos; int32_t mNumFramesEncoded; // Time between capture of two frames. Loading Loading
media/libstagefright/CameraSource.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ CameraSource::CameraSource( mNumFramesReceived(0), mLastFrameTimestampUs(0), mStarted(false), mEos(false), mNumFramesEncoded(0), mTimeBetweenFrameCaptureUs(0), mFirstFrameTimeUs(0), Loading Loading @@ -880,6 +881,7 @@ status_t CameraSource::reset() { { Mutex::Autolock autoLock(mLock); mStarted = false; mEos = false; mStopSystemTimeUs = -1; mFrameAvailableCondition.signal(); Loading Loading @@ -1075,7 +1077,7 @@ status_t CameraSource::read( { Mutex::Autolock autoLock(mLock); while (mStarted && mFramesReceived.empty()) { while (mStarted && !mEos && mFramesReceived.empty()) { if (NO_ERROR != mFrameAvailableCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { Loading @@ -1091,6 +1093,9 @@ status_t CameraSource::read( if (!mStarted) { return OK; } if (mFramesReceived.empty()) { return ERROR_END_OF_STREAM; } frame = *mFramesReceived.begin(); mFramesReceived.erase(mFramesReceived.begin()); Loading Loading @@ -1129,6 +1134,8 @@ bool CameraSource::shouldSkipFrameLocked(int64_t timestampUs) { if (mStopSystemTimeUs != -1 && timestampUs >= mStopSystemTimeUs) { ALOGV("Drop Camera frame at %lld stop time: %lld us", (long long)timestampUs, (long long)mStopSystemTimeUs); mEos = true; mFrameAvailableCondition.signal(); return true; } Loading
media/libstagefright/include/media/stagefright/CameraSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ protected: int32_t mNumFramesReceived; int64_t mLastFrameTimestampUs; bool mStarted; bool mEos; int32_t mNumFramesEncoded; // Time between capture of two frames. Loading