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

Commit 5cecaa94 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

Merge "stagefright: allow state change while handling OMX message list" into mnc-dev

parents 81e998b0 e421a32a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,9 @@ private:
    enum {
    enum {
        kWhatSetup                   = 'setu',
        kWhatSetup                   = 'setu',
        kWhatOMXMessage              = 'omx ',
        kWhatOMXMessage              = 'omx ',
        // same as kWhatOMXMessage - but only used with
        // handleMessage during OMX message-list handling
        kWhatOMXMessageItem          = 'omxI',
        kWhatOMXMessageList          = 'omxL',
        kWhatOMXMessageList          = 'omxL',
        kWhatInputBufferFilled       = 'inpF',
        kWhatInputBufferFilled       = 'inpF',
        kWhatOutputBufferDrained     = 'outD',
        kWhatOutputBufferDrained     = 'outD',
+8 −1
Original line number Original line Diff line number Diff line
@@ -4511,6 +4511,12 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) {
            return checkOMXMessage(msg) ? onOMXMessageList(msg) : true;
            return checkOMXMessage(msg) ? onOMXMessageList(msg) : true;
        }
        }


        case ACodec::kWhatOMXMessageItem:
        {
            // no need to check as we already did it for kWhatOMXMessageList
            return onOMXMessage(msg);
        }

        case ACodec::kWhatOMXMessage:
        case ACodec::kWhatOMXMessage:
        {
        {
            return checkOMXMessage(msg) ? onOMXMessage(msg) : true;
            return checkOMXMessage(msg) ? onOMXMessage(msg) : true;
@@ -4598,7 +4604,8 @@ bool ACodec::BaseState::onOMXMessageList(const sp<AMessage> &msg) {
    bool receivedRenderedEvents = false;
    bool receivedRenderedEvents = false;
    for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().cbegin();
    for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().cbegin();
          it != msgList->getList().cend(); ++it) {
          it != msgList->getList().cend(); ++it) {
        onOMXMessage(*it);
        (*it)->setWhat(ACodec::kWhatOMXMessageItem);
        mCodec->handleMessage(*it);
        int32_t type;
        int32_t type;
        CHECK((*it)->findInt32("type", &type));
        CHECK((*it)->findInt32("type", &type));
        if (type == omx_message::FRAME_RENDERED) {
        if (type == omx_message::FRAME_RENDERED) {