summaryrefslogtreecommitdiffstats
path: root/cmds/screenrecord/Overlay.cpp
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2013-11-19 12:50:17 -0800
committerAndy McFadden <fadden@android.com>2013-11-19 13:02:25 -0800
commit7a66622c2c9250ce4ad0091195331ce4cb91a63d (patch)
tree1a521a9c8acf7d555052fc6e9e21ff22178d703f /cmds/screenrecord/Overlay.cpp
parent432600c1688d35087123303a6737603ec62ce5d5 (diff)
downloadframeworks_av-7a66622c2c9250ce4ad0091195331ce4cb91a63d.zip
frameworks_av-7a66622c2c9250ce4ad0091195331ce4cb91a63d.tar.gz
frameworks_av-7a66622c2c9250ce4ad0091195331ce4cb91a63d.tar.bz2
screenrecord fixes
Fixes to issues identified during code review. Change-Id: I2203694acb5c0544878f64f4347d29ad1a0725c4
Diffstat (limited to 'cmds/screenrecord/Overlay.cpp')
-rw-r--r--cmds/screenrecord/Overlay.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/screenrecord/Overlay.cpp b/cmds/screenrecord/Overlay.cpp
index f2d8b59..96e25b8 100644
--- a/cmds/screenrecord/Overlay.cpp
+++ b/cmds/screenrecord/Overlay.cpp
@@ -28,6 +28,7 @@
#include <GLES2/gl2ext.h>
#include <stdlib.h>
+#include <assert.h>
#include "screenrecord.h"
#include "Overlay.h"
@@ -66,10 +67,11 @@ status_t Overlay::start(const sp<IGraphicBufferProducer>& outputSurface,
mStartMonotonicNsecs = systemTime(CLOCK_MONOTONIC);
mStartRealtimeNsecs = systemTime(CLOCK_REALTIME);
+ Mutex::Autolock _l(mMutex);
+
// Start the thread. Traffic begins immediately.
run("overlay");
- Mutex::Autolock _l(mMutex);
mState = INIT;
while (mState == INIT) {
mStartCond.wait(mMutex);
@@ -79,7 +81,7 @@ status_t Overlay::start(const sp<IGraphicBufferProducer>& outputSurface,
ALOGE("Failed to start overlay thread: err=%d", mThreadResult);
return mThreadResult;
}
- assert(mState == READY);
+ assert(mState == RUNNING);
ALOGV("Overlay::start successful");
*pBufferProducer = mBufferQueue;