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

Commit f1c934f2 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "The qcom OMX video decoders do not allocate output buffer memory at the...

Merge "The qcom OMX video decoders do not allocate output buffer memory at the time OMX_AllocateBuffer is called, wait until we received the first FILL_BUFFER_DONE notification until we rely on the buffer data ptr."
parents 1790c13e 52733b83
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ struct omx_message {
            OMX_U32 flags;
            OMX_TICKS timestamp;
            OMX_PTR platform_private;
            OMX_PTR data_ptr;
        } extended_buffer_data;

    } u;
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ private:
        kRequiresFlushCompleteEmulation      = 16,
        kRequiresAllocateBufferOnOutputPorts = 32,
        kRequiresFlushBeforeShutdown         = 64,
        kDefersOutputBufferAllocation        = 128,
    };

    struct BufferInfo {
+26 −3
Original line number Diff line number Diff line
@@ -301,8 +301,8 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
        quirks |= kRequiresAllocateBufferOnOutputPorts;
    }
    if (!strncmp(componentName, "OMX.qcom.video.decoder.", 23)) {
        // XXX Required on P....on only.
        quirks |= kRequiresAllocateBufferOnOutputPorts;
        quirks |= kDefersOutputBufferAllocation;
    }

    if (!strncmp(componentName, "OMX.TI.", 7)) {
@@ -1237,9 +1237,16 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) {
        info.mMediaBuffer = NULL;

        if (portIndex == kPortIndexOutput) {
            if (!(mOMXLivesLocally
                        && (mQuirks & kRequiresAllocateBufferOnOutputPorts)
                        && (mQuirks & kDefersOutputBufferAllocation))) {
                // If the node does not fill in the buffer ptr at this time,
                // we will defer creating the MediaBuffer until receiving
                // the first FILL_BUFFER_DONE notification instead.
                info.mMediaBuffer = new MediaBuffer(info.mData, info.mSize);
                info.mMediaBuffer->setObserver(this);
            }
        }

        mPortBuffers[portIndex].push(info);

@@ -1346,6 +1353,22 @@ void OMXCodec::on_message(const omx_message &msg) {
            } else if (mPortStatus[kPortIndexOutput] != SHUTTING_DOWN) {
                CHECK_EQ(mPortStatus[kPortIndexOutput], ENABLED);

                if (info->mMediaBuffer == NULL) {
                    CHECK(mOMXLivesLocally);
                    CHECK(mQuirks & kRequiresAllocateBufferOnOutputPorts);
                    CHECK(mQuirks & kDefersOutputBufferAllocation);

                    // The qcom video decoders on Nexus don't actually allocate
                    // output buffer memory on a call to OMX_AllocateBuffer
                    // the "pBuffer" member of the OMX_BUFFERHEADERTYPE
                    // structure is only filled in later.

                    info->mMediaBuffer = new MediaBuffer(
                            msg.u.extended_buffer_data.data_ptr,
                            info->mSize);
                    info->mMediaBuffer->setObserver(this);
                }

                MediaBuffer *buffer = info->mMediaBuffer;

                buffer->set_range(
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ void SampleIterator::reset() {
status_t SampleIterator::seekTo(uint32_t sampleIndex) {
    LOGV("seekTo(%d)", sampleIndex);

    if (sampleIndex >= mTable->mNumSampleSizes) {
        return ERROR_END_OF_STREAM;
    }

    if (mTable->mSampleToChunkOffset < 0
            || mTable->mChunkOffsetOffset < 0
            || mTable->mSampleSizeOffset < 0
+0 −2
Original line number Diff line number Diff line
@@ -276,8 +276,6 @@ MediaAlbumArt *StagefrightMetadataRetriever::extractAlbumArt() {
}

const char *StagefrightMetadataRetriever::extractMetadata(int keyCode) {
    LOGV("extractMetadata %d", keyCode);

    if (mExtractor == NULL) {
        return NULL;
    }
Loading