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

Commit eb0010f9 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "rtsp: add startup timeout constant property"

parents b42e61d3 0d3c9c03
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#endif

#include <utils/Log.h>
#include <cutils/properties.h> // for property_get

#include "APacketSource.h"
#include "ARTPConnection.h"
@@ -807,11 +808,7 @@ struct MyHandler : public AHandler {
                        result = UNKNOWN_ERROR;
                    } else {
                        parsePlayResponse(response);

                        sp<AMessage> timeout = new AMessage('tiou', this);
                        mCheckTimeoutGeneration++;
                        timeout->setInt32("tioucheck", mCheckTimeoutGeneration);
                        timeout->post(kStartupTimeoutUs);
                        postTimeout();
                    }
                }

@@ -1153,10 +1150,7 @@ struct MyHandler : public AHandler {

                        // Post new timeout in order to make sure to use
                        // fake timestamps if no new Sender Reports arrive
                        sp<AMessage> timeout = new AMessage('tiou', this);
                        mCheckTimeoutGeneration++;
                        timeout->setInt32("tioucheck", mCheckTimeoutGeneration);
                        timeout->post(kStartupTimeoutUs);
                        postTimeout();
                    }
                }

@@ -1248,10 +1242,7 @@ struct MyHandler : public AHandler {

                // Start new timeoutgeneration to avoid getting timeout
                // before PLAY response arrive
                sp<AMessage> timeout = new AMessage('tiou', this);
                mCheckTimeoutGeneration++;
                timeout->setInt32("tioucheck", mCheckTimeoutGeneration);
                timeout->post(kStartupTimeoutUs);
                postTimeout();

                int64_t timeUs;
                CHECK(msg->findInt64("time", &timeUs));
@@ -1305,10 +1296,7 @@ struct MyHandler : public AHandler {

                        // Post new timeout in order to make sure to use
                        // fake timestamps if no new Sender Reports arrive
                        sp<AMessage> timeout = new AMessage('tiou', this);
                        mCheckTimeoutGeneration++;
                        timeout->setInt32("tioucheck", mCheckTimeoutGeneration);
                        timeout->post(kStartupTimeoutUs);
                        postTimeout();

                        ssize_t i = response->mHeaders.indexOfKey("rtp-info");
                        CHECK_GE(i, 0);
@@ -1960,6 +1948,16 @@ private:
        msg->post();
    }

    void postTimeout() {
        sp<AMessage> timeout = new AMessage('tiou', this);
        mCheckTimeoutGeneration++;
        timeout->setInt32("tioucheck", mCheckTimeoutGeneration);

        int64_t startupTimeoutUs;
        startupTimeoutUs = property_get_int64("media.rtsp.timeout-us", kStartupTimeoutUs);
        timeout->post(startupTimeoutUs);
    }

    DISALLOW_EVIL_CONSTRUCTORS(MyHandler);
};