/* Author: Ian Collier Licence: GPL Support: None whatsoever - please don't write asking for help This program is a hack and may or may not work. Use at your own risk. */ #include #include #include "librtsp/rtsp_session.h" int main (int argc, char **argv) { rtsp_session_t *rtsp; char *mrl=0; char *file=0; FILE *fp; static char buffer[8192]; int r; int w; int v=1; unsigned long t=0; for (r=1; r1) fprintf(stderr, "About to try dumping %s to %s\n", mrl, file); rtsp = rtsp_session_start(mrl); if (!rtsp) { fputs("RTSP session did not start for some reason\n",stderr); exit(3); } if (v>1) fputs("RTSP session successfully started\n", stderr); if (v) fprintf(stderr, "%9lu bytes read\r", 0L); while ((r=rtsp_session_read(rtsp, buffer, sizeof buffer))>0) { t+=r; if (r1) fprintf(stderr, " short read of %d bytes (total so far %lu)\n", r, t); w=fwrite(buffer, 1, r, fp); if (w1) fputs("Finished successfully\n",stderr); exit(0); }