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

Commit 1f8df93c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5652689 from 0fff5050 to qt-c2f2-release

Change-Id: I21b66cf7820cdcef71a29d7416e4b6192b34c5d4
parents 6460cc58 0fff5050
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -38,8 +38,10 @@ namespace.default.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv
namespace.platform.isolated = true

namespace.platform.search.paths  = /system/${LIB}
namespace.platform.search.paths += /apex/com.android.runtime/${LIB}
namespace.platform.asan.search.paths  = /data/asan/system/${LIB}
namespace.platform.asan.search.paths +=           /system/${LIB}
namespace.platform.asan.search.paths += /apex/com.android.runtime/${LIB}

# /system/lib/libc.so, etc are symlinks to /apex/com.android.lib/lib/bionic/libc.so, etc.
# Add /apex/... pat to the permitted paths because linker uses realpath(3)
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.media",
  "version": 220000000
  "version": 290000000
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.media.swcodec",
  "version": 220000000
  "version": 290000000
}
+13 −7
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ void CCodecConfig::initializeStandardParams() {
               .limitTo(D::ENCODER & D::VIDEO));
    // convert to timestamp base
    add(ConfigMapper(KEY_I_FRAME_INTERVAL, C2_PARAMKEY_SYNC_FRAME_INTERVAL, "value")
        .withMapper([](C2Value v) -> C2Value {
        .withMappers([](C2Value v) -> C2Value {
            // convert from i32 to float
            int32_t i32Value;
            float fpValue;
@@ -518,6 +518,12 @@ void CCodecConfig::initializeStandardParams() {
                return int64_t(c2_min(1000000 * fpValue + 0.5, (double)INT64_MAX));
            }
            return C2Value();
        }, [](C2Value v) -> C2Value {
            int64_t i64;
            if (v.get(&i64)) {
                return float(i64) / 1000000;
            }
            return C2Value();
        }));
    // remove when codecs switch to proper coding.gop (add support for calculating gop)
    deprecated(ConfigMapper("i-frame-period", "coding.gop", "intra-period")
@@ -711,7 +717,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to dBFS and add default
    add(ConfigMapper(KEY_AAC_DRC_TARGET_REFERENCE_LEVEL, C2_PARAMKEY_DRC_TARGET_REFERENCE_LEVEL, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
@@ -722,7 +728,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to 0-1 (%) and add default
    add(ConfigMapper(KEY_AAC_DRC_ATTENUATION_FACTOR, C2_PARAMKEY_DRC_ATTENUATION_FACTOR, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
@@ -733,7 +739,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to 0-1 (%) and add default
    add(ConfigMapper(KEY_AAC_DRC_BOOST_FACTOR, C2_PARAMKEY_DRC_BOOST_FACTOR, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
@@ -744,7 +750,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to compression type and add default
    add(ConfigMapper(KEY_AAC_DRC_HEAVY_COMPRESSION, C2_PARAMKEY_DRC_COMPRESSION_MODE, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
@@ -755,7 +761,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to dBFS and add default
    add(ConfigMapper(KEY_AAC_ENCODED_TARGET_LEVEL, C2_PARAMKEY_DRC_ENCODED_TARGET_LEVEL, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
@@ -766,7 +772,7 @@ void CCodecConfig::initializeStandardParams() {

    // convert to effect type (these map to SDK values) and add default
    add(ConfigMapper(KEY_AAC_DRC_EFFECT_TYPE, C2_PARAMKEY_DRC_EFFECT_TYPE, "value")
        .limitTo(D::AUDIO & D::DECODER)
        .limitTo(D::AUDIO & D::DECODER & D::CONFIG)
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < -1 || value > 8) {
+41 −8
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ namespace android {

OggWriter::OggWriter(int fd)
      : mFd(dup(fd)),
        mHaveAllCodecSpecificData(false),
        mInitCheck(mFd < 0 ? NO_INIT : OK) {
    // empty
}
@@ -115,17 +116,26 @@ status_t OggWriter::addSource(const sp<MediaSource>& source) {

    mSampleRate = sampleRate;
    uint32_t type;
    const void *header_data;
    size_t packet_size;
    const void *header_data = NULL;
    size_t packet_size = 0;

    if (!source->getFormat()->findData(kKeyOpusHeader, &type, &header_data, &packet_size)) {
        ALOGE("opus header not found");
        return UNKNOWN_ERROR;
        ALOGV("opus header not found in format");
    } else if (header_data && packet_size) {
        writeOggHeaderPackets((unsigned char *)header_data, packet_size);
    } else {
        ALOGD("ignoring incomplete opus header data in format");
    }

    mSource = source;
    return OK;
}

status_t OggWriter::writeOggHeaderPackets(unsigned char *buf, size_t size) {
    ogg_packet op;
    ogg_page og;
    op.packet = (unsigned char *)header_data;
    op.bytes = packet_size;
    op.packet = buf;
    op.bytes = size;
    op.b_o_s = 1;
    op.e_o_s = 0;
    op.granulepos = 0;
@@ -169,8 +179,8 @@ status_t OggWriter::addSource(const sp<MediaSource>& source) {
        write(mFd, og.body, og.body_len);
    }

    mSource = source;
    free(comments);
    mHaveAllCodecSpecificData = true;
    return OK;
}

@@ -301,12 +311,35 @@ status_t OggWriter::threadFunc() {
             && isCodecSpecific)
            || IsOpusHeader((uint8_t*)buffer->data() + buffer->range_offset(),
                         buffer->range_length())) {
            ALOGV("Drop codec specific info buffer");
            if (mHaveAllCodecSpecificData == false) {
                size_t opusHeadSize = 0;
                size_t codecDelayBufSize = 0;
                size_t seekPreRollBufSize = 0;
                void *opusHeadBuf = NULL;
                void *codecDelayBuf = NULL;
                void *seekPreRollBuf = NULL;
                GetOpusHeaderBuffers((uint8_t*)buffer->data() + buffer->range_offset(),
                                    buffer->range_length(), &opusHeadBuf,
                                    &opusHeadSize, &codecDelayBuf,
                                    &codecDelayBufSize, &seekPreRollBuf,
                                    &seekPreRollBufSize);
                writeOggHeaderPackets((unsigned char *)opusHeadBuf, opusHeadSize);
            } else {
                ALOGV("ignoring later copy of CSD contained in info buffer");
            }
            buffer->release();
            buffer = nullptr;
            continue;
        }

        if (mHaveAllCodecSpecificData == false) {
            ALOGE("Did not get valid opus header before first sample data");
            buffer->release();
            buffer = nullptr;
            err = ERROR_MALFORMED;
            break;
        }

        int64_t timestampUs;
        CHECK(buffer->meta_data().findInt64(kKeyTime, &timestampUs));
        if (timestampUs > mEstimatedDurationUs) {
Loading