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

Commit fb5a2d73 authored by Nipun Kwatra's avatar Nipun Kwatra
Browse files

Checks for auxiliary video recording.

- Check that time lapse mode is on when using auxiliary video recording.
- Check that auxiliary video size is strictly less than the main video
  size.

Change-Id: Ic49d25e6ac30f6f885ce4f5fb38dbe0cc7bc1be1
parent 4922c795
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1193,8 +1193,6 @@ status_t StagefrightRecorder::setupMPEG4Recording(
        }
        if ((videoWidth != mVideoWidth) || (videoHeight != mVideoHeight)) {
            // Use downsampling from the original source.
            CHECK(videoWidth <= mVideoWidth);
            CHECK(videoHeight <= mVideoHeight);
            cameraMediaSource =
                new VideoSourceDownSampler(cameraMediaSource, videoWidth, videoHeight);
        }
@@ -1244,6 +1242,10 @@ void StagefrightRecorder::setupMPEG4MetaData(int64_t startTimeUs, int32_t totalB

status_t StagefrightRecorder::startMPEG4Recording() {
    if (mCaptureAuxVideo) {
        if (!mCaptureTimeLapse) {
            LOGE("Auxiliary video can be captured only in time lapse mode");
            return UNKNOWN_ERROR;
        }
        LOGV("Creating MediaSourceSplitter");
        sp<CameraSource> cameraSource;
        status_t err = setupCameraSource(&cameraSource);
@@ -1278,6 +1280,12 @@ status_t StagefrightRecorder::startMPEG4Recording() {
            LOGE("Auxiliary File writer is not avaialble");
            return UNKNOWN_ERROR;
        }
        if ((mAuxVideoWidth > mVideoWidth) || (mAuxVideoHeight > mVideoHeight) ||
                ((mAuxVideoWidth == mVideoWidth) && mAuxVideoHeight == mVideoHeight)) {
            LOGE("Auxiliary video size (%d x %d) same or larger than the main video size (%d x %d)",
                    mAuxVideoWidth, mAuxVideoHeight, mVideoWidth, mVideoHeight);
            return UNKNOWN_ERROR;
        }

        int32_t totalBitrateAux;
        err = setupMPEG4Recording(mCaptureAuxVideo,