We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a81fe3b + 8312278 commit b335a5aCopy full SHA for b335a5a
media/libstagefright/CameraSource.cpp
@@ -635,6 +635,12 @@ status_t CameraSource::stop() {
635
mStarted = false;
636
mFrameAvailableCondition.signal();
637
638
+ int64_t token;
639
+ bool isTokenValid = false;
640
+ if (mCamera != 0) {
641
+ token = IPCThreadState::self()->clearCallingIdentity();
642
+ isTokenValid = true;
643
+ }
644
releaseQueuedFrames();
645
while (!mFramesBeingEncoded.empty()) {
646
if (NO_ERROR !=
@@ -645,6 +651,9 @@ status_t CameraSource::stop() {
651
}
652
stopCameraRecording();
647
653
releaseCamera();
654
+ if (isTokenValid) {
655
+ IPCThreadState::self()->restoreCallingIdentity(token);
656
648
657
649
658
if (mCollectStats) {
650
659
LOGI("Frames received/encoded/dropped: %d/%d/%d in %lld us",
0 commit comments