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

Commit 2b488364 authored by James Dong's avatar James Dong
Browse files

Use metadata in video buffers for timelapse video recording by default to eliminate memcpy

bug - 3361771

Change-Id: Ib37ffe4be8edc8708baa76b3507b6f11372536d9
parent de16890e
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -1229,25 +1229,13 @@ status_t StagefrightRecorder::setupVideoEncoder(
    }
    if (mVideoEncoderLevel != -1) {
        enc_meta->setInt32(kKeyVideoLevel, mVideoEncoderLevel);
    } else if (mCaptureTimeLapse) {
        // Check if we are using high resolution and/or high bitrate and
        // set appropriate level for the software AVCEncoder.
        if ((width * height >= 921600) // 720p
                || (videoBitRate >= 20000000)) {
            enc_meta->setInt32(kKeyVideoLevel, OMX_VIDEO_AVCLevel5);
        }
    }

    OMXClient client;
    CHECK_EQ(client.connect(), OK);

    // Use software codec for time lapse
    uint32_t encoder_flags = 0;
    if (mCaptureTimeLapse) {
        // Do not use software encoder for timelapse for now
        // It is _very_ slow and the preview appears sluggish
        //encoder_flags |= OMXCodec::kPreferSoftwareCodecs;
    } else if (mIsMetaDataStoredInVideoBuffers) {
    if (mIsMetaDataStoredInVideoBuffers) {
        encoder_flags |= OMXCodec::kHardwareCodecsOnly;
        encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
    }
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ CameraSourceTimeLapse::CameraSourceTimeLapse(
        int32_t videoFrameRate,
        const sp<Surface>& surface,
        int64_t timeBetweenTimeLapseFrameCaptureUs)
    : CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, false),
    : CameraSource(camera, cameraId, videoSize, videoFrameRate, surface, true),
      mTimeBetweenTimeLapseFrameCaptureUs(timeBetweenTimeLapseFrameCaptureUs),
      mTimeBetweenTimeLapseVideoFramesUs(1E6/videoFrameRate),
      mLastTimeLapseFrameRealTimestampUs(0),