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

Commit 354db505 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "External Camera: more CTS fix"

parents d0bd4f11 fb1c1543
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ const std::array<uint32_t, /*size*/1> kSupportedFourCCs {{
//       Also make sure that can be done without editing source code

// TODO: b/72261675: make it dynamic since this affects memory usage
const int kMaxJpegSize = {13 * 1024 * 1024};  // 13MB
const int kMaxJpegSize = {5 * 1024 * 1024};  // 5MB
} // anonymous namespace

ExternalCameraDevice::ExternalCameraDevice(const std::string& cameraId) :
+9 −6
Original line number Diff line number Diff line
@@ -1681,6 +1681,7 @@ Status ExternalCameraDeviceSession::configureStreams(
        switch (config.streams[i].format) {
            case PixelFormat::BLOB:
            case PixelFormat::YCBCR_420_888:
            case PixelFormat::YV12: // Used by SurfaceTexture
                // No override
                out->streams[i].v3_2.overrideFormat = config.streams[i].format;
                break;
@@ -1693,7 +1694,7 @@ Status ExternalCameraDeviceSession::configureStreams(
                mStreamMap[config.streams[i].id].format = out->streams[i].v3_2.overrideFormat;
                break;
            default:
                ALOGE("%s: unsupported format %x", __FUNCTION__, config.streams[i].format);
                ALOGE("%s: unsupported format 0x%x", __FUNCTION__, config.streams[i].format);
                return Status::ILLEGAL_ARGUMENT;
        }
    }
@@ -1847,15 +1848,14 @@ status_t ExternalCameraDeviceSession::fillCaptureResult(
    const uint8_t ae_lock = ANDROID_CONTROL_AE_LOCK_OFF;
    UPDATE(md, ANDROID_CONTROL_AE_LOCK, &ae_lock, 1);


    // TODO: b/72261912 AF should stay LOCKED until cancel is seen
    bool afTrigger = false;
    bool afTrigger = mAfTrigger;
    if (md.exists(ANDROID_CONTROL_AF_TRIGGER)) {
        Mutex::Autolock _l(mLock);
        camera_metadata_entry entry = md.find(ANDROID_CONTROL_AF_TRIGGER);
        if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_START) {
            afTrigger = true;
            mAfTrigger = afTrigger = true;
        } else if (entry.data.u8[0] == ANDROID_CONTROL_AF_TRIGGER_CANCEL) {
            afTrigger = false;
            mAfTrigger = afTrigger = false;
        }
    }

@@ -1885,6 +1885,9 @@ status_t ExternalCameraDeviceSession::fillCaptureResult(
        return -EINVAL;
    }

    const uint8_t flashState = ANDROID_FLASH_STATE_UNAVAILABLE;
    UPDATE(md, ANDROID_FLASH_STATE, &flashState, 1);

    // android.scaler
    const int32_t crop_region[] = {
          active_array_size.data.i32[0], active_array_size.data.i32[1],
+2 −0
Original line number Diff line number Diff line
@@ -359,6 +359,8 @@ protected:
    // Stream ID -> circulating buffers map
    std::map<int, CirculatingBuffers> mCirculatingBuffers;

    bool mAfTrigger = false;

    static HandleImporter sHandleImporter;

    /* Beginning of members not changed after initialize() */