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

Commit 21328495 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Return bits per sample and sample rate as metadata"

am: 814b6837

Change-Id: I756577aaec5981ee15b73e8275fa31d106bbb4ec
parents c44e326a 814b6837
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ enum {
    METADATA_KEY_COLOR_STANDARD  = 35,
    METADATA_KEY_COLOR_TRANSFER  = 36,
    METADATA_KEY_COLOR_RANGE     = 37,
    METADATA_KEY_SAMPLERATE      = 38,
    METADATA_KEY_BITS_PER_SAMPLE = 39,

    // Add more here...
};
+13 −0
Original line number Diff line number Diff line
@@ -550,6 +550,19 @@ void StagefrightMetadataRetriever::parseMetaData() {
                if (!trackMeta->findInt32(kKeyBitRate, &audioBitrate)) {
                    audioBitrate = -1;
                }

                int32_t bitsPerSample = -1;
                int32_t sampleRate = -1;
                trackMeta->findInt32(kKeyBitsPerSample, &bitsPerSample);
                trackMeta->findInt32(kKeySampleRate, &sampleRate);
                if (bitsPerSample >= 0) {
                    sprintf(tmp, "%d", bitsPerSample);
                    mMetaData.add(METADATA_KEY_BITS_PER_SAMPLE, String8(tmp));
                }
                if (sampleRate >= 0) {
                    sprintf(tmp, "%d", sampleRate);
                    mMetaData.add(METADATA_KEY_SAMPLERATE, String8(tmp));
                }
            } else if (!hasVideo && !strncasecmp("video/", mime, 6)) {
                hasVideo = true;