/* Stress test for the SPlay plugin. */ #include "../../lib/splay/splayPlugin.h" #include "../../lib/tplay/tplayPlugin.h" #include "../../lib/input/bufferInputStream.h" #include "../../lib/output/avSyncer.h" int main(int argc, char** argv) { if (argc <= 1) { printf("Usage:\n\n"); printf("%s filename\n\n",argv[0]); exit(0); } // // The order is important !!!! // 1. construct // 2. set Output // 3. open input // 4. set input // // you cannot set the input _before_ the output // in fact you can, but this gives you a segfault! for(int cnt = 0;cnt != 100000; cnt++) { cout << "count = " << cnt << endl; SplayPlugin* plugin=new SplayPlugin(); OutputStream* out=OutPlugin::createOutputStream(_OUTPUT_LOCAL); InputStream* in=InputPlugin::createInputStream(argv[1]); // The plugin does not do "open" in->open(argv[1]); // watch the order! plugin->setOutputPlugin(out); plugin->setInputPlugin(in); plugin->play(); usleep(30000); out->audioClose(); plugin->close(); delete plugin; delete in; delete out; } }