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

Commit 63299c03 authored by James Dong's avatar James Dong
Browse files

Interleave the audio and video by default

- default interleave duration is set to 1 second

This can dramatically reduce the memory usage
by the MP4 file writer.

Change-Id: Ia3ff202cabfcd2d3f183065d31e4596617c2dded
parent 53d4e0d5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -981,8 +981,10 @@ status_t StagefrightRecorder::startMPEG4Recording() {
        totalBitRate += mVideoBitRate;
    }

    if (mInterleaveDurationUs > 0) {
        reinterpret_cast<MPEG4Writer *>(writer.get())->
            setInterleaveDuration(mInterleaveDurationUs);
    }

    if (mMaxFileDurationUs != 0) {
        writer->setMaxFileDuration(mMaxFileDurationUs);
+2 −2
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ MPEG4Writer::MPEG4Writer(const char *filename)
      mOffset(0),
      mMdatOffset(0),
      mEstimatedMoovBoxSize(0),
      mInterleaveDurationUs(500000) {
      mInterleaveDurationUs(1000000) {
    CHECK(mFile != NULL);
}

@@ -157,7 +157,7 @@ MPEG4Writer::MPEG4Writer(int fd)
      mOffset(0),
      mMdatOffset(0),
      mEstimatedMoovBoxSize(0),
      mInterleaveDurationUs(500000) {
      mInterleaveDurationUs(1000000) {
    CHECK(mFile != NULL);
}