Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d6e14bb authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4922203 from 29ac15a4 to pi-qpr1-release

Change-Id: Ifb531ae022888d23d3dd8f828193a018ccc42006
parents 96d34e01 29ac15a4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ CameraSource::CameraSource(
      mNumFramesReceived(0),
      mLastFrameTimestampUs(0),
      mStarted(false),
      mEos(false),
      mNumFramesEncoded(0),
      mTimeBetweenFrameCaptureUs(0),
      mFirstFrameTimeUs(0),
@@ -880,6 +881,7 @@ status_t CameraSource::reset() {
    {
        Mutex::Autolock autoLock(mLock);
        mStarted = false;
        mEos = false;
        mStopSystemTimeUs = -1;
        mFrameAvailableCondition.signal();

@@ -1075,7 +1077,7 @@ status_t CameraSource::read(

    {
        Mutex::Autolock autoLock(mLock);
        while (mStarted && mFramesReceived.empty()) {
        while (mStarted && !mEos && mFramesReceived.empty()) {
            if (NO_ERROR !=
                mFrameAvailableCondition.waitRelative(mLock,
                    mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) {
@@ -1091,6 +1093,9 @@ status_t CameraSource::read(
        if (!mStarted) {
            return OK;
        }
        if (mFramesReceived.empty()) {
            return ERROR_END_OF_STREAM;
        }
        frame = *mFramesReceived.begin();
        mFramesReceived.erase(mFramesReceived.begin());

@@ -1129,6 +1134,8 @@ bool CameraSource::shouldSkipFrameLocked(int64_t timestampUs) {
    if (mStopSystemTimeUs != -1 && timestampUs >= mStopSystemTimeUs) {
        ALOGV("Drop Camera frame at %lld  stop time: %lld us",
                (long long)timestampUs, (long long)mStopSystemTimeUs);
        mEos = true;
        mFrameAvailableCondition.signal();
        return true;
    }

+9 −0
Original line number Diff line number Diff line
@@ -475,7 +475,16 @@ nsecs_t VideoFrameScheduler::schedule(nsecs_t renderTime) {
                nextVsyncTime += mVsyncPeriod;
                if (vsyncsForLastFrame < ULONG_MAX)
                    ++vsyncsForLastFrame;
            } else if (mTimeCorrection < -correctionLimit * 2
                    || mTimeCorrection > correctionLimit * 2) {
                ALOGW("correction beyond limit: %lld vs %lld (vsyncs for last frame: %zu, min: %zu)"
                        " restarting. render=%lld",
                        (long long)mTimeCorrection, (long long)correctionLimit,
                        vsyncsForLastFrame, minVsyncsPerFrame, (long long)origRenderTime);
                restart();
                return origRenderTime;
            }

            ATRACE_INT("FRAME_VSYNCS", vsyncsForLastFrame);
        }
        mLastVsyncTime = nextVsyncTime;
+1 −0
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ protected:
    int32_t mNumFramesReceived;
    int64_t mLastFrameTimestampUs;
    bool mStarted;
    bool mEos;
    int32_t mNumFramesEncoded;

    // Time between capture of two frames.
+4 −6
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#define LOG_TAG "APM::SessionRoute"
#define LOG_TAG "APM_SessionRoute"
//#define LOG_NDEBUG 0

#include "SessionRoute.h"
@@ -122,19 +122,17 @@ void SessionRouteMap::addRoute(audio_session_t session,
audio_devices_t SessionRouteMap::getActiveDeviceForStream(audio_stream_type_t streamType,
                                                          const DeviceVector& availableDevices)
{
    audio_devices_t device = AUDIO_DEVICE_NONE;

    for (size_t index = 0; index < size(); index++) {
        sp<SessionRoute> route = valueAt(index);
        if (streamType == route->mStreamType && route->isActiveOrChanged()
                && route->mDeviceDescriptor != 0) {
            device = route->mDeviceDescriptor->type();
            audio_devices_t device = route->mDeviceDescriptor->type();
            if (!availableDevices.getDevicesFromType(device).isEmpty()) {
                break;
                return device;
            }
        }
    }
    return device;
    return AUDIO_DEVICE_NONE;
}

} // namespace android