Added Display increments, more controls, and a readme to the replayer

Change-Id: Id21144b7f808858149772de511951546fddfb252
diff --git a/cmds/surfacereplayer/replayer/Main.cpp b/cmds/surfacereplayer/replayer/Main.cpp
index bf5da52..dd1dd7d 100644
--- a/cmds/surfacereplayer/replayer/Main.cpp
+++ b/cmds/surfacereplayer/replayer/Main.cpp
@@ -41,9 +41,16 @@
     std::cout << "  -m  Stops the replayer at the start of the trace and switches ";
                  "to manual replay\n";
 
-    std::cout << "  -t [Number of Threads]  Specifies the number of threads to be used while "
+    std::cout << "\n  -t [Number of Threads]  Specifies the number of threads to be used while "
                  "replaying (default is " << android::DEFAULT_THREADS << ")\n";
 
+    std::cout << "\n  -s [Timestamp]  Specify at what timestamp should the replayer switch "
+                 "to manual replay\n";
+
+    std::cout << "  -n  Ignore timestamps and run through trace as fast as possible\n";
+
+    std::cout << "  -l  Indefinitely loop the replayer\n";
+
     std::cout << "  -h  Display help menu\n";
 
     std::cout << std::endl;
@@ -51,11 +58,14 @@
 
 int main(int argc, char** argv) {
     std::string filename;
+    bool loop = false;
+    bool wait = true;
     bool pauseBeginning = false;
     int numThreads = DEFAULT_THREADS;
+    long stopHere = -1;
 
     int opt = 0;
-    while ((opt = getopt(argc, argv, "pt:h?")) != -1) {
+    while ((opt = getopt(argc, argv, "mt:s:nlh?")) != -1) {
         switch (opt) {
             case 'm':
                 pauseBeginning = true;
@@ -63,6 +73,15 @@
             case 't':
                 numThreads = atoi(optarg);
                 break;
+            case 's':
+                stopHere = atol(optarg);
+                break;
+            case 'n':
+                wait = false;
+                break;
+            case 'l':
+                loop = true;
+                break;
             case 'h':
             case '?':
                 printHelpMenu();
@@ -81,8 +100,11 @@
     }
     filename.assign(input[0]);
 
-    android::Replayer r(filename, pauseBeginning, numThreads);
-    auto status = r.replay();
+    status_t status = NO_ERROR;
+    do {
+        android::Replayer r(filename, pauseBeginning, numThreads, wait, stopHere);
+        status = r.replay();
+    } while(loop);
 
     if (status == NO_ERROR) {
         std::cout << "Successfully finished replaying trace" << std::endl;