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

Commit 56da4ce4 authored by Hangyu Kuang's avatar Hangyu Kuang Committed by Android (Google) Code Review
Browse files

Merge "media: Support muxing multiple video and audio tracks."

parents dfe84776 bda05437
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -97,8 +97,6 @@ private:
    int64_t mStartTimestampUs;
    int mLatitudex10000;
    int mLongitudex10000;
    bool mHasAudioTrack;
    bool mHasVideoTrack;
    bool mAreGeoTagsAvailable;
    int32_t mStartTimeOffsetMs;

+0 −18
Original line number Diff line number Diff line
@@ -435,8 +435,6 @@ MPEG4Writer::MPEG4Writer(int fd)
      mStartTimestampUs(-1ll),
      mLatitudex10000(0),
      mLongitudex10000(0),
      mHasAudioTrack(false),
      mHasVideoTrack(false),
      mAreGeoTagsAvailable(false),
      mStartTimeOffsetMs(-1),
      mMetaKeys(new AMessage()) {
@@ -540,22 +538,6 @@ status_t MPEG4Writer::addSource(const sp<IMediaSource> &source) {
    const char *mime;
    source->getFormat()->findCString(kKeyMIMEType, &mime);

    if (!strncasecmp(mime, "audio/", 6)) {
        if (mHasAudioTrack) {
            ALOGE("At most one audio track can be added");
            return ERROR_UNSUPPORTED;
        }
        mHasAudioTrack = true;
    }

    if (!strncasecmp(mime, "video/", 6)) {
        if (mHasVideoTrack) {
            ALOGE("At most one video track can be added");
            return ERROR_UNSUPPORTED;
        }
        mHasVideoTrack = true;
    }

    if (Track::getFourCCForMime(mime) == NULL) {
        ALOGE("Unsupported mime '%s'", mime);
        return ERROR_UNSUPPORTED;