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

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

Merge "Misc debugging support and handling of latency changes." into jb-mr2-dev

parents 900fecc9 6bb4d7f0
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
@@ -267,37 +267,6 @@ status_t MediaSender::queueAccessUnit(
                        tsPackets,
                        33 /* packetType */,
                        RTPSender::PACKETIZATION_TRANSPORT_STREAM);

#if 0
                {
                    int64_t nowUs = ALooper::GetNowUs();

                    int64_t timeUs;
                    CHECK(accessUnit->meta()->findInt64("timeUs", &timeUs));

                    int64_t delayMs = (nowUs - timeUs) / 1000ll;

                    static const int64_t kMinDelayMs = 0;
                    static const int64_t kMaxDelayMs = 300;

                    const char *kPattern = "########################################";
                    size_t kPatternSize = strlen(kPattern);

                    int n = (kPatternSize * (delayMs - kMinDelayMs))
                                / (kMaxDelayMs - kMinDelayMs);

                    if (n < 0) {
                        n = 0;
                    } else if ((size_t)n > kPatternSize) {
                        n = kPatternSize;
                    }

                    ALOGI("[%lld]: (%4lld ms) %s\n",
                          timeUs / 1000,
                          delayMs,
                          kPattern + kPatternSize - n);
                }
#endif
            }

            if (err != OK) {
+12 −3
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@ static void usage(const char *me) {
            "               -u uri        \tconnect to an rtsp uri\n"
            "               -l ip[:port] \tlisten on the specified port "
            "               -f(ilename)  \tstream media "
            "(create a sink)\n",
            "(create a sink)\n"
            "               -s(pecial)   \trun in 'special' mode\n",
            me);
}

@@ -222,8 +223,10 @@ int main(int argc, char **argv) {

    AString path;

    bool specialMode = false;

    int res;
    while ((res = getopt(argc, argv, "hc:l:u:f:")) >= 0) {
    while ((res = getopt(argc, argv, "hc:l:u:f:s")) >= 0) {
        switch (res) {
            case 'c':
            {
@@ -281,6 +284,12 @@ int main(int argc, char **argv) {
                break;
            }

            case 's':
            {
                specialMode = true;
                break;
            }

            case '?':
            case 'h':
            default:
@@ -357,7 +366,7 @@ int main(int argc, char **argv) {
    sp<ALooper> looper = new ALooper;

    sp<WifiDisplaySink> sink = new WifiDisplaySink(
            0 /* flags */,
            specialMode ? WifiDisplaySink::FLAG_SPECIAL_MODE : 0 /* flags */,
            session,
            surface->getIGraphicBufferProducer());