summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-06-20 21:50:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-20 00:30:35 +0000
commitfcd58351b6d7fcd62a0fe65b425723dd53d10e5e (patch)
tree246a38dd5fa0bb0bc70619436ad6b3d0c8c1baf0
parent50468413251bd92a1cdf9de8275a994dab8648d1 (diff)
parent60800208d31bc5a0770c3acb4f7df53c6bb1ac39 (diff)
downloadframeworks_av-fcd58351b6d7fcd62a0fe65b425723dd53d10e5e.zip
frameworks_av-fcd58351b6d7fcd62a0fe65b425723dd53d10e5e.tar.gz
frameworks_av-fcd58351b6d7fcd62a0fe65b425723dd53d10e5e.tar.bz2
Merge "Camera2/3: Don't release recording buffer when stream is active"
-rw-r--r--services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
index 2064e2c..99abced 100644
--- a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
+++ b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
@@ -430,10 +430,13 @@ status_t StreamingProcessor::startStream(StreamType type,
Mutex::Autolock m(mMutex);
- // If a recording stream is being started up, free up any
- // outstanding buffers left from the previous recording session.
- // There should never be any, so if there are, warn about it.
- if (isStreamActive(outputStreams, mRecordingStreamId)) {
+ // If a recording stream is being started up and no recording
+ // stream is active yet, free up any outstanding buffers left
+ // from the previous recording session. There should never be
+ // any, so if there are, warn about it.
+ bool isRecordingStreamIdle = !isStreamActive(mActiveStreamIds, mRecordingStreamId);
+ bool startRecordingStream = isStreamActive(outputStreams, mRecordingStreamId);
+ if (startRecordingStream && isRecordingStreamIdle) {
releaseAllRecordingFramesLocked();
}