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

Commit 0e7c9f3d authored by Andrew Lewis's avatar Andrew Lewis Committed by Gerrit Code Review
Browse files

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

parents c7328cc4 ce22e863
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();