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

Commit a5407767 authored by Byeongjo Park's avatar Byeongjo Park Committed by Lajos Molnar
Browse files

VT: ARTPConnection: added an event to notify first-rtcp packet.



[Related JIRA] RAMEN9610-4400

[Problem] Call downgrade is not triggered from UE if there is no
rtcp packet received even call is started long time ago.

[Cause] There is no logic for auto-downgrade if there is no any single packet.

[Solution] A new logic for auto-downgrade implemented both
StagefrightPlayer and IMSService.

Merged-in: I44bf7131ba2cdb7a1c8760b62ea81427b43afcb1
Change-Id: I44bf7131ba2cdb7a1c8760b62ea81427b43afcb1
Signed-off-by: default avatarByeongjo Park <bjo.park@samsung.com>
parent 65f38210
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ void NuPlayer::RTPSource::onMessageReceived(const sp<AMessage> &msg) {
            }

            int32_t IMSRxNotice;
            if (msg->findInt32("IMS-Rx-notice", &IMSRxNotice)) {
            if (msg->findInt32("rtcp-event", &IMSRxNotice)) {
                int32_t payloadType, feedbackType;
                CHECK(msg->findInt32("payload-type", &payloadType));
                CHECK(msg->findInt32("feedback-type", &feedbackType));
+12 −5
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ void ARTPConnection::onPollStreams() {
            if (err == -ECONNRESET) {
                // socket failure, this stream is dead, Jim.
                sp<AMessage> notify = it->mNotifyMsg->dup();
                notify->setInt32("IMS-Rx-notice", 1);
                notify->setInt32("rtcp-event", 1);
                notify->setInt32("payload-type", 400);
                notify->setInt32("feedback-type", 1);
                notify->setInt32("sender", it->mSources.valueAt(0)->getSelfID());
@@ -721,6 +721,13 @@ status_t ARTPConnection::parseRTCP(StreamInfo *s, const sp<ABuffer> &buffer) {
        sp<AMessage> notify = s->mNotifyMsg->dup();
        notify->setInt32("first-rtcp", true);
        notify->post();

        ALOGI("send first-rtcp event to upper layer as ImsRxNotice");
        sp<AMessage> imsNotify = s->mNotifyMsg->dup();
        imsNotify->setInt32("rtcp-event", 1);
        imsNotify->setInt32("payload-type", 101);
        imsNotify->setInt32("feedback-type", 0);
        imsNotify->post();
    }

    const uint8_t *data = buffer->data();
@@ -907,7 +914,7 @@ status_t ARTPConnection::parseTSFB(
                        MxTBRMantissa, MxTBRExp, bitRate);

                sp<AMessage> notify = s->mNotifyMsg->dup();
                notify->setInt32("IMS-Rx-notice", 1);
                notify->setInt32("rtcp-event", 1);
                notify->setInt32("payload-type", 205);
                notify->setInt32("feedback-type", msgType);
                notify->setInt32("sender", id);
@@ -945,7 +952,7 @@ status_t ARTPConnection::parsePSFB(
        {
            CHECK(size == 0);   // PLI does not need parameters
            sp<AMessage> notify = s->mNotifyMsg->dup();
            notify->setInt32("IMS-Rx-notice", 1);
            notify->setInt32("rtcp-event", 1);
            notify->setInt32("payload-type", 206);
            notify->setInt32("feedback-type", msgType);
            notify->setInt32("sender", id);
@@ -958,7 +965,7 @@ status_t ARTPConnection::parsePSFB(
            uint32_t requestedId = u32at(&data[12]);
            if (requestedId == (uint32_t)mSelfID) {
                sp<AMessage> notify = s->mNotifyMsg->dup();
                notify->setInt32("IMS-Rx-notice", 1);
                notify->setInt32("rtcp-event", 1);
                notify->setInt32("payload-type", 206);
                notify->setInt32("feedback-type", msgType);
                notify->setInt32("sender", id);
@@ -1046,7 +1053,7 @@ void ARTPConnection::checkRxBitrate(int64_t nowUs) {
                source->addTMMBR(buffer);
                if (source->isNeedToDowngrade()) {
                    sp<AMessage> notify = s->mNotifyMsg->dup();
                    notify->setInt32("IMS-Rx-notice", 1);
                    notify->setInt32("rtcp-event", 1);
                    notify->setInt32("payload-type", 400);
                    notify->setInt32("feedback-type", 1);
                    notify->setInt32("sender", source->getSelfID());
+5 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,11 @@ struct MyHandler : public AHandler {
                    break;
                }

                int32_t rtcpEvent;
                if (msg->findInt32("rtcp-event", &rtcpEvent)) {
                    break;
                }

                ++mNumAccessUnitsReceived;
                postAccessUnitTimeoutCheck();