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

Commit bbbf9c45 authored by Yajun Zeng's avatar Yajun Zeng
Browse files

Store rtsp accessunit until PLAY response parsed



If RTP accessunit comes earlier than play response,
the normal play time mapping posted in func onAccessUnitComplete is wrong.
This leads wrong timestamp of the first few frames.
This issue is found in the 3 CtsVerifier RTSP streaming cases.

Change-Id: I640eea375b1f3f4730238f9d561c3b40ec682395
Signed-off-by: default avatarYajun Zeng <beanz@marvell.com>
parent 0dbff625
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -135,7 +135,8 @@ struct MyHandler : public AHandler {
          mReceivedFirstRTPPacket(false),
          mSeekable(false),
          mKeepAliveTimeoutUs(kDefaultKeepAliveTimeoutUs),
          mKeepAliveGeneration(0) {
          mKeepAliveGeneration(0),
          mPlayResponseParsed(false) {
        mNetLooper->setName("rtsp net");
        mNetLooper->start(false /* runOnCallingThread */,
                          false /* canCallJava */,
@@ -1093,6 +1094,7 @@ struct MyHandler : public AHandler {
    }

    void parsePlayResponse(const sp<ARTSPResponse> &response) {
        mPlayResponseParsed = true;
        mSeekable = false;
        if (mTracks.size() == 0) {
            ALOGV("parsePlayResponse: late packets ignored.");
@@ -1244,6 +1246,8 @@ private:

    Vector<TrackInfo> mTracks;

    bool mPlayResponseParsed;

    void setupTrack(size_t index) {
        sp<APacketSource> source =
            new APacketSource(mSessionDesc, index);
@@ -1415,6 +1419,13 @@ private:
            int32_t trackIndex, const sp<ABuffer> &accessUnit) {
        ALOGV("onAccessUnitComplete track %d", trackIndex);

        if(!mPlayResponseParsed){
            ALOGI("play response is not parsed, storing accessunit");
            TrackInfo *track = &mTracks.editItemAt(trackIndex);
            track->mPackets.push_back(accessUnit);
            return;
        }

        if (mFirstAccessUnit) {
            sp<AMessage> msg = mNotify->dup();
            msg->setInt32("what", kWhatConnected);