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

Commit f6e3b6d3 authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am 5fb60c7a: Use metadata in video buffers for timelapse video recording by...

am 5fb60c7a: Use metadata in video buffers for timelapse video recording by default to eliminate memcpy

* commit '5fb60c7af2cbf59a99ae324c4284c7860b37c723':
  Use metadata in video buffers for timelapse video recording by default to eliminate memcpy
parents a2aba71b 2b488364
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),