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

Commit cd6bc8c0 authored by Andrew Lewis's avatar Andrew Lewis Committed by Automerger Merge Worker
Browse files

Merge "Add Dolby Vision branding info into MPEG-4 ftyp box" into main am:...

Merge "Add Dolby Vision branding info into MPEG-4 ftyp box" into main am: 0e7c9f3d am: eb573246 am: 182d56fb

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2550270



Change-Id: I339d07f75008322b14af931830fb9ce937d314a8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8ac3068d 182d56fb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -567,6 +567,7 @@ void MPEG4Writer::initInternal(int fd, bool isFirstSession) {
    mDone = false;
    mThread = 0;
    mDriftTimeUs = 0;
    mHasDolbyVision = false;

    // Following variables only need to be set for the first recording session.
    // And they will stay the same for all the recording sessions.
@@ -714,6 +715,7 @@ status_t MPEG4Writer::addSource(const sp<MediaSource> &source) {
        // So we let the creation of the new track now and
        // assign FourCC codes later using getDoviFourCC()
        ALOGV("Add source mime '%s'", mime);
        mHasDolbyVision = true;
    } else if (Track::getFourCCForMime(mime) == NULL) {
        ALOGE("Unsupported mime '%s'", mime);
        return ERROR_UNSUPPORTED;
@@ -1576,6 +1578,13 @@ void MPEG4Writer::writeFtypBox(MetaData *param) {
                break;
            }
        }
        // The brand ‘dby1’ should be used in the compatible_brands field to indicate that the file
        // is compliant with all Dolby Extensions. For details, refer to
        // https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby_vision_bitstreams_within_the_iso_base_media_file_format_dec2017.pdf
        // Chapter 7, Dolby Vision Files.
        if (fileType == OUTPUT_FORMAT_MPEG_4 && mHasDolbyVision) {
            writeFourcc("dby1");
        }
    }

    endBox();
+2 −0
Original line number Diff line number Diff line
@@ -241,6 +241,8 @@ private:
    std::map<uint32_t, ItemInfo> mItems;
    Vector<ItemProperty> mProperties;

    bool mHasDolbyVision;

    // Writer thread handling
    status_t startWriterThread();
    status_t stopWriterThread();