diff options
author | Andy McFadden <fadden@android.com> | 2013-11-19 12:50:17 -0800 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2013-12-11 13:00:53 -0800 |
commit | 0c98f99cb8207ff5b08e33da4b7e024312c5d9c9 (patch) | |
tree | 4e92be58b828cf02e72e53020e4b88370ae01058 /cmds/screenrecord/Overlay.cpp | |
parent | aaa3f358410701710e31f31de62f0b4521989661 (diff) | |
download | frameworks_av-0c98f99cb8207ff5b08e33da4b7e024312c5d9c9.zip frameworks_av-0c98f99cb8207ff5b08e33da4b7e024312c5d9c9.tar.gz frameworks_av-0c98f99cb8207ff5b08e33da4b7e024312c5d9c9.tar.bz2 |
screenrecord fixes
Fixes to issues identified during code review.
(cherry-pick from I2203694acb5c0544878f64f4347d29ad1a0725c4)
Change-Id: I58fcb5264fc17b26fac4b03f95d35262e9e199e2
Diffstat (limited to 'cmds/screenrecord/Overlay.cpp')
-rw-r--r-- | cmds/screenrecord/Overlay.cpp | 6 |
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; |