mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Increase frame counters in the same critical section am: 928a4535c8 am: a343d0cf0c am: c070b5a14b am: 55baee93d6 am: e0868c4484 am: ca64f5b140 am: 9e8d44aba4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2594993 Change-Id: Ia4e04c19819fc41faf8387369f30411e95290612 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -133,6 +133,9 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) {
|
|||||||
// Local flag we use to keep track of when the stream is stopping
|
// Local flag we use to keep track of when the stream is stopping
|
||||||
bool timeToStop = false;
|
bool timeToStop = false;
|
||||||
|
|
||||||
|
// Another local flag telling whether or not current frame is displayed.
|
||||||
|
bool frameDisplayed = false;
|
||||||
|
|
||||||
if (bufferArg.memHandle.getNativeHandle() == nullptr) {
|
if (bufferArg.memHandle.getNativeHandle() == nullptr) {
|
||||||
// Signal that the last frame has been received and the stream is stopped
|
// Signal that the last frame has been received and the stream is stopped
|
||||||
timeToStop = true;
|
timeToStop = true;
|
||||||
@@ -172,9 +175,7 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) {
|
|||||||
} else {
|
} else {
|
||||||
// Everything looks good!
|
// Everything looks good!
|
||||||
// Keep track so tests or watch dogs can monitor progress
|
// Keep track so tests or watch dogs can monitor progress
|
||||||
mLock.lock();
|
frameDisplayed = true;
|
||||||
mFramesDisplayed++;
|
|
||||||
mLock.unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,12 +198,15 @@ Return<void> FrameHandler::deliverFrame(const BufferDesc& bufferArg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update our received frame count and notify anybody who cares that things have changed
|
// Update frame counters and notify anybody who cares that things have changed.
|
||||||
mLock.lock();
|
mLock.lock();
|
||||||
if (timeToStop) {
|
if (timeToStop) {
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
} else {
|
} else {
|
||||||
mFramesReceived++;
|
mFramesReceived++;
|
||||||
|
if (frameDisplayed) {
|
||||||
|
mFramesDisplayed++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mLock.unlock();
|
mLock.unlock();
|
||||||
mSignal.notify_all();
|
mSignal.notify_all();
|
||||||
|
|||||||
Reference in New Issue
Block a user